Esempio n. 1
0
 function on_delete_confirm()
 {
     $dialog = new GtkDialog('CAUTION!', $this, 0, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK, Gtk::STOCK_CANCEL, Gtk::RESPONSE_CANCEL));
     $hbox = new GtkHBox(false, 8);
     $hbox->set_border_width(8);
     $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
     $confirm_text1 = new GtkLabel('Are you sure you want to proceed ?');
     $confirm_text2 = new GtkLabel('Note: This process is irreversible.');
     $confirm_text3 = new GtkLabel($this->selected_file);
     $confirm_text3->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#ff0000"));
     $vbox2 = new GtkVBox();
     $vbox2->pack_start($confirm_text1);
     $vbox2->pack_start($confirm_text2);
     $vbox2->pack_start($confirm_text3);
     $hbox->pack_start($stock, false, false, 0);
     $hbox->pack_start($vbox2, false, false, 0);
     $dialog->vbox->pack_start($hbox, false, false, 0);
     $dialog->show_all();
     $response = $dialog->run();
     if ($response == Gtk::RESPONSE_OK) {
         $resp = $this->delete_file();
         if ($resp) {
             $this->on_delete_successful();
             $this->selected_file = "";
             $this->file_label->set_text($this->file_label_default);
         } else {
             $this->selected_file = "";
             $this->file_label->set_text('Unable to delete the specified file.');
         }
     }
     $dialog->destroy();
 }
Esempio n. 2
0
function alert($msg)
{
    // note 1
    $dialog = new GtkDialog('Alert', null, Gtk::DIALOG_MODAL);
    // create a new dialog
    $dialog->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
    $top_area = $dialog->vbox;
    // note 2
    $top_area->pack_start($hbox = new GtkHBox());
    // note 3
    $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG);
    // note 4
    $hbox->pack_start($stock, 0, 0);
    // stuff in the icon
    $hbox->pack_start(new GtkLabel($msg));
    // and the msg
    $dialog->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK);
    // note 5
    $dialog->set_has_separator(false);
    // don't display the set_has_separator
    $dialog->show_all();
    // show the dialog
    $dialog->run();
    // the dialog in action
    $dialog->destroy();
    // done. close the dialog box.
}
 function __construct($Parent, $CodId)
 {
     parent::__construct('Estornar Conta a Receber', 400, -1, 'contas_receber.png');
     $this->Parent = $Parent;
     $this->CodId = $CodId;
     // Id.
     $this->pack_start($hbox = new GtkHBox());
     $hbox->pack_start(GtkImage::new_from_stock(Gtk::STOCK_CANCEL, Gtk::ICON_SIZE_DIALOG), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup(' Cod. Id.: <b>' . $CodId . '</b>');
     // anotacoes
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(new GtkLabel(latin1(' Anotações: ')), false);
     $hbox->pack_start($this->anotacoes = new AEntry(true));
     // 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->anotacoes->focus_widget = $this->ok;
     $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->anotacoes->grab_focus();
 }
 function on_interactive_dialog_clicked($button)
 {
     $dialog = new GtkDialog('Interactive Dialog', $this, 0, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK, '_Non-stock button', Gtk::RESPONSE_CANCEL));
     $hbox = new GtkHBox(false, 8);
     $hbox->set_border_width(8);
     $dialog->vbox->pack_start($hbox, false, false, 0);
     $stock = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
     $hbox->pack_start($stock, false, false, 0);
     $table = new GtkTable(2, 2);
     $table->set_row_spacings(4);
     $table->set_col_spacings(4);
     $hbox->pack_start($table, true, true, 0);
     $label = new GtkLabel('Entry _1');
     $label->set_use_underline(true);
     $table->attach($label, 0, 1, 0, 1);
     $local_entry1 = new GtkEntry();
     $local_entry1->set_text($this->entry1->get_text());
     $table->attach($local_entry1, 1, 2, 0, 1);
     $label->set_mnemonic_widget($local_entry1);
     $label = new GtkLabel('Entry _2');
     $label->set_use_underline(true);
     $table->attach($label, 0, 1, 1, 2);
     $local_entry2 = new GtkEntry();
     $local_entry2->set_text($this->entry2->get_text());
     $table->attach($local_entry2, 1, 2, 1, 2);
     $label->set_mnemonic_widget($local_entry2);
     $dialog->show_all();
     $response = $dialog->run();
     if ($response == Gtk::RESPONSE_OK) {
         $this->entry1->set_text($local_entry1->get_text());
         $this->entry2->set_text($local_entry2->get_text());
     }
     $dialog->destroy();
 }
 public function menuCreate($xml, $mainObject)
 {
     // Cria o menu
     // @since rev 1
     $menu = new GtkMenu();
     // Cria o vetor
     // @since rev 1
     $obj = array();
     $obj['object'] = new GtkMenuItem((string) $xml['title']);
     $obj['object']->set_submenu($menu);
     // Percorre os itens
     // @since rev 1
     foreach ($xml as $xmlItem) {
         // Guarda o nome do item
         // @since rev 1
         $name = (string) $xmlItem['name'];
         $title = (string) $xmlItem['title'];
         $onclick = (string) $xmlItem['onclick'];
         // Verifica se é um submenu, um item, um separador
         // @since rev 1
         if ($xmlItem->getName() == "menu") {
             // Cria o submenu
             // @since rev 1
             $subObj = FMenus::menuCreate($xmlItem, $mainObject);
             $menu->append($subObj['object']);
             $obj[$name] = $subObj;
         } elseif ($xmlItem->getName() == "separator") {
             $menu->append(new GtkSeparatorMenuItem());
         } else {
             // Verifica se possui sock icon
             // @since rev 1
             $stockicon = (string) $xmlItem['stockicon'];
             if (defined($stockicon)) {
                 $obj[$name] = new GtkImageMenuItem($title);
                 $obj[$name]->set_image(GtkImage::new_from_stock(constant($stockicon), Gtk::ICON_SIZE_MENU));
             } else {
                 $obj[$name] = new GtkMenuItem($title);
             }
             // Verifica se existe evento
             // @since rev 1
             if (strlen($onclick) > 0) {
                 // Verifica se é orientado à objeto
                 // @since rev 1
                 if ($mainObject != NULL) {
                     $function = array($mainObject, $onclick);
                 } else {
                     $function = $onclick;
                 }
                 $obj[$name]->connect_simple("activate", $function);
             }
             // Adiciona o item
             // @since rev 1
             $menu->append($obj[$name]);
         }
     }
     // Retorna o objeto
     // @since rev 1
     return $obj;
 }
