コード例 #1
0
 /**
  * método construtor
  * instancia um campo do formulario
  * @param $name = nome do campo
  */
 public function __construct($name)
 {
     // define algumas características iniciais
     self::setEditable(true);
     self::setName($name);
     self::setSize(200);
     // Instancia um estilo CSS chamado tfield
     // que será utilizado pelos campos do formulário
     $style1 = new TStyle('tfield');
     $style1->border = 'solid';
     $style1->border_color = '#a0a0a0';
     $style1->border_width = '1px';
     $style1->z_index = '1';
     $style2 = new TStyle('tfield_disabled');
     $style2->border = 'solid';
     $style2->border_color = '#a0a0a0';
     $style2->border_width = '1px';
     $style2->background_color = '#e0e0e0';
     $style2->color = '#a0a0a0';
     $style1->show();
     $style2->show();
     // cria uma tag HTML do tipo <input>
     $this->tag = new TElement('input');
     $this->tag->class = 'tfield';
     // classe CSS
 }
コード例 #2
0
 /**
  * Shows the tag
  */
 public function show()
 {
     $stylename = 'tscroll' . $this->id;
     $style = new TStyle($stylename);
     if (!$this->transparency) {
         $style->border = '1px solid #c2c2c2';
         $style->background = '#ffffff';
     }
     $style->padding_left = "{$this->margin}px";
     $style->padding_top = "{$this->margin}px";
     $style->padding_right = "{$this->margin}px";
     $style->padding_bottom = "{$this->margin}px";
     $style->width = $this->width . 'px';
     $style->height = $this->height . 'px';
     $style->overflow = 'auto';
     $style->scroll = 'none';
     // check if there's any TSourceCode inside
     if (is_array($this->children)) {
         foreach ($this->children as $child) {
             if ($child instanceof TSourceCode) {
                 $style->background_color = '#ffffff';
             }
         }
     }
     // show the style
     $style->show();
     $this->{'class'} = $stylename;
     parent::show();
 }
コード例 #3
0
 public function show()
 {
     $window_id = 'TWindow' . self::$counter;
     // instancia objeto TStyle para definir as características
     // de posicionamento e dimensão da camada criada
     $style = new TStyle($window_id);
     $style->position = 'absolute';
     $style->left = $this->x;
     $style->top = $this->y;
     $style->width = $this->width;
     $style->height = $this->height;
     $style->background = '#e0e0e0';
     $style->border = '1px solid #000000';
     $style->z_index = "10000";
     // exibe o estilo em tela
     $style->show();
     // cria tag <div> para a camada que representará a janela
     $painel = new TElement('div');
     $painel->id = $window_id;
     // define o ID
     $painel->class = $window_id;
     // define a classe CSS
     // instancia objeto TTable
     $table = new TTable();
     // define as propriedades da tabela
     $table->width = '100%';
     $table->height = '100%';
     $table->style = 'border-collapse:collapse';
     // adiciona uma linha para o título
     $row1 = $table->addRow();
     $row1->bgcolor = '#707070';
     $row1->height = '20px';
     // adiciona uma célula para o título
     $titulo = $row1->addCell("<font face=Arial size=2 color=white><b>{$this->title}</b></font>");
     $titulo->width = '100%';
     // cria um link com ação para esconder o <div>
     $link = new TElement('a');
     $link->add(new TImage("../app.images/ico_close.png"));
     $link->onclick = "document.getElementById('{$window_id}').style.display='none'";
     // adiciona uma célula com o link de fechar
     $cell = $row1->addCell($link);
     $cell->align = 'right';
     // cria uma linha para o conteúdo
     $row2 = $table->addRow();
     $row2->valign = 'top';
     // adiciona o conteúdo ocupando duas colunas (colspan)
     $cell = $row2->addCell($this->content);
     $cell->colspan = 2;
     // adiciona a tabela ao painel
     $painel->add($table);
     // exibe o painel
     $painel->show();
 }
