本文整理汇总了PHP中GtkHBox::pack_start方法的典型用法代码示例。如果您正苦于以下问题:PHP GtkHBox::pack_start方法的具体用法?PHP GtkHBox::pack_start怎么用?PHP GtkHBox::pack_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GtkHBox
的用法示例。
在下文中一共展示了GtkHBox::pack_start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GtkHBox
function __construct($Parent, $operacao = 'i', $CodUnidade = null)
{
parent::__construct($operacao == 'i' ? 'Unidade de Estoque - Incluir' : 'Unidade de Estoque - Alterar', null, null, 'unid_estoques.png');
$this->Parent = $Parent;
$this->operacao = $operacao;
$this->CodUnidade = $CodUnidade;
$GLOBALS['XMONEY_FIELD'] = 'Cod_S_Unidade';
$GLOBALS['XMONEY_FIELD_ID'] = $CodUnidade ? $CodUnidade : -1;
// Id
$this->pack_start($hbox = new GtkHBox());
if ($operacao == 'a') {
$hbox->pack_start($id = new GtkLabel(), false);
$id->set_markup(' Id.: <b>' . $CodUnidade . '</b>');
}
// nome
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start(new GtkLabel(' Nome: '), false);
$hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Unid_Estoques', 'Nome'));
// ok
$this->pack_start($hbbox = new GtkHButtonBox(), false);
$hbbox->set_layout(Gtk::BUTTONBOX_END);
$hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-ok'), false);
$this->ok->connect('clicked', array($this, 'ok_clicked'));
// cancelar
$hbbox->pack_start($this->cancelar = GtkButton::new_from_stock('gtk-cancel'), false);
$this->cancelar->connect('clicked', array($this, 'cancelar_clicked'));
$this->cancelar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
// extra
$this->children_show_all();
$this->nome->set_next_focus($this->ok);
$this->nome->set_focus();
}
示例2: GtkHBox
function __construct($Parent, $operacao = 'i', $CodTrans, $CodId = null)
{
parent::__construct($operacao == 'i' ? latin1('Novo endereço') : latin1('Alterar endereço'), null, null, 'enderecos.png');
$this->Parent = $Parent;
$this->operacao = $operacao;
$this->CodTrans = $CodTrans;
$this->CodId = $CodId;
// Id e Tipo
$this->pack_start($hbox = new GtkHBox());
if ($operacao == 'a') {
$hbox->pack_start($id = new GtkLabel(), false);
$id->set_markup(' Id.: <b>' . $this->CodId . '</b>');
}
$hbox->pack_start($this->tipo = new TTipoEndereco($this));
// endereco
$this->pack_start($frame = new GtkFrame());
$frame->add($vbox = new GtkVBox());
$vbox->set_border_width(5);
$vbox->pack_start($hbox = new GtkHBox());
$hbox->pack_start(new GtkLabel('Endereco: '), false);
$hbox->pack_start($this->endereco = new AEntry(true));
// cep
$vbox->pack_start($hbox = new GtkHBox());
$hbox->pack_start(new GtkLabel('CEP: '), false);
$hbox->pack_start($this->cep = new AEntry(true));
// bairro
$hbox->pack_start(new GtkLabel('Bairro: '), false);
$hbox->pack_start($this->bairro = new AEntry(true));
// cidade
$vbox->pack_start($hbox = new GtkHBox());
$hbox->pack_start(new GtkLabel('Cidade: '), false);
$hbox->pack_start($this->cidade = new AEntry(true));
// estado
$hbox->pack_start($this->estado = new TEstados($this));
// contato
$this->pack_start($frame = new GtkFrame());
$frame->add($vbox = new GtkVBox());
$vbox->set_border_width(5);
$vbox->pack_start($hbox = new GtkHBox());
$hbox->pack_start(new GtkLabel('Contato: '), false);
$hbox->pack_start($this->contato = new AEntry());
// fone
$hbox->pack_start(new GtkLabel('Fone: '), false);
$hbox->pack_start($this->fone = new AEntry());
// referencia
$vbox->pack_start($hbox = new GtkHBox());
$hbox->pack_start(new GtkLabel(latin1('Referência: ')), false);
$hbox->pack_start($this->referencia = new AEntry());
// ok e cancelar
$this->pack_start($hbbox = new GtkHButtonBox(), false);
$hbbox->set_layout(Gtk::BUTTONBOX_END);
$hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-ok'), false);
$this->ok->connect('clicked', array($this, 'ok_clicked'));
$hbbox->pack_start($this->cancelar = GtkButton::new_from_stock('gtk-cancel'), false);
$this->cancelar->connect('clicked', array($this, 'cancelar_clicked'));
$this->cancelar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
$this->referencia->set_next_focus($this->ok);
$this->children_show_all();
$this->endereco->set_focus();
}
示例3: __construct
/**
* Class Constructor
* @param $name Name of the widget
*/
public function __construct($name)
{
parent::__construct($name);
$this->widget = new GtkVBox();
parent::add($this->widget);
$this->orientation = 'vertical';
$this->count = 0;
$this->types = array();
$this->created = FALSE;
$this->table_fields = new TTable();
$this->editing = FALSE;
$this->widget->pack_start($this->table_fields, false, false);
$this->view = new GtkTreeView();
$this->model = new GtkListStore();
$button_bar = new GtkHBox();
$add = GtkButton::new_from_stock(Gtk::STOCK_SAVE);
$del = GtkButton::new_from_stock(Gtk::STOCK_DELETE);
$can = GtkButton::new_from_stock(Gtk::STOCK_CANCEL);
$add->connect_simple('clicked', array($this, 'onSave'));
$del->connect_simple('clicked', array($this, 'onDelete'));
$can->connect_simple('clicked', array($this, 'onCancel'));
$button_bar->pack_start($add, FALSE, FALSE);
$button_bar->pack_start($del, FALSE, FALSE);
$button_bar->pack_start($can, FALSE, FALSE);
$this->widget->pack_start($button_bar, false, false);
$scroll = new GtkScrolledWindow();
$scroll->add($this->view);
$scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
$this->widget->pack_start($scroll, false, false);
$this->view->set_size_request(400, 140);
$this->height = 140;
$this->view->connect_simple('button_release_event', array($this, 'onClick'));
}
示例4: GtkHBox
function __construct($Parent, $CodId)
{
parent::__construct('Estornar Conta a Receber', 400, -1, 'contas_receber.png');
$this->Parent = $Parent;
$this->CodId = $CodId;
// Id.
$this->pack_start($hbox = new GtkHBox());
$hbox->pack_start(GtkImage::new_from_stock(Gtk::STOCK_CANCEL, Gtk::ICON_SIZE_DIALOG), false);
$hbox->pack_start($label = new GtkLabel(), false);
$label->set_markup(' Cod. Id.: <b>' . $CodId . '</b>');
// anotacoes
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start(new GtkLabel(latin1(' Anotações: ')), false);
$hbox->pack_start($this->anotacoes = new AEntry(true));
// ok
$this->pack_start($hbbox = new GtkHButtonBox(), false);
$hbbox->set_layout(Gtk::BUTTONBOX_END);
$hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-ok'), false);
$this->anotacoes->focus_widget = $this->ok;
$this->ok->connect('clicked', array($this, 'ok_clicked'));
// cancelar
$hbbox->pack_start($this->cancelar = GtkButton::new_from_stock('gtk-cancel'), false);
$this->cancelar->connect('clicked', array($this, 'cancelar_clicked'));
$this->cancelar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
$this->children_show_all();
$this->anotacoes->grab_focus();
}
示例5: alert
function alert($msg)
{
// note 1
$dialog = new GtkDialog('Alert', null, Gtk::DIALOG_MODAL);
// create a new dialog
$dialog->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
$top_area = $dialog->vbox;
// note 2
$top_area->pack_start($hbox = new GtkHBox());
// note 3
$stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG);
// note 4
$hbox->pack_start($stock, 0, 0);
// stuff in the icon
$hbox->pack_start(new GtkLabel($msg));
// and the msg
$dialog->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK);
// note 5
$dialog->set_has_separator(false);
// don't display the set_has_separator
$dialog->show_all();
// show the dialog
$dialog->run();
// the dialog in action
$dialog->destroy();
// done. close the dialog box.
}
示例6: GtkHBox
function __construct($Parent, $operacao = 'i', $CodForma = null)
{
parent::__construct($operacao == 'i' ? 'Formas de Pagamento - Incluir' : 'Formas de Pagamento - Alterar', null, null, 'formas_pgto.png');
$this->Parent = $Parent;
$this->operacao = $operacao;
$this->CodForma = $CodForma;
$GLOBALS['XMONEY_FIELD'] = 'Cod_S_Forma';
$GLOBALS['XMONEY_FIELD_ID'] = $CodForma ? $CodForma : -1;
// Id
$this->pack_start($hbox = new GtkHBox());
if ($operacao == 'a') {
$hbox->pack_start($id = new GtkLabel(), false);
$id->set_markup(' Id.: <b>' . $CodForma . '</b>');
}
// tipo doc.
$hbox->pack_start($this->tipo = new TTipoDoc($this));
// nome
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start(new GtkLabel(' Nome: '), false);
$hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Formas_Pgto', 'Nome'));
// ok
$this->pack_start($hbbox = new GtkHButtonBox(), false);
$hbbox->set_layout(Gtk::BUTTONBOX_END);
$hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-ok'), false);
$this->ok->connect('clicked', array($this, 'ok_clicked'));
// cancelar
$hbbox->pack_start($this->cancelar = GtkButton::new_from_stock('gtk-cancel'), false);
$this->cancelar->connect('clicked', array($this, 'cancelar_clicked'));
$this->cancelar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
$this->children_show_all();
$this->nome->set_next_focus($this->ok);
$this->nome->set_focus();
}
示例7: setup_dialog
function setup_dialog()
{
$dialog = new GtkDialog();
$dialog->vbox->pack_start(new GtkLabel('Which platform are you using: '));
$radio0 = setup_radio(null, 'radio button 0', '100');
// note 1
$radio1 = setup_radio($radio0, 'Windows', 'win');
$radio2 = setup_radio($radio0, 'Mac', 'mac');
$radio3 = setup_radio($radio0, 'Linux', 'linux');
// pack them inside vbox
$dialog->vbox->pack_start($radio1, 0, 0);
// note 2
$dialog->vbox->pack_start($radio2, 0, 0);
// note 2
$dialog->vbox->pack_start($radio3, 0, 0);
// note 2
$dialog->vbox->pack_start($hbox2 = new GtkHBox());
$button_ok = GtkButton::new_from_stock(Gtk::STOCK_OK);
$button_ok->set_size_request(87, 33);
$hbox2->pack_start(new GtkLabel());
$hbox2->pack_start($button_ok, 0);
$button_ok->connect('clicked', 'on_ok_button', $dialog);
$dialog->set_has_separator(false);
$dialog->action_area->set_size_request(-1, 1);
$dialog->show_all();
global $selected_radio, $selected_radio_value;
$selected_radio = $selected_radio_value = '';
$dialog->run();
$dialog->destroy();
global $response;
$response->set_text("{$selected_radio} ({$selected_radio_value})");
// note 5
}
示例8: GtkDialog
function on_delete_confirm()
{
$dialog = new GtkDialog('CAUTION!', $this, 0, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK, Gtk::STOCK_CANCEL, Gtk::RESPONSE_CANCEL));
$hbox = new GtkHBox(false, 8);
$hbox->set_border_width(8);
$stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
$confirm_text1 = new GtkLabel('Are you sure you want to proceed ?');
$confirm_text2 = new GtkLabel('Note: This process is irreversible.');
$confirm_text3 = new GtkLabel($this->selected_file);
$confirm_text3->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#ff0000"));
$vbox2 = new GtkVBox();
$vbox2->pack_start($confirm_text1);
$vbox2->pack_start($confirm_text2);
$vbox2->pack_start($confirm_text3);
$hbox->pack_start($stock, false, false, 0);
$hbox->pack_start($vbox2, false, false, 0);
$dialog->vbox->pack_start($hbox, false, false, 0);
$dialog->show_all();
$response = $dialog->run();
if ($response == Gtk::RESPONSE_OK) {
$resp = $this->delete_file();
if ($resp) {
$this->on_delete_successful();
$this->selected_file = "";
$this->file_label->set_text($this->file_label_default);
} else {
$this->selected_file = "";
$this->file_label->set_text('Unable to delete the specified file.');
}
}
$dialog->destroy();
}
示例9: __construct
public function __construct()
{
parent::__construct();
parent::set_title('Incluir');
parent::connect_simple('destroy', array('Gtk', 'main_quit'));
parent::set_default_size(400, 240);
parent::set_border_width(10);
parent::set_position(GTK::WIN_POS_CENTER);
$vbox = new GtkVBox();
$this->labels['id'] = new GtkLabel('Código:');
$this->campos['id'] = new GtkEntry();
$this->campos['id']->set_size_request(80, -1);
$this->labels['nome'] = new GtkLabel('Nome: ');
$this->campos['nome'] = new GtkEntry();
$this->campos['nome']->set_size_request(240, -1);
$this->labels['endereco'] = new GtkLabel('Endereço: ');
$this->campos['endereco'] = new GtkEntry();
$this->campos['endereco']->set_size_request(240, -1);
$this->labels['telefone'] = new GtkLabel('Telefone: ');
$this->campos['telefone'] = new GtkEntry();
$this->campos['telefone']->set_size_request(140, -1);
$this->labels['id_cidade'] = new GtkLabel('Cidade: ');
$this->campos['id_cidade'] = GtkComboBox::new_text();
$this->campos['id_cidade']->set_size_request(240, -1);
$this->campos['id_cidade']->insert_text(0, 'Porto Alegre');
$this->campos['id_cidade']->insert_text(1, 'São Paulo');
$this->campos['id_cidade']->insert_text(2, 'Rio de Janeiro');
$this->campos['id_cidade']->insert_text(3, 'Belo Horizonte');
foreach ($this->campos as $chave => $objeto) {
$hbox = new GtkHBox();
$hbox->pack_start($this->labels[$chave], false, false);
$hbox->pack_start($this->campos[$chave], false, false);
$this->labels[$chave]->set_size_request(100, -1);
$this->labels[$chave]->set_alignment(1, 0.5);
// xAlign, yalign (0.5, 1)
$vbox->pack_start($hbox, false, false);
}
$vbox->pack_start(new GtkHSeparator(), true, true);
// cria uma caixa de botões
$buttonbox = new GtkHButtonBox();
$buttonbox->set_layout(Gtk::BUTTONBOX_START);
// cria um botão de salvar
$botao = GtkButton::new_from_stock(Gtk::STOCK_SAVE);
// conecta o botão ao método onSaveClick()
$botao->connect_simple('clicked', array($this, 'onSaveClick'));
$buttonbox->pack_start($botao, false, false);
// cria um botão de fechar a aplicação
$botao = GtkButton::new_from_stock(Gtk::STOCK_CLOSE);
$botao->connect_simple('clicked', array('Gtk', 'main_quit'));
$buttonbox->pack_start($botao, false, false);
$vbox->pack_start($buttonbox, false, false);
parent::add($vbox);
// exibe a janela
parent::show_all();
}
示例10: __construct
/**
* Class Constructor
* @param $name Name of the widget
*/
public function __construct($name)
{
parent::__construct($name);
$this->widget = new GtkHBox();
parent::add($this->widget);
$this->mask = 'yyyy-mm-dd';
// creates the entry field
$this->entry = new TEntry($name);
$this->entry->setSize(200);
$this->setMask($this->mask);
$this->widget->add($this->entry);
// creates a button with a calendar image
$button = new GtkButton();
$button->set_relief(GTK::RELIEF_NONE);
$imagem = GtkImage::new_from_file('lib/adianti/images/tdate-gtk.png');
$button->set_image($imagem);
$this->actionButton = $button;
// define the button's callback
$button->connect_simple('clicked', array($this, 'onCalendar'));
$this->widget->add($button);
// creates the calendar window
$this->popWindow = new GtkWindow(Gtk::WINDOW_POPUP);
// creates the calendar
$this->calendar = new GtkCalendar();
// define the action when the user selects a date
$this->calendar->connect_simple('day-selected-double-click', array($this, 'onSelectDate'));
$this->month = new TCombo('tdate-month');
$this->month->addItems(array(TAdiantiCoreTranslator::translate('January'), TAdiantiCoreTranslator::translate('February'), TAdiantiCoreTranslator::translate('March'), TAdiantiCoreTranslator::translate('April'), TAdiantiCoreTranslator::translate('May'), TAdiantiCoreTranslator::translate('June'), TAdiantiCoreTranslator::translate('July'), TAdiantiCoreTranslator::translate('August'), TAdiantiCoreTranslator::translate('September'), TAdiantiCoreTranslator::translate('October'), TAdiantiCoreTranslator::translate('November'), TAdiantiCoreTranslator::translate('December')));
$this->month->setCallback(array($this, 'onChangeMonth'));
$this->month->setSize(70);
for ($n = date('Y') - 10; $n <= date('Y') + 10; $n++) {
$years[$n] = $n;
}
$this->year = new TCombo('tdate-year');
$this->year->addItems($years);
$this->year->setCallback(array($this, 'onChangeMonth'));
$this->year->setSize(70);
$hbox = new GtkHBox();
$hbox->pack_start($this->month);
$hbox->pack_start($this->year);
$bt_today = new GtkButton(TAdiantiCoreTranslator::translate('Today'));
$bt_close = new GtkButton(TAdiantiCoreTranslator::translate('Close'));
$bt_today->connect_simple('clicked', array($this, 'selectToday'));
$inst = $this->popWindow;
$bt_close->connect_simple('clicked', array($inst, 'hide'));
$hbox2 = new GtkHBox();
$hbox2->pack_start($bt_today);
$hbox2->pack_start($bt_close);
$vbox = new GtkVBox();
$vbox->pack_start($hbox, FALSE, FALSE);
$vbox->pack_start($this->calendar);
$vbox->pack_start($hbox2, FALSE, FALSE);
// shows the window
$this->popWindow->add($vbox);
}
示例11: init
public function init(GtkFrame $userList, GtkFrame $userForm, GtkFrame $rolePanel)
{
$mainVBox = new GtkVBox(false, 10);
$mainHBox = new GtkHBox(true, 10);
$mainVBox->pack_start($userList, true, true, 0);
$mainHBox->pack_start($userForm, true, true, 0);
$mainHBox->pack_start($rolePanel, true, true, 0);
$mainVBox->pack_start($mainHBox, false, false, 0);
$this->window->add($mainVBox);
$this->window->show_all();
Gtk::main();
}
示例12: GtkHBox
function __construct($Parent, $operacao = 'i', $CodPerfil = null)
{
parent::__construct($operacao == 'i' ? 'Perfis - Incluir' : 'Perfis - Alterar', 800, 600, 'perfis.png');
$this->Parent = $Parent;
$this->operacao = $operacao;
$this->CodPerfil = $CodPerfil;
$GLOBALS['XMONEY_FIELD'] = 'Cod_S_Perfil';
$GLOBALS['XMONEY_FIELD_ID'] = $CodPerfil ? $CodPerfil : -1;
// Id
$this->pack_start($hbox = new GtkHBox(), false);
if ($operacao == 'a') {
$hbox->pack_start($id = new GtkLabel(), false);
$id->set_markup(' Id.: <b>' . $CodPerfil . '</b>');
}
// nome
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start(new GtkLabel(' Nome: '), false);
$hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Perfis', 'Nome'));
// descricao
$hbox->pack_start(new GtkLabel(latin1(' Descrição: ')), false);
$hbox->pack_start($this->descricao = new AEntry(true, true, 'Tb_Perfis', 'Descricao'));
// Expandir e Sel. Todos
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start($this->expandir = new GtkCheckButton('Expandir'), false);
$this->expandir->connect('toggled', array($this, 'expandir_toggled'));
$hbox->pack_start($check = new GtkCheckButton('Sel. Todos'), false);
$check->connect('toggled', array($this, 'sel_todos_toggled'));
// progresso
$hbox->pack_start($this->progresso = new GtkProgressBar());
// Permissoes
$this->pack_start($frame = new GtkFrame(latin1(' Permissões ')));
$frame->set_border_width(5);
$frame->add($scroll_wnd = new GtkScrolledWindow());
$scroll_wnd->set_border_width(5);
$scroll_wnd->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
$scroll_wnd->add_with_viewport($this->lista = new GtkVBox());
// ok
$this->pack_start($hbbox = new GtkHButtonBox(), false);
$hbbox->set_layout(Gtk::BUTTONBOX_END);
$hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-ok'), false);
$this->ok->connect('clicked', array($this, 'ok_clicked'));
// cancelar
$hbbox->pack_start($this->cancelar = GtkButton::new_from_stock('gtk-cancel'), false);
$this->cancelar->connect('clicked', array($this, 'cancelar_clicked'));
$this->cancelar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
$this->children_show_all();
$this->nome->set_focus();
}
示例13: show
/**
* Show the table and all aggregated rows
*/
public function show()
{
if ($this->showed === FALSE) {
$i = 0;
if ($this->rows) {
foreach ($this->rows as $row) {
$c = 0;
if ($row->getCells()) {
foreach ($row->getCells() as $column) {
$properties = $column->getProperties();
$properties['colspan'] = isset($properties['colspan']) ? $properties['colspan'] - 1 : 0;
$hbox = new GtkHBox();
if (isset($properties['width'])) {
$hbox->set_size_request($properties['width'], -1);
}
$hbox->set_border_width(1);
$hbox->pack_start($column->getContent(), false, false);
$column->getContent()->show();
//$hbox->pack_start(new GtkHBox, true, true);
parent::attach($hbox, $c, $c + 1 + $properties['colspan'], $i, $i + 1, GTK::FILL, 0, 0, 0);
$c++;
}
}
$i++;
}
}
$this->showed = TRUE;
}
parent::show();
}
示例14: GtkHBox
function __construct($Parent, $CodConta)
{
parent::__construct(latin1('Movimentação da Conta'), 600, 300, 'contas_receber.png');
$this->Parent = $Parent;
$this->CodConta = $CodConta;
// CodConta, TipoDoc e NumDoc
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start($this->cod_conta = new GtkLabel());
$hbox->pack_start($this->tipo_doc = new GtkLabel());
$hbox->pack_start($this->num_doc = new GtkLabel());
$this->pack_start($vbox = new GtkVBox());
$vbox->pack_start($this->grid = new TGridInfoMovContaReceber($this));
$vbox->pack_start($this->fechar = GtkButton::new_from_stock('gtk-close'), false);
$this->fechar->add_accelerator('clicked', $this->accel_group, Gdk::KEY_Escape, 0, 0);
$this->fechar->connect('clicked', array($this, 'fechar_clicked'));
$this->children_show_all();
}
示例15: __construct
public function __construct()
{
$this->frame = new GtkFrame();
$frameBox = new GtkVBox(false, 10);
$frameBox->set_border_width(10);
$titleBox = new GtkHBox(false, 10);
$titleLabel = new GtkLabel("User Profile");
$titleLabel->set_markup("<span weight='bold'>User Profile</span>");
$titleLabel->set_alignment(0, 0.5);
$this->statusLabel = new GtkLabel("");
$this->statusLabel->set_alignment(1, 0.5);
$titleBox->pack_start($titleLabel, true, true, 0);
$titleBox->pack_end($this->statusLabel, true, true, 0);
$frameBox->pack_start($titleBox, false, false, 0);
$this->frame->add($frameBox);
$this->userFormTable = new GtkTable(3, 7);
list($labelFname, $this->entryFname) = $this->createLabelText('First Name', true);
list($labelLname, $this->entryLname) = $this->createLabelText('Last Name', true);
list($labelEmail, $this->entryEmail) = $this->createLabelText('Email', true);
list($labelUsername, $this->entryUsername) = $this->createLabelText('Username', true);
list($labelPassword, $this->entryPassword) = $this->createLabelText('Password', false);
list($labelConfirm, $this->entryConfirm) = $this->createLabelText('Confirm Password', false);
$this->deptComboStore = new GtkRefListStore(Gobject::TYPE_STRING);
$this->deptComboStore->refInsert(DeptEnum::getList());
$this->comboDept = new GtkRefComboBox($this->deptComboStore);
$cellDept = new GtkCellRendererText();
$cellDept->set_property('ellipsize', Pango::ELLIPSIZE_END);
$this->comboDept->pack_start($cellDept);
$this->comboDept->set_attributes($cellDept, 'text', 0);
$labelDept = new GtkLabel('Department');
$labelDept->set_alignment(1, 0.5);
$this->attachLabelText($labelFname, $this->entryFname, false, 0);
$this->attachLabelText($labelLname, $this->entryLname, false, 1);
$this->attachLabelText($labelEmail, $this->entryEmail, false, 2);
$this->attachLabelText($labelUsername, $this->entryUsername, true, 3);
$this->attachLabelText($labelPassword, $this->entryPassword, true, 4);
$this->attachLabelText($labelConfirm, $this->entryConfirm, true, 5);
$this->attachLabelText($labelDept, $this->comboDept, true, 6);
$this->entryUsername->connect('key-release-event', array($this, 'enableSubmit'));
$this->entryPassword->connect('key-release-event', array($this, 'enableSubmit'));
$this->entryConfirm->connect('key-release-event', array($this, 'enableSubmit'));
$this->comboDept->connect('changed', array($this, 'enableSubmit'));
$subFrame = new GtkFrame();
$subFrameBox = new GtkVBox(false, 0);
$subFrameBox->set_border_width(12);
$subFrame->add($subFrameBox);
$subFrameBox->pack_start($this->userFormTable, false, false, 0);
$frameBox->pack_start($subFrame, false, false, 0);
$buttonBox = new GtkHBox(false, 8);
$this->submitButton = new GtkButton($this->mode == self::MODE_ADD ? 'Add User' : 'Update Profile');
$this->submitButton->connect('clicked', array($this, 'submit'));
$this->cancelButton = new GtkButton("Cancel");
$buttonBox->pack_end($this->cancelButton, false, false, 0);
$buttonBox->pack_end($this->submitButton, false, false, 0);
$frameBox->pack_end($buttonBox, true, true, 0);
$this->enableForm(false);
}