Esempio n. 1
0
 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();
 }
 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();
 }
Esempio n. 3
0
 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();
 }
 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();
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
 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();
 }
 /**
  * Adiciona um botão no final do box
  * 
  * @name add_button_from_widget($button)
  * @param GtkButton $button Widget a ser adicionado ao final do box
  * @return GtkButton
  */
 public function add_button_from_widget($button)
 {
     // Adiciona o botão
     parent::add($button);
     // Retorna o botão
     return $button;
 }
Esempio n. 8
0
 function __construct($Parent, $operacao = 'i', $CodConta = null)
 {
     parent::__construct($operacao == 'i' ? 'Contas a Pagar - Incluir' : 'Contas a Pagar - Alterar', null, null, 'contas_pagar.png');
     $this->Parent = $Parent;
     $this->operacao = $operacao;
     $this->CodConta = $CodConta;
     // tipo doc.
     $this->pack_start($this->tipo_doc = new TTipoDoc($this));
     // filial
     $this->pack_start($this->filial = new TFiliais($this));
     // Fornecedor
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($this->fornecedores = new TFornecedores($this));
     // num doc
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($this->num_doc = new AEntry(true));
     $this->num_doc->label->set_text(' Num. Doc.: ');
     // parcela
     $hbox->pack_start($this->parcela = new IEntry(true));
     $this->parcela->label->set_text(' Parcela: ');
     // vencimento
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($this->vencimento = new TData(true));
     $this->vencimento->label->set_text(' Vencimento: ');
     // valor
     $hbox->pack_start($this->valor = new TFloat(true));
     $this->valor->label->set_text(' Valor: ');
     // anotacoes
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($this->anotacoes = new AEntry());
     $this->anotacoes->label->set_text(latin1(' Anotações '));
     // 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);
     // extra
     $this->children_show_all();
     $this->anotacoes->set_next_focus($this->ok);
     $this->fornecedores->entry->grab_focus();
 }
Esempio n. 9
0
 function __construct($Parent, $operacao = 'i', $CodBanco = null)
 {
     parent::__construct($operacao == 'i' ? 'Bancos - Incluir' : 'Bancos - Alterar', null, null, 'bancos.png');
     $this->Parent = $Parent;
     $this->operacao = $operacao;
     $this->CodBanco = $CodBanco;
     $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Banco';
     $GLOBALS['XMONEY_FIELD_ID'] = $CodBanco ? $CodBanco : -1;
     // Id
     $this->pack_start($hbox = new GtkHBox());
     if ($operacao == 'a') {
         $hbox->pack_start($id = new GtkLabel(), false);
         $id->set_markup(' Id.: <b>' . $CodBanco . '</b>');
     }
     // Filial
     $hbox->pack_start($this->filial = new TFiliais($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_Bancos', 'Nome'));
     // agencia
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(new GtkLabel(' Agencia: '), false);
     $hbox->pack_start($this->agencia = new AEntry(true, true, 'Tb_Bancos', 'Agencia'));
     // conta
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(new GtkLabel(' Conta: '), false);
     $hbox->pack_start($this->conta = new AEntry(true, true, 'Tb_Bancos', 'Conta'));
     // 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->conta->set_next_focus($this->ok);
     $this->children_show_all();
     $this->nome->set_focus();
 }
Esempio n. 10
0
 function __construct($Parent, $operacao = 'i', $CodSit = null)
 {
     parent::__construct($operacao == 'i' ? latin1('Situação de Produto - Incluir') : latin1('Situação de Produto - Alterar'), null, null, 'sit_produtos.png');
     $this->Parent = $Parent;
     $this->operacao = $operacao;
     $this->CodSit = $CodSit;
     $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Sit';
     $GLOBALS['XMONEY_FIELD_ID'] = $CodSit ? $CodSit : -1;
     // Id
     $this->pack_start($hbox = new GtkHBox());
     if ($operacao == 'a') {
         $hbox->pack_start($id = new GtkLabel(), false);
         $id->set_markup(' Id.: <b>' . $CodSit . '</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_Sit_Produtos', 'Nome'));
     // abreviacao
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(new GtkLabel(latin1(' Abreviação: ')), false);
     $hbox->pack_start($this->abreviacao = new AEntry(true, true, 'Tb_Sit_Produtos', 'Abreviacao'));
     // 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->abreviacao->set_next_focus($this->ok);
     $this->nome->set_focus();
 }
Esempio n. 11
0
 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();
 }
Esempio n. 12
0
//options attach to table
$tbl->attach($chkOptionHideFiles, 0, 1, 1, 2);
$tbl->attach($chkOptionHideFilenames, 0, 1, 2, 3);
$tbl->attach($chkOptionHideDirnames, 0, 1, 3, 4);
$tbl->attach($chkOptionHideDates, 0, 1, 4, 5);
$tbl->attach($chkOptionHideProgress, 0, 1, 5, 6);
$tbl->attach($chkOptionHideBloom, 1, 2, 1, 2);
$tbl->attach($chkOptionHideTree, 1, 2, 2, 3);
$tbl->attach($chkOptionHideUsers, 1, 2, 3, 4);
$tbl->attach($chkOptionHideUsernames, 1, 2, 4, 5);
$tbl->attach($chkOptionFullscreen, 2, 3, 1, 2);
$tbl->attach($chkOptionMultiSampling, 2, 3, 2, 3);
$tbl->attach($chkOptionTransparent, 2, 3, 3, 4);
$tbl->attach($chkOptionSaveConfig, 2, 3, 4, 5);
//Add the buttons to a button box
$bbox = new GtkHButtonBox();
$bbox->set_layout(Gtk::BUTTONBOX_EDGE);
$bbox->add($btnQuit);
$bbox->add($btnConfigFile);
$bbox->add($btnRun);
//Add the table and the button box to a vbox
$vbox = new GtkVBox();
$vbox->pack_start($tbl);
$vbox->pack_start($bbox);
//Add the vbox to the window
$wnd->add($vbox);
//resize window
$wnd->move(450, 350);
$wnd->resize(600, 300);
//Show all widgets
$wnd->show_all();
Esempio n. 13
0
 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();
 }
