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> |
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 |
|
|
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: |
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 |
|
|