GnuCash
5.6-150-g038405b370+
|
A "Cell" is an active object which is designed to read a specific kind of user input. More...
Files | |
file | basiccell.h |
file | cell-factory.h |
file | checkboxcell.h |
file | combocell.h |
file | datecell.h |
file | doclinkcell.h |
file | formulacell.h |
file | numcell.h |
file | pricecell.h |
file | quickfillcell.h |
file | recncell.h |
Data Structures | |
struct | BasicCell |
The BasicCell class provides an abstract base class defining the handling of the editing of a cell of a table. More... | |
struct | CheckboxCell |
The CheckboxCell object implements a cell handler that will toggle between yes and no values when clicked upon by the mouse. More... | |
struct | ComboCell |
The ComboCell object implements a cell handler with a "combination-box" pull-down menu in it. More... | |
struct | CompletionCell |
The CompletionCell object implements a cell handler with a "combination-box" pull-down menu in it. More... | |
struct | DateCell |
The DateCell object implements a date handling cell. More... | |
struct | Doclinkcell |
The Doclinkcell object implements a cell handler that will cycle through a series of single-character values when clicked upon by the mouse and will return a glyph if font can show it. More... | |
struct | FormulaCell |
The FormulaCell is a register-table cell which can contain a formula involving numbers, formula markup and strings denoting either functions or variables. More... | |
struct | NumCell |
The NumCell object implements a number handling cell. More... | |
struct | PriceCell |
The PriceCell object implements a cell handler that stores a single double-precision value, and has the smarts to display it as a price/amount as well as accepting monetary or general numeric input. More... | |
struct | QuickFillCell |
The QuickFillCell implements a text cell with quick-fill capabilities. More... | |
struct | RecnCell |
The RecnCell object implements a cell handler that will cycle through a series of single-character values when clicked upon by the mouse. More... | |
Macros | |
#define | GLYPH_PAPERCLIP "\360\237\223\216" |
#define | GLYPH_LINK "\360\237\224\227" |
Enumerations | |
enum | CellAlignment { CELL_ALIGN_RIGHT, CELL_ALIGN_CENTER, CELL_ALIGN_LEFT } |
Functions | |
gboolean | gnc_cell_name_equal (const char *cell_name_1, const char *cell_name_2) |
BasicCell * | gnc_basic_cell_new (void) |
void | gnc_basic_cell_init (BasicCell *bcell) |
void | gnc_basic_cell_destroy (BasicCell *bcell) |
void | gnc_basic_cell_set_name (BasicCell *cell, const char *name) |
gboolean | gnc_basic_cell_has_name (BasicCell *cell, const char *name) |
void | gnc_basic_cell_set_type_name (BasicCell *cell, const gchar *type_name) |
gboolean | gnc_basic_cell_has_type_name (BasicCell *cell, const gchar *type_name) |
void | gnc_basic_cell_set_sample_text (BasicCell *cell, const char *sample_text) |
void | gnc_basic_cell_set_alignment (BasicCell *cell, CellAlignment alignment) |
void | gnc_basic_cell_set_expandable (BasicCell *cell, gboolean expandable) |
void | gnc_basic_cell_set_span (BasicCell *cell, gboolean span) |
const char * | gnc_basic_cell_get_value (BasicCell *cell) |
void | gnc_basic_cell_set_value (BasicCell *bcell, const char *value) |
gboolean | gnc_basic_cell_get_changed (BasicCell *cell) |
gboolean | gnc_basic_cell_get_conditionally_changed (BasicCell *cell) |
void | gnc_basic_cell_set_changed (BasicCell *cell, gboolean changed) |
void | gnc_basic_cell_set_conditionally_changed (BasicCell *cell, gboolean changed) |
void | gnc_basic_cell_set_value_internal (BasicCell *bcell, const char *value) |
char * | gnc_basic_cell_validate (BasicCell *bcell, GNCPrintAmountInfo print_info, const char *change, const char *newval, const char *toks, gint *cursor_position) |
CellFactory * | gnc_cell_factory_new (void) |
void | gnc_cell_factory_destroy (CellFactory *cf) |
void | gnc_cell_factory_add_cell_type (CellFactory *cf, const char *cell_type_name, CellCreateFunc cell_creator) |
BasicCell * | gnc_cell_factory_make_cell (CellFactory *cf, const char *cell_type_name) |
BasicCell * | gnc_checkbox_cell_new (void) |
void | gnc_checkbox_cell_set_flag (CheckboxCell *cell, gboolean flag) |
gboolean | gnc_checkbox_cell_get_flag (CheckboxCell *cell) |
const char * | gnc_checkbox_cell_get_string (gboolean flag) |
BasicCell * | gnc_combo_cell_new (void) |
void | gnc_combo_cell_init (ComboCell *cell) |
void | gnc_combo_cell_set_value (ComboCell *cell, const char *value) |
void | gnc_combo_cell_clear_menu (ComboCell *cell) |
void | gnc_combo_cell_add_menu_item (ComboCell *cell, const char *menustr) |
Add a menu item to the list. More... | |
void | gnc_combo_cell_add_account_menu_item (ComboCell *cell, char *menustr) |
Add a 'account name' menu item to the list. More... | |
void | gnc_combo_cell_set_sort_enabled (ComboCell *cell, gboolean enabled) |
Enable sorting of the menu item's contents. More... | |
void | gnc_combo_cell_set_strict (ComboCell *cell, gboolean strict) |
Determines whether the cell will accept strings not in the menu. More... | |
void | gnc_combo_cell_set_complete_char (ComboCell *cell, gunichar complete_char) |
Sets a character used for special completion processing. More... | |
void | gnc_combo_cell_add_ignore_string (ComboCell *cell, const char *ignore_string) |
Add a string to a list of strings which, if the cell has that value, will cause the cell to be uneditable on 'enter'. More... | |
void | gnc_combo_cell_set_autosize (ComboCell *cell, gboolean autosize) |
Determines whether the popup list autosizes itself or uses all available space. More... | |
void | gnc_combo_cell_use_quickfill_cache (ComboCell *cell, QuickFill *shared_qf) |
Tell the combocell to use a shared QuickFill object. More... | |
void | gnc_combo_cell_use_list_store_cache (ComboCell *cell, gpointer data) |
BasicCell * | gnc_completion_cell_new (void) |
void | gnc_completion_cell_init (CompletionCell *cell) |
void | gnc_completion_cell_set_value (CompletionCell *cell, const char *value) |
void | gnc_completion_cell_clear_menu (CompletionCell *cell) |
void | gnc_completion_cell_add_menu_item (CompletionCell *cell, const char *menustr) |
Add a menu item to the hash table list. More... | |
void | gnc_completion_cell_set_sort_enabled (CompletionCell *cell, gboolean enabled) |
Enable sorting of the menu item's contents. More... | |
void | gnc_completion_cell_set_strict (CompletionCell *cell, gboolean strict) |
Determines whether the cell will accept strings not in the menu. More... | |
void | gnc_completion_cell_set_autosize (CompletionCell *cell, gboolean autosize) |
Determines whether the popup list autosizes itself or uses all available space. More... | |
void | gnc_completion_cell_reverse_sort (CompletionCell *cell, gboolean is_reversed) |
Register the sort direction. More... | |
BasicCell * | gnc_date_cell_new (void) |
installs a callback to handle date recording | |
void | gnc_date_cell_set_value (DateCell *cell, int day, int mon, int year) |
Accepts a numeric date and sets the contents of the date cell to that value. More... | |
void | gnc_date_cell_set_value_secs (DateCell *cell, time64 secs) |
Sets the contents of the cell with seconds before or since the Unix epoch. More... | |
void | gnc_date_cell_commit (DateCell *cell) |
Commits any pending changes to the value of the cell. More... | |
void | gnc_date_cell_get_date (DateCell *cell, time64 *time, gboolean warn) |
Set a time64 to the value in the DateCell. More... | |
BasicCell * | gnc_doclink_cell_new (void) |
void | gnc_doclink_cell_set_flag (Doclinkcell *cell, char flag) |
char | gnc_doclink_cell_get_flag (Doclinkcell *cell) |
void | gnc_doclink_cell_set_confirm_cb (Doclinkcell *cell, DoclinkcellConfirm confirm_cb, gpointer data) |
void | gnc_doclink_cell_set_string_getter (Doclinkcell *cell, DoclinkcellStringGetter getter) |
void | gnc_doclink_cell_set_valid_flags (Doclinkcell *cell, const char *flags, char default_flag) |
note that More... | |
void | gnc_doclink_cell_set_flag_order (Doclinkcell *cell, const char *flags) |
void | gnc_doclink_cell_set_read_only (Doclinkcell *cell, gboolean read_only) |
void | gnc_doclink_cell_set_use_glyphs (Doclinkcell *cell) |
gboolean | gnc_doclink_get_use_glyphs (Doclinkcell *cell) |
const char * | gnc_doclink_get_glyph_from_flag (char link_flag) |
BasicCell * | gnc_formula_cell_new (void) |
void | gnc_formula_cell_set_value (FormulaCell *fc, const char *newVal) |
BasicCell * | gnc_num_cell_new (void) |
void | gnc_num_cell_set_value (NumCell *cell, const char *str) |
gboolean | gnc_num_cell_set_last_num (NumCell *cell, const char *str) |
BasicCell * | gnc_price_cell_new (void) |
installs a callback to handle price recording | |
gnc_numeric | gnc_price_cell_get_value (PriceCell *cell) |
return the value of a price cell | |
gboolean | gnc_price_cell_set_value (PriceCell *cell, gnc_numeric amount) |
updates amount, returns TRUE if string representation actually changed | |
void | gnc_price_cell_set_fraction (PriceCell *cell, int fraction) |
Sets the fraction used for rounding. More... | |
void | gnc_price_cell_blank (PriceCell *cell) |
Sets the cell as blank, regardless of the blank_zero value. | |
void | gnc_price_cell_set_blank_zero (PriceCell *cell, gboolean blank_zero) |
determines whether 0 values are left blank or printed. More... | |
void | gnc_price_cell_set_print_info (PriceCell *cell, GNCPrintAmountInfo print_info) |
set the printing context of the price cell | |
void | gnc_price_cell_set_debt_credit_value (PriceCell *debit, PriceCell *credit, gnc_numeric amount) |
updates two cells; the deb cell if amt is negative, the credit cell if amount is positive, and makes the other cell blank. More... | |
BasicCell * | gnc_quickfill_cell_new (void) |
void | gnc_quickfill_cell_set_value (QuickFillCell *cell, const char *value) |
sets the current cell value to the indicated string, simultaneously adding the string to the quick-fill tree. | |
void | gnc_quickfill_cell_set_sort (QuickFillCell *cell, QuickFillSort sort) |
void | gnc_quickfill_cell_add_completion (QuickFillCell *cell, const char *completion) |
void | gnc_quickfill_cell_use_quickfill_cache (QuickFillCell *cell, QuickFill *shared_qf) |
Lets the cell use the given shared quickfill object instead of the one it owns internally. More... | |
BasicCell * | gnc_recn_cell_new (void) |
void | gnc_recn_cell_set_flag (RecnCell *cell, char flag) |
char | gnc_recn_cell_get_flag (RecnCell *cell) |
void | gnc_recn_cell_set_confirm_cb (RecnCell *cell, RecnCellConfirm confirm_cb, gpointer data) |
void | gnc_recn_cell_set_string_getter (RecnCell *cell, RecnCellStringGetter getter) |
void | gnc_recn_cell_set_valid_flags (RecnCell *cell, const char *flags, char default_flag) |
note that chars is copied into the RecnCell directly, but remains the "property" of the caller. More... | |
void | gnc_recn_cell_set_flag_order (RecnCell *cell, const char *flags) |
void | gnc_recn_cell_set_read_only (RecnCell *cell, gboolean read_only) |
A "Cell" is an active object which is designed to read a specific kind of user input.
A Cell object has callbacks that are called when the user enters the cell (e.g. by mouse-clicking on a cell in a table, or tabbing into it), when the user attempts to modify text in the cell (e.g. by typing in it), and when the user leaves the cell (e.g. by mouse-clicking elsewhere, or tabbing away).
Special-purpose cells can be created by "inheriting" from the basic cell object. Thus, there are special-purpose cells for handling dates, pull-down menus, text fields with auto-completion from a list of alternatives, monetary amounts, etc.
Cells implementations may or may not contain GUI code. Cells which require only that text be displayed are completely "GUI-independent", that is, they depend on the underlying table to display the text. Cells which require additional GUI elements (such as pull-down menus) must implement the proper GUI handling on their own (using, e.g., GTK).
void gnc_combo_cell_add_account_menu_item | ( | ComboCell * | cell, |
char * | menustr | ||
) |
Add a 'account name' menu item to the list.
When testing for equality with the currently selected item, this function will ignore the characters normally used to separate account names.
Definition at line 462 of file combocell-gnome.c.
void gnc_combo_cell_add_ignore_string | ( | ComboCell * | cell, |
const char * | ignore_string | ||
) |
Add a string to a list of strings which, if the cell has that value, will cause the cell to be uneditable on 'enter'.
Definition at line 1106 of file combocell-gnome.c.
void gnc_combo_cell_add_menu_item | ( | ComboCell * | cell, |
const char * | menustr | ||
) |
Add a menu item to the list.
Definition at line 423 of file combocell-gnome.c.
void gnc_combo_cell_set_autosize | ( | ComboCell * | cell, |
gboolean | autosize | ||
) |
Determines whether the popup list autosizes itself or uses all available space.
FALSE by default.
Definition at line 1124 of file combocell-gnome.c.
void gnc_combo_cell_set_complete_char | ( | ComboCell * | cell, |
gunichar | complete_char | ||
) |
Sets a character used for special completion processing.
Definition at line 1093 of file combocell-gnome.c.
void gnc_combo_cell_set_sort_enabled | ( | ComboCell * | cell, |
gboolean | enabled | ||
) |
Enable sorting of the menu item's contents.
Loading the item is much faster with sorting disabled.
Definition at line 348 of file combocell-gnome.c.
void gnc_combo_cell_set_strict | ( | ComboCell * | cell, |
gboolean | strict | ||
) |
Determines whether the cell will accept strings not in the menu.
Defaults to strict, i.e., only menu items are accepted.
Definition at line 1080 of file combocell-gnome.c.
void gnc_combo_cell_use_quickfill_cache | ( | ComboCell * | cell, |
QuickFill * | shared_qf | ||
) |
Tell the combocell to use a shared QuickFill object.
Using this routine can dramatically improve performance when creating combocells with a large number of entries. For example, users with thousands of accounts are complaining about 10-second register startup times, of which 98% of the cpu is spent building the multi-thousand entry quickfill. When a shared quickfill is specified, the combo-cell will not add to nor delete the quickfill; it is the users resonsibility to manage the quickfill object. The combocell will not make a copy of the quickfill.
Definition at line 397 of file combocell-gnome.c.
void gnc_completion_cell_add_menu_item | ( | CompletionCell * | cell, |
const char * | menustr | ||
) |
Add a menu item to the hash table list.
Definition at line 459 of file completioncell-gnome.c.
void gnc_completion_cell_reverse_sort | ( | CompletionCell * | cell, |
gboolean | is_reversed | ||
) |
Register the sort direction.
Used to determine in what order the completion should present the list. FALSE by default
Definition at line 829 of file completioncell-gnome.c.
void gnc_completion_cell_set_autosize | ( | CompletionCell * | cell, |
gboolean | autosize | ||
) |
Determines whether the popup list autosizes itself or uses all available space.
FALSE by default.
Definition at line 1072 of file completioncell-gnome.c.
void gnc_completion_cell_set_sort_enabled | ( | CompletionCell * | cell, |
gboolean | enabled | ||
) |
Enable sorting of the menu item's contents.
Definition at line 386 of file completioncell-gnome.c.
void gnc_completion_cell_set_strict | ( | CompletionCell * | cell, |
gboolean | strict | ||
) |
Determines whether the cell will accept strings not in the menu.
Defaults to strict, i.e., only menu items are accepted.
Definition at line 1059 of file completioncell-gnome.c.
void gnc_date_cell_commit | ( | DateCell * | cell | ) |
Commits any pending changes to the value of the cell.
That is, it will take the cells current string value, and parse it into a month-day-year value.
Why is this needed? Basically, while the user is typing into the cell, we do not even try to parse the date, lest we confuse things royally. Normally, when the user leaves this cell, and moves to another, we parse the date and print it nicely and cleanly into the cell. But it can happen that we want to get the accurate contents of the date cell before we've left it, e.g. if the user has clicked on the "commit" button. This is the routine to call for that.
Definition at line 461 of file datecell-gnome.c.
Set a time64 to the value in the DateCell.
cell | The DateCell |
time | A time64* to which the function will write the time. |
warn | Whether to warn of parse errors or silently change to a valid one. |
Definition at line 720 of file datecell-gnome.c.
void gnc_date_cell_set_value | ( | DateCell * | cell, |
int | day, | ||
int | mon, | ||
int | year | ||
) |
Accepts a numeric date and sets the contents of the date cell to that value.
The value day, month, year should follow the regular written conventions.
cell | The DateCell to set |
day | The day of the month, 1..31 |
month | The month of the year, 1..12 |
year | The year, 4 digits, common era |
Definition at line 405 of file datecell-gnome.c.
Sets the contents of the cell with seconds before or since the Unix epoch.
cell | The DateCell to set |
secs | Seconds before or since the Unix epoch, 1 January 1970 CE. |
Definition at line 435 of file datecell-gnome.c.
void gnc_doclink_cell_set_valid_flags | ( | Doclinkcell * | cell, |
const char * | flags, | ||
char | default_flag | ||
) |
note that
flags | is copied into the RecnCell directly, but remains the "property" of the caller. The caller must maintain the chars pointer, and the caller must setup a mechanism to 'free' the chars pointer. The rationale is that you may have many Doclinkcell objects that use the same set of flags. |
Definition at line 236 of file doclinkcell.c.
void gnc_price_cell_set_blank_zero | ( | PriceCell * | cell, |
gboolean | blank_zero | ||
) |
determines whether 0 values are left blank or printed.
defaults to true.
Definition at line 263 of file pricecell.c.
void gnc_price_cell_set_debt_credit_value | ( | PriceCell * | debit, |
PriceCell * | credit, | ||
gnc_numeric | amount | ||
) |
updates two cells; the deb cell if amt is negative, the credit cell if amount is positive, and makes the other cell blank.
Definition at line 281 of file pricecell.c.
void gnc_price_cell_set_fraction | ( | PriceCell * | cell, |
int | fraction | ||
) |
Sets the fraction used for rounding.
If 0, no rounding is performed.
Definition at line 242 of file pricecell.c.
void gnc_quickfill_cell_use_quickfill_cache | ( | QuickFillCell * | cell, |
QuickFill * | shared_qf | ||
) |
Lets the cell use the given shared quickfill object instead of the one it owns internally.
The cell will not delete the shared quickfill upon destruction.
Definition at line 346 of file quickfillcell.c.
void gnc_recn_cell_set_valid_flags | ( | RecnCell * | cell, |
const char * | flags, | ||
char | default_flag | ||
) |
note that chars is copied into the RecnCell directly, but remains the "property" of the caller.
The caller must maintain the chars pointer, and the caller must setup a mechanism to 'free' the chars pointer. The rationale is that you may have many RecnCell objects that use the same set of flags – this saves you an alloc/free for each cell. - warlord 2001-11-28
Definition at line 196 of file recncell.c.