Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 function __construct($toba_instalador)
 {
     $this->toba_instalador = $toba_instalador;
     $archivo = dirname(__FILE__) . '/toba.glade';
     $glade = new GladeXML($archivo, 'dlg_crear_instancia');
     foreach (self::$comp_req as $comp) {
         $this->comp[$comp] = $glade->get_widget($comp);
     }
     $glade->signal_autoconnect_instance($this);
     //---Bases disponibles
     $store = new GtkListStore(Gtk::TYPE_STRING);
     $instalacion = $this->toba_instalador->get_instalacion();
     foreach ($instalacion->get_lista_bases() as $db) {
         $param = $instalacion->get_parametros_base($db);
         $store->append(array($db));
     }
     $this->comp['combo_base']->set_model($store);
     $cellRenderer = new GtkCellRendererText();
     $this->comp['combo_base']->pack_start($cellRenderer);
     $this->comp['combo_base']->set_active(0);
     //--- Pone los proyectos
     $proyectos = toba_modelo_proyecto::get_lista();
     foreach ($proyectos as $path => $id) {
         $label = $path == $id ? $id : "{$id} (Directorio {$path})";
         $check = new GtkCheckButton($label);
         $check->set_use_underline(false);
         $this->check_proyectos[] = array($id, $path, $check);
         $check->show();
         $this->comp['box_proyectos']->pack_start($check);
     }
 }