本文整理汇总了PHP中TButton::setProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP TButton::setProperty方法的具体用法?PHP TButton::setProperty怎么用?PHP TButton::setProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TButton
的用法示例。
在下文中一共展示了TButton::setProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TForm
//.........这里部分代码省略.........
// // add a row for the field Email
// $row = $table->addRow();
// $row->addCell(new TLabel('Tempo:'));
// $cell = $row->addCell($temporegistro);
//
// // add a row for the field celular
// $row = $table->addRow();
// $row->addCell(new TLabel('Data:'));
// $cell = $row->addCell($dataregistro);
//
// // add a row for the field skype
// $row = $table->addRow();
// $row->addCell(new TLabel('Hora:'));
// $cell = $row->addCell($hora_registro);
//
// // add a row for the field endereco
// $row = $table->addRow();
// $row->addCell(new TLabel('Numero Registro:'));
// $row->addCell($numero_registro);
//
// // add a row for the field name
// $row = $table->addRow();
// $row->addCell(new TLabel('Registro:'));
// $cell = $row->addCell($registro);
// add a row for the field Category
// $row = $table_data->addRow();
// $row->addCell(new TLabel('Cidade:'));
// $cell = $row->addCell($cidade_id);
// add a row for the field city
// $row=$table_data->addRow();
// $row->addCell(new TLabel('Cidade:'));
// $cell = $row->addCell($cidade_id);
/*
// add a row for the field Phone
$row = $table_data->addRow();
$row->addCell(new TLabel('Phone:'));
$row->addCell($phone);
// add a row for the field BirthDate
$row->addCell(new TLabel('BirthDate:'));
$row->addCell($birthdate);
// add a row for the field status
$row = $table_data->addRow();
$row->addCell(new TLabel('Status:'));
$cell = $row->addCell($status);
// add a row for the field Email
$row->addCell(new TLabel('Email:'));
$cell = $row->addCell($email);
// add a row for the field gender
$row->addCell(new TLabel('Gender:'));
$row->addCell($gender);
$row = $table_contact->addRow();
$cell = $row->addCell(new TLabel('<b>Contact</b>'));
$cell->valign = 'top';
// add two fields inside the multifield in the second sheet
$contacts_list->setHeight(100);
$contacts_list->setClass('Contact'); // define the returning class
$contacts_list->addField('type', 'Contact Type: ', new TEntry('type'), 200);
$contacts_list->addField('value', 'Contact Value: ', new TEntry('value'), 200);
$row = $table_contact->addRow();
$row->addCell($contacts_list);
// create the radio button for the skills list
$skill_list = new TDBCheckGroup('skill_list', 'samples', 'Skill', 'id', 'name');
$table_skill->addRow()->addCell($lbl = new TLabel('Skills'));
$table_skill->addRow()->addCell($skill_list);
$lbl->setFontStyle('b');
*
*/
// create an action button
$button1 = new TButton('action1');
$button1->setAction(new TAction(array($this, 'onSave')), 'Save');
$button1->setImage('ico_save.png');
$button1->setProperty('width', 150);
// create an action button (go to list)
$button2 = new TButton('list');
$button2->setAction(new TAction(array('RegistroList', 'onReload')), 'Ir para Listagem');
$button2->setImage('ico_datagrid.gif');
$button2->setProperty('width', 100);
$panel->put($button1, 100, 325);
$panel->put($button2, 200, 325);
// define wich are the form fields
$this->form->setFields(array($code, $crm_id, $registro, $temporegistro, $tiporegistro_id, $dataregistro, $hora_registro, $numero_registro, $button1, $button2));
// $subtable = new TTable;
// $row = $subtable->addRow();
// $row->addCell($button1);
// $row->addCell($button2);
// $table_layout = new TTable;
// $table_layout->addRow()->addCell($this->form);
// $table_layout->addRow()->addCell($subtable);
// add the form inside the page
parent::add($panel);
// parent::add($table_layout);
}
示例2: __construct
/**
* Class constructor
* Creates the page, the search form and the listing
*/
public function __construct()
{
parent::__construct();
new TSession();
// creates the form
$this->form = new TForm('form_listar_registro');
// create the form fields
$name = new TEntry('nome');
// $email = new TEntry('email');
// $telefone = new TEntry('telefone');
// $celular = new TEntry('celular');
// $skype = new TEntry('skype');
// $endereco = new TEntry('endereco');
// $bairro = new TEntry('bairro');
// $cidade_id = new TEntry('cidade_id');
$name->setSize(170);
// $email->setSize(170);
// $telefone->setSize(170);
// $celular->setSize(170);
// $skype->setSize(170);
// $endereco->setSize(170);
// $bairro->setSize(126);
// $cidade_id->setSize(126);
//$name->setValue(TSession::getValue('customer_name'));
// $city_name->setValue(TSession::getValue('customer_city_name'));
$table = new TTable();
$row = $table->addRow();
$cell = $row->addCell('');
$cell->width = PHP_SAPI == 'cli' ? 40 : 80;
$row->addCell($name);
/*
$cell=$row->addCell('');
$row->addCell($email);
$cell=$row->addCell('');
$row->addCell($telefone);
$cell=$row->addCell('');
$row->addCell($celular);
$cell=$row->addCell('');
$row->addCell($skype);
$cell=$row->addCell('');
$row->addCell($endereco);
$cell=$row->addCell('');
$row->addCell($bairro);
$cell=$row->addCell('');
$row->addCell($cidade_id);
*
*/
$this->form->add($table);
// creates the action button
$button1 = new TButton('find');
$button1->setAction(new TAction(array($this, 'onSearch')), 'Buscar');
$button1->setImage('ico_find.png');
$button2 = new TButton('novo');
$button2->setAction(new TAction(array('RegistroForm', 'onEdit')), 'Novo');
$button2->setProperty('key', '');
$button2->setImage('ico_new.png');
$button3 = new TButton('csv');
$button3->setAction(new TAction(array($this, 'onExportCSV')), 'CSV');
$button3->setImage('ico_print.png');
$row->addCell($button1);
$row->addCell($button2);
$row->addCell($button3);
$this->form->setFields(array($name, $button1, $button2, $button3));
// creates a DataGrid
$this->datagrid = new TQuickGrid();
$this->datagrid->setHeight(200);
// creates the datagrid columns
$this->datagrid->addQuickColumn('Id', 'id', 'right', 40, new TAction(array($this, 'onReload')), array('order', 'id'));
$this->datagrid->addQuickColumn('CRM Titulo', 'crm_nome', 'left', 170, new TAction(array($this, 'onReload')), array('order', 'nome'));
$this->datagrid->addQuickColumn('Tipo', 'tiporegistro_nome', 'left', 140);
$this->datagrid->addQuickColumn('Tempo', 'tempo_registro', 'left', 190);
$this->datagrid->addQuickColumn('Data', 'data_registro', 'left', 150);
$this->datagrid->addQuickColumn('Hora', 'hora_registro', 'left', 150);
$this->datagrid->addQuickColumn('Nª Registro', 'numero_registro', 'left', 150);
// creates two datagrid actions
$this->datagrid->addQuickAction('Edit', new TDataGridAction(array('RegistroForm', 'onEdit')), 'id', 'ico_edit.png');
$this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
// create the datagrid model
$this->datagrid->createModel();
// creates the page navigation
$this->pageNavigation = new TPageNavigation();
$this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
$this->pageNavigation->setWidth($this->datagrid->getWidth());
// creates the page structure using a table
$table = new TTable();
$table->addRow()->addCell($this->form);
$table->addRow()->addCell($this->datagrid);
$table->addRow()->addCell($this->pageNavigation);
// add the table inside the page
//.........这里部分代码省略.........