/** * @name __construct() * @return Demo */ public function __construct() { // Cria a janela $this->widgets['frmDemo'] = new GtkWindow(); $this->widgets['frmDemo']->set_size_request(400, 400); $this->widgets['frmDemo']->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $this->widgets['frmDemo']->connect("destroy", array($this, "frmDemo_unload")); $fix = new GtkFixed(); // Cria o objeto webcam $this->widgets['webcam'] = Fabula::GtkWebCam(); $this->widgets['webcam']->set_size(320, 240); $this->widgets['webcam']->set_quality(65); $this->widgets['webcam']->set_device("/dev/video0"); // Inicia a captura $this->widgets['btnStartStop'] = new GtkButton("Iniciar"); $this->widgets['btnStartStop']->connect_simple("clicked", array($this, "btnStartStop_onclick")); $fix->put($this->widgets['btnStartStop'], 8, 265); // Salva a imagem $this->widgets['btnSave'] = new GtkButton("Salvar"); $this->widgets['btnSave']->connect_simple("clicked", array($this, "btnSave_onclick")); $fix->put($this->widgets['btnSave'], 8, 300); // Adiciona o frame da webcam $frame = new GtkFrame(); $frame->add($this->widgets['webcam']); $frame->set_size_request(331, 251); $fix->put($frame, 8, 8); // Inicia a aplicação $this->widgets['frmDemo']->add($fix); $this->frmDemo_onload(); }
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(); }
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); }
function display_table($table, $a) { for ($row = 0; $row < count($a); ++$row) { for ($col = 0; $col < count($a[$row]); ++$col) { $frame = new GtkFrame(); // note1 $frame->add(new GtkLabel($a[$row][$col])); // note 2 $table->attach($frame, $col, $col + 1, $row, $row + 1); // note3 } } }
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(); }
/** * Handle paths from a XML file * @param $xml_file path for the file */ public function __construct() { parent::__construct(); parent::set_border_width(4); $this->container = new GtkHBox(); $this->container->set_border_width(4); parent::add($this->container); }
/** * Show the page and its child */ public function show() { $child = parent::get_child(); if ($child) { $child->show(); } parent::show_all(); }
/** * Show the Frame */ public function show() { if (parent::get_child()) { // show child object parent::get_child()->show(); } parent::show_all(); }
/** * Show the page and its child */ public function show() { if (!$this->constructed) { throw new Exception(TAdiantiCoreTranslator::translate('You must call ^1 constructor', __CLASS__)); } $child = parent::get_child(); if ($child) { $child->show(); } parent::show_all(); }
function create_framedbox($horizontal, $title, $spacing, $layout) { $frame = new GtkFrame($title); if ($horizontal) { $box = new GtkHButtonBox(); } else { $box = new GtkVButtonBox(); } $box->set_border_width(5); $box->set_layout($layout); $box->set_spacing($spacing); $frame->add($box); $button = GtkButton::new_from_stock(Gtk::STOCK_OK); $box->add($button); $button = GtkButton::new_from_stock(Gtk::STOCK_CANCEL); $box->add($button); $button = GtkButton::new_from_stock(Gtk::STOCK_HELP); $box->add($button); return $frame; }
function __create_box() { $vbox = new GtkVBox(false, 5); $vbox->set_border_width(8); //Create the color swatch area $frame = new GtkFrame(); $frame->set_shadow_type(Gtk::SHADOW_IN); $vbox->pack_start($frame, true, true, 8); $this->d_area = new GtkDrawingArea(); $this->d_area->set_size_request(200, 200); // $this->d_area->modify_bg(Gtk::STATE_NORMAL, $this->color); $frame->add($this->d_area); $alignment = new GtkAlignment(1.0, 0.5, 0.0, 0.0); $button = new GtkButton('_Change the above color'); $alignment->add($button); $vbox->pack_start($alignment, true, true); $button->connect('clicked', array($this, 'on_change_color_clicked')); $button->set_flags(Gtk::CAN_DEFAULT); return $vbox; }
function __construct() { parent::__construct(); parent::set_title('Adianti Framework :: Library'); $this->content = new GtkFixed(); $vbox = new GtkVBox(); $vbox->pack_start(GtkImage::new_from_file('app/images/pageheader-gtk.png'), false, false); $hbox = new GtkHBox(); $vbox->pack_start($hbox, true, true); $frame = new GtkFrame(); $frame->add($this->content); $this->scroll = new GtkScrolledWindow(); $this->scroll->set_policy(GTK::POLICY_AUTOMATIC, GTK::POLICY_ALWAYS); $this->scroll->set_size_request(200, -1); $hbox->pack_start($this->scroll, false, false); $hbox->pack_start($frame, true, true); parent::add($vbox); parent::show_all(); $this->run('LoginForm'); }
function __create_box() { $mvbox = new GtkVBox(false); $frame = new GtkFrame('Dialogs'); $vbox = new GtkVBox(false, 8); $vbox->set_border_width(8); $frame->add($vbox); # Standard message dialog $hbox = new GtkHBox(false, 8); $vbox->pack_start($hbox); $button = new GtkButton('_Message Dialog'); $button->connect('clicked', array($this, 'on_message_dialog_clicked')); $hbox->pack_start($button, false, false, 0); $vbox->pack_start(new GtkHSeparator(), false, false, 0); # Interactive dialog $hbox = new GtkHBox(false, 8); $vbox->pack_start($hbox, false, false, 0); $vbox2 = new GtkVBox(); $button = new GtkButton('_Interactive Dialog'); $button->connect('clicked', array($this, 'on_interactive_dialog_clicked')); $hbox->pack_start($vbox2, false, false, 0); $vbox2->pack_start($button, false, false, 0); $table = new GtkTable(2, 2); $table->set_row_spacings(4); $table->set_col_spacings(4); $hbox->pack_start($table, false, false, 0); $label = new GtkLabel('Entry _1'); $label->set_use_underline(true); $table->attach($label, 0, 1, 0, 1); $this->entry1 = new GtkEntry(); $table->attach($this->entry1, 1, 2, 0, 1); $label->set_mnemonic_widget($this->entry1); $label = new GtkLabel('Entry _2'); $label->set_use_underline(true); $table->attach($label, 0, 1, 1, 2); $this->entry2 = new GtkEntry(); $table->attach($this->entry2, 1, 2, 1, 2); $label->set_mnemonic_widget($this->entry2); return $frame; }
function __construct() { parent::__construct(); $this->set_border_width(10); $this->set_title('X-Money - Login'); $this->set_icon_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'logo.png'); $this->vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'logo.png')); $hbox->pack_start($vbox = new GtkVBox()); $vbox->pack_start($frame = new GtkFrame(latin1(' Digite suas informações para acessar o sistema: '))); $frame->set_border_width(10); $frame->add($table = new GtkTable()); $table->attach(new GtkLabel('Usuario:'), 0, 1, 0, 1); $table->attach($this->username = new GtkEntry(), 1, 2, 0, 1); $table->attach(new GtkLabel('Senha:'), 0, 1, 1, 2); $table->attach($this->password = new GtkEntry(), 1, 2, 1, 2); $this->password->set_visibility(false); $this->ok = $this->add_button('_Ok', Gtk::RESPONSE_OK); $this->add_button('_Cancelar', Gtk::RESPONSE_CANCEL); EntrySetNextFocus($this->username, $this->password); EntrySetNextFocus($this->password, $this->ok); $this->vbox->show_all(); }
<?php $window = new GtkWindow(); $window->set_size_request(400, 300); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $vbox2 = new GtkVBox(); // note 1 $vbox2->pack_start(new GtkLabel("This frame of size 200x200")); $vbox2->pack_start(new GtkLabel("will always stay stay centered")); $vbox2->pack_start(new GtkLabel("no matter how you resize the app")); $eventbox = new GtkEventBox(); // note 2 $eventbox->add($vbox2); $eventbox->modify_bg(Gtk::STATE_NORMAL, GdkColor::parse("#CCFF99")); $frame_200_200 = new GtkFrame(); // note 3 $frame_200_200->set_size_request(200, 200); $frame_200_200->add($eventbox); $hbox = new GtkHBox(); // note 4 $hbox->pack_start(new GtkHBox()); $hbox->pack_start($frame_200_200, 0); $hbox->pack_start(new GtkHBox()); $vbox = new GtkVBox(); // note 5 $vbox->pack_start(new GtkHBox()); $vbox->pack_start($hbox, 0); $vbox->pack_start(new GtkHBox()); $window->add($vbox); // note 6 $window->show_all();
function __construct($Parent, $InfoLinha) { parent::__construct('Contas a Receber - Baixar', 800, 480, 'contas_receber.png'); $this->Parent = $Parent; $this->InfoLinha = $InfoLinha; // info $this->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(GtkImage::new_from_stock(Gtk::STOCK_GO_DOWN, Gtk::ICON_SIZE_DIALOG), false); $hbox->pack_start($label = new GtkLabel(), false); $label->set_markup('<b> Todos os totais devem estar preenchidos! </b>'); $hbox->pack_start($frame = new GtkFrame(latin1(' Informações '))); $frame->add($vbox = new GtkVBox()); $vbox->set_border_width(5); // banco $vbox->pack_start($this->banco = new TBancos($this)); // tipo de despesa $vbox->pack_start($this->despesa = new TTipoDespesa($this)); // forma pgto $vbox->pack_start($this->forma_pgto = new TFormaPgto($this)); // Contas $this->pack_start($frame = new GtkFrame(' Contas a Receber ')); $frame->add($scroll = new GtkScrolledWindow()); $scroll->set_border_width(5); $scroll->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); $scroll->add_with_viewport($vbox = new GtkVBox()); $vbox->pack_start($this->lista = new GtkTable(count($InfoLinha) + 1, 8, false), false); $this->lista->attach($label = new GtkLabel(), 0, 1, 0, 1); $label->set_markup('<b>Id</b>'); $this->lista->attach($label = new GtkLabel(), 1, 2, 0, 1); $label->set_markup('<b>Fornecedor</b>'); $this->lista->attach($label = new GtkLabel(), 2, 3, 0, 1); $label->set_markup('<b>Num. do Doc.</b>'); $this->lista->attach($label = new GtkLabel(), 3, 4, 0, 1); $label->set_markup('<b>Valor em R$</b>'); $this->lista->attach($label = new GtkLabel(), 4, 5, 0, 1); $label->set_markup('<b>Juros em R$</b>'); $this->lista->attach($label = new GtkLabel(), 5, 6, 0, 1); $label->set_markup('<b>Desconto em R$</b>'); $this->lista->attach($label = new GtkLabel(), 6, 7, 0, 1); $label->set_markup('<b>Total em R$</b>'); $this->lista->attach($label = new GtkLabel(), 7, 8, 0, 1); $label->set_markup('<b>' . latin1('Anotações') . '</b>'); $vbox->pack_start(new GtkEventBox()); // Valores R$ $this->pack_start($frame = new GtkFrame(' Valores em R$ '), false); $frame->add($vbox = new GtkVBox()); // Valor das Contas $vbox->pack_start($this->lbl_valor_contas = new GtkLabel()); // Valor dos Juros $vbox->pack_start($this->lbl_valor_juros = new GtkLabel()); // Valor das Descontos $vbox->pack_start($this->lbl_valor_descontos = new GtkLabel()); // 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(); }
function __construct($Parent, $operacao = 'i', $CodFilial = null) { parent::__construct($operacao == 'i' ? 'Filial - Incluir' : 'Filial - Alterar', null, null, 'filiais.png'); $this->Parent = $Parent; $this->operacao = $operacao; $this->CodFilial = $CodFilial; $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Filial'; $GLOBALS['XMONEY_FIELD_ID'] = $CodFilial ? $CodFilial : -1; // Id $this->pack_start($hbox = new GtkHBox()); if ($operacao == 'a') { $hbox->pack_start($id = new GtkLabel(), false); $id->set_markup(' Id.: <b>' . $CodFilial . '</b>'); } // nome $this->pack_start($frame = new GtkFrame(latin1(' Informações ')), false); $frame->add($vbox = new GtkVBox()); $vbox->set_border_width(5); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' Nome: '), false); $hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Filiais', 'Nome')); // cnpj $hbox->pack_start(new GtkLabel(' CNPJ: '), false); $hbox->pack_start($this->cnpj = new IEntry(true, true, 'Tb_Filiais', 'CNPJ')); $this->cnpj->entry->set_max_length(14); // razao $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(latin1(' Razão: ')), false); $hbox->pack_start($this->razao = new AEntry(true, true, 'Tb_Filiais', 'Razao')); // endereço $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(latin1(' Endereço: ')), 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 IEntry(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)); // telefone $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' Telefone: '), false); $hbox->pack_start($this->tel = new IEntry(true)); // fax $hbox->pack_start(new GtkLabel(' Fax: '), false); $hbox->pack_start($this->fax = new IEntry()); // Email $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' e-mail: '), false); $hbox->pack_start($this->email = new AEntry(true)); // url $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' Site: '), false); $hbox->pack_start($this->url = new AEntry()); // dominio $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(latin1(' Domíio: ')), false); $hbox->pack_start($this->dominio = new AEntry()); // 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->dominio->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->dominio->set_next_focus($this->ok); $this->nome->grab_focus(); }
function __construct($Parent, $operacao = 'i', $CodFor = null) { parent::__construct($operacao == 'i' ? 'Fornecedor - Incluir' : 'Fornecedor - Alterar', null, null, 'fornecedores.png'); $this->Parent = $Parent; $this->Owner = $Parent->Owner; $this->operacao = $operacao; $this->CodFor = $CodFor; $GLOBALS['XMONEY_FIELD'] = 'Cod_S_For'; $GLOBALS['XMONEY_FIELD_ID'] = $CodFor ? $CodFor : -1; // Id $this->pack_start($hbox = new GtkHBox()); if ($operacao == 'a') { $hbox->pack_start($id = new GtkLabel(), false); $id->set_markup(' Id.: <b>' . $CodFor . '</b>'); } // Pessoa Fisica/Juridica $hbox->pack_start($this->pessoa = new TTipoPessoa($this), false); $this->pessoa->combobox->connect('changed', array($this, 'tipo_pessoa_changed')); // nome / razao social $this->pack_start($frame = new GtkFrame()); $frame->add($vbox = new GtkVBox()); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->lbl_nome = new GtkLabel(' Nome: '), false); $hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Fornecedores', 'Nome')); // CPF / CNPJ $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->lbl_cpf = new GtkLabel(' CPF: '), false); $hbox->pack_start($this->cpf = new AEntry(true, true, 'Tb_Fornecedores', 'CPF')); // Dados para Pessoa Juridica $vbox->pack_start($this->expander = new GtkExpander(' Juridico '), false); $this->expander->set_sensitive(false); $this->expander->add($vbox = new GtkVBox()); // fantasia $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' Fantasia: '), false); $hbox->pack_start($this->fantasia = new AEntry()); // I.E. $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' I.E.: '), false); $hbox->pack_start($this->ie = new AEntry()); // Suframa $hbox->pack_start(new GtkLabel(' Suframa: '), false); $hbox->pack_start($this->suframa = new IEntry()); /* Fones */ $this->pack_start($frame = new GtkFrame()); $frame->add($vbox = new GtkVBox()); $vbox->set_border_width(5); // fone 1 $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Fone: '), false); $hbox->pack_start($this->fone = new AEntry()); // fone 2 $hbox->pack_start(new GtkLabel(' Fone 2: '), false); $hbox->pack_start($this->fone2 = new AEntry()); // fax 1 $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Fax: '), false); $hbox->pack_start($this->fax = new AEntry()); // fax 2 $hbox->pack_start(new GtkLabel(' Fax 2: '), false); $hbox->pack_start($this->fax2 = new AEntry()); // email $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' e-mail: '), false); $hbox->pack_start($this->email = new AEntry()); // site $hbox->pack_start(new GtkLabel(' Site: '), false); $hbox->pack_start($this->site = new AEntry()); // anotacoes $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(latin1(' Anotações: ')), false); $hbox->pack_start($this->anotacoes = new AEntry()); // limite compra $this->pack_start($frame = new GtkFrame()); $frame->add($vbox = new GtkVBox()); $vbox->pack_start($hbox = new GtkHBox()); $vbox->set_border_width(5); $hbox->pack_start($this->limite_compra = new TFloat(), false); $this->limite_compra->label->set_text(' Limite de Compra: '); // Ativo $hbox->pack_start($this->ativo = new GtkCheckButton(' Ativo ')); // ok + cancelar $this->pack_start($hbbox = new GtkHButtonBox(), false); $hbbox->set_layout(Gtk::BUTTONBOX_END); $hbbox->pack_start($this->ok = GtkButton::new_from_stock('gtk-apply'), 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); // extra $this->limite_compra->set_next_focus($this->ok); $this->children_show_all(); $this->nome->set_focus(); }
/** * Shows the form at the screen */ public function show() { /* Não é possível, pois pode ter uma IF (Designer) somente com datagrid if (count($this->fields) == 0) { throw new Exception(TAdiantiCoreTranslator::translate('Use the addField() or setFields() to define the form fields')); } */ $child = parent::get_child(); if ($child) { $child->show(); } parent::show_all(); }
/** * Show the PageNavigation widget */ public function show() { parent::show(); $this->refresh(); }
function __construct($Parent, $operacao = 'i', $CodProduto = null) { parent::__construct($operacao == 'i' ? 'Produto - Incluir' : 'Produto - Alterar', null, null, 'produtos.png'); $this->Parent = $Parent; $this->operacao = $operacao; $this->CodProduto = $CodProduto; $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Produto'; $GLOBALS['XMONEY_FIELD_ID'] = $CodProduto ? $CodProduto : -1; // Id $this->pack_start($hbox = new GtkHBox()); if ($operacao == 'a') { $hbox->pack_start($id = new GtkLabel(), false); $id->set_markup(' Id.: <b>' . $CodProduto . '</b>'); } // Sit. Produto $hbox->pack_start($this->situacao = new TSitProduto($this)); // Tipo Produto $hbox->pack_start($this->tipo = new TTipoProduto($this)); // Ativo $hbox->pack_start($this->ativo = new GtkCheckButton(' Ativo ')); $this->ativo->set_active(true); // Grupo $this->pack_start($frame = new GtkFrame(), false); $frame->add($vbox = new GtkVBox()); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->grupos = new TGrupos($this)); // Marca $hbox->pack_start($this->marcas = new TMarcas($this)); // Modelo $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start(new GtkLabel(' Modelo: '), false); $hbox->pack_start($this->modelo = new AEntry(true, true, 'Tb_Produtos', 'Modelo')); // Descricao $hbox->pack_start(new GtkLabel(latin1(' Descrição: ')), false); $hbox->pack_start($this->descricao = new AEntry(true, true, 'Tb_Produtos', 'Descricao')); // Preco custo $this->pack_start($frame = new GtkFrame(), false); $frame->add($vbox = new GtkVBox()); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->custo = new TFloat(true)); $this->custo->label->set_text(latin1(' Preço Custo: ')); // Margem $hbox->pack_start($this->margem = new TFloat(true)); $this->margem->label->set_text(' Margem: '); // Percentual $hbox->pack_start($this->percentual = new TFloat(true)); $this->percentual->label->set_text(' Percentual: '); // ICMS $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->icms = new TInteger(true)); $this->icms->label->set_text(' ICMS: '); // IPI $hbox->pack_start($this->ipi = new TInteger(true)); $this->ipi->label->set_text(' IPI: '); // Clas. Fiscal $hbox->pack_start($this->clas_fiscal = new TInteger(true)); $this->clas_fiscal->label->set_text(' Clas. Fiscal: '); // Qtd Minima $this->pack_start($frame = new GtkFrame(), false); $frame->add($vbox = new GtkVBox()); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->qtde_minima = new TInteger(true), false); $this->qtde_minima->label->set_text(latin1(' Qtde Mínima: ')); // Cota de Compra $hbox->pack_start($this->cota_compra = new TInteger(true), false); $this->cota_compra->label->set_text(' Cota de Compra: '); // Cota de Venda $hbox->pack_start($this->cota_venda = new TInteger(true), false); $this->cota_venda->label->set_text(' Cota de Venda: '); // Unid. de Compra $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->unid_compra = new TUnidCompra($this), false); // Unid. de Venda $hbox->pack_start($this->unid_venda = new TUnidVenda($this), false); // Unid. de Estoque $hbox->pack_start($this->unid_estoque = new TUnidEstoque($this), false); // 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->conta->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->cota_venda->set_next_focus($this->ok); $this->grupos->entry->grab_focus(); }
function __construct($Parent, $operacao = 'i', $CodUsuario = null) { parent::__construct($operacao == 'i' ? latin1('Usuário - Incluir') : latin1('Usuário - Alterar'), null, null, 'usuarios.png'); $this->Parent = $Parent; $this->operacao = $operacao; $this->CodUsuario = $CodUsuario; $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Usuario'; $GLOBALS['XMONEY_FIELD_ID'] = $CodUsuario ? $CodUsuario : -1; // Id $this->pack_start($hbox = new GtkHBox()); if ($operacao == 'a') { $hbox->pack_start($id = new GtkLabel(), false); $id->set_markup(' Id.: <b>' . $CodUsuario . '</b>'); } // Informacoes $this->pack_start($frame = new GtkFrame(latin1(' Informações '))); $frame->set_border_width(5); $frame->add($vbox = new GtkVBox()); $vbox->set_border_width(5); // filial $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->filial = new TFiliais($this)); // perfil $hbox->pack_start($this->perfil = new TPerfis($this)); // usuario $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(latin1(' Usuário: ')), false); $hbox->pack_start($this->usuario = new AEntry(true, true, 'Tb_Usuarios', 'Usuario')); // ativo $hbox->pack_start($this->ativo = new GtkCheckButton(' Ativo '), false); $this->ativo->set_active(1); // senha $hbox->pack_start(new GtkLabel(' Senha: '), false); $hbox->pack_start($this->senha = new AEntry()); $this->senha->entry->set_visibility(false); // alterar senha $hbox->pack_start($this->alterar_senha = new GtkCheckButton(' Alterar '), false); // nome $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Nome: '), false); $hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Usuarios', 'Nome')); // endereço $hbox->pack_start(new GtkLabel(latin1(' Endereço: ')), false); $hbox->pack_start($this->endereco = new AEntry(true)); // bairro $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Bairro: '), false); $hbox->pack_start($this->bairro = new AEntry(true)); // cep $hbox->pack_start(new GtkLabel(' CEP: '), false); $hbox->pack_start($this->cep = new IEntry(true)); // cidade $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Cidade: '), false); $hbox->pack_start($this->cidade = new AEntry(true)); // estado $hbox->pack_start($this->estado = new TEstados($this)); // cpf $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' CPF: '), false); $hbox->pack_start($this->cpf = new IEntry(true, true, 'Tb_Usuarios', 'CPF')); // rg $hbox->pack_start(new GtkLabel(' RG: '), false); $hbox->pack_start($this->rg = new IEntry(true, true, 'Tb_Usuarios', 'RG')); // nascimento $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->data_nasc = new TData(true)); $this->data_nasc->label->set_text(' Nascimento: '); // sexo $hbox->pack_start($this->sexo = new TSexos($this)); // estado civil $hbox->pack_start($this->est_civil = new TEstCivil($this)); // dependentes $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Dependentes: '), false); $hbox->pack_start($this->dependentes = new IEntry()); // filhos $hbox->pack_start(new GtkLabel(' Filhos: '), false); $hbox->pack_start($this->filhos = new IEntry()); // cracha $hbox->pack_start(new GtkLabel(' Cracha: '), false); $hbox->pack_start($this->cracha = new IEntry()); // depto $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->depto = new TDeptos($this)); // cargo $hbox->pack_start($this->cargo = new TCargos($this)); // Tel $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start(new GtkLabel(' Tel.: '), false); $hbox->pack_start($this->tel = new IEntry(true)); // Cel $hbox->pack_start(new GtkLabel(' Cel.: '), false); $hbox->pack_start($this->cel = new IEntry()); // email $hbox->pack_start(new GtkLabel(' e-mail: '), false); $hbox->pack_start($this->email = new AEntry()); // data adm. $vbox->pack_start($hbox = new GtkHBox(), false); $hbox->pack_start($this->data_adm = new TData()); $this->data_adm->label->set_text(latin1('Admissão')); // Data h**o. $hbox->pack_start($this->data_homo = new TData()); $this->data_homo->label->set_text(latin1('Homologação')); // Data resicao $hbox->pack_start($this->data_resc = new TData()); $this->data_resc->label->set_text(latin1('Rescisão')); // 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->data_resc->set_next_focus($this->ok); $this->usuario->set_focus(); }