Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file TFrame.php

Documentation is available at TFrame.php

  1. <?php
  2. namespace Adianti\Widget\Container;
  3.  
  4. use Adianti\Widget\Base\TElement;
  5. use Adianti\Widget\Container\TNotebook;
  6. use Adianti\Widget\Form\TLabel;
  7.  
  8. /**
  9.  * Frame Widget: creates a bordered area with a title located at its top-left corner
  10.  *
  11.  * @version    7.4
  12.  * @package    widget
  13.  * @subpackage container
  14.  * @author     Pablo Dall'Oglio
  15.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  16.  * @license    http://www.adianti.com.br/framework-license
  17.  */
  18. class TFrame extends TElement
  19. {
  20.     private $legend;
  21.     private $width;
  22.     private $height;
  23.     
  24.     /**
  25.      * Class Constructor
  26.      * @param  $value text label
  27.      */
  28.     public function __construct($width NULL$height NULL)
  29.     {
  30.         parent::__construct('fieldset');
  31.         $this->{'id'}    'tfieldset_' mt_rand(10000000001999999999);
  32.         $this->{'class''tframe';
  33.         
  34.         $this->width  $width;
  35.         $this->height $height;
  36.         
  37.         if ($width)
  38.         {
  39.             $this->{'style'.= (strstr($width'%'!== FALSE";width:{$width}";width:{$width}px";
  40.         }
  41.         
  42.         if ($height)
  43.         {
  44.             $this->{'style'.= (strstr($height'%'!== FALSE";height:{$height}";height:{$height}px";
  45.         }
  46.     }
  47.     
  48.     /**
  49.      * Returns the frame size
  50.      * @return array(width, height)
  51.      */
  52.     public function getSize()
  53.     {
  54.         return array($this->width$this->height);
  55.     }
  56.     
  57.     /**
  58.      * Set Legend
  59.      * @param  $legend frame legend
  60.      */
  61.     public function setLegend($legend)
  62.     {
  63.         $obj new TElement('legend');
  64.         $obj->add(new TLabel($legend));
  65.         parent::add($obj);
  66.         $this->legend $legend;
  67.     }
  68.     
  69.     /**
  70.      * Returns the inner legend
  71.      */
  72.     public function getLegend()
  73.     {
  74.         return $this->legend;
  75.     }
  76.     
  77.     /**
  78.      * Return the Frame ID
  79.      * @ignore-autocomplete on
  80.      */
  81.     public function getId()
  82.     {
  83.         return $this->{'id'};
  84.     }
  85. }