Esempio n. 6
0
 /**
  * Class Constructor
  * @param  $message    A string containint the question
  * @param  $action_yes Action taken for YES response
  * @param  $action_no  Action taken for NO  response
  */
 public function __construct($message, TAction $action_yes, TAction $action_no = NULL)
 {
     $buttons = array(Gtk::STOCK_YES, Gtk::RESPONSE_YES);
     if ($action_no instanceof TAction) {
         $buttons[] = Gtk::STOCK_NO;
         $buttons[] = Gtk::RESPONSE_NO;
     }
     $buttons[] = Gtk::STOCK_CANCEL;
     $buttons[] = Gtk::RESPONSE_CANCEL;
     parent::__construct('', NULL, Gtk::DIALOG_MODAL, $buttons);
     parent::set_position(Gtk::WIN_POS_CENTER);
     parent::set_size_request(500, 300);
     $textview = new GtkTextView();
     $textview->set_wrap_mode(Gtk::WRAP_WORD);
     $textview->set_border_width(12);
     $textbuffer = $textview->get_buffer();
     $tagtable = $textbuffer->get_tag_table();
     $customTag = new GtkTextTag();
     $tagtable->add($customTag);
     $customTag->set_property('foreground', '#525252');
     $tagBegin = $textbuffer->create_mark('tagBegin', $textbuffer->get_end_iter(), true);
     $textbuffer->insert_at_cursor("\n   " . $message);
     $tagEnd = $textbuffer->create_mark('tagEnd', $textbuffer->get_end_iter(), true);
     $start = $textbuffer->get_iter_at_mark($tagBegin);
     $end = $textbuffer->get_iter_at_mark($tagEnd);
     $textbuffer->apply_tag($customTag, $start, $end);
     $textview->set_editable(FALSE);
     $textview->set_cursor_visible(FALSE);
     $pango = new PangoFontDescription('Sans 14');
     $textview->modify_font($pango);
     $image = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG);
     $scroll = new GtkScrolledWindow();
     $scroll->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
     $scroll->add($textview);
     $hbox = new GtkHBox();
     $this->vbox->pack_start($hbox);
     $hbox->pack_start($image, FALSE, FALSE);
     $hbox->pack_start($scroll, TRUE, TRUE);
     $this->show_all();
     $result = parent::run();
     if ($result == Gtk::RESPONSE_YES) {
         parent::destroy();
         call_user_func_array($action_yes->getAction(), array($action_yes->getParameters()));
     } else {
         if ($result == Gtk::RESPONSE_NO) {
             parent::destroy();
             call_user_func_array($action_no->getAction(), array($action_no->getParameters()));
         } else {
             parent::destroy();
         }
     }
 }
