Ejemplo n.º 1
0
 function __create_box()
 {
     $box = new GtkVBox();
     $box->pack_start(new GtkLabel('Double click with the mouse on a file, or select by key and press return'), false);
     $paned = new GtkHPaned();
     $paned->set_position(200);
     //filename, markup-filename, fullpath, is_dir, preview image
     $mFile = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING, GObject::TYPE_STRING, GObject::TYPE_BOOLEAN, GdkPixbuf::gtype);
     $mFile->set_sort_column_id(0, Gtk::SORT_ASCENDING);
     $vFile = new GtkTreeView($mFile);
     $col = new GtkTreeViewColumn('Image', new GtkCellRendererPixbuf(), 'pixbuf', 4);
     $text = new GtkCellRendererText();
     $col->pack_start($text);
     $col->add_attribute($text, 'markup', 1);
     $vFile->append_column($col);
     $vFile->set_headers_visible(false);
     $vFile->connect('key-press-event', array($this, 'onPressFile'));
     $vFile->connect('button-press-event', array($this, 'onPressFile'));
     /*
         GtkIconView has some problems with text that are too long
           and missing icons
             $vFile = new GtkIconView();
             $vFile->set_model($mFile);
             $vFile->set_columns(1);
             $vFile->set_pixbuf_column(3);
             $vFile->set_text_column(0);
             $vFile->set_item_width(100);
     */
     $this->loadFiles($mFile, getcwd());
     $scrwndFiles = new GtkScrolledWindow();
     $scrwndFiles->add($vFile);
     $scrwndFiles->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
     $vboxFile = new GtkVBox();
     $vboxFile->pack_start($scrwndFiles);
     $chkImg = new GtkCheckbutton('Load preview images');
     $chkImg->set_active(true);
     $chkImg->connect('toggled', array($this, 'onCheckPreview'));
     $vboxFile->pack_start($chkImg, false);
     $paned->add1($vboxFile);
     $this->img = new GtkImage();
     $scrwndImg = new GtkScrolledWindow();
     $scrwndImg->add_with_viewport($this->img);
     $scrwndImg->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
     $paned->add2($scrwndImg);
     $box->pack_end($paned);
     return $box;
 }
Ejemplo n.º 2
0
 function __construct($parent = null)
 {
     parent::__construct();
     if ($parent) {
         $this->set_screen($parent->get_screen());
     } else {
         $this->connect_simple('destroy', array('gtk', 'main_quit'));
     }
     $this->set_title("Pomm");
     $this->set_position(Gtk::WIN_POS_CENTER);
     $this->set_default_size(850 + 100, 600 + 50);
     $this->set_border_width(0);
     $this->set_resizable(false);
     $pin = new GtkHPaned();
     $pin->set_position(784);
     $vbox = new GtkVBox(false, 5);
     $this->add($vbox);
     $vbox->set_border_width(5);
     $pin->add1($this->__create_box());
     $pin->add2($this->__create_dbox());
     $vbox->pack_start($pin);
     $button = new GtkButton('Update');
     $button->connect('clicked', array($this, '__update'));
     $button2 = new GtkButton('Filter');
     $button2->connect('clicked', array($this, 'string_find'));
     $button3 = new GtkButton("LIST");
     $button3->connect('clicked', array($this, 'set_mode_stat'));
     $bbox = new GtkHBox(false, 5);
     $bbox->pack_start($button);
     $bbox->pack_start($button2);
     $bbox->pack_start($button3);
     $this->sinfo = new GtkLabel();
     $this->sinfo->set_markup('x:0 y:0 obj:0');
     $paned = new GtkHPaned();
     $paned->set_position(65 * 3);
     $paned->add1($bbox);
     $paned->add2($this->sinfo);
     $vbox->pack_end($paned, false, false, 0);
     //$this->set_icon_from_file("./img/4-1.gif");
     $this->show_all();
 }
Ejemplo n.º 3
0
 function __construct($parent = null)
 {
     parent::__construct();
     /**
      * Do I really need this?
      */
     if ($parent) {
         $this->set_screen($parent->get_screen());
     } else {
         $this->connect_simple('destroy', array('gtk', 'main_quit'));
     }
     $this->set_title(__CLASS__);
     $this->set_position(Gtk::WIN_POS_CENTER);
     $this->set_default_size(-1, 500);
     $this->set_border_width(8);
     $hpaned = new GtkHPaned();
     $this->frame1 = new GtkFrame(null);
     $this->frame2 = new GtkFrame(null);
     $hpaned->add1($this->frame1);
     $hpaned->add2($this->frame2);
     $this->frame1->set_shadow_type(Gtk::SHADOW_IN);
     $this->frame2->set_shadow_type(Gtk::SHADOW_IN);
     $this->scrolled = new GtkScrolledWindow(null, null);
     $this->scrolled->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
     $this->view = new GtkTreeView();
     /*
         Allow multiple selections?
         $selection = $view->get_selection();
         $selection->set_mode(Gtk::SELECTION_MULTIPLE);
     */
     // Registar Events
     $veiw_selection = $this->view->get_selection();
     $veiw_selection->connect('changed', array($this, 'changed'));
     $this->view->connect('row_expanded', array($this, 'click_section'));
     $this->connect('destroy', array($this, 'main_quit'));
     $this->setup_treeview($this->view);
     $this->scrolled->add_with_viewport($this->view);
     $this->frame1->add($this->scrolled);
     $this->add($hpaned);
     $this->show_all();
 }
Ejemplo n.º 4
0
 function __construct()
 {
     parent::__construct(XMONEY_TITULO . ' - ' . XMONEY_DESCRICAO . ' - ' . XMONEY_DESC_VERSAO, 800, 600, 'logo.png');
     $this->connect('delete_event', array($this, delete_event));
     // Painel
     $this->pack_start($hpaned = new GtkHPaned());
     $hpaned->pack1($this->painel = new TPainel($this), false, true);
     // Notebook
     $hpaned->pack2($this->notebook = new TNotebook($this), true, true);
     // status
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($filial = new GtkLabel());
     $filial->set_markup('<b> Filial: </b>' . $GLOBALS['Filial']);
     $hbox->pack_start($usuario = new GtkLabel());
     $usuario->set_markup('<b>' . latin1(' Usuário: ') . '</b>' . $GLOBALS['Usuario']);
     $hbox->pack_start($nome = new GtkLabel());
     $nome->set_markup('<b> Nome: </b>' . $GLOBALS['Nome']);
     $hbox->pack_start($this->data = new GtkLabel());
     $this->children_show_all();
     Gtk::timeout_add(1000, array($this, 'data_timeout'));
     define('XMONEY_JANELA_PRINCIPAL', $this);
 }