pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/ui/gui psppire-data-store.c


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui psppire-data-store.c
Date: Fri, 13 Jul 2007 06:39:06 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/07/13 06:39:06

Modified files:
        src/ui/gui     : psppire-data-store.c 

Log message:
        Finally got the datasheet responding fast enough.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.c?cvsroot=pspp&r1=1.47&r2=1.48

Patches:
Index: psppire-data-store.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- psppire-data-store.c        12 Jul 2007 12:22:35 -0000      1.47
+++ psppire-data-store.c        13 Jul 2007 06:39:05 -0000      1.48
@@ -815,11 +815,29 @@
   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 @@
   return text;
 }
 
-
 static void
 psppire_data_store_sheet_row_init (GSheetRowIface *iface)
 {
@@ -863,6 +880,7 @@
   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;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]