pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp/src/ui/gui ChangeLog automake.mk data-edit...


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui ChangeLog automake.mk data-edit...
Date: Sun, 08 Jul 2007 02:39:11 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/07/08 02:39:11

Modified files:
        src/ui/gui     : ChangeLog automake.mk data-editor.c 
                         data-editor.glade data-editor.h 
                         psppire-case-file.c psppire-case-file.h 
                         psppire-data-store.c psppire-data-store.h 
                         psppire.glade 
Added files:
        src/ui/gui     : goto-case-dialog.c goto-case-dialog.h 

Log message:
        Implemented the goto-case dialog

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/ChangeLog?cvsroot=pspp&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/automake.mk?cvsroot=pspp&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.glade?cvsroot=pspp&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.h?cvsroot=pspp&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-case-file.c?cvsroot=pspp&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-case-file.h?cvsroot=pspp&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.c?cvsroot=pspp&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.h?cvsroot=pspp&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire.glade?cvsroot=pspp&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/goto-case-dialog.c?cvsroot=pspp&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/goto-case-dialog.h?cvsroot=pspp&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/ChangeLog,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- ChangeLog   7 Jul 2007 02:12:41 -0000       1.64
+++ ChangeLog   8 Jul 2007 02:39:10 -0000       1.65
@@ -1,3 +1,11 @@
+2007-07-08  John Darrington <address@hidden>
+
+       * goto-case-dialog.c goto-case-dialog.h (new files)
+       * automake.mk data-editor.c data-editor.glade data-editor.h 
+       psppire-case-file.c psppire-case-file.h psppire-data-store.c 
+       psppire-data-store.h psppire.glade :  Implemented the goto-case dialog
+       
+
 2007-07-07  John Darrington <address@hidden>
        
        * psppire-data-store.c psppire-data-store.h: Made cases number from 

Index: automake.mk
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/automake.mk,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- automake.mk 8 Jun 2007 02:08:05 -0000       1.31
+++ automake.mk 8 Jul 2007 02:39:10 -0000       1.32
@@ -77,6 +77,8 @@
        src/ui/gui/comments-dialog.h \
        src/ui/gui/customentry.c \
        src/ui/gui/customentry.h \
+       src/ui/gui/goto-case-dialog.c \
+       src/ui/gui/goto-case-dialog.h \
        src/ui/gui/data-sheet.c \
        src/ui/gui/data-sheet.h \
        src/ui/gui/data-editor.c \

Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- data-editor.c       7 Jul 2007 07:34:19 -0000       1.33
+++ data-editor.c       8 Jul 2007 02:39:10 -0000       1.34
@@ -33,6 +33,7 @@
 #include "transpose-dialog.h"
 #include "sort-cases-dialog.h"
 #include "compute-dialog.h"
+#include "goto-case-dialog.h"
 #include "comments-dialog.h"
 #include "variable-info-dialog.h"
 #include "dict-display.h"
@@ -248,6 +249,13 @@
                    G_CALLBACK (insert_variable), de);
 
 
+
+  g_signal_connect (de->insert_variable, "activate",
+                   G_CALLBACK (insert_variable), de);
+
+
+
+
   gtk_action_connect_proxy (de->insert_variable,
                            get_widget_assert (de->xml, 
"button-insert-variable")
                            );
@@ -256,6 +264,26 @@
                            get_widget_assert (de->xml, "data_insert-variable")
                            );
 
