From 5ae0c7d839b1c9ad4e8581197b4e62e0c521f77a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 13 Jul 2007 06:39:05 +0000 Subject: [PATCH] Finally got the datasheet responding fast enough. --- src/ui/gui/psppire-data-store.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 8f52cf7b..638661a5 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -815,11 +815,29 @@ geometry_get_row_count (const GSheetRow *geom, gpointer data) return TRAILING_ROWS + psppire_case_file_get_case_count (ds->case_file); } +#define ROW_HEIGHT 25 static gint geometry_get_height (const GSheetRow *geom, glong unit, gpointer data) { - return 25; + return ROW_HEIGHT; +} + +static guint +geometry_get_top_ypixel (const GSheetRow *geo, glong row, gpointer data) +{ + return row * ROW_HEIGHT; +} + +static glong +geometry_pixel_to_row (const GSheetRow *geo, guint pixel, gpointer data) +{ + glong row = pixel / ROW_HEIGHT; + + if (row >= geometry_get_row_count (geo, data)) + row = geometry_get_row_count (geo, data) -1; + + return row; } @@ -853,7 +871,6 @@ geometry_get_row_button_label (const GSheetRow *geom, glong unit, gpointer data) return text; } - static void psppire_data_store_sheet_row_init (GSheetRowIface *iface) { @@ -863,6 +880,7 @@ psppire_data_store_sheet_row_init (GSheetRowIface *iface) iface->set_height = 0; iface->get_visibility = always_true; iface->get_sensitivity = geometry_get_row_sensitivity; - + iface->top_ypixel = geometry_get_top_ypixel; + iface->pixel_to_row = geometry_pixel_to_row; iface->get_button_label = geometry_get_row_button_label; } -- 2.30.2