Exemple #1
0
static void
gnc_table_refresh_cursor_gnome (Table * table,
                                VirtualCellLocation vcell_loc,
                                gboolean do_scroll)
{
    GnucashSheet *sheet;

    if (!table || !table->ui_data)
        return;

    g_return_if_fail (GNUCASH_IS_SHEET (table->ui_data));

    if (gnc_table_virtual_cell_out_of_bounds (table, vcell_loc))
        return;

    sheet = GNUCASH_SHEET (table->ui_data);

    gnucash_sheet_cursor_set_from_table (sheet, do_scroll);

    if (gnucash_sheet_block_set_from_table (sheet, vcell_loc))
    {
        gnucash_sheet_recompute_block_offsets (sheet);
        gnucash_sheet_set_scroll_region (sheet);
        gnucash_sheet_compute_visible_range (sheet);
        gnucash_sheet_redraw_all (sheet);
    }
    else
        gnucash_sheet_redraw_block (sheet, vcell_loc);
}
Exemple #2
0
void
gnc_table_refresh_gui (Table * table, gboolean do_scroll)
{
    GnucashSheet *sheet;

    if (!table)
        return;
    if (!table->ui_data)
        return;

    g_return_if_fail (GNUCASH_IS_SHEET (table->ui_data));

    sheet = GNUCASH_SHEET(table->ui_data);

    gnucash_sheet_styles_recompile (sheet);
    gnucash_sheet_table_load (sheet, do_scroll);
    gnucash_sheet_redraw_all (sheet);
}
Exemple #3
0
void
gnc_table_show_range (Table *table,
                      VirtualCellLocation start_loc,
                      VirtualCellLocation end_loc)
{
    GnucashSheet *sheet;

    if (!table || !table->ui_data)
        return;

    g_return_if_fail (GNUCASH_IS_SHEET (table->ui_data));

    if (gnc_table_virtual_cell_out_of_bounds (table, start_loc))
        return;

    if (gnc_table_virtual_cell_out_of_bounds (table, end_loc))
        return;

    sheet = GNUCASH_SHEET (table->ui_data);

    gnucash_sheet_show_range (sheet, start_loc, end_loc);
}
Exemple #4
0
static void
gnucash_register_configure (GnucashSheet *sheet, gchar * state_section)
{
    GNCHeaderWidths widths;
    Table *table;
    GList *node;
    gchar *key;
    guint value;
    GKeyFile *state_file = gnc_state_get_current();

    // Stuff for per-register settings load.
    g_return_if_fail (sheet != NULL);
    g_return_if_fail (GNUCASH_IS_SHEET (sheet));

    PINFO("state_section=%s",state_section);

    ENTER("sheet=%p, data=%p", sheet, "");

    table = sheet->table;
    gnc_table_init_gui (table);
    table->ui_data = sheet;

    g_object_ref (sheet);

    /* config the cell-block styles */

    widths = gnc_header_widths_new ();

    if (state_section && gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
    {
        node = gnc_table_layout_get_cells (table->layout);
        for (; node; node = node->next)
        {
            BasicCell *cell = node->data;

            if (cell->expandable)
                continue;

            /* Remember whether the column is visible */
            key = g_strdup_printf("%s_width", cell->cell_name);
            value = g_key_file_get_integer (state_file, state_section, key, NULL);
            if (value != 0)
                gnc_header_widths_set_width (widths, cell->cell_name, value);
            g_free(key);
        }
    }

    gnucash_sheet_create_styles (sheet);

    gnucash_sheet_set_header_widths (sheet, widths);

    gnucash_sheet_compile_styles (sheet);

    gnucash_sheet_table_load (sheet, TRUE);
    gnucash_sheet_cursor_set_from_table (sheet, TRUE);
    gnucash_sheet_redraw_all (sheet);

    gnc_header_widths_destroy (widths);

    LEAVE(" ");
}