/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkFileChooserButton(TAdiantiCoreTranslator::translate('Open'), GTK::FILE_CHOOSER_ACTION_OPEN); parent::add($this->widget); $this->setSize(200); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkVBox(); parent::add($this->widget); $this->orientation = 'vertical'; $this->count = 0; $this->types = array(); $this->created = FALSE; $this->table_fields = new TTable(); $this->editing = FALSE; $this->widget->pack_start($this->table_fields, false, false); $this->view = new GtkTreeView(); $this->model = new GtkListStore(); $button_bar = new GtkHBox(); $add = GtkButton::new_from_stock(Gtk::STOCK_SAVE); $del = GtkButton::new_from_stock(Gtk::STOCK_DELETE); $can = GtkButton::new_from_stock(Gtk::STOCK_CANCEL); $add->connect_simple('clicked', array($this, 'onSave')); $del->connect_simple('clicked', array($this, 'onDelete')); $can->connect_simple('clicked', array($this, 'onCancel')); $button_bar->pack_start($add, FALSE, FALSE); $button_bar->pack_start($del, FALSE, FALSE); $button_bar->pack_start($can, FALSE, FALSE); $this->widget->pack_start($button_bar, false, false); $scroll = new GtkScrolledWindow(); $scroll->add($this->view); $scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); $this->widget->pack_start($scroll, false, false); $this->view->set_size_request(400, 140); $this->height = 140; $this->view->connect_simple('button_release_event', array($this, 'onClick')); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkEntry(); parent::add($this->widget); $this->setSize(200); }
/** * Class Constructor * @param $name Widet's name */ public function __construct($name) { parent::__construct($name); self::$counter++; $this->widgetId = 'THtmlEditor_' . self::$counter; // creates a tag $this->tag = new TElement('div'); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkHbox(FALSE); parent::add($this->widget); $this->widget->set_border_width(0); $this->setLayout('vertical'); }
/** * método construtor * instancia a combo box * @param $name = nome do campo */ public function __construct($name) { // executa o método construtor da classe-pai. parent::__construct($name); // cria uma tag HTML do tipo <select> $this->tag = new TElement('select'); $this->tag->class = 'tfield'; // classe CSS }
/** * Class Constructor * @param $name Widet's name */ public function __construct($name) { parent::__construct($name); // creates a <textarea> tag $this->tag = new TElement('textarea'); $this->tag->{'class'} = 'tfield'; // CSS // defines the text default height $this->height = 100; }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkEntry(); parent::add($this->widget); $this->setSize(200); $this->chars = array('-', '_', '.', '/', '\\', ':', '|', '(', ')', '[', ']', '{', '}'); // Connecting 'changed' signal to check the typed chars. $this->handler = $this->widget->connect_after('changed', array($this, 'onChanged')); }
/** * Class Constructor * @param $name widget's name */ public function __construct($name) { parent::__construct($name); $this->widget = GtkComboBox::new_text(); parent::add($this->widget); // create the combo model $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING); $this->widget->set_model($this->model); $this->setSize(200); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkHBox(); parent::add($this->widget); $this->mask = 'yyyy-mm-dd'; // creates the entry field $this->entry = new TEntry($name); $this->entry->setSize(200); $this->setMask($this->mask); $this->widget->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); $this->actionButton = $button; // define the button's callback $button->connect_simple('clicked', array($this, 'onCalendar')); $this->widget->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); }
/** * método construtor * instancia um novo objeto * @param $name = nome do campo */ public function __construct($name) { // executa o método construtor da classe-pai. parent::__construct($name); // cria uma tag HTML do tipo <textarea > $this->tag = new TElement('textarea'); $this->tag->class = 'tfield'; // classe CSS // define a altura padrão da caixa de texto $this->height = 100; }
/** * Class Constructor * @param $name Widet's name */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkScrolledWindow(); $this->widget->set_size_request(200, -1); parent::add($this->widget); $this->textview = new GtkTextView(); $this->textview->set_wrap_mode(Gtk::WRAP_WORD); $this->textbuffer = $this->textview->get_buffer(); $this->widget->add($this->textview); }
/** * Class Constructor * @param $value Label's text */ public function __construct($value) { self::$counter++; parent::__construct('tlabel' . self::$counter); $this->widget = new GtkLabel($value); $this->widget->set_size_request(-1, -1); parent::add($this->widget); $this->setValue($value); $this->set_alignment(0, 0.5); parent::set_use_markup(TRUE); }
/** * Class Constructor * @param $name widget's name */ public function __construct($name) { // executes the parent class constructor parent::__construct($name); $this->id = 'tcombo_' . uniqid(); TPage::include_css('lib/adianti/include/tcombo/tcombo.css'); // creates a <select> tag $this->tag = new TElement('select'); $this->tag->{'class'} = 'tcombo'; // CSS }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkHBox(); parent::add($this->widget); $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(); $this->widget->pack_start($this->entry, false, false); $this->widget->pack_start($this->btn, false, false); }
/** * Class Constructor * @param $name widget's name */ public function __construct($name) { // executes the parent class constructor parent::__construct($name); self::$counter++; $this->id = 'tsortlist_' . uniqid(); $this->initialItems = array(); $this->items = array(); TPage::include_css('lib/adianti/include/tsortlist/tsortlist.css'); // creates a <ul> tag $this->tag = new TElement('ul'); $this->tag->{'class'} = 'tsortlist'; $this->tag->{'id'} = $this->id; $this->tag->{'itemname'} = $name; }
/** * Class Constructor * @param $name widget's name * @param $text widget's name */ public function __construct($name, $text_name) { // executes the parent class constructor parent::__construct($name); $this->text_name = $text_name; // creates the default field style $style1 = new TStyle('tcombo'); $style1->height = '24px'; $style1->z_index = '1'; $style1->show(); // creates a <select> tag $this->tag = new TElement('select'); $this->tag->{'class'} = 'tcombo'; // CSS }
/** * Class Constructor * @param $name widget's name * @param $text widget's name */ public function __construct($name, $text_name) { parent::__construct($name); $this->widget = new GtkHBox(); parent::add($this->widget); $this->text_name = $text_name; // create the combo model $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING); $this->entry = new GtkEntry(); $this->entry->set_size_request(50, 25); $this->entry->set_sensitive(FALSE); $this->combo = GtkComboBox::new_text(); $this->combo->set_model($this->model); $this->combo->set_size_request(200, -1); $this->combo->connect_simple('changed', array($this, 'onComboChange')); $this->widget->pack_start($this->entry); $this->widget->pack_start($this->combo); }
/** * Class Constructor * @param $name widget's name */ function __construct($name) { parent::__construct($name); $this->widget = new GtkFrame(); parent::add($this->widget); $this->container = new GtkVBox(); $this->initialItems = array(); $this->items = array(); $targets = array(array('text/plain', 0, -1)); $this->widget->connect('drag_data_received', array($this, 'onDataReceived')); $this->widget->drag_dest_set(Gtk::DEST_DEFAULT_ALL, $targets, Gdk::ACTION_COPY); $scroll = new GtkScrolledWindow(); $scroll->set_border_width(4); $this->widget->add($scroll); $hbox = new GtkHBox(); $scroll->add_with_viewport($hbox); $hbox->pack_start($this->container, TRUE, TRUE); $hbox->set_border_width(20); parent::show_all(); }
/** * Class Constructor * @param $name widget's name */ function __construct($name) { parent::__construct($name); $this->widget = new GtkScrolledWindow(); $this->widget->set_policy(GTK::POLICY_AUTOMATIC, GTK::POLICY_ALWAYS); parent::add($this->widget); $this->tree = new GtkTreeView(); $this->tree->connect_simple('select-cursor-row', array($this, 'onPreExecuteExitAction')); $this->tree->connect_simple('button-press-event', array($this, 'onPreExecuteExitAction')); $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING); $this->tree->set_model($this->model); $this->tree->set_headers_visible(FALSE); $this->tree->set_rubber_banding(TRUE); $this->tree->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); $column = new GtkTreeViewColumn(); $cell_renderer = new GtkCellRendererText(); $column->pack_start($cell_renderer, true); $column->add_attribute($cell_renderer, 'text', 1); $this->tree->append_column($column); $this->widget->add($this->tree); parent::show_all(); }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); self::$counter++; $this->id = 'tspinner_' . uniqid(); }
public function __construct($name) { parent::__construct($name); $this->height = 25; }
/** * Class Constructor * @param $name Name of the widget */ public function __construct($name) { parent::__construct($name); $this->widget = new GtkButton(); parent::add($this->widget); }
/** * Class Constructor * @param $name name of the field */ public function __construct($name) { parent::__construct($name); $this->numericMask = FALSE; }