Esempio n. 7
0
 function __construct($required = false, $duplicated = false, $table = null, $field = null)
 {
     parent::__construct($required, $duplicated, $table, $field);
     $this->label->set_text(' Data: ');
     $this->entry->set_editable(false);
     $this->entry->set_max_length(10);
     /* max 99/99/9999 */
     $this->entry->set_width_chars(10);
     $this->entry->connect('changed', array($this, 'data_changed'));
     $this->eventbox->add($button = new GtkButton());
     $button->add(GtkImage::new_from_stock(Gtk::STOCK_PROPERTIES, Gtk::ICON_SIZE_BUTTON));
     $button->connect('clicked', array($this, 'prop_clicked'), $this->entry);
     $this->extra_key = 47;
     /* / */
 }
Esempio n. 8
0
 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();
 }
Esempio n. 9
0
 /**
  * Class Constructor
  * @param $type    Type of the message (info, error)
  * @param $message Message to be shown
  * @param $action  Action to be processed when closing the dialog
  */
 public function __construct($type, $message, TAction $action = NULL)
 {
     parent::__construct('', NULL, Gtk::DIALOG_MODAL, array(Gtk::STOCK_OK, Gtk::RESPONSE_OK));
     parent::set_position(Gtk::WIN_POS_CENTER);
     parent::set_size_request(500, 300);
     $textview = new GtkTextView();
     $textview->set_wrap_mode(Gtk::WRAP_WORD);
     $textview->set_border_width(12);
     $textbuffer = $textview->get_buffer();
     $tagtable = $textbuffer->get_tag_table();
     $customTag = new GtkTextTag();
     $tagtable->add($customTag);
     $customTag->set_property('foreground', '#525252');
     $message = "\n   " . str_replace('<br>', "\n   ", $message);
     $tagBegin = $textbuffer->create_mark('tagBegin', $textbuffer->get_end_iter(), true);
     $textbuffer->insert_at_cursor(strip_tags($message));
     $tagEnd = $textbuffer->create_mark('tagEnd', $textbuffer->get_end_iter(), true);
     $start = $textbuffer->get_iter_at_mark($tagBegin);
     $end = $textbuffer->get_iter_at_mark($tagEnd);
     $textbuffer->apply_tag($customTag, $start, $end);
     $textview->set_editable(FALSE);
     $textview->set_cursor_visible(FALSE);
     $pango = new PangoFontDescription('Sans 14');
     $textview->modify_font($pango);
     $image = $type == 'info' ? GtkImage::new_from_stock(Gtk::STOCK_DIALOG_INFO, Gtk::ICON_SIZE_DIALOG) : GtkImage::new_from_stock(Gtk::STOCK_DIALOG_ERROR, Gtk::ICON_SIZE_DIALOG);
     $scroll = new GtkScrolledWindow();
     $scroll->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
     $scroll->add($textview);
     $hbox = new GtkHBox();
     $this->vbox->pack_start($hbox);
     $hbox->pack_start($image, FALSE, FALSE);
     $hbox->pack_start($scroll, TRUE, TRUE);
     $this->show_all();
     parent::connect('key_press_event', array($this, 'onClose'));
     $result = parent::run();
     if ($result == Gtk::RESPONSE_OK) {
         if ($action) {
             $parameters = $action->getParameters();
             call_user_func_array($action->getAction(), array($parameters));
         }
     }
     parent::destroy();
 }