+  de->invoke_goto_dialog =
+    gtk_action_new ("goto-case-dialog",
+                   _("Goto Case"),
+                   _("Jump to a Case in the Data Sheet"),
+                   "gtk-jump-to");
+
+
+  gtk_action_connect_proxy (de->invoke_goto_dialog,
+                           get_widget_assert (de->xml, "button-goto-case")
+                           );
+
+  gtk_action_connect_proxy (de->invoke_goto_dialog,
+                           get_widget_assert (de->xml, "data_goto-case")
+                           );
+
+
+  g_signal_connect (de->invoke_goto_dialog, "activate",
+                   G_CALLBACK (goto_case_dialog), de);
+
+
   de->invoke_weight_cases_dialog =
     gtk_action_new ("weight-cases-dialog",
                    _("Weights"),
@@ -619,13 +647,12 @@
       gtk_widget_show (view_data);
       gtk_widget_set_sensitive (insert_variable, TRUE);
       gtk_widget_set_sensitive (insert_cases, FALSE);
+      gtk_action_set_sensitive (de->invoke_goto_dialog, FALSE);
       break;
     case PAGE_DATA_SHEET:
       gtk_widget_show (view_variables);
       gtk_widget_hide (view_data);
-#if 0
-      gtk_widget_set_sensitive (insert_cases, TRUE);
-#endif
+      gtk_action_set_sensitive (de->invoke_goto_dialog, TRUE);
       break;
     default:
       g_assert_not_reached ();

Index: data-editor.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.glade,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- data-editor.glade   1 Jul 2007 00:16:53 -0000       1.20
+++ data-editor.glade   8 Jul 2007 02:39:10 -0000       1.21
@@ -288,7 +288,7 @@
                       </widget>
                     </child>
                     <child>
-                      <widget class="GtkImageMenuItem" id="go_to_case">
+                      <widget class="GtkImageMenuItem" id="data_goto-case">
                         <property name="visible">True</property>
                         <property name="sensitive">False</property>
                         <property name="label" translatable="yes">Go To 
Case</property>

Index: data-editor.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- data-editor.h       7 Jul 2007 06:14:27 -0000       1.13
+++ data-editor.h       8 Jul 2007 02:39:10 -0000       1.14
@@ -37,10 +37,9 @@
   GtkAction *invoke_sort_cases_dialog;
   GtkAction *invoke_compute_dialog;
   GtkAction *invoke_comments_dialog;
-
+  GtkAction *invoke_goto_dialog;
   GtkAction *invoke_variable_info_dialog;
 
-
   GtkAction *insert_variable;
 
   GladeXML *xml;

Index: psppire-case-file.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-case-file.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- psppire-case-file.c 7 Jul 2007 06:14:28 -0000       1.23
+++ psppire-case-file.c 8 Jul 2007 02:39:10 -0000       1.24
@@ -223,7 +223,7 @@
 }
 
 
-inline gint
+inline casenumber
 psppire_case_file_get_case_count (const PsppireCaseFile *cf)
 {
   g_return_val_if_fail (cf, FALSE);

Index: psppire-case-file.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-case-file.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- psppire-case-file.h 7 Jul 2007 06:14:28 -0000       1.15
+++ psppire-case-file.h 8 Jul 2007 02:39:11 -0000       1.16
@@ -71,7 +71,7 @@
 
 gboolean psppire_case_file_insert_case (PsppireCaseFile *cf, struct ccase *c, 
gint row);
 
-gint psppire_case_file_get_case_count (const PsppireCaseFile *cf);
+casenumber psppire_case_file_get_case_count (const PsppireCaseFile *cf);
 
 
 union value * psppire_case_file_get_value (const PsppireCaseFile *cf,

Index: psppire-data-store.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- psppire-data-store.c        7 Jul 2007 06:14:28 -0000       1.42
+++ psppire-data-store.c        8 Jul 2007 02:39:11 -0000       1.43
@@ -159,8 +159,14 @@
   return psppire_dict_get_var_cnt (store->dict);
 }
 
+casenumber
+psppire_data_store_get_case_count (PsppireDataStore *store)
+{
+  return psppire_case_file_get_case_count (store->case_file);
+}
+
 static gint
-psppire_data_store_get_case_count (const GSheetModel *model)
+psppire_data_store_get_case_count_from_model (const GSheetModel *model)
 {
   const PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
 
@@ -168,6 +174,8 @@
 }
 
 
+
+
 static void
 psppire_data_store_init (PsppireDataStore *data_store)
 {
@@ -219,7 +227,7 @@
   iface->get_font_desc = psppire_data_store_get_font_desc;
   iface->get_cell_border = NULL;
   iface->get_column_count = psppire_data_store_get_var_count;
-  iface->get_row_count = psppire_data_store_get_case_count;
+  iface->get_row_count = psppire_data_store_get_case_count_from_model;
 }
 
 static

Index: psppire-data-store.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- psppire-data-store.h        7 Jul 2007 06:14:28 -0000       1.14
+++ psppire-data-store.h        8 Jul 2007 02:39:11 -0000       1.15
@@ -108,6 +108,9 @@
                                        const gchar *text,
                                        gint row, gint column);
 
