Exemple #1
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkColorButton();
     parent::add($this->widget);
     $this->setSize(200);
 }
Exemple #2
0
 /**
  * Class Constructor
  * @param $name Name of the widget
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkFileChooserButton(AdiantiCoreTranslator::translate('Open'), GTK::FILE_CHOOSER_ACTION_OPEN);
     parent::add($this->widget);
     $this->setSize(200);
 }
 /**
  * Class Constructor
  * @param $name Widet's name
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = 'THtmlEditor_' . uniqid();
     // creates a tag
     $this->tag = new TElement('div');
 }
Exemple #4
0
 /**
  * Class Constructor
  * @param $name Widet's name
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = 'THtmlEditor_' . mt_rand(1000000000, 1999999999);
     // creates a tag
     $this->tag = new TElement('textarea');
 }
Exemple #5
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = $this->name . '_' . mt_rand(1000000000, 1999999999);
     $this->height = 25;
     $this->uploaderClass = 'AdiantiUploaderService';
 }
 /**
  * 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 Field Name
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkEntry();
     parent::add($this->widget);
     $this->setSize(200);
     $this->widget->set_visibility(FALSE);
 }
 /**
  * Class Constructor
  * @param $name Name of the widget
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkHBox();
     $this->widget->set_border_width(0);
     parent::add($this->widget);
     $this->setLayout('vertical');
 }
Exemple #9
0
 /**
  * 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;
 }
Exemple #10
0
 /**
  * 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'));
 }
Exemple #11
0
 /**
  * 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(AdiantiCoreTranslator::translate('January'), AdiantiCoreTranslator::translate('February'), AdiantiCoreTranslator::translate('March'), AdiantiCoreTranslator::translate('April'), AdiantiCoreTranslator::translate('May'), AdiantiCoreTranslator::translate('June'), AdiantiCoreTranslator::translate('July'), AdiantiCoreTranslator::translate('August'), AdiantiCoreTranslator::translate('September'), AdiantiCoreTranslator::translate('October'), AdiantiCoreTranslator::translate('November'), AdiantiCoreTranslator::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(AdiantiCoreTranslator::translate('Today'));
     $bt_close = new GtkButton(AdiantiCoreTranslator::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);
 }
Exemple #12
0
 /**
  * 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);
 }
Exemple #13
0
 /**
  * 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);
 }
Exemple #14
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = GtkComboBox::new_text();
     parent::add($this->widget);
     $this->defaultOption = '';
     // create the combo model
     $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING);
     $this->widget->set_model($this->model);
     $this->setSize(200);
 }
Exemple #15
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 public function __construct($name)
 {
     // executes the parent class constructor
     parent::__construct($name);
     $this->id = 'tcombo_' . mt_rand(1000000000, 1999999999);
     $this->defaultOption = '';
     // creates a <select> tag
     $this->tag = new TElement('select');
     $this->tag->{'class'} = 'tcombo';
     // CSS
 }
Exemple #16
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 public function __construct($name)
 {
     // executes the parent class constructor
     parent::__construct($name);
     $this->id = 'tsortlist_' . mt_rand(1000000000, 1999999999);
     $this->initialItems = array();
     $this->items = array();
     // creates a <ul> tag
     $this->tag = new TElement('ul');
     $this->tag->{'class'} = 'tsortlist';
     $this->tag->{'itemname'} = $name;
 }
Exemple #17
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 public function __construct($name)
 {
     // executes the parent class constructor
     parent::__construct($name);
     $this->id = 'tselect_' . uniqid();
     $this->defaultOption = '';
     // creates a <select> tag
     $this->tag = new TElement('select');
     $this->tag->{'class'} = 'tcombo';
     // CSS
     $this->tag->{'multiple'} = '1';
 }
 /**
  * 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
  * @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
  */
 public function __construct($name)
 {
     // executes the parent class constructor
     parent::__construct($name);
     $this->id = 'tmultisearch' . uniqid();
     $this->height = 100;
     $this->minLength = 5;
     $this->maxSize = 0;
     if (LANG !== 'en') {
         TPage::include_js('lib/adianti/include/tmultisearch/select2_locale_' . LANG . '.js');
     }
     // creates a <select> tag
     $this->tag = new TElement('input');
     $this->tag->{'type'} = 'hidden';
     $this->tag->{'component'} = 'multisearch';
 }
 /**
  * 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);
 }
Exemple #22
0
 /**
  * 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();
 }
Exemple #23
0
 /**
  * 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();
 }
Exemple #24
0
 /**
  * Class Constructor
  * @param  $name name of the field
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->numericMask = FALSE;
     $this->replaceOnPost = FALSE;
 }
Exemple #25
0
 /**
  * Class Constructor
  * @param $name Name of the widget
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = 'tspinner_' . mt_rand(1000000000, 1999999999);
 }
Exemple #26
0
 /**
  * Class Constructor
  * @param  $name name of the field
  */
 public function __construct($name)
 {
     parent::__construct($name);
     parent::setSize(NULL);
 }
Exemple #27
0
 /**
  * Class Constructor
  * @param $name Name of the widget
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkButton();
     parent::add($this->widget);
 }
Exemple #28
0
 /**
  * Class Constructor
  * @param $name Name of the widget
  */
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = 'tslider_' . uniqid();
 }
Exemple #29
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->id = $this->name . '_' . uniqid();
     $this->height = 25;
 }