Esempio n. 10
0
 function __construct($required = false, $duplicated = false, $table = null, $field = null)
 {
     parent::__construct();
     $this->pack_start($this->label = new GtkLabel(), false);
     $this->pack_start($this->entry = new GtkEntry());
     $this->pack_start($this->eventbox = new GtkEventBox(), false);
     $this->pack_start($this->status = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_QUESTION, Gtk::ICON_SIZE_BUTTON), false);
     $this->required = $required;
     $this->duplicated = $duplicated;
     $this->table = $table;
     $this->field = $field;
     $entry_next_focus = $GLOBALS['ENTRY_NEXT_FOCUS'];
     if ($entry_next_focus instanceof GtkWidget) {
         EntrySetNextFocus($entry_next_focus, $this->entry);
     }
     $this->entry->connect('changed', array($this, '__tentry_changed'));
     $this->entry->connect('focus_in_event', array($this, '__tentry_focus_in_event'));
     $this->entry->connect('focus_out_event', array($this, '__tentry_focus_out_event'));
     $GLOBALS['ENTRY_NEXT_FOCUS'] = $this->entry;
 }
Esempio n. 11
0
 /**
  * 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);
 }
Esempio n. 12
0
 public function __construct($message)
 {
     parent::__construct();
     $this->strings = KioskClient::getStrings();
     $this->set_position(GtK::WIN_POS_CENTER_ALWAYS);
     $this->set_default_size(200, 100);
     $this->set_resizable(false);
     $this->set_modal(false);
     $alertMessage = new GtkLabel();
     $alertMessage->set_use_markup(true);
     $alertMessage->set_markup($message);
     $this->vbox->pack_start($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($alertMessage);
     $this->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK);
     $this->action_area->set_layout(Gtk::BUTTONBOX_SPREAD);
     $this->set_has_separator(false);
     $this->show_all();
     $this->run();
     $this->destroy();
 }
 /**
  * Cria um novo item
  * 
  * @name append_item($title, $callback=NULL)
  * @param string $title Texto do item
  * @param mixed $callback Função de callback
  * @param GtkStockItem StockID do icone para aparecer
  * @return GtkMenuItem
  */
 public function append_item($title, $callback = NULL, $stock = NULL)
 {
     // Verifica o stock
     if ($stock == NULL) {
         // Cria o item
         $menuitem = Fabula::GtkMenuItem($title);
     } else {
         // Cria o item com imagem
         $menuitem = new GtkImageMenuItem($title);
         $image = GtkImage::new_from_stock($stock, Gtk::ICON_SIZE_MENU);
         $menuitem->set_image($image);
     }
     // Adiciona o item ao menu
     $this->append($menuitem);
     // Atualiza o widget
     $this->show_all();
     // Verifica o callback
     if ($callback !== NULL) {
         $menuitem->connect("activate", $callback);
     }
     // Retorna o menuitem
     return $menuitem;
 }