コード例 #4
0
 /**
  * Class Constructor
  * @param  $width   Panel's width
  * @param  $height  Panel's height
  */
 public function __construct($width, $height)
 {
     self::$counter++;
     // creates the panel style
     $painel_style = new TStyle('tpanel' . self::$counter);
     $painel_style->position = 'relative';
     $painel_style->width = $width . 'px';
     $painel_style->height = $height . 'px';
     // show the style
     $painel_style->show();
     $this->panelId = self::$counter;
     parent::__construct('div');
     $this->{'class'} = 'tpanel' . self::$counter;
 }
コード例 #5
0
 /**
  * Class Constructor
  * @param  $name widget's name
  * @param  $text widget's name
  */
 public function __construct($name, $text_name)
 {
     // executes the parent class constructor
     parent::__construct($name);
     $this->text_name = $text_name;
     // creates the default field style
     $style1 = new TStyle('tcombo');
     $style1->height = '24px';
     $style1->z_index = '1';
     $style1->show();
     // creates a <select> tag
     $this->tag = new TElement('select');
     $this->tag->{'class'} = 'tcombo';
     // CSS
 }
コード例 #6
0
ファイル: TLink.class.php プロジェクト: jfrank1500/curso_php
 public function __construct($label)
 {
     parent::__construct('a');
     $this->id = 'tlink_' . uniqid();
     $this->class = 'tlink';
     $style = new TStyle('tlink');
     $style->display = 'inline-block';
     $style->border = '1px solid #000';
     $style->padding = '4px';
     $style->border_radius = '5px 5px 5px 5px';
     $style->background = '#FFFFD8';
     $style->cursor = 'pointer';
     $style->show();
     parent::add($label);
 }
コード例 #7
0
 /**
  * método construtor
  * instancia objeto TQuestion
  * @param $message = pergunta ao usuário
  * @param $action_yes = ação para resposta positiva
  * @param $action_no = ação para resposta negativa
  */
 function __construct($message, TAction $action_yes, TAction $action_no)
 {
     $style = new TStyle('tquestion');
     $style->position = 'absolute';
     $style->left = '30%';
     $style->top = '30%';
     $style->width = '300';
     $style->height = '150';
     $style->border_width = '1px';
     $style->color = 'black';
     $style->background = '#DDDDDD';
     $style->border = '4px solid #000000';
     $style->z_index = '10000000000000000';
     // converte os nomes de métodos em URL's
     $url_yes = $action_yes->serialize();
     $url_no = $action_no->serialize();
     // exibe o estilo na tela
     $style->show();
     // instancia o painel para exibir o diálogo
     $painel = new TElement('div');
     $painel->class = "tquestion";
     // cria um botão para a resposta positiva
     $button1 = new TElement('input');
     $button1->type = 'button';
     $button1->value = 'Sim';
     $button1->onclick = "javascript:location='{$url_yes}'";
     // cria um botão para a resposta negativa
     $button2 = new TElement('input');
     $button2->type = 'button';
     $button2->value = 'Não';
     $button2->onclick = "javascript:location='{$url_no}'";
     // cria uma tabela para organizar o layout
     $table = new TTable();
     $table->align = 'center';
     $table->cellspacing = 10;
     // cria uma linha para o ícone e a mensagem
     $row = $table->addRow();
     $row->addCell(new TImage('app.images/question.png'));
     $row->addCell($message);
     // cria uma linha para os botões
     $row = $table->addRow();
     $row->addCell($button1);
     $row->addCell($button2);
     // adiciona a tabela ao painél
     $painel->add($table);
     // exibe o painél
     $painel->show();
 }
コード例 #8
0
 /**
  * método __construct()
  * instancia objeto TPanel.
  * @param $width     = largura do painel
  * @param $height = altura do painel
  */
 public function __construct($width, $height)
 {
     // instancia objeto TStyle
     // para definir as características do painel
     $painel_style = new TStyle('tpanel');
     $painel_style->position = 'relative';
     $painel_style->width = $width;
     $painel_style->height = $height;
     $painel_style->border = '2px solid';
     $painel_style->border_color = 'grey';
     $painel_style->background_color = '#f0f0f0';
     // exibe o estilo na tela
     $painel_style->show();
     parent::__construct('div');
     $this->class = 'tpanel';
 }
