51 #include "table-gnome.h" 62 #define UNUSED_VAR __attribute__ ((unused)) 65 static QofLogModule UNUSED_VAR log_module = GNC_MOD_REGISTER;
74 GNCHeaderWidths widths;
82 if (
table->ui_data == NULL)
87 sheet = GNUCASH_SHEET (
table->ui_data);
89 widths = gnc_header_widths_new ();
91 gnucash_sheet_get_header_widths (sheet, widths);
93 node = gnc_table_layout_get_cells (
table->layout);
94 for (; node; node = node->next)
96 BasicCell *cell = node->data;
99 width = gnc_header_widths_get_width (widths, cell->cell_name);
102 key = g_strdup_printf(
"%s_width", cell->cell_name);
103 if ((width > 0) && (!cell->expandable))
105 g_key_file_set_integer (state_file, state_section, key, width);
107 else if (g_key_file_has_key (state_file, state_section, key, NULL))
108 g_key_file_remove_key (state_file, state_section, key, NULL);
111 gnc_header_widths_destroy (widths);
115 table_ui_redraw_cb (Table *
table)
122 if (
table->ui_data == NULL)
125 sheet = GNUCASH_SHEET (
table->ui_data);
127 gnucash_sheet_redraw_help (sheet);
131 table_destroy_cb (Table *
table)
138 if (
table->ui_data == NULL)
141 sheet = GNUCASH_SHEET (
table->ui_data);
143 g_object_unref (sheet);
145 table->ui_data = NULL;
160 table->gui_handlers.redraw_help = table_ui_redraw_cb;
161 table->gui_handlers.destroy = table_destroy_cb;
174 g_return_if_fail (GNUCASH_IS_SHEET (
table->ui_data));
176 sheet = GNUCASH_SHEET(
table->ui_data);
178 gnucash_sheet_styles_recompile (sheet);
179 gnucash_sheet_table_load (sheet, do_scroll);
180 gnucash_sheet_redraw_all (sheet);
185 gnc_table_refresh_cursor_gnome (Table *
table,
186 VirtualCellLocation vcell_loc,
194 g_return_if_fail (GNUCASH_IS_SHEET (
table->ui_data));
199 sheet = GNUCASH_SHEET (
table->ui_data);
201 gnucash_sheet_cursor_set_from_table (sheet, do_scroll);
203 if (gnucash_sheet_block_set_from_table (sheet, vcell_loc))
205 gnucash_sheet_recompute_block_offsets (sheet);
206 gnucash_sheet_set_scroll_region (sheet);
207 gnucash_sheet_compute_visible_range (sheet);
208 gnucash_sheet_redraw_all (sheet);
211 gnucash_sheet_redraw_block (sheet, vcell_loc);
216 VirtualCellLocation start_loc,
217 VirtualCellLocation end_loc)
224 g_return_if_fail (GNUCASH_IS_SHEET (
table->ui_data));
232 sheet = GNUCASH_SHEET (
table->ui_data);
234 gnucash_sheet_show_range (sheet, start_loc, end_loc);
238 gnc_table_gnome_init (
void)
242 gui_handlers.cursor_refresh = gnc_table_refresh_cursor_gnome;
Public declarations for GncLedgerDisplay class.
Functions to load, save and get gui state.
GKeyFile * gnc_state_get_current(void)
Returns a pointer to the most recently loaded state.
void gnc_table_init_gui(Table *table)
UI-specific functions.
void gnc_table_refresh_gui(Table *table, gboolean do_scroll)
Refresh the whole GUI from the table.
void gnc_table_show_range(Table *table, VirtualCellLocation start_loc, VirtualCellLocation end_loc)
Try to show the whole range in the register.
void gnc_table_set_default_gui_handlers(TableGUIHandlers *gui_handlers)
Implementation.
Public declarations of GnucashRegister class.
Private declarations for GnucashSheet class.
All type declarations for the whole Gnucash engine.
Generic api to store and retrieve preferences.
gboolean gnc_table_virtual_cell_out_of_bounds(Table *table, VirtualCellLocation vcell_loc)
checks the given location and returns true if it is out of bounds of the table.
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Get a boolean value from the preferences backend.
Declarations for the Table object.
Styling functions for RegisterGnome.
void gnc_table_save_state(Table *table, const gchar *state_section)
Implementation.