public function __construct() { parent::__construct(); $dbi = new DBInterface(); $this->strings = KioskClient::getStrings(); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(300, 200); $this->set_resizable(false); $this->timeLabel = new GtkLabel($this->strings["timeLeftLabel_begin"] . '0' . $this->strings["timeLeftLabel_end"]); $this->set_title($this->strings["windowTitle_begin"] . '0' . $this->strings["windowTitle_end"]); $this->logoutButton = new GtkButton($this->strings['logoutButton']); $this->pauseButton = new GtkButton($this->strings['pauseButton']); $box = new GtkVBox(); $box->pack_start($this->timeLabel); if ($dbi->getSetting('max_pause_time')) { $box->pack_start($this->pauseButton); } $box->pack_start($this->logoutButton); # if ( DEBUG ) { # $this->quitButton = new GtkButton("Quit"); # $box->pack_start( $this->quitButton ); # } # $this->connect_simple( 'destroy', array('Gtk', 'main_quit') ); $this->add($box); }
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(__CLASS__); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(-1, 500); $this->set_border_width(8); $hbox = new GtkHBox(false, 8); $this->add($hbox); $scrolled = new GtkScrolledWindow(); $scrolled->set_shadow_type(Gtk::SHADOW_ETCHED_IN); $scrolled->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); $hbox->pack_start($scrolled, false, false, 0); $model = $this->create_model(); $treeview = new GtkTreeView($model); $scrolled->add($treeview); $column = new GtkTreeViewColumn(); $column->set_title('Icon and Constant'); $cell_renderer = new GtkCellRendererPixbuf(); $column->pack_start($cell_renderer, false); $column->set_attributes($cell_renderer, 'stock-id', 1); $cell_renderer = new GtkCellRendererText(); $column->pack_start($cell_renderer, true); $column->set_cell_data_func($cell_renderer, 'constant_setter'); $treeview->append_column($column); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'Label', $cell_renderer, 'label_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'Accelerator', $cell_renderer, 'accel_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->insert_column_with_data_func(-1, 'ID', $cell_renderer, 'id_setter'); $align = new GtkAlignment(0.5, 0, 0, 0); $hbox->pack_end($align, true, true, 0); $frame = new GtkFrame('Selection Info'); $align->add($frame); $vbox = new GtkVBox(false, 8); $vbox->set_border_width(4); $frame->add($vbox); $display = new StockItemDisplay(); $treeview->set_data('stock-display', $display); $display->type_label = new GtkLabel(); $display->constant_label = new GtkLabel(); $display->id_label = new GtkLabel(); $display->accel_label = new GtkLabel(); $display->icon_image = new GtkImage(); $vbox->pack_start($display->type_label, false, false, 0); $vbox->pack_start($display->icon_image, false, false, 0); $vbox->pack_start($display->accel_label, false, false, 0); $vbox->pack_start($display->constant_label, false, false, 0); $vbox->pack_start($display->id_label, false, false, 0); $selection = $treeview->get_selection(); $selection->set_mode(Gtk::SELECTION_SINGLE); $selection->connect('changed', array($this, 'on_selection_changed')); $this->show_all(); }
/** * Constructor Method */ function __construct() { parent::__construct(); parent::set_size_request(840, 640); parent::set_position(GTK::WIN_POS_CENTER); parent::connect_simple('delete-event', array($this, 'onClose')); parent::connect_simple('destroy', array('Gtk', 'main_quit')); parent::set_title(self::APP_TITLE); parent::set_icon(GdkPixbuf::new_from_file('favicon.png')); $gtk = GtkSettings::get_default(); $gtk->set_long_property("gtk-button-images", TRUE, 0); $gtk->set_long_property("gtk-menu-images", TRUE, 0); self::$inst = $this; $ini = parse_ini_file('application.ini'); $lang = $ini['language']; TAdiantiCoreTranslator::setLanguage($lang); TApplicationTranslator::setLanguage($lang); date_default_timezone_set($ini['timezone']); $this->content = new GtkFixed(); $vbox = new GtkVBox(); parent::add($vbox); $vbox->pack_start(GtkImage::new_from_file('app/images/pageheader-gtk.png'), false, false); $MenuBar = TMenuBar::newFromXML('menu.xml'); $vbox->pack_start($MenuBar, false, false); $vbox->pack_start($this->content, true, true); parent::show_all(); }
/** * Class Constructor * @param $title Window's title */ public function __construct($title = '') { parent::__construct(); parent::set_position(Gtk::WIN_POS_CENTER); parent::connect('key_press_event', array($this, 'onKeyTest')); parent::connect_simple('destroy', array($this, 'onClose')); parent::set_title($title); }
function __construct() { parent::__construct(); require_once 'WidgetEditor.php'; $this->set_default_size(200, 200); $this->set_title('GtkWindow demo'); $this->connect_simple('destroy', array('gtk', 'main_quit')); $this->add($this->__create_box()); $this->show_all(); }
public function __construct() { parent::__construct(); parent::set_title('Incluir'); parent::connect_simple('destroy', array('Gtk', 'main_quit')); parent::set_default_size(400, 240); parent::set_border_width(10); parent::set_position(GTK::WIN_POS_CENTER); $vbox = new GtkVBox(); $this->labels['id'] = new GtkLabel('Código:'); $this->campos['id'] = new GtkEntry(); $this->campos['id']->set_size_request(80, -1); $this->labels['nome'] = new GtkLabel('Nome: '); $this->campos['nome'] = new GtkEntry(); $this->campos['nome']->set_size_request(240, -1); $this->labels['endereco'] = new GtkLabel('Endereço: '); $this->campos['endereco'] = new GtkEntry(); $this->campos['endereco']->set_size_request(240, -1); $this->labels['telefone'] = new GtkLabel('Telefone: '); $this->campos['telefone'] = new GtkEntry(); $this->campos['telefone']->set_size_request(140, -1); $this->labels['id_cidade'] = new GtkLabel('Cidade: '); $this->campos['id_cidade'] = GtkComboBox::new_text(); $this->campos['id_cidade']->set_size_request(240, -1); $this->campos['id_cidade']->insert_text(0, 'Porto Alegre'); $this->campos['id_cidade']->insert_text(1, 'São Paulo'); $this->campos['id_cidade']->insert_text(2, 'Rio de Janeiro'); $this->campos['id_cidade']->insert_text(3, 'Belo Horizonte'); foreach ($this->campos as $chave => $objeto) { $hbox = new GtkHBox(); $hbox->pack_start($this->labels[$chave], false, false); $hbox->pack_start($this->campos[$chave], false, false); $this->labels[$chave]->set_size_request(100, -1); $this->labels[$chave]->set_alignment(1, 0.5); // xAlign, yalign (0.5, 1) $vbox->pack_start($hbox, false, false); } $vbox->pack_start(new GtkHSeparator(), true, true); // cria uma caixa de botões $buttonbox = new GtkHButtonBox(); $buttonbox->set_layout(Gtk::BUTTONBOX_START); // cria um botão de salvar $botao = GtkButton::new_from_stock(Gtk::STOCK_SAVE); // conecta o botão ao método onSaveClick() $botao->connect_simple('clicked', array($this, 'onSaveClick')); $buttonbox->pack_start($botao, false, false); // cria um botão de fechar a aplicação $botao = GtkButton::new_from_stock(Gtk::STOCK_CLOSE); $botao->connect_simple('clicked', array('Gtk', 'main_quit')); $buttonbox->pack_start($botao, false, false); $vbox->pack_start($buttonbox, false, false); parent::add($vbox); // exibe a janela parent::show_all(); }
function __construct($widget, $data) { parent::__construct(); $this->set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY); $this->set_title('WidgetEditor'); $this->table = new GtkTable(count($data), 2, false); foreach ($data as $nPos => $dat) { $this->addEditor($widget, $nPos, $dat); } $this->add($this->table); $this->show_all(); }
function __construct() { parent::__construct(); require_once 'WidgetEditor.php'; if (@$GLOBALS['framework']) { return; } $this->set_default_size(700, 300); $this->set_title('GtkIconView'); $this->connect_simple('destroy', array('gtk', 'main_quit')); $this->add($this->__create_box()); $this->show_all(); }
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(__CLASS__); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(-1, 500); $this->set_border_width(8); $hbox = new GtkHBox(false, 8); $this->add($hbox); $scrolled = new GtkScrolledWindow(); $scrolled->set_shadow_type(Gtk::SHADOW_ETCHED_IN); $scrolled->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); $hbox->pack_start($scrolled, false, false, 0); $this->list = new GtkListStore(Gtk::TYPE_STRING, GdkPixbuf::gtype, GdkPixbuf::gtype, Gtk::TYPE_LONG, Gtk::TYPE_LONG, Gtk::TYPE_STRING); $treeview = new GtkTreeView($this->list); $scrolled->add($treeview); $column = new GtkTreeViewColumn(); //$column->set_title('Name'); $cell_renderer = new GtkCellRendererText(); //$treeview->insert_column_with_data_func(-1, 'Name', $cell_renderer, 'smart_setter'); $treeview->append_column(new GtkTreeViewColumn('Name', $cell_renderer, 'text', 0)); $cell_renderer = new GtkCellRendererPixbuf(); $treeview->append_column(new GtkTreeViewColumn('Race', $cell_renderer, 'pixbuf', 1)); //$treeview->insert_column_with_data_func(-1, 'Race', $cell_renderer, 'smart_setter'); $cell_renderer = new GtkCellRendererPixbuf(); $treeview->append_column(new GtkTreeViewColumn('Class', $cell_renderer, 'pixbuf', 2)); //$treeview->insert_column_with_data_func(-1, 'Class', $cell_renderer, 'smart_setter'); $cell_renderer = new GtkCellRendererText(); //$treeview->insert_column_with_data_func(-1, 'Zone', $cell_renderer, 'smart_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->append_column(new GtkTreeViewColumn('Level', $cell_renderer, 'text', 3)); //$treeview->insert_column_with_data_func(-1, 'LEVEL', $cell_renderer, 'smart_setter'); $cell_renderer = new GtkCellRendererText(); $treeview->append_column(new GtkTreeViewColumn('Ping', $cell_renderer, 'text', 4)); //$treeview->insert_column_with_data_func(-1, 'PING', $cell_renderer, 'smart_setter'); $treeview->append_column(new GtkTreeViewColumn('Zone', $cell_renderer, 'text', 5)); $align = new GtkAlignment(0.5, 0, 0, 0); $hbox->pack_end($align, true, true, 0); $selection = $treeview->get_selection(); $selection->set_mode(Gtk::SELECTION_SINGLE); //$selection->connect('changed', array($this, 'on_selection_changed')); $treeview->connect('key-press-event', array($this, 'on_selection_changed')); $treeview->connect('button-press-event', array($this, 'on_selection_changed')); $this->show_all(); }
/** * Constructor Method */ function __construct() { parent::__construct(); parent::set_size_request(840, 640); parent::set_position(GTK::WIN_POS_CENTER); parent::connect_simple('delete-event', array($this, 'onClose')); parent::connect_simple('destroy', array('Gtk', 'main_quit')); parent::set_title(self::APP_TITLE); parent::set_icon(GdkPixbuf::new_from_file('favicon.png')); $gtk = GtkSettings::get_default(); $gtk->set_long_property("gtk-button-images", TRUE, 0); $gtk->set_long_property("gtk-menu-images", TRUE, 0); self::$inst = $this; set_error_handler(array('TCoreApplication', 'errorHandler')); }
function __construct($parent = null) { parent::__construct(); if (@$GLOBALS['framework']) { return; } 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_border_width(8); $this->add($this->__create_box()); $this->show_all(); }
public function __construct($message) { parent::__construct(); $this->strings = KioskClient::getStrings(); $this->set_default_size(300, 200); $this->set_resizable(false); $this->set_keep_above(true); $this->set_title("Message: {$message}"); $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_markup($this->strings["message_begin"] . $message . $this->strings["message_end"]); $this->set_title($message); $hbox = new GtkHBox(); $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); $hbox->pack_start($stock, 0, 0); $hbox->pack_start($this->messageLabel); $this->add($hbox); $this->show_all(); }
function __construct() { parent::__construct(); $this->connect_simple('destroy', array('gtk', 'main_quit')); $this->set_title('PHP-Gtk2 Demos'); $this->set_default_size(800, 400); $hbox = new GtkHBox(false, 3); $this->add($hbox); $treeview = $this->__create_treeview(); $hbox->pack_start($treeview, false, false); $notebook = new GtkNotebook(); $hbox->pack_start($notebook, true); $notebook->append_page($this->__create_text(), new GtkLabel('Info')); $demobox = new GtkVBox(); $this->demobox = $demobox; $notebook->append_page($this->demobox, new GtkLabel('Demo')); list($text, $this->sourcebuffer) = $this->__create_source(); $notebook->append_page($text, new GtkLabel('Source')); $this->show_all(); }
function __construct($titulo, $width, $height, $icone) { parent::__construct(); $this->set_transient_for($GLOBALS['XMONEY_JANELA_PRINCIPAL']); $this->set_modal(true); $this->set_title($titulo); $this->set_border_width(5); if ($width && $height) { $this->set_default_size($width, $height); } else { $this->set_resizable(false); } $this->set_position(Gtk::WIN_POS_CENTER); $this->set_icon_from_file(XMONEY_IMAGES . DIRECTORY_SEPARATOR . $icone); // accelgroup $this->add_accel_group($this->accel_group = new GtkAccelGroup()); // default_container $this->add($this->main_vbox = new GtkVBox()); $this->main_vbox->show(); }
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(); }
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(); }
public function __construct($username) { parent::__construct(); $this->username = $username; $this->strings = KioskClient::getStrings(); # $this->set_default_size( 300, 200 ); $this->set_resizable(false); $this->set_modal(true); $this->set_keep_above(true); $this->set_title($this->strings['setPassword']); $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_markup($this->strings['setPassword']); $passwordLabel1 = new GtkLabel(); $passwordLabel1->set_use_markup(true); $passwordLabel1->set_label($this->strings['passwordLabel']); $this->passwordEntry1 = new GtkEntry(); $this->passwordEntry1->set_visibility(0); $passwordBox1 = new GtkHBox(); $passwordBox1->pack_start($passwordLabel1); $passwordBox1->pack_start($this->passwordEntry1); $passwordLabel2 = new GtkLabel(); $passwordLabel2->set_use_markup(true); $passwordLabel2->set_label($this->strings['passwordLabel']); $this->passwordEntry2 = new GtkEntry(); $this->passwordEntry2->set_visibility(0); $passwordBox2 = new GtkHBox(); $passwordBox2->pack_start($passwordLabel2); $passwordBox2->pack_start($this->passwordEntry2); $this->setPasswordButton = new GtkButton($this->strings['setPasswordButton']); $mainBox = new GtkVBox(); $mainBox->pack_start($this->messageLabel); $mainBox->pack_start($passwordBox1); $mainBox->pack_start($passwordBox2); $mainBox->pack_start($this->setPasswordButton); $this->add($mainBox); $this->connect('key-press-event', array(&$this, 'onKey'), $input); $this->setPasswordButton->connect_simple('clicked', array(&$this, 'onClick')); $this->show_all(); }
function __construct($parent = null) { parent::__construct(); $this->selected_file = ""; $this->hash_label_default = "Open a file (Ctrl+O) OR Type a sentence (Ctrl+T)"; $this->set_size_request(400, 60); $this->connect_simple('destroy', array('gtk', 'main_quit')); $this->set_title(__CLASS__); $this->set_position(Gtk::WIN_POS_CENTER); $this->add($vbox = new GtkVBox()); $accel_group = new GtkAccelGroup(); $this->add_accel_group($accel_group); $menu_definition = array('_File' => array('_Open|O', '_Type|T', '<hr>', 'E_xit'), '_Help' => array('_About|H')); // define menu definition $this->menu = new Menu($vbox, $menu_definition, $accel_group); // display title $button = new GtkButton('_Get Hash'); $button->connect('clicked', array($this, 'calculate')); $this->hash_label = new GtkLabel($this->hash_label_default); $vbox->pack_start($hbox = new GtkHBox()); $hbox->pack_start($this->hash_label); $hbox->pack_start($button, false, false, 0); $this->show_all(); }
public function __construct($status = null) { if (DEBUG) { echo "LoginWindow::__construct( \$status = {$status} )\n"; } parent::__construct(); $this->strings = KioskClient::getStrings(); $this->status = $status; $screen = GdkScreen::get_default(); $screenWidth = $screen->get_width(); $screenHeight = $screen->get_height(); $this->set_decorated(1); $this->set_default_size(800, 600); ##Temporary Changed for testing ($screenWidth, $screenHeight) #$this->fullscreen(); $this->set_keep_above(0); $this->set_modal(1); $messageBox = new GtkHBox(); $this->loginBox = new GtkVBox(); $this->errorBox = new GtkVBox(); $usernameBox = new GtkHBox(); $passwordBox = new GtkHBox(); ## Build the login box $this->messageLabel = new GtkLabel(); $this->messageLabel->set_use_markup(true); $this->messageLabel->set_label($this->strings['promptLabel']); $usernameLabel = new GtkLabel(); $usernameLabel->set_use_markup(true); $usernameLabel->set_label($this->strings['usernameLabel']); $this->usernameEntry = new GtkEntry(); $passwordLabel = new GtkLabel(); $passwordLabel->set_use_markup(true); $passwordLabel->set_label($this->strings['passwordLabel']); $this->passwordEntry = new GtkEntry(); $this->passwordEntry->set_visibility(0); $this->loginButton = new GtkButton($this->strings['loginButton']); $messageBox->pack_start($this->messageLabel); $usernameBox->pack_start($usernameLabel); $usernameBox->pack_start($this->usernameEntry); $passwordBox->pack_start($passwordLabel); $passwordBox->pack_start($this->passwordEntry); $this->loginBox->pack_start($messageBox); $this->loginBox->pack_start($usernameBox); $this->loginBox->pack_start($passwordBox); $this->loginBox->pack_start($this->loginButton); ## Build the error message box $this->errorLabel = new GtkLabel(); $this->errorLabel->set_use_markup(true); $this->errorLabel->set_label('Error : Username and Password Do Not Match'); $errorLabelBox = new GtkHBox(); $errorLabelBox->pack_start($this->errorLabel); $this->errorButton = new GtkButton('OK'); $errorButtonBox = new GtkHBox(); $errorButtonBox->pack_start($this->errorButton); $this->errorBox->pack_start($errorLabelBox); $this->errorBox->pack_start($errorButtonBox); if (DEBUG) { $this->quitButton = new GtkButton("Quit"); $this->loginBox->pack_start($this->quitButton); } $this->connect_simple('destroy', array('Gtk', 'main_quit')); $centerHBox = new GtkHBox(); $centerVBox = new GtkVBox(); $leftBox = new GtkHBox(); $rightBox = new GtkHBox(); $topBox = new GtkHBox(); $bottomBox = new GtkHBox(); $insideTopBox = new GtkVBox(); $this->topLabel = new GtkLabel(); $this->topLabel->set_use_markup(true); $this->topLabel->set_label($this->strings['topLabel']); $insideTopBox->pack_start($this->topLabel); if (file_exists('/etc/libki/logo.png')) { $logo = GtkImage::new_from_file('/etc/libki/logo.png'); $insideTopBox->pack_start($logo); } elseif (file_exists('logo.png')) { $logo = GtkImage::new_from_file('logo.png'); $insideTopBox->pack_start($logo); } $topBox->pack_start($insideTopBox); $centerHBox->pack_start($leftBox, true); $centerHBox->pack_start($this->loginBox, false); $centerHBox->pack_start($this->errorBox, false); $centerHBox->pack_start($rightBox, true); $centerVBox->pack_start($topBox, true); $centerVBox->pack_start($centerHBox, false); $centerVBox->pack_start($bottomBox, true); $this->add($centerVBox); }
function TwentyFourCal() { parent::__construct(); $this->draw(); $this->show(); }
public function __construct() { parent::__construct(); $this->window(); }
/** * @name __construct($type=Gtk::WINDOW_TOPLEVEL) * @param GtkWindowType $type tipo da janela a ser criada * @return GtkWindow */ public function __construct($type = Gtk::WINDOW_TOPLEVEL) { parent::__construct($type); }