本文整理汇总了PHP中TEntry::setSize方法的典型用法代码示例。如果您正苦于以下问题:PHP TEntry::setSize方法的具体用法?PHP TEntry::setSize怎么用?PHP TEntry::setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEntry
的用法示例。
在下文中一共展示了TEntry::setSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// instancia um formulário
$this->form = new TForm('form_relat_vendas');
// instancia uma tabela
$table = new TTable();
// adiciona a tabela ao formulário
$this->form->add($table);
// cria os campos do formulário
$data_ini = new TEntry('data_ini');
$data_fim = new TEntry('data_fim');
// define os tamanhos
$data_ini->setSize(100);
$data_fim->setSize(100);
// adiciona uma linha para o campo data inicial
$row = $table->addRow();
$row->addCell(new TLabel('Data Inicial:'));
$row->addCell($data_ini);
// adiciona uma linha para o campo data final
$row = $table->addRow();
$row->addCell(new TLabel('Data Final:'));
$row->addCell($data_fim);
// cria um botão de ação
$gera_button = new TButton('gera');
// define a ação do boão
$gera_button->setAction(new TAction(array($this, 'onGera')), 'Gerar Relatório');
// adiciona uma linha para a ação do formulário
$row = $table->addRow();
$row->addCell($gera_button);
// define quais são os campos do formulário
$this->form->setFields(array($data_ini, $data_fim, $gera_button));
// adiciona o formulário à página
parent::add($this->form);
}
示例2: TTable
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
$table = new TTable();
$table->width = '100%';
// creates the form
$this->form = new TForm('form_login');
$this->form->class = 'tform';
$this->form->style = 'margin:auto;width: 350px';
// add the notebook inside the form
$this->form->add($table);
// create the form fields
$login = new TEntry('login');
$password = new TPassword('password');
// define the sizes
$login->setSize(150, 40);
$password->setSize(150, 40);
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onLogin')), _t('Login'));
$save_button->setImage('ico_apply.png');
// add a row for the field login
$row = $table->addRow();
$cell = $row->addCell(new TLabel('Login'));
$cell->colspan = 2;
$row->class = 'tformtitle';
$table->addRowSet(new TLabel(_t('User') . ': '), $login);
$table->addRowSet(new TLabel(_t('Password') . ': '), $password);
$row = $table->addRowSet($save_button, '');
$row->class = 'tformaction';
$this->form->setFields(array($login, $password, $save_button));
// add the form to the page
parent::add($this->form);
}
示例3: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_City');
$this->form->class = 'tform';
// CSS class
$this->form->style = 'width: 500px';
// creates a table
$table = new TTable();
$table->width = '100%';
$table_buttons = new TTable();
// add the table inside the form
$this->form->add($table);
// create the form fields
$id = new TEntry('id');
$name = new TEntry('name');
// define the sizes
$id->setSize(100);
$name->setSize(100);
$id->setEditable(FALSE);
// define the form title
$row = $table->addRow();
$row->class = 'tformtitle';
$cell = $row->addCell(new TLabel('Manual form'));
$cell->colspan = 2;
// add the form fields
$table->addRowSet(new TLabel('ID:'), $id);
$table->addRowSet(new TLabel('Name:'), $name);
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onSave')), 'Save');
$save_button->setImage('ico_save.png');
// create an action button (new)
$new_button = new TButton('new');
$new_button->setAction(new TAction(array($this, 'onEdit')), 'New');
$new_button->setImage('ico_new.png');
// create an action button (go to list)
$goto_button = new TButton('list');
$goto_button->setAction(new TAction(array('CompleteDataGridView', 'onReload')), 'Listing');
$goto_button->setImage('ico_datagrid.gif');
// add a row for the form action
$row = $table_buttons->addRow();
$row->addCell($save_button);
$row->addCell($new_button);
$row->addCell($goto_button);
// add a row for the form action
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($table_buttons);
$cell->colspan = 2;
// define wich are the form fields
$this->form->setFields(array($id, $name, $save_button, $new_button, $goto_button));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例4: TTable
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the table container
$table = new TTable();
$table->style = 'width:100%';
// creates the form
$this->form = new TForm('form_System_Provider');
$this->form->class = 'tform';
// add the notebook inside the form
$this->form->add($table);
$row1 = $table->addRow();
$row1->class = 'tformtitle';
$cell1 = $row1->addCell(new TLabel('Add new provider'), '');
$cell1->colspan = 2;
// create the form fields
$id = new TEntry('id');
$nif = new TEntry('nif');
$name = new TEntry('name');
$id->setEditable(false);
// define the sizes
$id->setSize(100);
$nif->setSize(300);
$name->setSize(300);
// validations
$nif->addValidation('nif', new TRequiredValidator());
$name->addValidation('name', new TRequiredValidator());
// add a row for the field id
$table->addRowSet(new TLabel('ID:'), $id);
$table->addRowSet(new TLabel('NIF: '), $nif);
$table->addRowSet(new TLabel('Name: '), $name);
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
$save_button->setImage('fa:floppy-o');
// create an new button (edit with no parameters)
$new_button = new TButton('new');
$new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
$new_button->setImage('fa:plus-square green');
$list_button = new TButton('list');
$list_button->setAction(new TAction(array('SystemProvidersList', 'onReload')), _t('Back to the listing'));
$list_button->setImage('fa:table blue');
// define the form fields
$this->form->setFields(array($id, $nif, $name, $save_button, $new_button, $list_button));
$buttons = new THBox();
$buttons->add($save_button);
$buttons->add($new_button);
$buttons->add($list_button);
$container = new TTable();
$container->width = '80%';
$container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProvidersList'));
$container->addRow()->addCell($this->form);
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($buttons);
$cell->colspan = 2;
// add the form to the page
parent::add($container);
}
示例5: Exception
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// security check
if (TSession::getValue('logged') !== TRUE) {
throw new Exception(_t('Not logged'));
}
// security check
TTransaction::open('changeman');
if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR' and Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'MANAGER') {
throw new Exception(_t('Permission denied'));
}
TTransaction::close();
// creates a table
$table = new TTable();
// creates the form
$this->form = new TForm('form_Document');
$this->form->add($this->notebook);
$this->form->class = 'tform';
$this->form->add($table);
$table->addRowSet(new TLabel(_t('Document')), '')->class = 'tformtitle';
// create the form fields
$id = new TEntry('id');
$id_project = new TDBCombo('id_project', 'changeman', 'Project', 'id', 'description');
$title = new TEntry('title');
$content = new THtmlEditor('content');
$id->setEditable(FALSE);
// define the sizes
$id->setSize(100);
$id_project->setSize(200);
$title->setSize(200, 40);
$content->setSize(680, 350);
$table->addRowSet(new TLabel('ID:'), $id);
$table->addRowSet(new TLabel(_t('Project') . ': '), $id_project);
$table->addRowSet(new TLabel(_t('Title') . ': '), $title);
$hbox = new THBox();
$hbox->style = 'margin: 10px';
$hbox->add($content);
$row = $table->addRow();
$row->addCell($lbl = new TLabel(_t('Content') . ': '));
$lbl->setFontStyle('b');
$row = $table->addRow();
$cell = $row->addCell($hbox);
$cell->colspan = 3;
// create an action button (save)
$save_button = new TButton('save');
// define the button action
$save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
$save_button->setImage('ico_save.png');
// define wich are the form fields
$this->form->setFields(array($id, $id_project, $title, $content, $save_button));
$table->addRowSet($save_button, '')->class = 'tformaction';
$container = new TTable();
$container->addRow()->addCell($this->form);
// add the form to the page
parent::add($container);
}
示例6: Exception
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// security check
if (TSession::getValue('logged') !== TRUE) {
throw new Exception(_t('Not logged'));
}
// creates a table
$table = new TTable();
$this->notebook = new TNotebook();
$this->notebook->setSize(600, 350);
$this->notebook->appendPage(_t('Data'), $table);
// creates the form
$this->form = new TForm('form_Release');
$this->form->add($this->notebook);
$options = array('Y' => _t('Yes'), 'N' => _t('No'));
// create the form fields
$id = new TEntry('id');
$id_project = new TEntry('project');
$name = new TEntry('name');
$description = new THtmlEditor('description');
$id->setEditable(FALSE);
$id_project->setEditable(FALSE);
$name->setEditable(FALSE);
$description->setEditable(FALSE);
// define the sizes
$id->setSize(100);
$id_project->setSize(200);
$name->setSize(200, 40);
$description->setSize(530, 200);
// add a row for the field id
$row = $table->addRow();
$row->addCell(new TLabel('ID:'));
$row->addCell($id);
// add a row for the field id_project
$row = $table->addRow();
$row->addCell(new TLabel(_t('Project') . ': '));
$row->addCell($id_project);
// add a row for the field name
$row = $table->addRow();
$row->addCell(new TLabel(_t('Name') . ': '));
$row->addCell($name);
// add a row for the field description
$row = $table->addRow();
$row->addCell($lbl = new TLabel(_t('Description') . ': '));
$lbl->setFontStyle('b');
$row = $table->addRow();
$cell = $row->addCell($description);
$cell->colspan = 3;
// define wich are the form fields
$this->form->setFields(array($id, $id_project, $name, $description));
$container = new TTable();
$container->addRow()->addCell($this->form);
// add the form to the page
parent::add($container);
}
示例7: TTable
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
$table = new TTable();
$table->width = '100%';
// creates the form
$this->form = new TForm('form_User');
$this->form->class = 'tform';
$this->form->style = 'width: 450px;margin:auto; margin-top:10px;';
// add the notebook inside the form
$this->form->add($table);
// create the form fields
$login = new TEntry('login');
$password = new TPassword('password');
// define the sizes
$login->setSize(320, 40);
$password->setSize(320, 40);
$login->style = 'height:35px; font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
$password->style = 'height:35px;margin-bottom: 15px;font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
$row = $table->addRow();
$row->addCell(new TLabel('Login'))->colspan = 2;
$row->class = 'tformtitle';
$login->placeholder = _t('User');
$password->placeholder = _t('Password');
$user = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>';
$locker = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>';
$container1 = new TElement('div');
$container1->add($user);
$container1->add($login);
$container2 = new TElement('div');
$container2->add($locker);
$container2->add($password);
$row = $table->addRow();
$row->addCell($container1)->colspan = 2;
// add a row for the field password
$row = $table->addRow();
$row->addCell($container2)->colspan = 2;
// create an action button (save)
$save_button = new TButton('save');
// define the button action
$save_button->setAction(new TAction(array($this, 'onLogin')), _t('Log in'));
$save_button->class = 'btn btn-success btn-defualt';
$save_button->style = 'margin-left:32px;width:355px;height:40px;border-radius:6px;font-size:18px';
$row = $table->addRow();
$row->class = 'tformaction';
$cell = $row->addCell($save_button);
$cell->colspan = 2;
$this->form->setFields(array($login, $password, $save_button));
// add the form to the page
$caixa = new TVBox();
$caixa->style = "text-align:center";
$caixa->add(new TImage("app/images/pgo.png"));
$caixa->add($this->form);
parent::add($caixa);
}
示例8: TForm
function __construct()
{
parent::__construct();
// instancia o formulário
$this->form = new TForm();
$this->form->setName('form_livros');
// instancia o painél
$panel = new TPanel(400, 300);
$this->form->add($panel);
// coloca o campo id no formulário
$panel->put(new TLabel('ID'), 10, 10);
$panel->put($id = new TEntry('id'), 100, 10);
$id->setSize(100);
$id->setEditable(FALSE);
// coloca a imagem de um livro
$panel->put(new TImage('book.png'), 320, 20);
// coloca o campo título no formulário
$panel->put(new TLabel('Título'), 10, 40);
$panel->put($titulo = new TEntry('titulo'), 100, 40);
// coloca o campo autor no formulário
$panel->put(new TLabel('Autor'), 10, 70);
$panel->put($autor = new TEntry('autor'), 100, 70);
// coloca o campo tema no formulário
$panel->put(new TLabel('Tema'), 10, 100);
$panel->put($tema = new TCombo('tema'), 100, 100);
// cria um vetor com as opções da combo tema
$items = array();
$items['1'] = 'Administração';
$items['2'] = 'Informática';
$items['3'] = 'Economia';
$items['4'] = 'Matemática';
// adiciona os itens na combo
$tema->addItems($items);
// coloca o campo editora no formulário
$editora = new TEntry('editora');
$panel->put(new TLabel('Editora'), 10, 130);
$panel->put($editora, 100, 130);
// coloca o campo ano no formulário
$panel->put(new TLabel('Ano'), 210, 130);
$panel->put($ano = new TEntry('ano'), 260, 130);
$editora->setSize(100);
$ano->setSize(40);
// coloca o campo resumo no formulário
$panel->put(new TLabel('Resumo'), 10, 160);
$panel->put($resumo = new TText('resumo'), 100, 160);
// cria uma ação
$panel->put($acao = new TButton('action1'), 320, 240);
$acao->setAction(new TAction(array($this, 'onSave')), 'Salvar');
// define quais são os campos do formulário
$this->form->setFields(array($id, $titulo, $autor, $tema, $editora, $ano, $resumo, $acao));
parent::add($this->form);
}
示例9: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Customer_Report');
$this->form->class = 'tform';
// CSS class
// creates a table
$table = new TTable();
$table->width = '100%';
// add the table inside the form
$this->form->add($table);
// create the form fields
$name = new TEntry('name');
$city_id = new TDBSeekButton('city_id', 'samples', 'form_Customer_Report', 'City', 'name', 'city_id', 'city_name');
$city_name = new TEntry('city_name');
$category_id = new TDBCombo('category_id', 'samples', 'Category', 'id', 'name');
$output_type = new TRadioGroup('output_type');
$options = array('html' => 'HTML', 'pdf' => 'PDF', 'rtf' => 'RTF');
$output_type->addItems($options);
$output_type->setValue('pdf');
$output_type->setLayout('horizontal');
// define the sizes
$name->setSize(200);
$city_id->setSize(100);
$category_id->setSize(100);
$city_name->setEditable(FALSE);
// add a row for the field name
$row = $table->addRowSet(new TLabel('Report filters'), '');
$row->class = 'tformtitle';
// CSS class
// add the fields into the table
$table->addRowSet(new TLabel('Name' . ': '), $name);
$table->addRowSet(new TLabel('City' . ': '), array($city_id, $city_name));
$table->addRowSet(new TLabel('Category' . ': '), $category_id);
$table->addRowSet(new TLabel('Output' . ': '), $output_type);
// create an action button (save)
$save_button = new TButton('generate');
$save_button->setAction(new TAction(array($this, 'onGenerate')), 'Generate');
$save_button->setImage('ico_save.png');
// add a row for the form action
$row = $table->addRowSet($save_button, '');
$row->class = 'tformaction';
// define wich are the form fields
$this->form->setFields(array($name, $city_id, $city_name, $category_id, $output_type, $save_button));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例10: show
/**
* Shows the widget
*/
public function show()
{
$tag = new TEntry($this->name);
$tag->setEditable(FALSE);
$tag->setProperty('id', $this->name);
$tag->setSize(40);
$tag->setProperty('onchange', "aux = document.getElementsByName('{$this->text_name}'); aux[0].value = this.value;");
$tag->show();
// define the tag properties
$this->tag->name = $this->text_name;
$this->tag->onchange = "entry = document.getElementById('{$this->name}'); entry.value = this.value;";
$this->tag->style = "width:{$this->size}px;";
// tamanho em pixels
// creates an empty <option> tag
$option = new TElement('option');
$option->add('');
$option->value = '0';
// valor da TAG
// add the option tag to the combo
$this->tag->add($option);
if ($this->items) {
// iterate the combobox items
foreach ($this->items as $chave => $item) {
// creates an <option> tag
$option = new TElement('option');
$option->value = $chave;
// define the index
$option->add($item);
// add the item label
// verify if this option is selected
if ($chave == $this->value) {
// mark as selected
$option->selected = 1;
}
// add the option to the combo
$this->tag->add($option);
}
}
// verify whether the widget is editable
if (!parent::getEditable()) {
// make the widget read-only
$this->tag->readonly = "1";
$this->tag->{'class'} = 'tfield_disabled';
// CSS
}
// shows the combobox
$this->tag->show();
}
示例11: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
Usuario::checkLogin();
// creates the form
$this->form = new TForm('form_Usuario');
$this->form->class = 'tform';
// CSS class
// add a table inside form
$table = new TTable();
$table->width = '100%';
$this->form->add($table);
// add a row for the form title
$row = $table->addRow();
$row->class = 'tformtitle';
// CSS class
$row->addCell(new TLabel('Usuario'))->colspan = 2;
// create the form fields
$id = new TEntry('id');
$login = new TEntry('login');
$senha = new TPassword('senha');
// define the sizes
$id->setSize(100);
$login->setSize(200);
$senha->setSize(200);
// add one row for each form field
$table->addRowSet(new TLabel('id:'), $id);
$table->addRowSet(new TLabel('login:'), $login);
$table->addRowSet(new TLabel('senha:'), $senha);
// create an action button (save)
$save_button = new TButton('save');
$save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
$save_button->setImage('ico_save.png');
// create an new button (edit with no parameters)
$new_button = new TButton('new');
$new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
$new_button->setImage('ico_new.png');
$this->form->setFields(array($id, $login, $senha, $save_button, $new_button));
$buttons_box = new THBox();
$buttons_box->add($save_button);
$buttons_box->add($new_button);
// add a row for the form action
$row = $table->addRow();
$row->class = 'tformaction';
// CSS class
$row->addCell($buttons_box)->colspan = 2;
parent::add($this->form);
}
示例12: TForm
function __construct()
{
parent::__construct();
//Instancia um novo Formulario
$this->form = new TForm('livroForm');
//Isntancia o Painel
$painel = new TPanel('400', '300');
$this->form->add($painel);
//Coloca o campo ID no Formulario
$painel->put(new TLabel('ID'), '10', '10');
$painel->put($id = new TEntry('id'), '100', '10');
$id->setSize('100');
$id->setEditable(false);
//Coloca o campo titulo no formulario
$painel->put(new TLabel('Titulo'), '10', '40');
$painel->put($titulo = new TEntry('titulo'), '100', '40');
//Coloca o campo autor no formulario
$painel->put(new TLabel('Autor'), '10', '70');
$painel->put($autor = new TEntry('autor'), '100', '70');
//coloca o campo tema no formulario
$painel->put(new TLabel('Tema'), '10', '100');
$painel->put($tema = new TCombo('tema'), '100', '100');
//Cria um vetor com as opções da Combo Tema
$itens = array();
$itens['1'] = 'Administração';
$itens['2'] = 'Matematica';
$itens['3'] = 'Informatica';
//Adiciona os na Combo
$tema->addItems($itens);
//Coloca o campo editora no formulario
$painel->put(new TLabel('Editora'), '10', '130');
$painel->put($editora = new TEntry('editora'), '100', '130');
$editora->setSize('100');
//Coloca o campo ano no formulario
$painel->put(new TLabel('Ano'), '210', '130');
$painel->put($ano = new TEntry('ano'), '260', '130');
$ano->setSize('40');
//coloca o campo resumo no formulario
$painel->put(new TLabel('Remuno'), '10', '160');
$painel->put($resumo = new TText('resumo'), '100', '160');
//Cria uma Ação
$painel->put($acao = new TButton('action'), '320', '240');
$acao->setAction(new TAction(array($this, 'onSave')), 'Salvar');
//Define quais são os Campos do Formulario
$this->form->setFields(array($id, $titulo, $autor, $tema, $editora, $ano, $resumo, $acao));
parent::add($this->form);
}
示例13: TTable
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// creates a table
$table = new TTable();
// creates a label with the title
$title = new TLabel('Table Multi Cell');
$title->setFontSize(18);
$title->setFontFace('Arial');
$title->setFontColor('red');
// adds a row to the table
$row = $table->addRow();
$title = $row->addCell($title);
$title->colspan = 2;
// creates a series of input widgets
$id = new TEntry('id');
$name = new TEntry('name');
$min = new TEntry('min');
$max = new TEntry('max');
$start_date = new TDate('start_date');
$end_date = new TDate('end_date');
$address = new TEntry('address');
// adjust the size of the code
$id->setSize(70);
$start_date->setSize(70);
$end_date->setSize(70);
$min->setSize(87);
$max->setSize(87);
// add rows for the fields
$table->addRowSet(new TLabel('Code'), $id);
$table->addRowSet(new TLabel('Name'), $name);
// first approach
$table->addRowSet(new TLabel('Value'), array($min, new TLabel('To'), $max));
// second approach
$row = $table->addRow();
$row->addCell(new TLabel('Date'));
$row->addMultiCell($start_date, $end_date);
$table->addRowSet(new TLabel('Address'), $address);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($table);
parent::add($vbox);
}
示例14: TTable
function __construct()
{
parent::__construct('form_conclui_venda');
// instancia uma tabela
$table = new TTable();
// adiciona a tabela ao formulário
parent::add($table);
// cria os campos do formulário
$cliente = new TEntry('id_cliente');
$desconto = new TEntry('desconto');
$valor_total = new TEntry('valor_total');
$valor_pago = new TEntry('valor_pago');
// define alguns atributos para os campos do formulário
$valor_total->setEditable(FALSE);
$cliente->setSize(100);
$desconto->setSize(100);
$valor_total->setSize(100);
$valor_pago->setSize(100);
// adiciona uma linha para o campo cliente
$row = $table->addRow();
$row->addCell(new TLabel('Cliente:'));
$row->addCell($cliente);
// adiciona uma linha para o campo desconto
$row = $table->addRow();
$row->addCell(new TLabel('Desconto:'));
$row->addCell($desconto);
// adiciona uma linha para o campo valor total
$row = $table->addRow();
$row->addCell(new TLabel('Valor Total:'));
$row->addCell($valor_total);
// adiciona uma linha para o campo valor pago
$row = $table->addRow();
$row->addCell(new TLabel('Valor Pago:'));
$row->addCell($valor_pago);
// cria um botão de ação para o formulário
$this->button = new TButton('action1');
// adiciona uma linha para as ações do formulário
$row = $table->addRow();
$row->addCell('');
$row->addCell($this->button);
// define quais são os campos do formulário
parent::setFields(array($cliente, $desconto, $valor_total, $valor_pago, $this->button));
}
示例15: makeTEntry
/**
*
*/
public function makeTEntry($properties)
{
$widget = new TEntry((string) $properties->{'name'});
$widget->setValue((string) $properties->{'value'});
$widget->setMask((string) $properties->{'mask'});
$widget->setSize((int) $properties->{'width'});
if (isset($properties->{'maxlen'})) {
$widget->setMaxLength((int) $properties->{'maxlen'});
}
if (isset($properties->{'tip'})) {
$widget->setTip((string) $properties->{'tip'});
}
if (isset($properties->{'required'}) and $properties->{'required'} == '1') {
$widget->addValidation((string) $properties->{'name'}, new TRequiredValidator());
}
$widget->setEditable((string) $properties->{'editable'});
$this->fields[] = $widget;
$this->fieldsByName[(string) $properties->{'name'}] = $widget;
return $widget;
}