/** * Shows the HBox */ public function show() { $children = parent::get_children(); if ($children) { foreach ($children as $child) { // show child object $child->show(); } } parent::show_all(); }
/** * @name __construct($widget) * @param GtkWidget $widget Widget para colocar dentro do FFWViewPort * @return GtkHBox */ public function __construct($widget) { parent::__construct(); // Cria o frame para criação da borda $this->__widgets['frame'] = new GtkFrame(); // Cria o scrolledwindow para criação dos scrools $this->__widgets['scrolled'] = new GtkScrolledWindow(); // Adiciona o scrolled dentro do frame $this->__widgets['frame']->add($this->__widgets['scrolled']); // Adiciona o widget ao scrolledwindow $this->__widgets['scrolled']->add($widget); // Configura os scrolls como automatico $this->__widgets['scrolled']->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); // Adiciona o frame ao GtkHBox parent::pack_start($this->__widgets['frame']); parent::show_all(); }
/** * Class Constructor * @param $name = Name of the column in the database * @param $label = Text label that will be shown in the header * @param $align = Column align (left, center, right) * @param $width = Column Width (pixels) */ public function __construct($name, $label, $align, $width = NULL) { $this->name = $name; $this->label = $label; $this->align = $align; $this->width = (int) $width; if ($align == 'left') { $alignment = 0.0; } else { if ($align == 'center') { $alignment = 0.5; } else { if ($align == 'right') { $alignment = 1.0; } } } parent::__construct(); $this->renderer = new GtkCellRendererText(); if ($width) { $this->renderer->set_property('width', $width); parent::set_fixed_width($width); } $this->renderer->set_property('xalign', $alignment); parent::pack_start($this->renderer, true); parent::set_alignment($alignment); parent::set_title($label); $header_hbox = new GtkHBox(); $header_label = new GtkLabel($this->label); $header_hbox->pack_start($header_label); $this->sort_up = GtkImage::new_from_stock(GTK::STOCK_GO_UP, Gtk::ICON_SIZE_MENU); $this->sort_down = GtkImage::new_from_stock(GTK::STOCK_GO_DOWN, Gtk::ICON_SIZE_MENU); $header_hbox->pack_start($this->sort_up); $header_hbox->pack_start($this->sort_down); $header_hbox->show_all(); // hide the ordering images $this->sort_up->hide(); $this->sort_down->hide(); parent::set_widget($header_hbox); }
function append($page) { $this->remove_background(); $page->Parent = $this; $page->Owner = $this->Owner; // Icone + Rotulo $guide = new GtkHBox(); if ($page->Icon) { $guide->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $page->Icon), false); } $guide->pack_start(new GtkLabel(' ' . $page->Title . ' ')); // Fechar $guide->pack_start($close = new GtkButton()); $close->set_image(GtkImage::new_from_stock(Gtk::STOCK_CLOSE, Gtk::ICON_SIZE_BUTTON)); $guide->show_all(); // Guia $menu_item = new GtkHBox(); if ($page->Icon) { $menu_item->pack_start(GtkImage::new_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $page->Icon), false); } $menu_item->pack_start(new GtkLabel(' ' . $page->Title . ' ')); $menu_item->show_all(); $scroll = new GtkScrolledWindow(); $scroll->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); $scroll->add_with_viewport($page); $scroll->show_all(); $current = $this->append_page_menu($scroll, $guide, $menu_item); $this->set_current_page($current); // Close signal if ($this->background) { $close->connect('clicked', array($this, 'xmoney_close_clicked'), $current); } else { $close->connect('clicked', array($this, 'close_button'), $current); } return $current; }