From bfeada5a44e8efc51cf58860170524f64e658bb3 Mon Sep 17 00:00:00 2001 From: Jens Klaer Date: Fri, 4 Sep 2015 11:42:33 +0200 Subject: added width and height properties for convenience --- framework/Web/UI/WebControls/TInlineFrame.php | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/WebControls/TInlineFrame.php b/framework/Web/UI/WebControls/TInlineFrame.php index 09e82315..67ff5830 100644 --- a/framework/Web/UI/WebControls/TInlineFrame.php +++ b/framework/Web/UI/WebControls/TInlineFrame.php @@ -145,6 +145,42 @@ class TInlineFrame extends TWebControl implements IDataRenderer $this->setViewState('ScrollBars',TPropertyValue::ensureEnum($value,'TInlineFrameScrollBars'),TInlineFrameScrollBars::Auto); } + /** + * @return integer the width of the control + */ + public function getWidth() + { + return $this->getViewState('Width',-1); + } + + /** + * @param integer the width of the control + */ + public function setWidth($value) + { + if(($value=TPropertyValue::ensureInteger($value))<0) + $value=-1; + $this->setViewState('Width',$value,-1); + } + + /** + * @return integer the height of the control + */ + public function getHeight() + { + return $this->getViewState('Height',-1); + } + + /** + * @param integer the height of the control + */ + public function setHeight($value) + { + if(($value=TPropertyValue::ensureInteger($value))<0) + $value=-1; + $this->setViewState('Height',$value,-1); + } + /** * @return integer the amount of space, in pixels, that should be left between * the frame's contents and the left and right margins. Defaults to -1, meaning not set. @@ -212,6 +248,12 @@ class TInlineFrame extends TWebControl implements IDataRenderer if(($longdesc=$this->getDescriptionUrl())!=='') $writer->addAttribute('longdesc',$longdesc); + + if (($width=$this->getWidth())!==-1) + $writer->addAttribute('width',$width); + + if (($height=$this->getHeight())!==-1) + $writer->addAttribute('height',$height); if(($marginheight=$this->getMarginHeight())!==-1) $writer->addAttribute('marginheight',$marginheight); -- cgit v1.2.3