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();
 }
Esempio n. 2
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, $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();
 }
 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();
 }
 /**
  * Shows the exception stack
  */
 function show()
 {
     $error_array = $this->e->getTrace();
     $table = new TTable();
     $row = $table->addRow();
     $message = $this->e->getMessage();
     $message = str_replace('<br>', "\n", $message);
     $title = new GtkLabel();
     $title->set_markup('<b>General Error: ' . $message . '</b>' . "\n");
     $row->addCell($title);
     var_dump($this->e->getTraceAsString());
     foreach ($error_array as $error) {
         $file = isset($error['file']) ? $error['file'] : '';
         $line = isset($error['line']) ? $error['line'] : '';
         $file = str_replace(PATH, '', $file);
         $row = $table->addRow();
         $row->addCell('File: ' . $file . ' : ' . $line);
         $row = $table->addRow();
         $args = array();
         if ($error['args']) {
             foreach ($error['args'] as $arg) {
                 if (is_object($arg)) {
                     $args[] = get_class($arg) . ' object';
                 } else {
                     if (is_array($arg)) {
                         $array_param = array();
                         foreach ($arg as $value) {
                             if (is_object($value)) {
                                 $array_param[] = get_class($value);
                             } else {
                                 if (is_array($value)) {
                                     $array_param[] = 'array';
                                 } else {
                                     $array_param[] = $value;
                                 }
                             }
                         }
                         $args[] = implode(',', $array_param);
                     } else {
                         $args[] = (string) $arg;
                     }
                 }
             }
         }
         $label = new GtkLabel();
         $row->addCell($label);
         $class = isset($error['class']) ? $error['class'] : '';
         $type = isset($error['type']) ? $error['type'] : '';
         $label->set_markup('  <i>' . '<span foreground="#78BD4C">' . $class . '</span>' . '<span foreground="#600097">' . $type . '</span>' . '<span foreground="#5258A3">' . $error['function'] . '</span>' . '(' . '<span foreground="#894444">' . implode(',', $args) . '</span>' . ')</i>');
     }
     $scroll = new TScroll();
     $scroll->setSize(690, 390);
     $scroll->add($table);
     $scroll->child->modify_bg(GTK::STATE_NORMAL, GdkColor::parse('#ffffff'));
     parent::add($scroll);
     parent::show();
 }
Esempio n. 6
0
function link($title, $url)
{
    $label = new GtkLabel($title);
    $label->set_markup('<span color="blue"><u>' . $title . "</u></span>");
    $eventbox = new GtkEventBox();
    $eventbox->add($label);
    $eventbox->connect('button-press-event', 'on_click', $title, $url);
    $eventbox->connect('enter-notify-event', 'on_enter', $title, $url);
    $eventbox->connect('leave-notify-event', 'on_leave', $title, $url);
    return $eventbox;
}
Esempio n. 7
0
 function __create_box()
 {
     $vbox = new GtkVBox(false, 5);
     $vbox->set_border_width(5);
     $label = new GtkLabel();
     $label->set_markup('Expander demo. Click on the triangle for details.');
     $vbox->pack_start($label, false, false, 0);
     $expander = new GtkExpander('Details');
     $vbox->pack_start($expander, false, false, 0);
     $label2 = new GtkLabel('Details can be shown or hidden');
     $expander->add($label2);
     return $vbox;
 }
 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 Roles");
     $titleLabel->set_markup("<span weight='bold'>User Roles</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->roleListStore = new GtkRefListStore(Gobject::TYPE_STRING);
     $this->roleListTree = new GtkRefTreeView($this->roleListStore);
     $this->roleListTree->set_headers_visible(false);
     $roleListSelection = $this->roleListTree->get_selection();
     $roleListSelection->set_mode(Gtk::SELECTION_SINGLE);
     $roleListSelection->connect('changed', array($this, 'selectRoleToRemove'));
     $rolesWindow = new GtkScrolledWindow();
     $rolesWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
     $rolesWindow->set_shadow_type(Gtk::SHADOW_ETCHED_IN);
     $rolesWindow->add($this->roleListTree);
     $frameBox->pack_start($rolesWindow, true, true, 0);
     $renderer = new GtkCellRendererText();
     $renderer->set_property("editable", false);
     $column = new GtkTreeViewColumn('Role', $renderer, "text", 0);
     $column->set_expand(true);
     $column->set_resizable(false);
     $this->roleListTree->append_column($column);
     $this->roleComboStore = new GtkRefListStore(Gobject::TYPE_STRING);
     $this->roleComboStore->refInsert(RoleEnum::getList());
     $this->roleCombo = new GtkRefComboBox($this->roleComboStore);
     $roleCell = new GtkCellRendererText();
     $roleCell->set_property('ellipsize', Pango::ELLIPSIZE_END);
     $this->roleCombo->pack_start($roleCell);
     $this->roleCombo->set_attributes($roleCell, 'text', 0);
     $this->roleCombo->connect('changed', array($this, 'selectRoleToAdd'));
     $this->addButton = new GtkButton("Add");
     $this->addButton->set_sensitive(false);
     $this->removeButton = new GtkButton("Remove");
     $this->removeButton->set_sensitive(false);
     $this->enableForm(false);
     $buttonBox = new GtkHBox(false, 8);
     $buttonBox->pack_end($this->removeButton, false, false, 0);
     $buttonBox->pack_end($this->addButton, false, false, 0);
     $buttonBox->pack_end($this->roleCombo, true, true, 0);
     $frameBox->pack_end($buttonBox, false, false, 0);
 }