+casenumber psppire_data_store_get_case_count (PsppireDataStore *store);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Index: psppire.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire.glade,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- psppire.glade       7 Jul 2007 09:23:53 -0000       1.23
+++ psppire.glade       8 Jul 2007 02:39:11 -0000       1.24
@@ -248,25 +248,36 @@
                 <property name="column_spacing">5</property>
                 <property name="row_spacing">5</property>
                 <child>
-                  <widget class="PsppireSelector" id="psppire-selector2">
+                  <widget class="GtkVBox" id="vbox5">
                     <property name="visible">True</property>
-                    <property name="border_width">5</property>
+                    <child>
+                      <widget class="GtkLabel" id="label4">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Name 
Variable:</property>
                   </widget>
                   <packing>
-                    <property name="x_options"></property>
-                    <property name="y_options"></property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="PsppireSelector" id="psppire-selector3">
+                      <widget class="GtkEntry" id="new-name-entry">
                     <property name="visible">True</property>
-                    <property name="border_width">5</property>
                   </widget>
                   <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
                     <property name="top_attach">1</property>
                     <property name="bottom_attach">2</property>
-                    <property name="x_options"></property>
-                    <property name="y_options">GTK_FILL</property>
+                    <property name="y_options"></property>
                   </packing>
                 </child>
                 <child>
@@ -319,35 +330,24 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox5">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkLabel" id="label4">
+                  <widget class="PsppireSelector" id="psppire-selector3">
                         <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Name 
Variable:</property>
+                    <property name="border_width">5</property>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_options"></property>
+                    <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkEntry" id="new-name-entry">
+                  <widget class="PsppireSelector" id="psppire-selector2">
                         <property name="visible">True</property>
+                    <property name="border_width">5</property>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
+                    <property name="x_options"></property>
                     <property name="y_options"></property>
                   </packing>
                 </child>
@@ -1829,30 +1829,18 @@
                         <property name="n_rows">2</property>
                         <property name="n_columns">2</property>
                         <child>
-                          <widget class="GtkRadioButton" 
id="radio-button-user-label">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                          </widget>
-                          <packing>
-                            <property name="x_options"></property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkRadioButton" 
id="radio-button-expression-label">
+                          <widget class="GtkLabel" id="label27">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                            <property 
name="group">radio-button-user-label</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Use 
expression as label</property>
                           </widget>
                           <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
-                            <property name="x_options"></property>
+                            <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
@@ -1889,18 +1877,30 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkLabel" id="label27">
+                          <widget class="GtkRadioButton" 
id="radio-button-expression-label">
                             <property name="visible">True</property>
+                            <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Use 
expression as label</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property 
name="group">radio-button-user-label</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
-                            <property name="y_options"></property>
+                            <property name="x_options"></property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkRadioButton" 
id="radio-button-user-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                          </widget>
+                          <packing>
+                            <property name="x_options"></property>
                           </packing>
                         </child>
                       </widget>
@@ -1939,78 +1939,107 @@
                         <property name="n_rows">2</property>
                         <property name="n_columns">2</property>
                         <child>
-                          <widget class="GtkLabel" id="label28">
+                          <widget class="GtkHBox" id="hbox20">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                            <child>
+                              <widget class="GtkLabel" id="label29">
                             <property name="visible">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
                             <property name="xalign">0</property>
-                            <property name="label" 
translatable="yes">Numeric</property>
+                                <property name="label" 
translatable="yes">String</property>
+                              </widget>
+                            </child>
+                            <child>
+                              <widget class="GtkHBox" id="hbox21">
+                                <property name="visible">True</property>
+                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label30">
+                                    <property name="visible">True</property>
+                                    <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <property name="label" 
translatable="yes">Width</property>
+                                  </widget>
+                                </child>
+                                <child>
+                                  <widget class="GtkSpinButton" 
id="type-and-label-width">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <property name="adjustment">8 1 32767 1 10 
10</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </widget>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="right_attach">2</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkRadioButton" 
id="radio-button-numeric">
+                          <widget class="GtkRadioButton" 
id="radio-button-string">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
-                            <property 
name="group">radio-button-string</property>
                           </widget>
                           <packing>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
                             <property name="x_options"></property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkRadioButton" 
id="radio-button-string">
+                          <widget class="GtkRadioButton" 
id="radio-button-numeric">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
                             <property name="active">True</property>
                             <property name="draw_indicator">True</property>
+                            <property 
name="group">radio-button-string</property>
                           </widget>
                           <packing>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
                             <property name="x_options"></property>
                             <property name="y_options"></property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkHBox" id="hbox20">
-                            <property name="visible">True</property>
-                            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                            <child>
-                              <widget class="GtkLabel" id="label29">
+                          <widget class="GtkLabel" id="label28">
                                 <property name="visible">True</property>
                                 <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="xalign">0</property>
-                                <property name="label" 
translatable="yes">String</property>
+                            <property name="label" 
translatable="yes">Numeric</property>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                          </packing>
+                        </child>
                               </widget>
                             </child>
-                            <child>
-                              <widget class="GtkHBox" id="hbox21">
-                                <property name="visible">True</property>
-                                <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <child>
-                                  <widget class="GtkLabel" id="label30">
-                                    <property name="visible">True</property>
-                                    <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="label" 
translatable="yes">Width</property>
                                   </widget>
                                 </child>
                                 <child>
-                                  <widget class="GtkSpinButton" 
id="type-and-label-width">
+                  <widget class="GtkLabel" id="label15">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
                                     <property 
name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                    <property name="adjustment">8 1 32767 1 10 
10</property>
+                    <property name="label" translatable="yes">Type</property>
+                    <property name="use_markup">True</property>
                                   </widget>
                                   <packing>
-                                    <property name="position">1</property>
+                    <property name="type">label_item</property>
                                   </packing>
                                 </child>
                               </widget>
@@ -2019,42 +2048,71 @@
                               </packing>
                             </child>
                           </widget>
+        </child>
+        <child>
+          <widget class="PsppireVButtonBox" id="psppire-vbuttonbox1">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+            <property name="border_width">5</property>
+            <property name="buttons">PSPPIRE_BUTTON_CONTINUE_MASK | 
PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK</property>
+          </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+            <property name="position">1</property>
                           </packing>
                         </child>
                       </widget>
                     </child>
                   </widget>
-                </child>
+  <widget class="PsppireDialog" id="goto-case-dialog">
+    <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+    <property name="title">Goto Case</property>
+    <property name="modal">True</property>
+    <property name="orientation">PSPPIRE_VERTICAL</property>
+    <child internal-child="hbox">
+      <widget class="GtkVBox" id="dialog-hbox10">
+        <property name="visible">True</property>
+        <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+        <property name="spacing">5</property>
                 <child>
-                  <widget class="GtkLabel" id="label15">
+          <widget class="GtkHBox" id="hbox22">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">Type</property>
-                    <property name="use_markup">True</property>
+            <property name="spacing">5</property>
+            <child>
+              <widget class="GtkLabel" id="label31">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                <property name="xalign">1</property>
+                <property name="label" translatable="yes">Goto Case 
Number:</property>
                   </widget>
