GnuCash  4.11-148-gc20d717b33+
Data Structures | Macros | Enumerations | Functions
gnc-tree-view.c File Reference

Base GncTreeView implementation for gnucash trees. More...

#include <config.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
#include "gnc-tree-view.h"
#include "gnc-engine.h"
#include "gnc-gnome-utils.h"
#include "gnc-gobject-utils.h"
#include "gnc-cell-renderer-date.h"
#include "gnc-cell-renderer-text-view.h"
#include "gnc-state.h"
#include "gnc-prefs.h"
#include "dialog-utils.h"

Go to the source code of this file.

Data Structures

struct  GncTreeViewPrivate
 Private Data Structure. More...
 

Macros

#define STATE_KEY   "state-key"
 
#define STATE_KEY_SORT_COLUMN   "sort_column"
 
#define STATE_KEY_SORT_ORDER   "sort_order"
 
#define STATE_KEY_COLUMN_ORDER   "column_order"
 
#define STATE_KEY_SUFF_VISIBLE   "visible"
 
#define STATE_KEY_SUFF_WIDTH   "width"
 
#define GNC_TREE_VIEW_GET_PRIVATE(o)   ((GncTreeViewPrivate*)gnc_tree_view_get_instance_private((GncTreeView*)o))
 

Enumerations

enum  { PROP_0, PROP_STATE_SECTION, PROP_SHOW_COLUMN_MENU }
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 convenience routines. More...
 
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. More...
 
gint gnc_tree_view_append_column (GncTreeView *view, GtkTreeViewColumn *column)
 Add a column to a view based upon a GncTreeView. More...
 
gboolean gnc_tree_view_path_is_valid (GncTreeView *view, GtkTreePath *path)
 
void gnc_tree_view_keynav (GncTreeView *view, GtkTreeViewColumn **col, GtkTreePath *path, GdkEventKey *event)
 
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 the actions delete menu option.
 
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 the actions delete menu option.
 
Gnc Tree View Object Implementation
Gnc Tree View Callback Functions
Gnc Tree View Column Selection Menu Related Functions
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. More...
 
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 color strings or a cell data function that sets the "cell-background" property. More...
 
void gnc_tree_view_set_sort_user_data (GncTreeView *view, GtkTreeModel *s_model)
 This allows the columns to be setup without the model connected. More...
 
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. More...
 
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. More...
 
Gnc Tree View state Callback / Related Functions
void gnc_tree_view_remove_state_information (GncTreeView *view)
 Completely wipe the treeview's state information (column visibility, width, sorting order,..). More...
 
void gnc_tree_view_set_state_section (GncTreeView *view, const gchar *section)
 Set up or remove an association between a saved state section and the display of a view. More...
 
const gchar * gnc_tree_view_get_state_section (GncTreeView *view)
 Get the name of the state section this tree view is associated with. More...
 
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. More...
 
Gnc Tree View Auxiliary Functions
GtkTreeViewColumn * gnc_tree_view_find_column_by_name (GncTreeView *view, const gchar *wanted)
 Find a tree column given the "pref name" used with saved state. More...
 

Detailed Description

Base GncTreeView implementation for gnucash trees.

Author
David Hampton hampt.nosp@m.on@e.nosp@m.mploy.nosp@m.ees..nosp@m.org

Definition in file gnc-tree-view.c.