Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
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();
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
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();
 }