gboolean ggg_delete_event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) { GncGWENGui *gui = user_data; g_return_val_if_fail(gui, FALSE); ENTER("gui=%p, state=%d", gui, gui->state); if (gui->state == RUNNING) { const char *still_running_msg = _("The Online Banking job is still running; are you " "sure you want to cancel?"); if (!gnc_verify_dialog(gui->dialog, FALSE, "%s", still_running_msg)) return FALSE; set_aborted(gui); } hide_dialog(gui); LEAVE(" "); return TRUE; }
static void gtk_file_chooser_native_hide (GtkNativeDialog *native) { GtkFileChooserNative *self = GTK_FILE_CHOOSER_NATIVE (native); switch (self->mode) { case MODE_FALLBACK: hide_dialog (self); break; case MODE_WIN32: #ifdef GDK_WINDOWING_WIN32 gtk_file_chooser_native_win32_hide (self); #endif break; case MODE_QUARTZ: #ifdef GDK_WINDOWING_QUARTZ gtk_file_chooser_native_quartz_hide (self); #endif break; case MODE_PORTAL: gtk_file_chooser_native_portal_hide (self); break; default: break; } }
void destroy_dialog() { if (ui_dialog_wid) { hide_dialog(); XPDestroyWidget(ui_dialog_wid, 1); // 1 = destroy child widgets ui_dialog_wid = NULL; ui_dlg_text_wid = NULL; } }
virtual BOOL on_event (HELEMENT he, HELEMENT target, BEHAVIOR_EVENTS type, UINT_PTR reason ) { if(type != BUTTON_CLICK) return false; dom::element button = target; if( button.test("[role='ok-button']") || button.test("[role='cancel-button']") ) hide_dialog(he); return FALSE; }
float hide_dialog_flcb(float elapsed_sec_last_call, float elapsed_sec_since_last_loop, int counter, void* refcon) { UNUSED(elapsed_sec_last_call); UNUSED(elapsed_sec_since_last_loop); UNUSED(counter); UNUSED(refcon); hide_dialog(); return 0; // one shot }
// handler of custom functions for the CSSS! engine virtual BOOL on_script_call(HELEMENT he, LPCSTR name, UINT argc, json::value* argv, json::value& retval) { if( aux::streq(name, "show") ) { show_dialog(he); return TRUE; } else if( aux::streq(name, "hide") ) { hide_dialog(he); return TRUE; } return FALSE; }
void ggg_close_clicked_cb(GtkButton *button, gpointer user_data) { GncGWENGui *gui = user_data; g_return_if_fail(gui); g_return_if_fail(gui->state == FINISHED || gui->state == ABORTED); ENTER("gui=%p", gui); hide_dialog(gui); LEAVE(" "); }
static void set_finished(GncGWENGui *gui) { g_return_if_fail(gui); ENTER("gui=%p", gui); /* Do not serve as GUI anymore */ gui->state = FINISHED; unregister_callbacks(gui); gtk_widget_set_sensitive(gui->abort_button, FALSE); gtk_widget_set_sensitive(gui->close_button, TRUE); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gui->close_checkbutton))) hide_dialog(gui); LEAVE(" "); }
void show_dialog() { if (ui_dialog_wid) { if (ui_dialog_open) { hide_dialog(); } if (ui_dialog_x == UI_POSITION_DEFAULT || ui_dialog_y == UI_POSITION_DEFAULT) { set_dialog_default_position(); } else if (!dialog_is_on_screen()) { debug("dialog is off screen"); set_dialog_default_position(); } XPShowWidget(ui_dialog_wid); XPBringRootWidgetToFront(ui_dialog_wid); // debug("showing dialog"); ui_dialog_open = 1; } }