function __construct($Owner) { parent::__construct(); $this->pack_start(new GtkLabel(latin1(' Tipo de Endereço: ')), false); $this->store = new GtkListStore(TYPE_STRING, TYPE_LONG); $this->pack_start($this->combobox = new GtkComboBox($this->store)); $this->combobox->pack_start($cell = new GtkCellRendererText()); $this->combobox->set_attributes($cell, 'text', 0); $this->combobox->connect('changed', array($this, 'tipo_endereco_changed')); $this->show_all(); /* * preenche lista */ $db = new Database($Owner, true); if (!$db->link) { return; } /* * Tipo de Endereco */ if (!$db->multi_query('SELECT * FROM Vw_Tipos_Endereco')) { return; } $this->store->clear(); unset($this->it); while ($line = $db->line()) { $row = $this->store->append(); $this->store->set($row, 0, $line['Descricao'], 1, $line['Id']); $this->it[$line['Id']] = $row; } }
function __construct($Owner) { parent::__construct(); $this->pack_start(new GtkLabel(' Fornecedor: '), false); $completion = new GtkEntryCompletion(); $completion->set_model($this->store = new GtkListStore(TYPE_STRING, TYPE_LONG)); $completion->set_text_column(0); $completion->pack_start($cell = new GtkCellRendererText()); $completion->set_attributes($cell, 'text', 1); $completion->connect('match-selected', array($this, 'fornecedor_selected')); $this->pack_start($this->entry = new GtkEntry()); $this->entry->set_completion($completion); $this->show_all(); /* * preenche lista */ $db = new Database($Owner, true); if (!$db->link) { return; } /* * Fornecedores */ if (!$db->multi_query('SELECT * FROM Vw_Fornecedores')) { return; } $this->store->clear(); unset($this->it); while ($line = $db->line()) { $row = $this->store->append(); $this->store->set($row, 0, $line['Nome'], 1, $line['Id']); $this->it[$line['Id']] = $row; } }
/** * Class Constructor * @param $name name of the field */ public function __construct($name) { parent::__construct(); self::setName($name); // initialize validations array $this->validations = array(); }
function __construct($Owner) { parent::__construct(); $this->pack_start(new GtkLabel(' Forma de Pgto: '), false); $this->store = new GtkListStore(TYPE_STRING, TYPE_LONG); $this->pack_start($this->combobox = new GtkComboBox($this->store)); $this->combobox->pack_start($cell = new GtkCellRendererText()); $this->combobox->set_attributes($cell, 'text', 0); $this->combobox->connect('changed', array($this, 'forma_pgto_changed')); $this->show_all(); /* * preenche lista */ $db = new Database($Owner, true); if (!$db->link) { return; } /* * Formas de Pagamento */ if (!$db->multi_query('SELECT * FROM Vw_Formas_Pgto')) { return; } $this->store->clear(); unset($this->it); while ($line = $db->line()) { $row = $this->store->append(); $this->store->set($row, 0, $line['Nome'], 1, $line['Id']); $this->it[$line['Id']] = $row; } }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct(); $this->wname = $name; $this->mask = 'yyyy-mm-dd'; $this->validations = array(); // creates the entry field $this->entry = new TEntry($name); $this->entry->setSize(200); //set_size_request(200, 24); $this->setMask($this->mask); parent::add($this->entry); // creates a button with a calendar image $button = new GtkButton(); $button->set_relief(GTK::RELIEF_NONE); $imagem = GtkImage::new_from_file('lib/adianti/images/tdate-gtk.png'); $button->set_image($imagem); // define the button's callback $button->connect_simple('clicked', array($this, 'onCalendar')); parent::add($button); // creates the calendar window $this->popWindow = new GtkWindow(Gtk::WINDOW_POPUP); // creates the calendar $this->calendar = new GtkCalendar(); // define the action when the user selects a date $this->calendar->connect_simple('day-selected-double-click', array($this, 'onSelectDate')); $this->month = new TCombo('tdate-month'); $this->month->addItems(array(TAdiantiCoreTranslator::translate('January'), TAdiantiCoreTranslator::translate('February'), TAdiantiCoreTranslator::translate('March'), TAdiantiCoreTranslator::translate('April'), TAdiantiCoreTranslator::translate('May'), TAdiantiCoreTranslator::translate('June'), TAdiantiCoreTranslator::translate('July'), TAdiantiCoreTranslator::translate('August'), TAdiantiCoreTranslator::translate('September'), TAdiantiCoreTranslator::translate('October'), TAdiantiCoreTranslator::translate('November'), TAdiantiCoreTranslator::translate('December'))); $this->month->setCallback(array($this, 'onChangeMonth')); $this->month->setSize(70); for ($n = date('Y') - 10; $n <= date('Y') + 10; $n++) { $years[$n] = $n; } $this->year = new TCombo('tdate-year'); $this->year->addItems($years); $this->year->setCallback(array($this, 'onChangeMonth')); $this->year->setSize(70); $hbox = new GtkHBox(); $hbox->pack_start($this->month); $hbox->pack_start($this->year); $bt_today = new GtkButton(TAdiantiCoreTranslator::translate('Today')); $bt_close = new GtkButton(TAdiantiCoreTranslator::translate('Close')); $bt_today->connect_simple('clicked', array($this, 'selectToday')); $inst = $this->popWindow; $bt_close->connect_simple('clicked', array($inst, 'hide')); $hbox2 = new GtkHBox(); $hbox2->pack_start($bt_today); $hbox2->pack_start($bt_close); $vbox = new GtkVBox(); $vbox->pack_start($hbox, FALSE, FALSE); $vbox->pack_start($this->calendar); $vbox->pack_start($hbox2, FALSE, FALSE); // shows the window $this->popWindow->add($vbox); }
/** * Class Constructor * @param $name widget's name */ public function __construct($name) { parent::__construct(); $this->widget = GtkComboBox::new_text(); // create the combo model $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING); $this->widget->set_model($this->model); $this->widget->set_size_request(200, -1); $this->wname = $name; parent::add($this->widget); $this->validations = array(); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct(); $this->wname = $name; $this->entry = new GtkEntry(); $this->btn = new TButton('find'); $this->btn->set_image(new TImage('lib/adianti/images/ico_find.png')); $this->btn->set_relief(Gtk::RELIEF_NONE); $this->useOutEvent = TRUE; $this->validations = array(); parent::pack_start($this->entry, false, false); parent::pack_start($this->btn, false, false); }
/** * @name __construct($widget) * @param GtkWidget $widget Widget para colocar dentro do FFWViewPort * @return GtkHBox */ public function __construct($widget) { parent::__construct(); // Cria o frame para criação da borda $this->__widgets['frame'] = new GtkFrame(); // Cria o scrolledwindow para criação dos scrools $this->__widgets['scrolled'] = new GtkScrolledWindow(); // Adiciona o scrolled dentro do frame $this->__widgets['frame']->add($this->__widgets['scrolled']); // Adiciona o widget ao scrolledwindow $this->__widgets['scrolled']->add($widget); // Configura os scrolls como automatico $this->__widgets['scrolled']->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); // Adiciona o frame ao GtkHBox parent::pack_start($this->__widgets['frame']); parent::show_all(); }
/** The constructor of GtkEntryDate. */ function __construct(){ parent::__construct(); require_once "knj/class_knj_eventmanager.php"; $this->eventm = new EventManager(); $this->eventm->addEvent("changed"); $this->eventm->addEvent("changed-manually"); $this->entry = new GtkEntry(); $this->entry->set_width_chars(10); $this->entry->connect_after("key-press-event", array($this, "on_entry_keypress")); $this->entry->connect_after("key-release-event", array($this, "on_entry_keyrelease")); $this->btn_select = new GtkButton("..."); $this->btn_select->connect("clicked", array($this, "showDialog")); $this->pack_start($this->entry); $this->pack_start($this->btn_select, false, false); }
function __construct($required = false, $duplicated = false, $table = null, $field = null) { parent::__construct(); $this->pack_start($this->label = new GtkLabel(), false); $this->pack_start($this->entry = new GtkEntry()); $this->pack_start($this->eventbox = new GtkEventBox(), false); $this->pack_start($this->status = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_BUTTON), false); $this->required = $required; $this->duplicated = $duplicated; $this->table = $table; $this->field = $field; $entry_next_focus = $GLOBALS['ENTRY_NEXT_FOCUS']; if ($entry_next_focus instanceof GtkWidget) { EntrySetNextFocus($entry_next_focus, $this->entry); } $this->entry->connect('changed', array($this, '__tentry_changed')); $this->entry->connect('focus_in_event', array($this, '__tentry_focus_in_event')); $this->entry->connect('focus_out_event', array($this, '__tentry_focus_out_event')); $GLOBALS['ENTRY_NEXT_FOCUS'] = $this->entry; }