is a long string variable.
Closes bug #20564
+2007-07-25 John Darrington <john@darrington.wattle.id.au>
+
+ * customentry.c: Redraw button in insensitive state, if the widget's
+ "editable" style is FALSE. Don't emit the "clicked" signal if
+ "editable" is FALSE.
+
+ * var-sheet.c: If variables are long-string variables, then set the
+ "editable" properties of the entry widgets for the values and missing
+ cells to FALSE,
+
2007-07-18 John Darrington <john@darrington.wattle.id.au>
* psppire-case-file.c psppire-case-file.h psppire-data-store.c
2007-07-18 John Darrington <john@darrington.wattle.id.au>
* psppire-case-file.c psppire-case-file.h psppire-data-store.c
/* PSPPIRE - a graphical user interface for PSPP.
/* 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
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))
{
if (GTK_WIDGET_DRAWABLE (widget))
{
GtkShadowType shadow_type;
GdkRectangle rect;
GtkShadowType shadow_type;
GdkRectangle rect;
shadow_type = psppire_custom_entry_get_shadow_type (ce);
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);
}
gdk_window_end_paint (ce->panel);
}
if (event->window == ce->panel)
{
if (event->window == ce->panel)
{
if (!GTK_WIDGET_HAS_FOCUS (widget))
gtk_widget_grab_focus (widget);
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);
}
g_signal_emit (widget, custom_entry_signals[CLICKED], 0);
}
/* PSPPIRE - a graphical user interface for PSPP.
/* 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
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 ;
{
GtkSheetCellAttr attributes;
PsppireVarStore *var_store ;
gtk_sheet_get_attributes (sheet, row, column, &attributes);
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:
{
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 =
GtkComboBoxEntry *cbe;
gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY);
cbe =
g_signal_connect (G_OBJECT (cbe),"changed",
g_signal_connect (G_OBJECT (cbe),"changed",
- G_CALLBACK (change_alignment), pv);
+ G_CALLBACK (change_alignment), var);
case COL_MEASURE:
{
static GtkListStore *list_store = 0;
case COL_MEASURE:
{
static GtkListStore *list_store = 0;
gtk_combo_box_entry_set_text_column (cbe, 0);
g_signal_connect (G_OBJECT (cbe),"changed",
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:
{
}
break;
case COL_VALUES:
{
- static struct val_labs_dialog *val_labs_dialog = 0;
+ static struct val_labs_dialog *val_labs_dialog = NULL;
PsppireCustomEntry *customEntry;
PsppireCustomEntry *customEntry;
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
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);
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",
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
val_labs_dialog);
}
break;
val_labs_dialog);
}
break;
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
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);
if (!missing_val_dialog )
missing_val_dialog = missing_val_dialog_create (xml);
var_type_dialog = var_type_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",
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
var_type_dialog);
}
break;
var_type_dialog);
}
break;
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
const gint current_value = atoi (s);
GtkObject *adj ;
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:
switch (column)
{
case COL_WIDTH: