function __create_box() { $vbox = new GtkVBox(false, 5); $vbox->set_border_width(5); $this->size_group = new GtkSizeGroup(gtk::SIZE_GROUP_HORIZONTAL); $frame = new GtkFrame('Color options'); $vbox->pack_start($frame, true, true, 0); $table = new GtkTable(2, 2, false); $table->set_border_width(5); $table->set_row_spacings(5); $table->set_col_spacings(10); $frame->add($table); $color_options = array('Red', 'Green', 'Blue'); $this->add_row($table, 0, '_Foreground', $color_options); $this->add_row($table, 1, '_Background', $color_options); $frame = new GtkFrame('Line options'); $vbox->pack_start($frame, true, true, 0); $table = new GtkTable(2, 2, false); $table->set_border_width(5); $table->set_row_spacings(5); $table->set_col_spacings(10); $frame->add($table); $dash_options = array('Solid', 'Dashed', 'Dotted'); $end_options = array('Square', 'Round', 'Arrow'); $this->add_row($table, 0, '_Dashing', $dash_options); $this->add_row($table, 1, '_Line ends', $end_options); $check_button = new GtkCheckButton('_Enable grouping'); $check_button->set_use_underline(true); $vbox->pack_start($check_button, false, false, 0); $check_button->set_active(true); $check_button->connect('toggled', array($this, 'on_toggle_grouping')); return $vbox; }
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 = null) { parent::__construct(); if ($parent) { $this->set_screen($parent->get_screen()); } else { $this->connect_simple('destroy', array('gtk', 'main_quit')); } $this->set_title(__CLASS__); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(-1, 500); $this->set_border_width(8); $hbox = new GtkHBox(false, 8); $this->add($hbox); $scrolled = new GtkScrolledWindow(); $scrolled->set_shadow_type(Gtk::SHADOW_ETCHED_IN); $scrolled->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); $hbox->pack_start($scrolled, false, false, 0); $model = $this->create_model(); $treeview = new GtkTreeView($model); $scrolled->add($treeview); $column = new GtkTreeViewColumn(); $column->set_title('Icon and Constant'); $cell_renderer = new GtkCellRendererPixbuf(); $column->pack_start($cell_renderer, false); $column->set_attributes($cell_renderer, 'stock-id', 1); $cell_renderer = new GtkCellRendererText(); $column->pack_start($cell_renderer, true); $column->set_cell_data_func($cell_renderer, 'constant_setter'); $treeview->append_column($column); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'Label', $cell_renderer, 'label_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'Accelerator', $cell_renderer, 'accel_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'ID', $cell_renderer, 'id_setter'); $align = new GtkAlignment(0.5, 0, 0, 0); $hbox->pack_end($align, true, true, 0); $frame = new GtkFrame('Selection Info'); $align->add($frame); $vbox = new GtkVBox(false, 8); $vbox->set_border_width(4); $frame->add($vbox); $display = new StockItemDisplay(); $treeview->set_data('stock-display', $display); $display->type_label = new GtkLabel(); $display->constant_label = new GtkLabel(); $display->id_label = new GtkLabel(); $display->accel_label = new GtkLabel(); $display->icon_image = new GtkImage(); $vbox->pack_start($display->type_label, false, false, 0); $vbox->pack_start($display->icon_image, false, false, 0); $vbox->pack_start($display->accel_label, false, false, 0); $vbox->pack_start($display->constant_label, false, false, 0); $vbox->pack_start($display->id_label, false, false, 0); $selection = $treeview->get_selection(); $selection->set_mode(Gtk::SELECTION_SINGLE); $selection->connect('changed', array($this, 'on_selection_changed')); $this->show_all(); }
function __create_box() { $vbox = new GtkVBox(false, 5); $vbox->set_border_width(5); $combo = GtkComboBox::new_text(); $data = array('PHP-Gtk2', 'is', 'really', 'cool'); foreach ($data as $string) { $combo->append_text($string); } $combo->set_active(2); $button = new GtkButton('Check this'); $vbox->pack_start($combo, false, true); $vbox->pack_start($button, false, true); $button->connect('clicked', array($this, 'onClickedButton'), $combo); //GtkComboBoxEntry $vbox->pack_start(new GtkHSeparator(), false, true); $comboentry = GtkComboBoxEntry::new_text(); $data2 = array('You', 'can', 'edit', 'this', 'box'); foreach ($data2 as $string) { $comboentry->append_text($string); } $comboentry->get_child()->set_text('That\'s an own text for the entry'); $vbox->pack_start($comboentry, false, true); $button2 = new GtkButton('Check that'); $vbox->pack_start($button2, false, true); $button2->connect('clicked', array($this, 'onClickedButton'), $comboentry); 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 Profile"); $titleLabel->set_markup("<span weight='bold'>User Profile</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->userFormTable = new GtkTable(3, 7); list($labelFname, $this->entryFname) = $this->createLabelText('First Name', true); list($labelLname, $this->entryLname) = $this->createLabelText('Last Name', true); list($labelEmail, $this->entryEmail) = $this->createLabelText('Email', true); list($labelUsername, $this->entryUsername) = $this->createLabelText('Username', true); list($labelPassword, $this->entryPassword) = $this->createLabelText('Password', false); list($labelConfirm, $this->entryConfirm) = $this->createLabelText('Confirm Password', false); $this->deptComboStore = new GtkRefListStore(Gobject::TYPE_STRING); $this->deptComboStore->refInsert(DeptEnum::getList()); $this->comboDept = new GtkRefComboBox($this->deptComboStore); $cellDept = new GtkCellRendererText(); $cellDept->set_property('ellipsize', Pango::ELLIPSIZE_END); $this->comboDept->pack_start($cellDept); $this->comboDept->set_attributes($cellDept, 'text', 0); $labelDept = new GtkLabel('Department'); $labelDept->set_alignment(1, 0.5); $this->attachLabelText($labelFname, $this->entryFname, false, 0); $this->attachLabelText($labelLname, $this->entryLname, false, 1); $this->attachLabelText($labelEmail, $this->entryEmail, false, 2); $this->attachLabelText($labelUsername, $this->entryUsername, true, 3); $this->attachLabelText($labelPassword, $this->entryPassword, true, 4); $this->attachLabelText($labelConfirm, $this->entryConfirm, true, 5); $this->attachLabelText($labelDept, $this->comboDept, true, 6); $this->entryUsername->connect('key-release-event', array($this, 'enableSubmit')); $this->entryPassword->connect('key-release-event', array($this, 'enableSubmit')); $this->entryConfirm->connect('key-release-event', array($this, 'enableSubmit')); $this->comboDept->connect('changed', array($this, 'enableSubmit')); $subFrame = new GtkFrame(); $subFrameBox = new GtkVBox(false, 0); $subFrameBox->set_border_width(12); $subFrame->add($subFrameBox); $subFrameBox->pack_start($this->userFormTable, false, false, 0); $frameBox->pack_start($subFrame, false, false, 0); $buttonBox = new GtkHBox(false, 8); $this->submitButton = new GtkButton($this->mode == self::MODE_ADD ? 'Add User' : 'Update Profile'); $this->submitButton->connect('clicked', array($this, 'submit')); $this->cancelButton = new GtkButton("Cancel"); $buttonBox->pack_end($this->cancelButton, false, false, 0); $buttonBox->pack_end($this->submitButton, false, false, 0); $frameBox->pack_end($buttonBox, true, true, 0); $this->enableForm(false); }
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 __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 __create_box() { $vbox = new GtkVBox(false, 5); $vbox->set_border_width(8); //Create the color swatch area $frame = new GtkFrame(); $frame->set_shadow_type(Gtk::SHADOW_IN); $vbox->pack_start($frame, true, true, 8); $this->d_area = new GtkDrawingArea(); $this->d_area->set_size_request(200, 200); // $this->d_area->modify_bg(Gtk::STATE_NORMAL, $this->color); $frame->add($this->d_area); $alignment = new GtkAlignment(1.0, 0.5, 0.0, 0.0); $button = new GtkButton('_Change the above color'); $alignment->add($button); $vbox->pack_start($alignment, true, true); $button->connect('clicked', array($this, 'on_change_color_clicked')); $button->set_flags(Gtk::CAN_DEFAULT); return $vbox; }
function __create_box() { $mvbox = new GtkVBox(false); $frame = new GtkFrame('Dialogs'); $vbox = new GtkVBox(false, 8); $vbox->set_border_width(8); $frame->add($vbox); # Standard message dialog $hbox = new GtkHBox(false, 8); $vbox->pack_start($hbox); $button = new GtkButton('_Message Dialog'); $button->connect('clicked', array($this, 'on_message_dialog_clicked')); $hbox->pack_start($button, false, false, 0); $vbox->pack_start(new GtkHSeparator(), false, false, 0); # Interactive dialog $hbox = new GtkHBox(false, 8); $vbox->pack_start($hbox, false, false, 0); $vbox2 = new GtkVBox(); $button = new GtkButton('_Interactive Dialog'); $button->connect('clicked', array($this, 'on_interactive_dialog_clicked')); $hbox->pack_start($vbox2, false, false, 0); $vbox2->pack_start($button, false, false, 0); $table = new GtkTable(2, 2); $table->set_row_spacings(4); $table->set_col_spacings(4); $hbox->pack_start($table, false, false, 0); $label = new GtkLabel('Entry _1'); $label->set_use_underline(true); $table->attach($label, 0, 1, 0, 1); $this->entry1 = new GtkEntry(); $table->attach($this->entry1, 1, 2, 0, 1); $label->set_mnemonic_widget($this->entry1); $label = new GtkLabel('Entry _2'); $label->set_use_underline(true); $table->attach($label, 0, 1, 1, 2); $this->entry2 = new GtkEntry(); $table->attach($this->entry2, 1, 2, 1, 2); $label->set_mnemonic_widget($this->entry2); return $frame; }
function __create_box() { $box = new GtkVBox(); $frame_horiz = new GtkFrame("Horizontal Button Boxes"); $box->pack_start($frame_horiz, true, true, 10); $vbox = new GtkVBox(); $vbox->set_border_width(10); $frame_horiz->add($vbox); $vbox->pack_start($this->create_framedbox(true, "Spread", 40, Gtk::BUTTONBOX_SPREAD)); $vbox->pack_start($this->create_framedbox(true, "Edge", 40, Gtk::BUTTONBOX_EDGE)); $vbox->pack_start($this->create_framedbox(true, "Start", 40, Gtk::BUTTONBOX_START)); $vbox->pack_start($this->create_framedbox(true, "End", 40, Gtk::BUTTONBOX_END)); $frame_vert = new GtkFrame("Vertical Button Boxes"); $box->pack_start($frame_vert, true, true, 10); $hbox = new GtkHBox(); $hbox->set_border_width(10); $frame_vert->add($hbox); $hbox->pack_start($this->create_framedbox(false, "Spread", 40, Gtk::BUTTONBOX_SPREAD)); $hbox->pack_start($this->create_framedbox(false, "Edge", 40, Gtk::BUTTONBOX_EDGE)); $hbox->pack_start($this->create_framedbox(false, "Start", 40, Gtk::BUTTONBOX_START)); $hbox->pack_start($this->create_framedbox(false, "End", 40, Gtk::BUTTONBOX_END)); return $box; }
* Create a new top-level window and connect the signals to the appropriate * functions. Note that all constructors must be assigned by reference. */ $window = new GtkWindow(); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->connect('delete-event', 'delete_event'); /* * Create a button and connect its 'clicked' signal to destroy() function. */ $button = new GtkButton('Close'); $button->connect_object('clicked', array('gtk', 'main_quit')); /* * Create a vertical layout box. */ $box = new GtkVBox(false, 10); $box->set_border_width(10); /* * Create a list widget and populate it with month names. */ $list = new GtkList(); $list->set_selection_mode(GTK_SELECTION_BROWSE); foreach (range(1, 12) as $month_num) { $items[] = new GtkListItem(strftime('%B', mktime(0, 0, 0, $month_num))); } $list->append_items($items); /* * Create a scrolled window and add the list widget to it - this provides * automatic scrollbars. */ $scrolled_window = new GtkScrolledWindow(); $scrolled_window->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
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(); }
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(); }
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(); }
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(); }