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, $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(); }
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 on_delete_confirm() { $dialog = new GtkDialog('CAUTION!', $this, 0, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK, Gtk::STOCK_CANCEL, Gtk::RESPONSE_CANCEL)); $hbox = new GtkHBox(false, 8); $hbox->set_border_width(8); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG); $confirm_text1 = new GtkLabel('Are you sure you want to proceed ?'); $confirm_text2 = new GtkLabel('Note: This process is irreversible.'); $confirm_text3 = new GtkLabel($this->selected_file); $confirm_text3->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#ff0000")); $vbox2 = new GtkVBox(); $vbox2->pack_start($confirm_text1); $vbox2->pack_start($confirm_text2); $vbox2->pack_start($confirm_text3); $hbox->pack_start($stock, false, false, 0); $hbox->pack_start($vbox2, false, false, 0); $dialog->vbox->pack_start($hbox, false, false, 0); $dialog->show_all(); $response = $dialog->run(); if ($response == Gtk::RESPONSE_OK) { $resp = $this->delete_file(); if ($resp) { $this->on_delete_successful(); $this->selected_file = ""; $this->file_label->set_text($this->file_label_default); } else { $this->selected_file = ""; $this->file_label->set_text('Unable to delete the specified file.'); } } $dialog->destroy(); }
/** * 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(); }
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; }
function add_row($table, $row, $label_text, $options) { $label = new GtkLabel($label_text); $label->set_use_underline(true); $label->set_alignment(0, 1); $table->attach($label, 0, 1, $row, $row + 1, Gtk::EXPAND + Gtk::FILL, 0, 0, 0); $option_menu = $this->create_option_menu($options); $label->set_mnemonic_widget($option_menu); $this->size_group->add_widget($option_menu); $table->attach($option_menu, 1, 2, $row, $row + 1, 0, 0, 0, 0); }
function get_data($title, $field_labels) { $dialog = new GtkDialog($title, null, Gtk::DIALOG_MODAL); // create a new dialog $dialog->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $top_area = $dialog->vbox; // get the top area $top_area->pack_start($hbox = new GtkHBox()); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, 0, 0); // stuff in the icon // display the data entry form as table $table = new GtkTable(); // create a new table $row = 0; $input = array(); // holds the ID of each GtkEntry foreach ($field_labels as $field_label) { $label = new GtkLabel($field_label); $label->set_alignment(0, 0); // left-justify the label $table->attach($label, 0, 1, $row, $row + 1); // insert the label into table $input[$row] = new GtkEntry(); // create a new input field $table->attach($input[$row], 1, 2, $row, $row + 1); // add this besides the label if (eregi("password", $field_label)) { $input[$row]->set_visibility(false); } // show password entry as '*' ++$row; } $hbox->pack_start($table); $dialog->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK); // add an OK button $dialog->set_has_separator(false); // don't display the set_has_separator $dialog->show_all(); // show the dialog $dialog->run(); // the dialog in action // grab the user input before destroying the dialog - note 1 $data = array(); // put user input in an array for ($i = 0; $i < count($input); ++$i) { $data[] = $input[$i]->get_text(); } $dialog->destroy(); // done. close the dialog box. return $data; // returns the user input as array }
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); }
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); }
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(); }
public function __construct($username) { parent::__construct(); $this->username = $username; $this->strings = KioskClient::getStrings(); # $this->set_default_size( 300, 200 ); $this->set_resizable(false); $this->set_modal(true); $this->set_keep_above(true); $this->set_title($this->strings['setPassword']); $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_markup($this->strings['setPassword']); $passwordLabel1 = new GtkLabel(); $passwordLabel1->set_use_markup(true); $passwordLabel1->set_label($this->strings['passwordLabel']); $this->passwordEntry1 = new GtkEntry(); $this->passwordEntry1->set_visibility(0); $passwordBox1 = new GtkHBox(); $passwordBox1->pack_start($passwordLabel1); $passwordBox1->pack_start($this->passwordEntry1); $passwordLabel2 = new GtkLabel(); $passwordLabel2->set_use_markup(true); $passwordLabel2->set_label($this->strings['passwordLabel']); $this->passwordEntry2 = new GtkEntry(); $this->passwordEntry2->set_visibility(0); $passwordBox2 = new GtkHBox(); $passwordBox2->pack_start($passwordLabel2); $passwordBox2->pack_start($this->passwordEntry2); $this->setPasswordButton = new GtkButton($this->strings['setPasswordButton']); $mainBox = new GtkVBox(); $mainBox->pack_start($this->messageLabel); $mainBox->pack_start($passwordBox1); $mainBox->pack_start($passwordBox2); $mainBox->pack_start($this->setPasswordButton); $this->add($mainBox); $this->connect('key-press-event', array(&$this, 'onKey'), $input); $this->setPasswordButton->connect_simple('clicked', array(&$this, 'onClick')); $this->show_all(); }
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); }
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(); }
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')); }
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')); }
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(); }
function on_interactive_dialog_clicked($button) { $dialog = new GtkDialog('Interactive Dialog', $this, 0, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK, '_Non-stock button', Gtk::RESPONSE_CANCEL)); $hbox = new GtkHBox(false, 8); $hbox->set_border_width(8); $dialog->vbox->pack_start($hbox, false, false, 0); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, false, false, 0); $table = new GtkTable(2, 2); $table->set_row_spacings(4); $table->set_col_spacings(4); $hbox->pack_start($table, true, true, 0); $label = new GtkLabel('Entry _1'); $label->set_use_underline(true); $table->attach($label, 0, 1, 0, 1); $local_entry1 = new GtkEntry(); $local_entry1->set_text($this->entry1->get_text()); $table->attach($local_entry1, 1, 2, 0, 1); $label->set_mnemonic_widget($local_entry1); $label = new GtkLabel('Entry _2'); $label->set_use_underline(true); $table->attach($label, 0, 1, 1, 2); $local_entry2 = new GtkEntry(); $local_entry2->set_text($this->entry2->get_text()); $table->attach($local_entry2, 1, 2, 1, 2); $label->set_mnemonic_widget($local_entry2); $dialog->show_all(); $response = $dialog->run(); if ($response == Gtk::RESPONSE_OK) { $this->entry1->set_text($local_entry1->get_text()); $this->entry2->set_text($local_entry2->get_text()); } $dialog->destroy(); }
<?php $window = new GtkWindow(); $window->set_size_request(148, 240); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $window->add($vbox = new GtkVBox()); // display title $title = new GtkLabel("Set up Volume Control\n" . "Part 1 - using GtkVScale"); $title->modify_font(new PangoFontDescription("Arial Narrow 8")); $title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff")); $title->set_size_request(-1, 40); $title->set_justify(Gtk::JUSTIFY_CENTER); $alignment = new GtkAlignment(0.5, 0.5, 0, 0); $alignment->add($title); $vbox->pack_start($alignment, 0); $vol_adj = GtkVScale::new_with_range(-100, 80, 1); // note 1 $vbox->pack_start(new GtkLabel('Volume'), 0); $vbox->pack_start($vol_adj, 0); $vol_adj->set_size_request(10, 160); $vol_adj->set_inverted(1); // note 2 $vol_adj->connect('format-value', 'on_format_value'); // note 3 $window->show_all(); Gtk::main(); function on_format_value($scale, $value) { return $value . "dB"; // note 4 }
<?php $window = new GtkWindow(); $window->set_size_request(400, 240); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $window->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $window->add($vbox = new GtkVBox()); // display title $title = new GtkLabel("Search for text in GtkTextView - Part 1\n"); $title->modify_font(new PangoFontDescription("Times New Roman Italic 10")); $title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff")); $title->set_size_request(-1, 60); $title->set_justify(Gtk::JUSTIFY_CENTER); $alignment = new GtkAlignment(0.5, 0, 0, 0); $alignment->add($title); $vbox->pack_start($alignment, 0, 0); $vbox->pack_start(new GtkLabel(), 0, 0); $hbox = new GtkHBox(); $hbox->pack_start(new GtkLabel("Search string: "), 0); $hbox->pack_start($entry = new GtkEntry(), 0); $hbox->pack_start($button_search = new GtkButton('Search'), 0); $vbox->pack_start($hbox, 0); $button_search->connect('clicked', 'on_search_button', $entry); // note 1 // Create a new buffer and a new view to show the buffer. $buffer = new GtkTextBuffer(); $view = new GtkTextView(); $view->set_buffer($buffer); $view->modify_font(new PangoFontDescription("Verdana italic 14")); $view->set_wrap_mode(Gtk::WRAP_WORD); $scrolled_win = new GtkScrolledWindow();
<?php $window = new GtkWindow(); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $window->set_size_request(400, 150); $window->add($vbox = new GtkVBox()); // display title $title = new GtkLabel("Setup and process GtkComboBox"); $title->modify_font(new PangoFontDescription("Times New Roman Italic 10")); $title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff")); $title->set_size_request(-1, 60); $vbox->pack_start($title, 0, 0); // the selection $list = array('item 1', 'item 2', 'item 3', 'item 4'); $vbox->pack_start($hbox = new GtkHBox(), 0, 0); $hbox->pack_start(new GtkLabel('Select: '), 0, 0); // Create a combobox $combobox = new GtkComboBox(); // Create a model if (defined("GObject::TYPE_STRING")) { $model = new GtkListStore(GObject::TYPE_STRING); } else { $model = new GtkListStore(Gtk::TYPE_STRING); } // Set up the combobox $combobox->set_model($model); // note 1 $cellRenderer = new GtkCellRendererText(); // note 2 $combobox->pack_start($cellRenderer); $combobox->set_attributes($cellRenderer, 'text', 0);
/** * Return the widget's content */ public function getValue() { return parent::get_text(); }
//$window2->connect_simple('destroy', array('Gtk','main_quit')); $window2->add($v2box = new GtkVBox()); $window2->modify_bg(Gtk::STATE_NORMAL, GdkColor::parse("#ffffff")); $G["displejmeno"] = new GtkLabel('-'); $G["displejmeno"]->modify_font(new PangoFontDescription($font . " 25")); $G["displejmeno"]->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $v2box->pack_start($G["displejmeno"], 1, 1, 3); $G["displejcas"] = new GtkLabel('000.00'); $G["displejcas"]->modify_font(new PangoFontDescription($font . " 170")); $G["displejcas"]->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $v2box->pack_start($G["displejcas"], 1, 1); $v2box->pack_start($h3box = new GtkHBox(), 1, 1); $h3box->pack_start($chnapis = new GtkLabel("CHYBY / ODM"), 1); $chnapis->modify_font(new PangoFontDescription($font . " 25")); $chnapis->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $h3box->pack_start($chnapis3 = new GtkLabel("TB"), 1); $chnapis3->modify_font(new PangoFontDescription($font . " 25")); $chnapis3->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $v2box->pack_start($h2box = new GtkHBox(), 1, 1); $h2box->pack_start($G["displejchyby"] = new GtkLabel("0"), 1); $G["displejchyby"]->modify_font(new PangoFontDescription($font . " 85")); $G["displejchyby"]->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $h2box->pack_start($G["displejodm"] = new GtkLabel('0'), 1); $G["displejodm"]->modify_font(new PangoFontDescription($font . " 85")); $G["displejodm"]->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $h2box->pack_start($G["displejtb"] = new GtkLabel('0.00'), 1); $G["displejtb"]->modify_font(new PangoFontDescription($font . " 85")); $G["displejtb"]->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#800000")); $window = new GtkWindow(); $window->set_title($argv[0]); $window->set_size_request(750, 550);
function __construct() { parent::__construct(); $this->foo = 'abcdef'; }
private function getAstLabel() { $mandatory = new GtkLabel(); $mandatory->set_markup('<span color="red">*</span>'); $mandatory->set_width_chars(1); return $mandatory; }
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(); }