Esempio n. 14
0
 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();
 }
Esempio n. 15
0
 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();
 }
Esempio n. 16
0
function uprav_behy()
{
    global $G, $model, $view;
    #debug_log('úprava behov');
    $dialog = new GtkDialog();
    // note 1
    $viewport1 = new GtkViewPort();
    $dialog->set_title('Behy');
    $dialog->set_position(GTK::WIN_POS_CENTER);
    $dialog->set_default_size(960, 420);
    $model = new GtkListStore(Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING);
    #datum
    #nazov
    #druh (OA, OJ, A1, A2, A3, J1, J2, J3)
    #rozhodca
    #$rozhodcovia=explode(",",$G["config"]->__get("rozhodca"));
    $view = new GtkTreeView($model);
    #	$view->set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_BOTH);
    $column1 = new GtkTreeViewColumn('Kód');
    $column2 = new GtkTreeViewColumn('Názov');
    $column3 = new GtkTreeViewColumn('Filter');
    $column4 = new GtkTreeViewColumn('Dátum');
    $column5 = new GtkTreeViewColumn('Rozhodca');
    $column6 = new GtkTreeViewColumn('Dĺžka');
    $column7 = new GtkTreeViewColumn('Prekážky');
    $column8 = new GtkTreeViewColumn('Štd.č');
    $column9 = new GtkTreeViewColumn('Max.č');
    $view->append_column($column1);
    $view->append_column($column2);
    $view->append_column($column3);
    $view->append_column($column4);
    $view->append_column($column5);
    $view->append_column($column6);
    $view->append_column($column7);
    $view->append_column($column8);
    $view->append_column($column9);
    $cell_renderer1 = new GtkCellRendererText();
    $cell_renderer2 = new GtkCellRendererText();
    $cell_renderer3 = new GtkCellRendererText();
    $cell_renderer4 = new GtkCellRendererText();
    $cell_renderer5 = new GtkCellRendererText();
    $cell_renderer6 = new GtkCellRendererText();
    $cell_renderer7 = new GtkCellRendererText();
    $cell_renderer8 = new GtkCellRendererText();
    $cell_renderer9 = new GtkCellRendererText();
    $cell_renderer1->set_property('width', 60);
    $cell_renderer1->set_property('editable', true);
    $cell_renderer2->set_property('width', 220);
    $cell_renderer2->set_property('editable', true);
    $cell_renderer3->set_property('width', 50);
    $cell_renderer3->set_property('editable', true);
    $cell_renderer4->set_property('width', 80);
    $cell_renderer4->set_property('editable', true);
    $cell_renderer5->set_property('width', 180);
    $cell_renderer5->set_property('editable', true);
    $cell_renderer6->set_property('width', 50);
    $cell_renderer6->set_property('editable', true);
    $cell_renderer7->set_property('width', 50);
    $cell_renderer7->set_property('editable', true);
    $cell_renderer8->set_property('width', 50);
    $cell_renderer8->set_property('editable', true);
    $cell_renderer9->set_property('width', 50);
    $cell_renderer9->set_property('editable', true);
    $cell_renderer1->connect('edited', 'callback_start1');
    $cell_renderer2->connect('edited', 'callback_start2');
    $cell_renderer3->connect('edited', 'callback_start3');
    $cell_renderer4->connect('edited', 'callback_start4');
    $cell_renderer5->connect('edited', 'callback_start5');
    $cell_renderer6->connect('edited', 'callback_start6');
    $cell_renderer7->connect('edited', 'callback_start7');
    $cell_renderer8->connect('edited', 'callback_start8');
    $cell_renderer9->connect('edited', 'callback_start9');
    #$cell_renderer3->set_property('width', -1);
    $column1->pack_start($cell_renderer1, true);
    $column2->pack_start($cell_renderer2, true);
    $column3->pack_start($cell_renderer3, true);
    $column4->pack_start($cell_renderer4, true);
    $column5->pack_start($cell_renderer5, true);
    $column6->pack_start($cell_renderer6, true);
    $column7->pack_start($cell_renderer7, true);
    $column8->pack_start($cell_renderer8, true);
    $column9->pack_start($cell_renderer9, true);
    $column1->set_attributes($cell_renderer1, 'text', 0);
    $column2->set_attributes($cell_renderer2, 'text', 1);
    $column3->set_attributes($cell_renderer3, 'text', 2);
    $column4->set_attributes($cell_renderer4, 'text', 3);
    $column5->set_attributes($cell_renderer5, 'text', 4);
    $column6->set_attributes($cell_renderer6, 'text', 5);
    $column7->set_attributes($cell_renderer7, 'text', 6);
    $column8->set_attributes($cell_renderer8, 'text', 7);
    $column9->set_attributes($cell_renderer9, 'text', 8);
    #print_r($G["behy"]);exit;
    foreach ($G["behy"] as $b) {
        $model->append($b);
    }
    $toolbar = new GtkHButtonBox();
    $addbutton = GtkButton::new_from_stock(Gtk::STOCK_ADD);
    $deletebutton = GtkButton::new_from_stock(Gtk::STOCK_DELETE);
    #$loadbutton=GtkButton::new_from_stock(Gtk::STOCK_REFRESH);
    $savebutton = GtkButton::new_from_stock(Gtk::STOCK_SAVE);
    $savebutton->connect("pressed", "uloz_behy");
    $addbutton->connect("pressed", "pridaj_beh");
    $deletebutton->connect("pressed", "vymaz_beh");
    $toolbar->add($addbutton);
    $toolbar->add($deletebutton);
    #$toolbar->add($loadbutton);
    $toolbar->add($savebutton);
    $toolbar->set_size_request(0, 40);
    $sw = new GtkScrolledWindow();
    $sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    $sw->add($view);
    $sw->set_size_request(-1, 560);
    $vbox = new GtkVBox();
    $vbox->add($toolbar);
    $vbox->add($sw);
    $dialog->vbox->pack_start($vbox);
    // note 3
    $dialog->show_all();
    // note 4
    $dialog->run();
    // note 5
    $dialog->destroy();
    // note 6
}
Esempio n. 17
0
 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();
 }