GnuCash
5.6-150-g038405b370+
|
Files | |
file | gnc-tree-view.c |
Base GncTreeView implementation for gnucash trees. | |
file | tree-view-utils.c |
Simple convenience functions for common tasks on GtkTreeViews. | |
file | tree-view-utils.c |
Simple convenience functions for common tasks on GtkTreeViews. | |
Data Structures | |
struct | GncTreeViewPrivate |
Private Data Structure. More... | |
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_pix_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn) |
This function adds a new pixbuf view 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. | |
void | tree_view_column_set_default_width (GtkTreeView *view, GtkTreeViewColumn *column, const gchar *sizing_text) |
Set default width for a treeview column. 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... | |
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 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... | |
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.
It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered. A numeric column is nothing more then a text column with a few extra attributes.
Parameters are defined in gnc-tree-view.h
Definition at line 2059 of file gnc-tree-view.c.
GtkTreeViewColumn* gnc_tree_view_add_pix_column | ( | GncTreeView * | view, |
const gchar * | column_title, | ||
const gchar * | pref_name, | ||
const gchar * | sizing_text, | ||
gint | model_data_column, | ||
gint | model_visibility_column, | ||
GtkTreeIterCompareFunc | column_sort_fn | ||
) |
This function adds a new pixbuf view column to a GncTreeView base view.
This function adds a pixbuf view column to a GncTreeView base view.
It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.
Parameters are defined in gnc-tree-view.h
Definition at line 1983 of file gnc-tree-view.c.
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.
It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.
Parameters are defined in gnc-tree-view.h
Definition at line 1919 of file gnc-tree-view.c.
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.
It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.
Parameters are defined in gnc-tree-view.h
Definition at line 1951 of file gnc-tree-view.c.
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.
It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. It handles creating a tooltip to show the full title name, and setting the sort and edit callback functions. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.
Parameters are defined in gnc-tree-view.h
Definition at line 1766 of file gnc-tree-view.c.
gint gnc_tree_view_append_column | ( | GncTreeView * | view, |
GtkTreeViewColumn * | column | ||
) |
Add a column to a view based upon a GncTreeView.
This function knows about the two special columns on the right side of this type of view, and adds the new column before these two columns. You could say that it appends to the data columns and ignores the infrastructure columns.
Parameters are defined in gnc-tree-view.h
Definition at line 2103 of file gnc-tree-view.c.
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.
column | The tree view column that was added to the GncTreeView |
Definition at line 2032 of file gnc-tree-view.c.
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.
view | A pointer to an gnc tree view. |
Definition at line 1596 of file gnc-tree-view.c.
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.
view | The tree view. |
list | of column names. |
Definition at line 1431 of file gnc-tree-view.c.
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.
Find a tree column given the "pref name".
This function simply runs the list of all (visible and invisible) columns looking for a match. Column names were attached to each column at the time the column was created.
view | The visible tree widget. |
wanted | The "pref name" to find. |
Definition at line 537 of file gnc-tree-view.c.
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.
It returns the same value passed to gnc_tree_view_set_show_menu_column().
Parameters are defined in gnc-tree-view.h
Definition at line 1560 of file gnc-tree-view.c.
const gchar* gnc_tree_view_get_state_section | ( | GncTreeView * | view | ) |
Get the name of the state section this tree view is associated with.
This function is called to get the current association between a saved state section and the display of a view.
It returns the same value passed to gnc_tree_view_set_state_section(); i.e. a string like "dialogs/edit_prices".
Parameters are defined in gnc-tree-view.h
Definition at line 1123 of file gnc-tree-view.c.
void gnc_tree_view_remove_state_information | ( | GncTreeView * | view | ) |
Completely wipe the treeview's state information (column visibility, width, sorting order,..).
This function is called to completely wipe the treeview's state information (column visibility, width, sorting order,..).
This function may be called at any time; either when the user wants to disconnect or when the view object is being destroyed.
view | The tree view. |
Definition at line 981 of file gnc-tree-view.c.
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.
view | The tree view. |
Definition at line 1133 of file gnc-tree-view.c.
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.
view | The tree view. |
column | The column in the model containing color strings. |
func | This is a cell data function that sets the "cell-background". |
Definition at line 1500 of file gnc-tree-view.c.
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.
This function has no visible effect if the "state-section" property has not been set.
Parameters are defined in gnc-tree-view.h
Definition at line 1539 of file gnc-tree-view.c.
void gnc_tree_view_set_sort_user_data | ( | GncTreeView * | view, |
GtkTreeModel * | s_model | ||
) |
This allows the columns to be setup without the model connected.
view | The tree view. |
sort | model. |
Definition at line 1518 of file gnc-tree-view.c.
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.
This function is called to set up or remove an association between a saved state section and the display of a view.
It will first remove any existing association, and then install the new one. If the new section has state information, update the view with this information.
Parameters are defined in gnc-tree-view.h
Definition at line 1008 of file gnc-tree-view.c.
void tree_view_column_set_default_width | ( | GtkTreeView * | view, |
GtkTreeViewColumn * | column, | ||
const gchar * | sizing_text | ||
) |
Set default width for a treeview column.
This base width is the largest of the column title and some arbitrary text passed in via sizing_text. This base width is then increased with some padding.
Definition at line 43 of file tree-view-utils.c.