/[pspp]/psppire/src/var_sheet.c
ViewVC logotype

Diff of /psppire/src/var_sheet.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by jmd, Sun Nov 20 12:26:14 2005 UTC revision 1.22 by jmd, Wed Nov 23 12:39:37 2005 UTC
# Line 22  Line 22 
22  /* This module creates the Variable Sheet used for inputing the  /* This module creates the Variable Sheet used for inputing the
23     variables in the  dictonary */     variables in the  dictonary */
24    
   
   
25  #include <psppire-conf.h>  #include <psppire-conf.h>
26    
27  #include <glade/glade.h>  #include <glade/glade.h>
# Line 34  Line 32 
32  #include "pspp-dict.h"  #include "pspp-dict.h"
33  #include "var_type_dialog.h"  #include "var_type_dialog.h"
34  #include "var_sheet.h"  #include "var_sheet.h"
35    #include "customentry.h"
36    
37  #define _(A) A  #define _(A) A
38  #define N_(A) A  #define N_(A) A
39    
   
   
40  /* The dictionary associated with this var sheet */  /* The dictionary associated with this var sheet */
41  static PSPP_Dict *pspp_dictionary;  static PSPP_Dict *pspp_dictionary;
42    
# Line 224  var_sheet_cell_change_entry (GtkSheet * Line 221  var_sheet_cell_change_entry (GtkSheet *
221    
222    switch (column)    switch (column)
223      {      {
224        case COL_VALUES:
225        case COL_MISSING:
226          gtk_sheet_change_entry(sheet, PSPPIRE_CUSTOM_ENTRY_TYPE);
227          break;
228    
229        case COL_TYPE:
230          {
231            PsppireCustomEntry *customEntry;
232    
233            struct variable *var = pspp_dict_get_var(pspp_dictionary, row);      
234    
235            gtk_sheet_change_entry(sheet, PSPPIRE_CUSTOM_ENTRY_TYPE);
236    
237            customEntry =
238              PSPPIRE_CUSTOM_ENTRY(gtk_sheet_get_entry(sheet));
239    
240    
241            /* Popup the Variable Type dialog box */
242            if (!var_type_dialog )
243              {
244                var_type_dialog = var_type_dialog_create(xml);
245    
246                g_signal_connect(GTK_OBJECT(var_type_dialog->ok),
247                                 "clicked",
248                                 GTK_SIGNAL_FUNC(set_var_type), sheet);
249              }
250    
251            var_type_dialog_set_state(var_type_dialog, var);
252    
253            g_signal_connect_swapped(GTK_OBJECT(customEntry),
254                                     "clicked",
255                                     GTK_SIGNAL_FUNC(var_type_dialog_show),
256                                     var_type_dialog);
257          }
258          break;
259      case COL_WIDTH:      case COL_WIDTH:
260      case COL_DECIMALS:      case COL_DECIMALS:
261      case COL_COLUMNS:      case COL_COLUMNS:
# Line 324  var_sheet_cell_set (GtkSheet * sheet, gi Line 356  var_sheet_cell_set (GtkSheet * sheet, gi
356    g_assert(gtk_sheet_get_rows_count(sheet) - last_populated_row    g_assert(gtk_sheet_get_rows_count(sheet) - last_populated_row
357              == n_initial_rows + 1);              == n_initial_rows + 1);
358    
   if ( column == COL_TYPE )  
     {  
       /* Popup the Variable Type dialog box */  
   
       if (!var_type_dialog )  
         {  
           var_type_dialog = var_type_dialog_create(xml);  
   
           g_signal_connect(GTK_OBJECT(var_type_dialog->ok),  
                            "clicked",  
                            GTK_SIGNAL_FUNC(set_var_type), sheet);  
         }  
   
       var_type_dialog_set_state(var_type_dialog, var);  
   
       var_type_dialog_show(var_type_dialog);  
     }  
   
359    return FALSE;    return FALSE;
360  }  }
361    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26