-                  <packing>
-                    <property name="type">label_item</property>
-                  </packing>
                 </child>
+            <child>
+              <widget class="GtkSpinButton" id="goto-case-case-num-entry">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
+                <property name="adjustment">1 1 100 1 10 10</property>
               </widget>
               <packing>
                 <property name="position">1</property>
               </packing>
             </child>
           </widget>
+          <packing>
+            <property name="fill">False</property>
+            <property name="padding">5</property>
+          </packing>
         </child>
         <child>
-          <widget class="PsppireVButtonBox" id="psppire-vbuttonbox1">
+          <widget class="PsppireHButtonBox" id="psppire-hbuttonbox4">
             <property name="visible">True</property>
             <property name="events">GDK_POINTER_MOTION_MASK | 
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
             <property name="border_width">5</property>
-            <property name="buttons">PSPPIRE_BUTTON_CONTINUE_MASK | 
PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK</property>
+            <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+            <property name="buttons">PSPPIRE_BUTTON_GOTO_MASK | 
PSPPIRE_BUTTON_CANCEL_MASK</property>
           </widget>
           <packing>
             <property name="expand">False</property>

Index: goto-case-dialog.c
===================================================================
RCS file: goto-case-dialog.c
diff -N goto-case-dialog.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ goto-case-dialog.c  8 Jul 2007 02:39:10 -0000       1.1
@@ -0,0 +1,83 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  Free Software Foundation
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+
+#include "goto-case-dialog.h"
+#include "helper.h"
+#include "psppire-dialog.h"
+#include "data-editor.h"
+#include "psppire-data-store.h"
+#include <gtksheet/gtksheet.h>
+
+
+static void
+refresh (const struct data_editor *de, GladeXML *xml)
+{
+  GtkSheet *data_sheet =
+    GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+
+  PsppireDataStore *ds =
+    PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
+
+  GtkWidget *case_num_entry =
+    get_widget_assert (xml, "goto-case-case-num-entry");
+
+  casenumber case_count =
+    psppire_data_store_get_case_count (ds);
+
+  gtk_spin_button_set_range (GTK_SPIN_BUTTON (case_num_entry),
+                            1, case_count);
+}
+
+void
+goto_case_dialog (GObject *o, gpointer data)
+{
+  gint response;
+  GladeXML *xml = XML_NEW ("psppire.glade");
+  struct data_editor *de = data;
+
+  GtkWidget *dialog = get_widget_assert   (xml, "goto-case-dialog");
+
+
+  gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window);
+
+  refresh (de, xml);
+
+  response = psppire_dialog_run (PSPPIRE_DIALOG (dialog));
+
+  if ( response == PSPPIRE_RESPONSE_GOTO )
+    {
+      gint row, column;
+      GtkSheet *data_sheet =
+       GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+
+
+      GtkWidget *case_num_entry =
+       get_widget_assert (xml, "goto-case-case-num-entry");
+
+      gtk_sheet_get_active_cell (data_sheet, &row, &column);
+
+      row =
+       gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry))
+       - FIRST_CASE_NUMBER ;
+
+      gtk_sheet_moveto (data_sheet,
+                       row, column,
+                       0.5, 0.5);
+
+      gtk_sheet_set_active_cell (data_sheet, row, column);
+    }
+}

Index: goto-case-dialog.h
===================================================================
RCS file: goto-case-dialog.h
diff -N goto-case-dialog.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ goto-case-dialog.h  8 Jul 2007 02:39:10 -0000       1.1
@@ -0,0 +1,27 @@
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  Free Software Foundation
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef __GOTO_CASE_DIALOG_H
+#define __GOTO_CASE_DIALOG_H
+
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+
+
+void goto_case_dialog (GObject *o, gpointer data);
+
+#endif




reply via email to

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