Esempio n. 14
0
 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;
 }
 /**
  * Adiciona um botão com menu no final do toolbar apartir de um stockitem
  * 
  * @name append_menu_from_image($menu, $stock_id, $label="", $tip=NULL)
  * @param GtkMenu $menu Menu que será mostrado ao lado do botão
  * @param GtkStockItem $stock_id Id do stock a ser adicionado
  * @param string $label Label do botão caso for usar um
  * @param string $tip String para mostrar como tooltip
  * @return GtkMenuToolButton
  */
 public function append_menu_from_stock($menu, $stock_id, $label = "", $tip = NULL)
 {
     // Cria a imagem
     $imagebutton = GtkImage::new_from_stock($stock_id, Gtk::ICON_SIZE_INVALID);
     // Cria o botão
     $toolbutton = new GtkMenuToolButton($imagebutton, $label);
     // Adiciona o menu
     $toolbutton->set_menu($menu);
     // Verifica se existe tooltip
     if ($tip != NULL) {
         // Adiciona o tooltip
         $toolbutton->set_tooltip_text($tip);
     }
     // Adiciona o callback do click
     $toolbutton->connect_simple("clicked", array($this, "__onclick"), ++$this->__counter);
     // Armazena o botão
     $this->__buttons[$this->__counter] = $toolbutton;
     // Adiciona o botão ao toolbar
     parent::insert($toolbutton, -1);
     // Retorna o botão
     return $toolbutton;
 }
Esempio n. 16
0
 function __construct()
 {
     parent::__construct(latin1('Lista de Preços'), 'lista_precos.png');
     $this->tipo = $tipo;
     $this->CodId = $CodId;
     // barra de ferramentas
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     /*
     if ($tipo == 'n')
     {
     }
     else
     {
     	switch ($tipo)
     	{
     	case 'cc': // Cotacao de Compra
     	{
     	    $lbl_anexo = 'na Cotacao de Compra';
     	    break;
     	}
     	case 'cv': // Cotacao de Venda
     	{
     	    $lbl_anexo = 'na Cotacao de Venda';
     	    break;
     	}
     	case 'pc': // Pedido de Compra
     	{
     	    $lbl_anexo = 'no Pedido de Compra';
     	    break;
     	}
     	case 'pv': // Pedido de Venda
     	{
     	    $lbl_anexo = 'no Pedido de Venda';
     	    break;
     	}
     	};
     	
     	$hbox->pack_start ($eventbox = new GtkEventBox);
     	$eventbox->add ($label = new GtkLabel);
     	$label->set_markup ('<b>Anexar os itens selecionados ' . $lbl_anexo . ': ' . $CodId . '</b>');
     }
     
     if ($tipo == 'n' || $tipo == 'cc')
     {
     	$hbox->pack_start ($this->cot_compra = new GtkButton ('Cot. Compra'), false);
     	$this->cot_compra->set_image (GtkImage::new_from_file (XMImage ('cotacao_compra.png')));
     	$this->cot_compra->connect ('clicked', array ($this, 'cotped_compra_venda_clicked'), 'cc');
     	// $this->incluir->add_accelerator ('clicked', $this->accel_group, Gdk::KEY_Insert, 0, 0);
     }
     
     if ($tipo == 'n' || $tipo == 'cv')
     {
     	$hbox->pack_start ($this->cot_venda = new GtkButton ('Cot. Venda'), false);
     	$this->cot_venda->set_image (GtkImage::new_from_file (XMImage ('cotacao_venda.png')));
     	$this->cot_venda->connect ('clicked', array ($this, 'cotped_compra_venda_clicked'), 'cv');
     	// $this->incluir->add_accelerator ('clicked', $this->accel_group, Gdk::KEY_Insert, 0, 0);
     }
     
     if ($tipo == 'n' || $tipo == 'pc')
     {
     	$hbox->pack_start ($this->ped_compra = new GtkButton ('Ped. Compra'), false);
     	$this->ped_compra->set_image (GtkImage::new_from_file (XMImage ('pedido_compra.png')));
     	$this->ped_compra->connect ('clicked', array ($this, 'cotped_compra_venda_clicked'), 'pc');
     	// $this->incluir->add_accelerator ('clicked', $this->accel_group, Gdk::KEY_Insert, 0, 0);
     }
     
     if ($tipo == 'n' || $tipo == 'pv')
     {
     	$hbox->pack_start ($this->ped_venda = new GtkButton ('Ped. Venda'), false);
     	$this->ped_venda->set_image (GtkImage::new_from_file (XMImage ('pedido_venda.png')));
     	$this->ped_venda->connect ('clicked', array ($this, 'cotped_compra_venda_clicked'), 'pv');
     	// $this->incluir->add_accelerator ('clicked', $this->accel_group, Gdk::KEY_Insert, 0, 0);
     }
     
     if ($tipo == 'n')
     {
     	$hbox->pack_start ($this->imprimir = GtkButton::new_from_stock ('gtk-print-preview'), false);
     	$this->imprimir->connect ('clicked', array ($this, 'imprimir_clicked'));
     	$this->imprimir->add_accelerator ('clicked', $this->accel_group, Gdk::KEY_p, Gdk::CONTROL_MASK, 0);
     }
     */
     // filtro
     $this->pack_start($this->filtro = new TFiltroListaPrecos(array($this, 'pega_dados')), false);
     // grid
     $this->pack_start($this->grid = new TGridListaPrecos($this));
     return;
     // cli / for
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($cli_for = new GtkButton(), false);
     $cli_for->add(GtkImage::new_from_stock('gtk-orientation-portrait', Gtk::ICON_SIZE_BUTTON));
     $cli_for->connect('clicked', array($this, 'cli_for_clicked'));
     $hbox->pack_start($this->box_cli_for = new GtkHBox());
     $cli_for->clicked();
 }
