projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
table-casereader: Put space between columns.
[pspp]
/
src
/
ui
/
gui
/
psppire-var-sheet.c
diff --git
a/src/ui/gui/psppire-var-sheet.c
b/src/ui/gui/psppire-var-sheet.c
index bffcfd1dd922bedf016d2e36c2b2d8d865a63a86..48f34f6d03f9ae7211b3bb63d95cecfe923ca011 100644
(file)
--- a/
src/ui/gui/psppire-var-sheet.c
+++ b/
src/ui/gui/psppire-var-sheet.c
@@
-1,5
+1,5
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008
, 2009
Free Software Foundation, Inc.
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
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
@@
-16,7
+16,7
@@
#include <config.h>
#include "psppire-var-sheet.h"
#include <config.h>
#include "psppire-var-sheet.h"
-#include <ui/gui/sheet/psppire-axis
-impl
.h>
+#include <ui/gui/sheet/psppire-axis.h>
#include "helper.h"
#include "helper.h"
@@
-251,6
+251,9
@@
traverse_cell_callback (PsppireSheet *sheet,
gint n_vars = psppire_var_store_get_var_cnt (var_store);
gint n_vars = psppire_var_store_get_var_cnt (var_store);
+ if (new_cell->col >= PSPPIRE_VAR_STORE_n_COLS)
+ return TRUE;
+
if (new_cell->row >= n_vars && !var_sheet->may_create_vars)
return TRUE;
if (new_cell->row >= n_vars && !var_sheet->may_create_vars)
return TRUE;
@@
-260,10
+263,10
@@
traverse_cell_callback (PsppireSheet *sheet,
const gchar *name = gtk_entry_get_text (entry);
const gchar *name = gtk_entry_get_text (entry);
- if (! psppire_dict_check_name (var_store->dict, name, TRUE))
+ if (! psppire_dict_check_name (var_store->dict
ionary
, name, TRUE))
return TRUE;
return TRUE;
- psppire_dict_insert_variable (var_store->dict, existing_cell->row, name);
+ psppire_dict_insert_variable (var_store->dict
ionary
, existing_cell->row, name);
return FALSE;
}
return FALSE;
}
@@
-278,7
+281,7
@@
traverse_cell_callback (PsppireSheet *sheet,
{
gint i;
for ( i = n_vars ; i <= new_cell->row; ++i )
{
gint i;
for ( i = n_vars ; i <= new_cell->row; ++i )
- psppire_dict_insert_variable (var_store->dict, i, NULL);
+ psppire_dict_insert_variable (var_store->dict
ionary
, i, NULL);
}
return FALSE;
}
return FALSE;
@@
-286,7
+289,6
@@
traverse_cell_callback (PsppireSheet *sheet,
-
/*
Callback whenever the active cell changes on the var sheet.
*/
/*
Callback whenever the active cell changes on the var sheet.
*/
@@
-296,7
+298,6
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
gint oldrow, gint oldcolumn,
gpointer data)
{
gint oldrow, gint oldcolumn,
gpointer data)
{
- PsppireSheetCellAttr attributes;
PsppireVarStore *var_store;
PsppireVarSheetClass *vs_class =
PSPPIRE_VAR_SHEET_CLASS(G_OBJECT_GET_CLASS (vs));
PsppireVarStore *var_store;
PsppireVarSheetClass *vs_class =
PSPPIRE_VAR_SHEET_CLASS(G_OBJECT_GET_CLASS (vs));
@@
-313,8
+314,6
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
g_return_if_fail (oldcolumn == PSPPIRE_VAR_STORE_COL_NAME ||
row < psppire_var_store_get_var_cnt (var_store));
g_return_if_fail (oldcolumn == PSPPIRE_VAR_STORE_COL_NAME ||
row < psppire_var_store_get_var_cnt (var_store));
- psppire_sheet_get_attributes (sheet, row, column, &attributes);
-
var = psppire_var_store_get_var (var_store, row);
switch (column)
var = psppire_var_store_get_var (var_store, row);
switch (column)
@@
-367,11
+366,6
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
customEntry =
PSPPIRE_CUSTOM_ENTRY (psppire_sheet_get_entry (sheet));
customEntry =
PSPPIRE_CUSTOM_ENTRY (psppire_sheet_get_entry (sheet));
- if ( var_is_long_string (var))
- g_object_set (customEntry,
- "editable", FALSE,
- NULL);
-
val_labs_dialog_set_target_variable (vs->val_labs_dialog, var);
g_signal_connect_swapped (customEntry,
val_labs_dialog_set_target_variable (vs->val_labs_dialog, var);
g_signal_connect_swapped (customEntry,
@@
-390,15
+384,11
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
customEntry =
PSPPIRE_CUSTOM_ENTRY (psppire_sheet_get_entry (sheet));
customEntry =
PSPPIRE_CUSTOM_ENTRY (psppire_sheet_get_entry (sheet));
- if ( var_is_long_string (var))
- g_object_set (customEntry,
- "editable", FALSE,
- NULL);
-
-
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
vs->missing_val_dialog->pv =
psppire_var_store_get_var (var_store, row);
+ vs->missing_val_dialog->dict = var_store->dictionary;
+
g_signal_connect_swapped (customEntry,
"clicked",
G_CALLBACK (missing_val_dialog_show),
g_signal_connect_swapped (customEntry,
"clicked",
G_CALLBACK (missing_val_dialog_show),
@@
-430,7
+420,8
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
case PSPPIRE_VAR_STORE_COL_DECIMALS:
case PSPPIRE_VAR_STORE_COL_COLUMNS:
{
case PSPPIRE_VAR_STORE_COL_DECIMALS:
case PSPPIRE_VAR_STORE_COL_COLUMNS:
{
- if ( attributes.is_editable)
+ if ( psppire_sheet_model_is_editable (PSPPIRE_SHEET_MODEL(var_store),
+ row, column))
{
gint r_min, r_max;
{
gint r_min, r_max;
@@
-462,9
+453,9
@@
var_sheet_change_active_cell (PsppireVarSheet *vs,
}
adj = gtk_adjustment_new (current_value,
}
adj = gtk_adjustment_new (current_value,
- r_min, r_max,
-
1.0, 1.0, 1.0
/* steps */
- );
+
r_min, r_max,
+
1.0, 1.0,
/* steps */
+
0
);
psppire_sheet_change_entry (sheet, GTK_TYPE_SPIN_BUTTON);
psppire_sheet_change_entry (sheet, GTK_TYPE_SPIN_BUTTON);
@@
-492,9
+483,12
@@
psppire_var_sheet_realize (GtkWidget *w)
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (vs));
- vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel));
+ vs->val_labs_dialog = val_labs_dialog_create (GTK_WINDOW (toplevel),
+ PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
+
vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
vs->missing_val_dialog = missing_val_dialog_create (GTK_WINDOW (toplevel));
- vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel));
+ vs->var_type_dialog = var_type_dialog_create (GTK_WINDOW (toplevel),
+ PSPPIRE_VAR_STORE (psppire_sheet_get_model (PSPPIRE_SHEET (vs))));
/* Chain up to the parent class */
GTK_WIDGET_CLASS (parent_class)->realize (w);
/* Chain up to the parent class */
GTK_WIDGET_CLASS (parent_class)->realize (w);
@@
-553,13
+547,13
@@
GtkWidget*
psppire_var_sheet_new (void)
{
gint i;
psppire_var_sheet_new (void)
{
gint i;
- PsppireAxis
Impl *ha = psppire_axis_impl
_new ();
- PsppireAxis
Impl *va = psppire_axis_impl
_new ();
+ PsppireAxis
*ha = psppire_axis
_new ();
+ PsppireAxis
*va = psppire_axis
_new ();
GtkWidget *w = g_object_new (psppire_var_sheet_get_type (), NULL);
for (i = 0 ; i < 10 ; ++i)
GtkWidget *w = g_object_new (psppire_var_sheet_get_type (), NULL);
for (i = 0 ; i < 10 ; ++i)
- psppire_axis_
impl_
append (ha, column_def[i].width);
+ psppire_axis_append (ha, column_def[i].width);
g_object_set (va,
"default-size", 25,
g_object_set (va,
"default-size", 25,