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);
     }
 }
Example #2
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;
 }
Example #3
0
function setup_checkbox($label)
{
    $checkbox = new GtkCheckButton($label);
    // note 1
    $checkbox->connect('toggled', "on_toggle");
    // note 2
    return $checkbox;
}
Example #4
0
 function __construct($Parent, $operacao = 'i', $CodPerfil = null)
 {
     parent::__construct($operacao == 'i' ? 'Perfis - Incluir' : 'Perfis - Alterar', 800, 600, 'perfis.png');
     $this->Parent = $Parent;
     $this->operacao = $operacao;
     $this->CodPerfil = $CodPerfil;
     $GLOBALS['XMONEY_FIELD'] = 'Cod_S_Perfil';
     $GLOBALS['XMONEY_FIELD_ID'] = $CodPerfil ? $CodPerfil : -1;
     // Id
     $this->pack_start($hbox = new GtkHBox(), false);
     if ($operacao == 'a') {
         $hbox->pack_start($id = new GtkLabel(), false);
         $id->set_markup(' Id.: <b>' . $CodPerfil . '</b>');
     }
     // nome
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(new GtkLabel(' Nome: '), false);
     $hbox->pack_start($this->nome = new AEntry(true, true, 'Tb_Perfis', 'Nome'));
     // descricao
     $hbox->pack_start(new GtkLabel(latin1(' Descrição: ')), false);
     $hbox->pack_start($this->descricao = new AEntry(true, true, 'Tb_Perfis', 'Descricao'));
     // Expandir e Sel. Todos
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($this->expandir = new GtkCheckButton('Expandir'), false);
     $this->expandir->connect('toggled', array($this, 'expandir_toggled'));
     $hbox->pack_start($check = new GtkCheckButton('Sel. Todos'), false);
     $check->connect('toggled', array($this, 'sel_todos_toggled'));
     // progresso
     $hbox->pack_start($this->progresso = new GtkProgressBar());
     // Permissoes
     $this->pack_start($frame = new GtkFrame(latin1(' Permissões ')));
     $frame->set_border_width(5);
     $frame->add($scroll_wnd = new GtkScrolledWindow());
     $scroll_wnd->set_border_width(5);
     $scroll_wnd->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     $scroll_wnd->add_with_viewport($this->lista = new GtkVBox());
     // 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->nome->set_focus();
 }
Example #5
0
 /**
  * Define if the widget is editable
  * @param $boolean A boolean
  */
 public function setEditable($editable)
 {
     parent::set_sensitive($editable);
 }