コード例 #9
0
 /**
  * método __construct()
  * instancia uma nova DataGrid
  */
 public function __construct()
 {
     parent::__construct();
     $this->class = 'tdatagrid_table';
     // instancia objeto TStyle
     // este estilo será utilizado para a tabela da datagrid
     $style1 = new TStyle('tdatagrid_table');
     $style1->border_collapse = 'separate';
     $style1->font_family = 'arial,verdana,sans-serif';
     $style1->font_size = '10pt';
     $style1->border_spacing = '0pt';
     // instancia objeto TStyle
     // Este estilo será utilizado para os cabeçalhos da datagrid
     $style2 = new TStyle('tdatagrid_col');
     $style2->font_size = '10pt';
     $style2->font_weight = 'bold';
     $style2->border_left = '1px solid white';
     $style2->border_top = '1px solid white';
     $style2->border_right = '1px solid gray';
     $style2->border_bottom = '1px solid gray';
     $style2->padding_top = '1px';
     $style2->background_color = '#CCCCCC';
     // instancia objeto TStyle
     // Este estilo será utilizado quando
     // o mouse estiver sobre um cabeçalho da datagrid
     $style3 = new TStyle('tdatagrid_col_over');
     $style3->font_size = '10pt';
     $style3->font_weight = 'bold';
     $style3->border_left = '1px solid white';
     $style3->border_top = '2px solid orange';
     $style3->border_right = '1px solid gray';
     $style3->border_bottom = '1px solid gray';
     $style3->padding_top = '0px';
     $style3->cursor = 'pointer';
     $style3->background_color = '#dcdcdc';
     // exibe estilos na tela
     $style1->show();
     $style2->show();
     $style3->show();
 }
コード例 #10
0
 /**
  * método construtor
  * instancia objeto TMessage
  * @param $type      = tipo de mensagem (info, error)
  * @param $message = mensagem ao usuário
  */
 public function __construct($type, $message)
 {
     $style = new TStyle('tmessage');
     $style->position = 'absolute';
     $style->left = '30%';
     $style->top = '30%';
     $style->width = '300';
     $style->height = '150';
     $style->color = 'black';
     $style->background = '#DDDDDD';
     $style->border = '4px solid #000000';
     $style->z_index = '10000000000000000';
     // exibe o estilo na tela
     $style->show();
     // instancia o painel para exibir o diálogo
     $painel = new TElement('div');
     $painel->class = "tmessage";
     $painel->id = "tmessage";
     // cria um botão que vai fechar o diálogo
     $button = new TElement('input');
     $button->type = 'button';
     $button->value = 'Fechar';
     $button->onclick = "document.getElementById('tmessage').style.display='none'";
     // cria um tabela para organizar o layout
     $table = new TTable();
     $table->align = 'center';
     // cria uma linha para o ícone e a mensagem
     $row = $table->addRow();
     $row->addCell(new TImage("app.images/{$type}.png"));
     $row->addCell($message);
     // cria uma linha para o botão
     $row = $table->addRow();
     $row->addCell('');
     $row->addCell($button);
     // adiciona a tabela ao painél
     $painel->add($table);
     // exibe o painél
     $painel->show();
 }
コード例 #11
0
 /**
  * Class Constructor
  * @param  $value text label
  */
 public function __construct($width = NULL, $height = NULL)
 {
     parent::__construct('fieldset');
     self::$counter++;
     $this->frameId = self::$counter;
     // creates the default field style
     $style = new TStyle('tfieldset' . self::$counter);
     $style->border = 'solid';
     $style->border_color = '#a0a0a0';
     $style->border_width = '1px';
     $style->padding_left = '3px';
     $style->padding_right = '3px';
     $style->padding_top = '3px';
     $style->padding_bottom = '3px';
     if ($width) {
         $style->width = $width . 'px';
     }
     if ($height) {
         $style->height = $height . 'px';
     }
     $style->show();
     $this->id = 'tfieldset' . self::$counter;
     $this->{'class'} = 'tfieldset' . self::$counter;
 }