Esempio n. 17
0
 function __construct($Parent, $InfoLinha)
 {
     parent::__construct('Contas a Receber - Baixar', 800, 480, 'contas_receber.png');
     $this->Parent = $Parent;
     $this->InfoLinha = $InfoLinha;
     // info
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start(GtkImage::new_from_stock(Gtk::STOCK_GO_DOWN, Gtk::ICON_SIZE_DIALOG), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup('<b> Todos os totais devem estar preenchidos! </b>');
     $hbox->pack_start($frame = new GtkFrame(latin1(' Informações ')));
     $frame->add($vbox = new GtkVBox());
     $vbox->set_border_width(5);
     // banco
     $vbox->pack_start($this->banco = new TBancos($this));
     // tipo de despesa
     $vbox->pack_start($this->despesa = new TTipoDespesa($this));
     // forma pgto
     $vbox->pack_start($this->forma_pgto = new TFormaPgto($this));
     // Contas
     $this->pack_start($frame = new GtkFrame(' Contas a Receber '));
     $frame->add($scroll = new GtkScrolledWindow());
     $scroll->set_border_width(5);
     $scroll->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
     $scroll->add_with_viewport($vbox = new GtkVBox());
     $vbox->pack_start($this->lista = new GtkTable(count($InfoLinha) + 1, 8, false), false);
     $this->lista->attach($label = new GtkLabel(), 0, 1, 0, 1);
     $label->set_markup('<b>Id</b>');
     $this->lista->attach($label = new GtkLabel(), 1, 2, 0, 1);
     $label->set_markup('<b>Fornecedor</b>');
     $this->lista->attach($label = new GtkLabel(), 2, 3, 0, 1);
     $label->set_markup('<b>Num. do Doc.</b>');
     $this->lista->attach($label = new GtkLabel(), 3, 4, 0, 1);
     $label->set_markup('<b>Valor em R$</b>');
     $this->lista->attach($label = new GtkLabel(), 4, 5, 0, 1);
     $label->set_markup('<b>Juros em R$</b>');
     $this->lista->attach($label = new GtkLabel(), 5, 6, 0, 1);
     $label->set_markup('<b>Desconto em R$</b>');
     $this->lista->attach($label = new GtkLabel(), 6, 7, 0, 1);
     $label->set_markup('<b>Total em R$</b>');
     $this->lista->attach($label = new GtkLabel(), 7, 8, 0, 1);
     $label->set_markup('<b>' . latin1('Anotações') . '</b>');
     $vbox->pack_start(new GtkEventBox());
     // Valores R$
     $this->pack_start($frame = new GtkFrame(' Valores em R$ '), false);
     $frame->add($vbox = new GtkVBox());
     // Valor das Contas
     $vbox->pack_start($this->lbl_valor_contas = new GtkLabel());
     // Valor dos Juros
     $vbox->pack_start($this->lbl_valor_juros = new GtkLabel());
     // Valor das Descontos
     $vbox->pack_start($this->lbl_valor_descontos = new GtkLabel());
     // 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();
 }
Esempio n. 18
0
 /**
  * @name __construct()
  * @return Demo
  */
 public function __construct()
 {
     // Cria a janela
     $this->widgets['frmDemo'] = new GtkWindow();
     $this->widgets['frmDemo']->set_size_request(200, 200);
     $this->widgets['frmDemo']->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
     $this->widgets['frmDemo']->connect("destroy", array($this, "frmDemo_unload"));
     $box = new GtkVBox();
     // Cria o video
     $this->widgets['vdoDemo'] = Fabula::GtkVideo();
     $this->widgets['vdoDemo']->set_auto_scalable(TRUE);
     $this->widgets['vdoDemo']->connect("button-press-event", array($this, "vdoDemo_button_pressed"));
     $this->widgets['vdoDemo']->connect("video-changed", array($this, "vdoDemo_onchange"));
     $this->widgets['vdoDemo']->connect("video-closed", array($this, "vdoDemo_onclose"));
     $box->pack_start($this->widgets['vdoDemo'], TRUE, TRUE);
     // Cria o progressbar
     $this->widgets['sclDemo'] = GtkHScale::new_with_range(0, 100, 1);
     $this->widgets['sclDemo']->set_draw_value(FALSE);
     $this->widgets['sclDemo']->connect("button-release-event", array($this, "sclDemo_button_pressed"));
     $box->pack_start($this->widgets['sclDemo'], FALSE, FALSE);
     // Cria o box dos botões
     $this->widgets['hbox'] = new GtkHBox();
     $box->pack_start($this->widgets['hbox'], FALSE, FALSE);
     // Cria o label do tempo
     $this->widgets['lblTime'] = Fabula::GtkLabel("");
     $this->widgets['lblTime']->set_alignment(1, 0.5);
     $this->widgets['hbox']->pack_end($this->widgets['lblTime']);
     // Adiciona os botões
     $this->widgets['btnOpen'] = Fabula::GtkButton(NULL, array($this, "btnOpen_click"));
     $this->widgets['btnOpen']->set_image(GtkImage::new_from_stock(Gtk::STOCK_OPEN, Gtk::ICON_SIZE_BUTTON));
     $this->widgets['hbox']->pack_start($this->widgets['btnOpen'], FALSE, FALSE);
     $this->widgets['btnPlay'] = Fabula::GtkButton(NULL, array($this, "btnPlay_click"));
     $this->widgets['btnPlay']->set_image(GtkImage::new_from_stock(Gtk::STOCK_MEDIA_PLAY, Gtk::ICON_SIZE_BUTTON));
     $this->widgets['hbox']->pack_start($this->widgets['btnPlay'], FALSE, FALSE);
     $this->widgets['btnPause'] = Fabula::GtkButton(NULL, array($this, "btnPause_click"));
     $this->widgets['btnPause']->set_image(GtkImage::new_from_stock(Gtk::STOCK_MEDIA_PAUSE, Gtk::ICON_SIZE_BUTTON));
     $this->widgets['hbox']->pack_start($this->widgets['btnPause'], FALSE, FALSE);
     $this->widgets['btnStop'] = Fabula::GtkButton(NULL, array($this, "btnStop_click"));
     $this->widgets['btnStop']->set_image(GtkImage::new_from_stock(Gtk::STOCK_MEDIA_STOP, Gtk::ICON_SIZE_BUTTON));
     $this->widgets['hbox']->pack_start($this->widgets['btnStop'], FALSE, FALSE);
     // Inicia a aplicação
     $this->widgets['frmDemo']->add($box);
     $this->frmDemo_onload();
 }
Esempio n. 19
0
function alert($msg)
{
    $dialog = new GtkDialog('Alert', null, Gtk::DIALOG_MODAL);
    $dialog->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
    $top_area = $dialog->vbox;
    $top_area->pack_start($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(new GtkLabel($msg));
    $dialog->add_button(Gtk::STOCK_OK, Gtk::RESPONSE_OK);
    $dialog->set_has_separator(false);
    $dialog->show_all();
    $dialog->run();
    $dialog->destroy();
}