power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Add ImageAlign to THyperLink #456

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi!

I propose to add an ImageAlign property to THyperLink.
Should be as easy as:

--------------------------------------------------------------------------------
-----
--- a/framework/Web/UI/WebControls/THyperLink.php
+++ b/framework/Web/UI/WebControls/THyperLink.php
@@ -92,6 +92,8 @@ class THyperLink extends TWebControl implements IDataRenderer
                        $image->setToolTip($toolTip);
                if(($text=$this->getText())!=='')
                        $image->setAlternateText($text);
+               if(($align=$this->getImageAlign())!=='')
+                       $image->setImageAlign($align);
                $image->setBorderWidth('0');
                return $image;
        }
@@ -114,6 +116,26 @@ class THyperLink extends TWebControl implements 
IDataRenderer
        }

        /**
+        * @return string the alignment of the image in the THyperLink with 
respective to other elements on the page, defaults to empty.
+        */
+       public function getImageAlign()
+       {
+               return $this->getViewState('ImageAlign','');
+       }
+
+       /**
+        * Sets the alignment of the image in the THyperLink with respective to 
other elements on the page.
+        * Possible values include: absbottom, absmiddle, baseline, bottom, 
left,
+        * middle, right, texttop, and top. If an empty string is passed in,
+        * imagealign attribute will not be rendered.
+        * @param string the alignment of the image
+        */
+       public function setImageAlign($value)
+       {
+               $this->setViewState('ImageAlign',$value,'');
+       }
+
+       /**
         * @return string height of the image in the THyperLink
         */
        public function getImageHeight()
--------------------------------------------------------------------------------
-----

Cheers,
Raoul

Original issue reported on code.google.com by ra...@bhatia.at on 15 Apr 2013 at 11:01

GoogleCodeExporter commented 8 years ago
Committed as r3286  , thank you

Original comment by ctrlal...@gmail.com on 18 Apr 2013 at 6:10