GNOME Bugzilla – Bug 65894
expr-entry-widget
Last modified: 2004-12-22 21:47:04 UTC
open gnumeric select correlation tool (or any other dialog with a multiple range expr entry widget) click in Input Range select a range type , select a range click in the first range select another range: the second range changes but the first one should. (if we click on `label' checkbox and then on the first range, the first range changes when the next range is being selected
This has an easy fix (we just can't ignore the meaning of a mouse click for the selection tochange: Index: src/widgets/gnumeric-expr-entry.c =================================================================== RCS file: /cvs/gnome/gnumeric/src/widgets/gnumeric-expr-entry.c,v retrieving revision 1.23 diff -u -r1.23 gnumeric-expr-entry.c --- src/widgets/gnumeric-expr-entry.c 2001/11/26 04:56:50 1.23 +++ src/widgets/gnumeric-expr-entry.c 2001/12/03 00:25:55 @@ -414,6 +414,19 @@ return result; } +static int +gnumeric_expr_entry_button_press_event (GtkWidget *widget, GdkEventButton *event) +{ + int result; + result = GTK_WIDGET_CLASS (gnumeric_expr_entry_parent_class)-> + button_press_event (widget, event); + + if (!gnumeric_expr_entry_rangesel_meaningful (GNUMERIC_EXPR_ENTRY (widget))) + scg_rangesel_stop (GNUMERIC_EXPR_ENTRY (widget)->scg, FALSE); + + return result; +} + static void gnumeric_expr_entry_class_init (GtkObjectClass *object_class) { @@ -424,6 +437,7 @@ object_class->destroy = gnumeric_expr_entry_destroy; widget_class->key_press_event = gnumeric_expr_entry_key_press_event; + widget_class->button_press_event= gnumeric_expr_entry_button_press_event; } E_MAKE_TYPE (gnumeric_expr_entry, "GnumericExprEntry", GnumericExprEntry,
hmm, that is the problem, but the fix feeling like it is at the wrong level. It is the movement of the entry cursor, not the button press, that is interesting.
Looking at the available signals I had originally thought that using the move-cursor signal of GtkEditables would be the right thing to do. Strangely that signal is never being raised... That's why I went one level up (or down?) to the mouse click.
Thanks for the reminder. I'm not going to have time to research this. Too many other things pendings. Commit the fix, and leave a nice verbose comment about why you're doing it at that level rather than higher up.
In fact I have figured out by now that for GTK2 & GNOME2 Gtk_Entry is going to have a move_cursor signal that doesn't exist yet. THat signal would be the perfect place to hook up to!
I'll commit the patch when I can connect to cvs again.
fixed in cvs