Source for file TPanel.php
Documentation is available at TPanel.php
namespace
Adianti \
Widget \
Container ;
use
Adianti \
Widget \
Base \
TStyle ;
* Panel Container: Allows to organize the widgets using fixed (absolute) positions
* @author Pablo Dall'Oglio
* @copyright Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
* @license http://www.adianti.com.br/framework-license
* @param $width Panel's width
* @param $height Panel's height
$this -> { 'id' } =
'tpanel_' .
mt_rand ( 1000000000 , 1999999999 ) ;
// creates the panel style
$this -> style =
new TStyle ( 'style_' .
$this -> { 'id' } ) ;
$this -> style -> position =
'relative' ;
$this -> { 'class' } =
'style_' .
$this -> { 'id' } ;
* @param $width Panel width
* @param $height Panel height
public function setSize ( $width , $height )
* @return array(width, height)
return array ( $this -> width , $this -> height ) ;
* Put a widget inside the panel
* @param $widget = widget to be shown
* @param $col = column in pixels.
* @param $row = row in pixels.
public function put ( $widget , $col , $row )
// creates a layer to put the widget inside
// define the layer position
$layer -> style =
" position:absolute; left:{$col } px; top:{$row } px; " ;
// add the widget to the layer
// add the widget to the container
$this -> style -> width =
$this -> width .
'px' ;
$this -> style -> height =
$this -> height .
'px' ;