/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 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
if (GTK_WIDGET_DRAWABLE (widget))
{
+ gboolean is_editable;
GtkShadowType shadow_type;
GdkRectangle rect;
shadow_type = psppire_custom_entry_get_shadow_type (ce);
- if (shadow_type != GTK_SHADOW_NONE)
- {
- gtk_paint_box (widget->style, ce->panel,
- GTK_STATE_NORMAL, shadow_type,
- NULL, widget, "customentry",
- rect.x, rect.y, rect.width, rect.height);
+ g_object_get (widget, "editable", &is_editable, NULL);
+
+ gtk_paint_box (widget->style, ce->panel,
+ is_editable ? GTK_STATE_NORMAL: GTK_STATE_INSENSITIVE,
+ shadow_type,
+ NULL, widget, "customentry",
+ rect.x, rect.y, rect.width, rect.height);
- }
gdk_window_end_paint (ce->panel);
}
if (event->window == ce->panel)
{
+ gboolean is_editable ;
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
- if ( event->button == 1)
+ g_object_get (ce, "editable", &is_editable, NULL);
+
+ if ( event->button == 1 && is_editable )
g_signal_emit (widget, custom_entry_signals[CLICKED], 0);
}
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation
+ Copyright (C) 2004, 2005, 2006, 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
{
GtkSheetCellAttr attributes;
PsppireVarStore *var_store ;
- struct variable *pv ;
+ struct variable *var ;
GladeXML *xml;
gtk_sheet_get_attributes (sheet, row, column, &attributes);
- pv = psppire_var_store_get_var (var_store, row);
+ var = psppire_var_store_get_var (var_store, row);
switch (column)
{
case COL_ALIGN:
{
- static GtkListStore *list_store = 0;
+ static GtkListStore *list_store = NULL;
GtkComboBoxEntry *cbe;
gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY);
cbe =
g_signal_connect (G_OBJECT (cbe),"changed",
- G_CALLBACK (change_alignment), pv);
+ G_CALLBACK (change_alignment), var);
}
break;
+
case COL_MEASURE:
{
static GtkListStore *list_store = 0;
gtk_combo_box_entry_set_text_column (cbe, 0);
g_signal_connect (G_OBJECT (cbe),"changed",
- G_CALLBACK (change_measure), pv);
+ G_CALLBACK (change_measure), var);
}
break;
case COL_VALUES:
{
- static struct val_labs_dialog *val_labs_dialog = 0;
+ static struct val_labs_dialog *val_labs_dialog = NULL;
PsppireCustomEntry *customEntry;
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
+ if ( var_is_long_string (var))
+ g_object_set (customEntry,
+ "editable", FALSE,
+ NULL);
if (!val_labs_dialog )
val_labs_dialog = val_labs_dialog_create (xml);
- val_labs_dialog_set_target_variable (val_labs_dialog, pv);
+ val_labs_dialog_set_target_variable (val_labs_dialog, var);
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
val_labs_dialog);
}
break;
+
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
+ if ( var_is_long_string (var))
+ g_object_set (customEntry,
+ "editable", FALSE,
+ NULL);
+
if (!missing_val_dialog )
missing_val_dialog = missing_val_dialog_create (xml);
var_type_dialog = var_type_dialog_create (xml);
- var_type_dialog->pv = pv;
+ var_type_dialog->pv = var;
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
var_type_dialog);
}
break;
+
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
const gint current_value = atoi (s);
GtkObject *adj ;
- const struct fmt_spec *fmt = var_get_write_format (pv);
+ const struct fmt_spec *fmt = var_get_write_format (var);
switch (column)
{
case COL_WIDTH: