[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/ui/gui ChangeLog customentry.c var-she...
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src/ui/gui ChangeLog customentry.c var-she... |
Date: |
Wed, 25 Jul 2007 01:33:02 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 07/07/25 01:33:02
Modified files:
src/ui/gui : ChangeLog customentry.c var-sheet.c
Log message:
Made Missing Values and Value Label cells non-editable, if the variable
is a long string variable.
Closes bug #20564
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/ChangeLog?cvsroot=pspp&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/customentry.c?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/var-sheet.c?cvsroot=pspp&r1=1.23&r2=1.24
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/ChangeLog,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- ChangeLog 18 Jul 2007 00:50:58 -0000 1.71
+++ ChangeLog 25 Jul 2007 01:33:02 -0000 1.72
@@ -1,3 +1,13 @@
+2007-07-25 John Darrington <address@hidden>
+
+ * 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 <address@hidden>
* psppire-case-file.c psppire-case-file.h psppire-data-store.c
Index: customentry.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/customentry.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- customentry.c 7 Jul 2007 06:14:27 -0000 1.8
+++ customentry.c 25 Jul 2007 01:33:02 -0000 1.9
@@ -1,5 +1,5 @@
/* 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
@@ -259,6 +259,7 @@
if (GTK_WIDGET_DRAWABLE (widget))
{
+ gboolean is_editable;
GtkShadowType shadow_type;
GdkRectangle rect;
@@ -275,14 +276,14 @@
shadow_type = psppire_custom_entry_get_shadow_type (ce);
- if (shadow_type != GTK_SHADOW_NONE)
- {
+ g_object_get (widget, "editable", &is_editable, NULL);
+
gtk_paint_box (widget->style, ce->panel,
- GTK_STATE_NORMAL, shadow_type,
+ 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);
}
@@ -370,10 +371,13 @@
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);
}
Index: var-sheet.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/var-sheet.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- var-sheet.c 7 Jul 2007 06:14:30 -0000 1.23
+++ var-sheet.c 25 Jul 2007 01:33:02 -0000 1.24
@@ -1,5 +1,5 @@
/* 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
@@ -206,7 +206,7 @@
{
GtkSheetCellAttr attributes;
PsppireVarStore *var_store ;
- struct variable *pv ;
+ struct variable *var ;
GladeXML *xml;
@@ -223,13 +223,13 @@
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 =
@@ -245,9 +245,10 @@
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;
@@ -265,13 +266,13 @@
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;
@@ -280,11 +281,15 @@
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",
@@ -292,6 +297,7 @@
val_labs_dialog);
}
break;
+
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
@@ -302,6 +308,11 @@
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);
@@ -331,7 +342,7 @@
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",
@@ -339,6 +350,7 @@
var_type_dialog);
}
break;
+
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
@@ -355,7 +367,7 @@
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:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/ui/gui ChangeLog customentry.c var-she...,
John Darrington <=