Example #1
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();
 }
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkFrame();
     parent::add($this->widget);
     $this->container = new GtkVBox();
     $this->initialItems = array();
     $this->items = array();
     $targets = array(array('text/plain', 0, -1));
     $this->widget->connect('drag_data_received', array($this, 'onDataReceived'));
     $this->widget->drag_dest_set(Gtk::DEST_DEFAULT_ALL, $targets, Gdk::ACTION_COPY);
     $scroll = new GtkScrolledWindow();
     $scroll->set_border_width(4);
     $this->widget->add($scroll);
     $hbox = new GtkHBox();
     $scroll->add_with_viewport($hbox);
     $hbox->pack_start($this->container, TRUE, TRUE);
     $hbox->set_border_width(20);
     parent::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();
 }