コード例 #12
0
 /**
  * Merges the style with a new one.
  * If a style field is not set in this style, it will be overwritten by
  * the new one.
  * @param TStyle the new style
  */
 public function mergeWith($style)
 {
     parent::mergeWith($style);
     if ($style instanceof TWizardNavigationButtonStyle) {
         if ($style->_imageUrl !== null) {
             $this->_imageUrl = $style->_imageUrl;
         }
         if ($style->_buttonText !== null) {
             $this->_buttonText = $style->_buttonText;
         }
         if ($style->_buttonType !== null) {
             $this->_buttonType = $style->_buttonType;
         }
     }
 }
コード例 #13
0
ファイル: pradolite.php プロジェクト: tejdeeps/tejcs.com
 public function addAttributesToRender($writer)
 {
     if (!$this->getWrap()) {
         $writer->addStyleAttribute('white-space', 'nowrap');
     }
     if (($horizontalAlign = $this->getHorizontalAlign()) !== THorizontalAlign::NotSet) {
         $writer->addAttribute('align', strtolower($horizontalAlign));
     }
     if (($verticalAlign = $this->getVerticalAlign()) !== TVerticalAlign::NotSet) {
         $writer->addAttribute('valign', strtolower($verticalAlign));
     }
     parent::addAttributesToRender($writer);
 }
コード例 #14
0
ファイル: TAccordion.php プロジェクト: tejdeeps/tejcs.com
 /**
  * @return TStyle the style for the active header div
  */
 public function getActiveHeaderStyle()
 {
     if (($style = $this->getViewState('ActiveHeaderStyle', null)) === null) {
         $style = new TStyle();
         $style->setCssClass('accordion-header-active');
         $this->setViewState('ActiveHeaderStyle', $style, null);
     }
     return $style;
 }
コード例 #15
0
ファイル: TPanelStyle.php プロジェクト: Nurudeen/prado
 /**
  * Merges the style with a new one.
  * If a style field is not set in this style, it will be overwritten by
  * the new one.
  * @param TStyle the new style
  */
 public function mergeWith($style)
 {
     parent::mergeWith($style);
     if ($style instanceof TPanelStyle) {
         if ($this->_backImageUrl === null && $style->_backImageUrl !== null) {
             $this->_backImageUrl = $style->_backImageUrl;
         }
         if ($this->_direction === null && $style->_direction !== null) {
             $this->_direction = $style->_direction;
         }
         if ($this->_horizontalAlign === null && $style->_horizontalAlign !== null) {
             $this->_horizontalAlign = $style->_horizontalAlign;
         }
         if ($this->_scrollBars === null && $style->_scrollBars !== null) {
             $this->_scrollBars = $style->_scrollBars;
         }
         if ($this->_wrap === null && $style->_wrap !== null) {
             $this->_wrap = $style->_wrap;
         }
     }
 }
コード例 #16
0
            <h2>Totalizador de Impostos de Saída - Mês Atual</h2>
            <?php 