Esempio n. 9
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();
 }
 function __create_box()
 {
     $vbox = new GtkVBox(false, 5);
     $vbox->set_border_width(5);
     $label = new GtkLabel();
     $label->set_markup('Completion demo, try writing <b>total</b> or <b>gnome</b> for example.');
     $vbox->pack_start($label, false, false, 0);
     $entry = new GtkEntry();
     $vbox->pack_start($entry, false, false, 0);
     $completion = new GtkEntryCompletion();
     $completion_model = $this->__create_completion_model();
     $completion->set_model($completion_model);
     $completion->set_text_column(0);
     $entry->set_completion($completion);
     return $vbox;
 }
 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("Users");
     $titleLabel->set_markup("<span weight='bold'>Users</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->userListStore = new GtkRefListStore(Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING, Gobject::TYPE_STRING);
     $this->userListTree = new GtkRefTreeView($this->userListStore);
     $this->userListTree->set_rules_hint(true);
     $usersWindow = new GtkScrolledWindow();
     $usersWindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
     $usersWindow->set_shadow_type(Gtk::SHADOW_ETCHED_IN);
     $usersWindow->add($this->userListTree);
     $frameBox->pack_start($usersWindow, true, true, 0);
     $cols = array('Username', 'First Name', 'Last Name', 'Email', 'Department');
     foreach ($cols as $num => $item) {
         $renderer = new GtkCellRendererText();
         $renderer->set_property("editable", false);
         $column = new GtkTreeViewColumn($item, $renderer, "text", $num);
         $column->set_sort_column_id($num);
         $column->set_expand(true);
         $column->set_resizable(true);
         $this->userListTree->append_column($column);
     }
     $userSelection = $this->userListTree->get_selection();
     $userSelection->set_mode(Gtk::SELECTION_SINGLE);
     $userSelection->connect('changed', array($this, 'isSelected'));
     $this->newButton = new GtkButton("New");
     $this->newButton->connect('clicked', array($this, 'deSelect'));
     $this->delButton = new GtkButton("Delete");
     $this->delButton->set_sensitive(false);
     $this->delButton->connect('clicked', array($this, 'confirmDeletion'));
     $buttonBox = new GtkHBox(false, 8);
     $buttonBox->pack_end($this->newButton, false, false, 0);
     $buttonBox->pack_end($this->delButton, false, false, 0);
     $frameBox->pack_end($buttonBox, false, false, 0);
 }
Esempio n. 12
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. 13
0
 function __construct()
 {
     parent::__construct(XMONEY_TITULO . ' - ' . XMONEY_DESCRICAO . ' - ' . XMONEY_DESC_VERSAO, 800, 600, 'logo.png');
     $this->connect('delete_event', array($this, delete_event));
     // Painel
     $this->pack_start($hpaned = new GtkHPaned());
     $hpaned->pack1($this->painel = new TPainel($this), false, true);
     // Notebook
     $hpaned->pack2($this->notebook = new TNotebook($this), true, true);
     // status
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($filial = new GtkLabel());
     $filial->set_markup('<b> Filial: </b>' . $GLOBALS['Filial']);
     $hbox->pack_start($usuario = new GtkLabel());
     $usuario->set_markup('<b>' . latin1(' Usuário: ') . '</b>' . $GLOBALS['Usuario']);
     $hbox->pack_start($nome = new GtkLabel());
     $nome->set_markup('<b> Nome: </b>' . $GLOBALS['Nome']);
     $hbox->pack_start($this->data = new GtkLabel());
     $this->children_show_all();
     Gtk::timeout_add(1000, array($this, 'data_timeout'));
     define('XMONEY_JANELA_PRINCIPAL', $this);
 }
Esempio n. 14
0
 public function __construct($message)
 {
     parent::__construct();
     $this->strings = KioskClient::getStrings();
     $this->set_position(GtK::WIN_POS_CENTER_ALWAYS);
     $this->set_default_size(200, 100);
     $this->set_resizable(false);
     $this->set_modal(false);
     $alertMessage = new GtkLabel();
     $alertMessage->set_use_markup(true);
     $alertMessage->set_markup($message);
     $this->vbox->pack_start($hbox = new GtkHBox());
     $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG);
     $hbox->pack_start($stock, 0, 0);
     $hbox->pack_start($alertMessage);
     $this->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK);
     $this->action_area->set_layout(Gtk::BUTTONBOX_SPREAD);
     $this->set_has_separator(false);
     $this->show_all();
     $this->run();
     $this->destroy();
 }
