32 #ifndef __GNC_TREE_VIEW_H 33 #define __GNC_TREE_VIEW_H 36 #include "gnc-cell-renderer-date.h" 41 #define GNC_TYPE_TREE_VIEW (gnc_tree_view_get_type ()) 42 #define GNC_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW, GncTreeView)) 43 #define GNC_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW, GncTreeViewClass)) 44 #define GNC_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW)) 45 #define GNC_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW)) 46 #define GNC_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW, GncTreeViewClass)) 47 #define GNC_TREE_VIEW_NAME "GncTreeView" 53 GtkTreeView gtk_tree_view;
58 GtkTreeViewClass gtk_tree_view;
62 GType gnc_tree_view_get_type (
void);
76 #define MODEL_COLUMN "model_column" 79 #define REAL_TITLE "real_title" 83 #define PREF_NAME "pref-name" 87 #define ALWAYS_VISIBLE "always-visible" 92 #define DEFAULT_VISIBLE "default-visible" 94 #define GNC_TREE_VIEW_COLUMN_DATA_NONE -1 95 #define GNC_TREE_VIEW_COLUMN_COLOR_NONE -1 96 #define GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS -1 99 typedef void (* renderer_toggled) (GtkCellRendererToggle *cell_renderer_toggle,
147 const gchar *column_title,
148 const gchar *column_short_title,
149 const gchar *pref_name,
150 gint model_data_column,
151 gint model_visibility_column,
152 GtkTreeIterCompareFunc column_sort_fn,
153 renderer_toggled toggle_edited_cb);
194 const gchar *column_title,
195 const gchar *pref_name,
196 const gchar *icon_name,
197 const gchar *sizing_text,
198 gint model_data_column,
199 gint model_visibility_column,
200 GtkTreeIterCompareFunc column_sort_fn);
241 const gchar *column_title,
242 const gchar *pref_name,
243 const gchar *icon_name,
244 const gchar *sizing_text,
245 gint model_data_column,
246 gint model_visibility_column,
247 GtkTreeIterCompareFunc column_sort_fn);
258 const gchar *column_title,
259 const gchar *pref_name,
260 const gchar *sizing_text,
261 gint model_data_column,
262 gint model_visibility_column,
263 GtkTreeModel *combo_tree_model,
264 gint combo_model_text_column,
265 GtkTreeIterCompareFunc column_sort_fn);
274 const gchar *column_title,
275 const gchar *pref_name,
276 const gchar *icon_name,
277 const gchar *sizing_text,
278 gint model_data_column,
279 gint model_visibility_column,
280 GtkTreeIterCompareFunc column_sort_fn);
324 const gchar *column_title,
325 const gchar *pref_name,
326 const gchar *sizing_text,
327 gint model_data_column,
328 gint model_color_column,
329 gint model_visibility_column,
330 GtkTreeIterCompareFunc column_sort_fn);
345 GtkTreeViewColumn *column);
373 const gchar *wanted);
391 const gchar *section);
431 gchar *first_column_name,
446 GtkTreeCellDataFunc func);
496 gnc_tree_view_keynav (
GncTreeView *view, GtkTreeViewColumn **col,
497 GtkTreePath *path, GdkEventKey *event);
501 gnc_tree_view_path_is_valid (
GncTreeView *view, GtkTreePath *path);
508 GFunc editing_started_cb, gpointer editing_cb_data);
515 GFunc editing_finished_cb, gpointer editing_cb_data);
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
Add a column to a view based upon a GncTreeView.
void gnc_tree_view_expand_columns(GncTreeView *view, gchar *first_column_name,...)
This function set the columns that will be allocated the free space in the view.
void gnc_tree_view_set_state_section(GncTreeView *view, const gchar *section)
This function is called to set up or remove an association between a saved state section and the disp...
GtkTreeViewColumn * gnc_tree_view_add_date_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
This function adds a new date column to a GncTreeView base view.
void gnc_tree_view_set_control_column_background(GncTreeView *view, gint column, GtkTreeCellDataFunc func)
This function links the cell backgrounds of the two control columns to a column in the model that has...
GtkTreeViewColumn * gnc_tree_view_add_numeric_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_color_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
This function adds a new numeric column to a GncTreeView base view.
GtkTreeViewColumn * gnc_tree_view_add_combo_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeModel *combo_tree_model, gint combo_model_text_column, GtkTreeIterCompareFunc column_sort_fn)
This function adds a new combobox column to a GncTreeView base view.
GtkTreeViewColumn * gnc_tree_view_add_toggle_column(GncTreeView *view, const gchar *column_title, const gchar *column_short_title, const gchar *pref_name, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn, renderer_toggled toggle_edited_cb)
This function adds a new toggle column to a GncTreeView base view.
const gchar * gnc_tree_view_get_state_section(GncTreeView *view)
This function is called to get the current association between a saved state section and the display ...
void gnc_tree_view_remove_state_information(GncTreeView *view)
This function is called to completely wipe the treeview's state information (column visibility...
void gnc_tree_view_configure_columns(GncTreeView *view)
Make all the correct columns visible, respecting their default visibility setting, their "always" visibility setting, and the last saved state if available.
void gnc_tree_view_set_editing_finished_cb(GncTreeView *view, GFunc editing_finished_cb, gpointer editing_cb_data)
Setup a callback for when the user finishes editing so appropriate actions can be taken like enable t...
void gnc_tree_view_set_editing_started_cb(GncTreeView *view, GFunc editing_started_cb, gpointer editing_cb_data)
Setup a callback for when the user starts editing so appropriate actions can be taken like disable th...
GtkTreeViewColumn * gnc_tree_view_add_text_view_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
This function adds a new text view column to a GncTreeView base view.
void gnc_tree_view_set_sort_user_data(GncTreeView *view, GtkTreeModel *s_model)
This allows the columns to be setup without the model connected.
gboolean gnc_tree_view_get_show_column_menu(GncTreeView *view)
This function is called to get the current value of the "show-column-menu" property.
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
Find a tree column given the "pref name".
GtkTreeViewColumn * gnc_tree_view_add_text_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
This function adds a new text column to a GncTreeView base view.
void gnc_tree_view_set_show_column_menu(GncTreeView *view, gboolean visible)
This function is called to set the "show-column-menu" property on this view.
void gnc_tree_view_save_state(GncTreeView *view)
This function is called to write the treeview's state information (column visibility, width, sorting order,..) to the state file.
GtkCellRenderer * gnc_tree_view_column_get_renderer(GtkTreeViewColumn *column)
Return the "main" cell renderer from a GtkTreeViewColumn added to a GncTreeView my one of the conveni...