try {
    $conn = TConnection::open('xmlparser');
    // abre uma conexão
    // cria um estilo para o cabeçalho
    $estilo_cabecalho = new TStyle('cabecalho');
    $estilo_cabecalho->font_family = 'arial,verdana,sans-serif';
    $estilo_cabecalho->font_style = 'normal';
    $estilo_cabecalho->font_weight = 'bold';
    $estilo_cabecalho->color = '#ffffff';
    $estilo_cabecalho->text_decoration = 'none';
    $estilo_cabecalho->background_color = '#825046';
    $estilo_cabecalho->font_size = '10pt';
    // cria um estilo para os dados
    $estilo_dados = new TStyle('dados');
    $estilo_dados->font_family = 'arial,verdana,sans-serif';
    $estilo_dados->font_style = 'bold';
    $estilo_dados->color = '#ffffff';
    $estilo_dados->background_color = '#757575';
    $estilo_dados->text_decoration = 'none';
    $estilo_dados->font_size = '10pt';
    $estilo_dados->show();
    $estilo_cabecalho->show();
    $tabela = new TTable();
    // instancia objeto tabela
    // define algumas propriedades da tabela
    $tabela->width = 700;
    $tabela->border = 1;
    $tabela->style = "border-collapse:collapse";
    // instancia uma linha para o cabeçalho
コード例 #17
0
<?php

// inclui classe TStyle
include_once 'app.widgets/TStyle.class.php';
// instancia objeto TStyle
// define características de um estilo chamado texto
$estilo1 = new TStyle('texto');
$estilo1->font_family = 'arial,verdana,sans-serif';
$estilo1->font_style = 'normal';
$estilo1->font_weight = 'bold';
$estilo1->color = 'white';
$estilo1->text_decoration = 'none';
$estilo1->font_size = '10pt';
// instancia objeto TStyle
// define características de um estilo chamado celula
$estilo2 = new TStyle('celula');
$estilo2->background_color = 'white';
$estilo2->padding_top = '10px';
$estilo2->padding_bottom = '10px';
$estilo2->padding_left = '10px';
$estilo2->padding_right = '10px';
$estilo2->margin_left = '5px';
$estilo2->width = '142px';
$estilo2->height = '154px';
// exibe estilos na tela
$estilo1->show();
$estilo2->show();
// exibe estilos na tela
$estilo1->show();
$estilo2->show();
コード例 #18
0
ファイル: TLabel.class.php プロジェクト: enieber/adianti
 /**
  * Shows the widget at the screen
  */
 public function show()
 {
     // define the font style
     $this->style->font_family = $this->fontFace;
     $this->style->color = $this->fontColor;
     $this->style->font_size = $this->fontSize . 'pt';
     $this->style->_moz_user_select = 'none';
     $this->style->_webkit_user_select = 'none';
     $this->style->user_select = 'none';
     // detect a previously loaded style
     if ($loadedstyle = TStyle::findStyle($this->style)) {
         $this->tag->{'class'} = $loadedstyle;
     } else {
         $this->style->show();
     }
     if ($this->fontStyle) {
         $pieces = explode(',', $this->fontStyle);
         if ($pieces) {
             $value = $this->value;
             foreach ($pieces as $piece) {
                 $value = "<{$piece}>{$value}</{$piece}>";
             }
         }
         // add content to the tag
         $this->tag->add($value);
     } else {
         // add content to the tag
         $this->tag->add($this->value);
     }
     // show the tag
     $this->tag->show();
 }
コード例 #19
0
<?php

// inclui as classes
include_once 'app.widgets/TElement.class.php';
include_once 'app.widgets/TStyle.class.php';
// cria um estilo
$style = new TStyle('estilo_texto');
$style->color = '#FF0000';
$style->font_family = 'Verdana';
$style->font_size = '20pt';
$style->font_weight = 'bold';
$style->show();
// instancia um parágrafo
$texto = new TElement('p');
$texto->align = 'center';
$texto->add('Sport Club Internacional');
// define o estilo do parágrafo
$texto->class = 'estilo_texto';
$texto->show();
コード例 #20
0
ファイル: TTabPanel.php プロジェクト: Nurudeen/prado
 /**
  * @return TStyle the style for the active tab div
  */
 public function getActiveTabStyle()
 {
     if (($style = $this->getViewState('ActiveTabStyle', null)) === null) {
         $style = new TStyle();
         $style->setCssClass('tab-active');
         $this->setViewState('ActiveTabStyle', $style, null);
     }
     return $style;
 }