Esempio n. 15
0
 function __construct($CodFor, $NomeFor)
 {
     $this->CodFor = $CodFor;
     parent::__construct(latin1('Endereços do Fornecedor'), 'enderecos.png');
     // toolbar
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'incluir_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'alterar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridEndFornecedores($this));
     // info fornecedor
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup('<b> Cod. Fornecedor: </b>' . $CodFor);
     $hbox->pack_start($label = new GtkLabel());
     $label->set_markup('<b>' . latin1(' Nome Fornecedor / Razão: ') . '</b>' . $NomeFor);
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_end_fornecedor'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_end_fornecedor'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_end_fornecedor'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_end_fornecedor'));
 }
Esempio n. 16
0
 function __construct($CodTrans, $NomeTrans)
 {
     $this->CodTrans = $CodTrans;
     parent::__construct(latin1('Endereços da Transportadora'), 'enderecos.png');
     // toolbar
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'incluir_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'alterar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridEndTransportadoras($this));
     // info transportadora
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup('<b> Cod. Transp.: </b>' . $CodTrans);
     $hbox->pack_start($label = new GtkLabel());
     $label->set_markup('<b> Transportadora </b>' . $NomeTrans);
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_end_transportadora'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_end_transportadora'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_end_transportadora'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_end_transportadora'));
 }
Esempio n. 17
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. 18
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. 19
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. 20
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. 21
0
<?php

$window = new GtkWindow();
$window->set_size_request(400, 200);
$window->connect_simple('destroy', array('Gtk', 'main_quit'));
$window->add($vbox = new GtkVBox());
// display title
$title = new GtkLabel();
$title->set_markup('<span color="blue" font_desc="Times New Roman Italic 12">
    Button Group Demo</span>');
$vbox->pack_start($title);
// setup grouped radio buttons
$radio1 = setup_radio(null, 'radio button 1', '101');
// note 1
$radio2 = setup_radio($radio1, 'radio button 2', '102');
// note 2
$radio3 = setup_radio($radio1, 'radio button 3', '103');
// pack them inside vbox
$vbox->pack_start($radio1, 0, 0);
$vbox->pack_start($radio2, 0, 0);
$vbox->pack_start($radio3, 0, 0);
// add a status area
$vbox->pack_start($status_area = new GtkLabel('Click a Button'));
// function to simplify the display of grouped radio buttons
function setup_radio($radio_button_grp, $button_label, $button_value)
{
    // note 3
    $radio = new GtkRadioButton($radio_button_grp, $button_label);
    $radio->connect('toggled', "on_toggle", $button_value);
    // note 4
    return $radio;
Esempio n. 22
0
 function preenche_lista()
 {
     $db = new Database($this->Owner, true);
     if (!$db->link) {
         return;
     }
     // Secoes
     $sql = 'SELECT * FROM Tb_Secoes';
     if (!$db->multi_query($sql)) {
         return;
     }
     while ($line = $db->line()) {
         $CodSecao = $line['Cod_S_Secao'];
         $Imagem = $line['Imagem'];
         $Nome = $line['Nome'];
         $this->lista->pack_start($ptr = $this->secoes[$CodSecao] = new GtkExpander(''), false);
         $ptr->add(new GtkVBox());
         $ptr->set_label_widget($hbox = new GtkHBox());
         $hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $Imagem), false);
         $hbox->pack_start($label = new GtkLabel());
         $label->set_markup('<b>' . $Nome . '</b>');
         $ptr->show_all();
     }
     // Menus
     $sql = 'SELECT * FROM Tb_Menus';
     if (!$db->multi_query($sql)) {
         return;
     }
     while ($line = $db->line()) {
         $CodMenu = $line['Cod_S_Menu'];
         $CodSecao = $line['Cod_S_Secao'];
         $Imagem = $line['Imagem'];
         $Nome = $line['Nome'];
         $Permissao = $line['Permissao'];
         $Classe = $line['Classe'];
         $this->secoes[$CodSecao]->child->pack_start($button = new GtkButton());
         $button->set_relief(Gtk::RELIEF_NONE);
         $button->add($hbox = new GtkHBox());
         $hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $Imagem), false);
         $hbox->pack_start(new GtkLabel(' ' . $Nome . ' '));
         $button->show_all();
         $button->connect('clicked', array($this, 'button_clicked'), array($Permissao, $Classe));
     }
     // Ajuda
     $this->lista->pack_start($ptr = new GtkExpander(''), false);
     $ptr->set_label_widget($hbox = new GtkHBox());
     $hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'ajuda.png'), false);
     $hbox->pack_start($label = new GtkLabel());
     $label->set_markup('<b>Ajuda</b>');
     $ptr->show_all();
     // Sobre
     $ptr->add($button = new GtkButton());
     $button->set_relief(Gtk::RELIEF_NONE);
     $button->add($hbox = new GtkHBox());
     $hbox->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . 'sobre.png'), false);
     $hbox->pack_start(new GtkLabel('Sobre'));
     $ptr->show_all();
     $button->connect('clicked', array($this, 'sobre_clicked'));
     return true;
 }
Esempio n. 23
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();
 }
 private function getAstLabel()
 {
     $mandatory = new GtkLabel();
     $mandatory->set_markup('<span color="red">*</span>');
     $mandatory->set_width_chars(1);
     return $mandatory;
 }
Esempio n. 25
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();
 }