void gnc_dialog_query_list_set_numerics (DialogQueryList *dql, gboolean abs, gboolean inv_sort) { if (!dql) return; gnc_query_list_set_numerics (GNC_QUERY_LIST(dql->qlist), abs, inv_sort); }
void gnc_dialog_query_list_refresh (DialogQueryList *dql) { if (!dql) return; gnc_query_list_refresh (GNC_QUERY_LIST(dql->qlist)); gtk_widget_show_all (dql->dialog); }
static void gnc_query_list_destroy (GtkObject *object) { GNCQueryList *list = GNC_QUERY_LIST(object); GNCQueryListPriv *priv; priv = GNC_QUERY_LIST_GET_PRIVATE(list); if (priv->component_id > 0) { gnc_unregister_gui_component (priv->component_id); priv->component_id = 0; } if (list->query) { qof_query_destroy(list->query); list->query = NULL; } if (list->column_params) { /* XXX: free the params list??? */ } if (list->title_arrows) { g_free(list->title_arrows); list->title_arrows = NULL; } if (list->title_widths) { g_free(list->title_widths); list->title_widths = NULL; } if (GTK_OBJECT_CLASS(parent_class)->destroy) GTK_OBJECT_CLASS(parent_class)->destroy (object); }
static void gnc_query_list_select_row (GtkCList *clist, gint row, gint column, GdkEvent *event) { GNCQueryList *list = GNC_QUERY_LIST(clist); if (clist->selection_mode == GTK_SELECTION_MULTIPLE) { // This is the GtkCTree instance of dialog-search.c. Don't mess with it. original_parent_class_functions.original_select_row(clist, row, column, event); return; } list->current_row = row; gnc_query_list_toggle (list); if (event == NULL) { /* User pressed the space key */ parent_class->scroll_vertical(clist, GTK_SCROLL_STEP_FORWARD, 0.0); } /* This will trigger an unselect event for the currently selected row */ parent_class->select_row (clist, row, column, event); if (event && (event->type == GDK_2BUTTON_PRESS)) { gpointer entry; entry = gtk_clist_get_row_data (clist, row); g_signal_emit(list, query_list_signals[DOUBLE_CLICK_ENTRY], 0, entry); } }
/********************************************************************\ * gnc_query_list_size_allocate_cb * * The allocated size has changed. Need to recompute the * * column widths * * * * Args: w - a GncQueryList widget * * allocation - a widget allocation desctiption * * data - unused * * Returns: nothing * \********************************************************************/ static void gnc_query_list_size_allocate_cb (GtkWidget *w, GtkAllocation *allocation, gpointer data) { GNCQueryList *list = GNC_QUERY_LIST(w); g_return_if_fail (list != NULL); gnc_query_list_recompute_widths(list, allocation->width); }
static void gnc_dialog_query_list_button_clicked (GtkButton *button, DialogQueryList *dql) { GNCDisplayListButton *cb; gpointer current; g_return_if_fail (dql); current = gnc_query_list_get_current_entry (GNC_QUERY_LIST (dql->qlist)); if (!current) return; cb = g_object_get_data (G_OBJECT (button), "data"); g_return_if_fail (cb); gnc_dialog_query_run_callback (cb, current, dql); }
GtkWidget * gnc_query_list_new(GList *param_list, Query *query) { GNCQueryList *list; gint columns; g_return_val_if_fail(param_list, NULL); g_return_val_if_fail(query, NULL); columns = g_list_length(param_list); list = GNC_QUERY_LIST(g_object_new(gnc_query_list_get_type(), "n_columns", columns, NULL)); gnc_query_list_construct(list, param_list, query); return GTK_WIDGET(list); }
static void gnc_query_list_click_column_cb(GtkWidget *w, gint column, gpointer data) { GNCQueryList *list = GNC_QUERY_LIST(w); gnc_query_list_set_sort_column(list, column); }