//------------------------------------------------------------------------------ void WBPageSetup::run_setup() { if (_app_page_settings.is_valid()) { update_gtk_page_setup_from_grt(_page_setup, _app_page_settings, false); } Glib::RefPtr<Gtk::PageSetup> new_page_setup = Gtk::run_page_setup_dialog(*get_mainwindow(), _page_setup, _print_settings); _page_setup = new_page_setup; propagate_print_settings_to_grt_tree(); }
//------------------------------------------------------------------------------ void WBPrintingLinux::on_print_done(Gtk::PrintOperationResult result, Glib::RefPtr<WBPrintOperation> &op) { if (result == Gtk::PRINT_OPERATION_RESULT_ERROR) { Gtk::MessageDialog err_dlg(*get_mainwindow(), "Error printing document", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); err_dlg.run(); } else if (result == Gtk::PRINT_OPERATION_RESULT_APPLY) { //_print_settings = op->get_print_settings(); } }
void FormImpl::show_modal(::mforms::Form *self, ::mforms::Button *accept, ::mforms::Button *cancel) { FormImpl* form = self->get_data<FormImpl>(); if (form) { form->_window->signal_delete_event().connect(sigc::bind(sigc::mem_fun(form, &FormImpl::on_widget_delete_event), cancel)); if (get_mainwindow()) form->_window->set_transient_for(*get_mainwindow()); form->_window->set_modal(false); bool status = false; if (accept) form->accept_c = accept->signal_clicked()->connect(sigc::bind(sigc::mem_fun(form, &FormImpl::accept_clicked), &status, false)); if (cancel) form->cancel_c = cancel->signal_clicked()->connect(sigc::bind(sigc::mem_fun(form, &FormImpl::cancel_clicked), &status, false)); form->_window->signal_key_release_event().connect(sigc::bind(sigc::mem_fun(form, &FormImpl::on_key_release), &status, false, accept, cancel)); form->_window->show(); } }
bool FormImpl::run_modal(::mforms::Form *self, ::mforms::Button *accept, ::mforms::Button *cancel) { if (g_thread_self() != _main_thread) g_warning("mforms::Form::run_modal() called in non-main thread, which is invalid"); FormImpl* form = self->get_data<FormImpl>(); if (form) { form->_window->signal_delete_event().connect(sigc::bind(sigc::mem_fun(form, &FormImpl::on_widget_delete_event), cancel)); if (get_mainwindow()) form->_window->set_transient_for(*get_mainwindow()); form->_window->set_modal(true); form->_window->show(); form->_result= false; if (accept) form->accept_c = accept->signal_clicked()->connect(sigc::bind(sigc::mem_fun(form, &FormImpl::accept_clicked), &form->_result, true)); if (cancel) form->cancel_c = cancel->signal_clicked()->connect(sigc::bind(sigc::mem_fun(form, &FormImpl::cancel_clicked), &form->_result, true)); form->_window->signal_key_release_event().connect(sigc::bind(sigc::mem_fun(form, &FormImpl::on_key_release), &form->_result, true, accept, cancel)); form->_in_modal_loop++; Gtk::Main::run(); form->_window->set_modal(false); // to be sure it wont Quit the app on close() form->_window->hide(); form->accept_c.disconnect(); form->cancel_c.disconnect(); return form->_result; } return false; }
//------------------------------------------------------------------------------ void WBPrintingLinux::show_plugin() { try { Glib::RefPtr<WBPrintOperation> printer = WBPrintOperation::create(_diagram); printer->signal_done().connect(sigc::bind(sigc::mem_fun(this, &WBPrintingLinux::on_print_done), printer)); /*Gtk::PrintOperationResult result = */printer->run(Gtk::PRINT_OPERATION_ACTION_PRINT_DIALOG, *(get_mainwindow())); } catch (const Gtk::PrintError &e) { g_message("Error while printing %s", e.what().c_str()); } }
//------------------------------------------------------------------------------ static bool create(mforms::Popover* self, mforms::PopoverStyle style) { PopoverWidget* w = new PopoverWidget(get_mainwindow(), style); self->set_data(w, delete_PopoverWidget); return w; }