[gnumeric] Fix effect of rolling-up expression entries on the default widget. [#651173]



commit 70eedad09cca1b9007ded376a13b958a0ac97bb4
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu May 26 12:24:17 2011 -0600

    Fix effect of rolling-up expression entries on the default widget. [#651173]
    
    2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* gnumeric-expr-entry.c (cb_icon_clicked): reset default widget
    	(gnm_expr_entry_grab_focus): set position at the end of the entry
    
    2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-analysis-tools.c (tool_load_selection): select the entered
    	range

 NEWS                                |    2 ++
 src/dialogs/ChangeLog               |    5 +++++
 src/dialogs/dialog-analysis-tools.c |    3 ++-
 src/widgets/ChangeLog               |    5 +++++
 src/widgets/gnumeric-expr-entry.c   |   13 ++++++++++---
 5 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index 09da2d8..290fd7b 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Andreas
 	* Extend the goto dialog.
 	* Extend the address box to handle both A1 and R1C1 style addresses.
 	  [#650941]
+	* Fix effect of rolling-up expression entries on the default
+	  widget. [#651173]
 
 Morten:
 	* Fix leaks in SHEET.  [#650761]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 73ee43e..9c0d907 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* dialog-analysis-tools.c (tool_load_selection): select the entered
+	range
+
+2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* help.h (GNUMERIC_HELP_LINK_GOTO_CELL): use a valid id
 	* goto.ui: add spin buttons
 	* dialog-goto-cell.c (dialog_goto_get_val): new
diff --git a/src/dialogs/dialog-analysis-tools.c b/src/dialogs/dialog-analysis-tools.c
index 4c76e9d..6d2a8a7 100644
--- a/src/dialogs/dialog-analysis-tools.c
+++ b/src/dialogs/dialog-analysis-tools.c
@@ -526,7 +526,8 @@ tool_load_selection (GenericToolState *state, gboolean allow_multiple)
 
 	gtk_widget_show (state->dialog);
 	gnm_expr_entry_grab_focus (GNM_EXPR_ENTRY (state->input_entry),
-				   FALSE);
+				   TRUE);
+	
 }
 
 
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index abe4b3c..8808021 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-26  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* gnumeric-expr-entry.c (cb_icon_clicked): reset default widget
+	(gnm_expr_entry_grab_focus): set position at the end of the entry
+
 2011-05-23  Morten Welinder  <terra gnome org>
 
 	* gnumeric-expr-entry.c (gee_set_with_icon): Extract from
diff --git a/src/widgets/gnumeric-expr-entry.c b/src/widgets/gnumeric-expr-entry.c
index 8a2c210..3d0780f 100644
--- a/src/widgets/gnumeric-expr-entry.c
+++ b/src/widgets/gnumeric-expr-entry.c
@@ -271,6 +271,8 @@ cb_icon_clicked (GtkButton *icon,
 			gtk_window_get_size (GTK_WINDOW (toplevel), &width, &height);
 			g_object_set_data (G_OBJECT (entry), "old_window_width", GUINT_TO_POINTER (width));
 			g_object_set_data (G_OBJECT (entry), "old_window_height", GUINT_TO_POINTER (height));
+			g_object_set_data (G_OBJECT (entry), "old_default", 
+					   gtk_window_get_default_widget (GTK_WINDOW (toplevel)));
 
 			container_props = NULL;
 
@@ -308,6 +310,7 @@ cb_icon_clicked (GtkButton *icon,
 
 		} else {
 			int i;
+			gpointer default_widget;
 
 			/* reset rolled-up window */
 
@@ -335,6 +338,11 @@ cb_icon_clicked (GtkButton *icon,
 			gtk_window_resize (GTK_WINDOW (toplevel),
 					   GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "old_window_width")),
 					   GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "old_window_height")));
+			default_widget = g_object_get_data (G_OBJECT (entry), "old_default");
+			if (default_widget != NULL) {
+				gtk_window_set_default (GTK_WINDOW (toplevel), GTK_WIDGET (default_widget));
+				g_object_set_data (G_OBJECT (entry), "old_default", NULL);
+			}
 
 			g_object_set_data (G_OBJECT (entry), "old_entry_parent", NULL);
 			g_object_set_data (G_OBJECT (entry), "old_toplevel_child", NULL);
@@ -2676,9 +2684,8 @@ gnm_expr_entry_grab_focus (GnmExprEntry *gee, gboolean select_all)
 
 	gtk_widget_grab_focus (GTK_WIDGET (gee->entry));
 	if (select_all) {
-		gtk_editable_set_position (GTK_EDITABLE (gee->entry), 0);
-		gtk_editable_select_region (GTK_EDITABLE (gee->entry), 0,
-					    gtk_entry_get_text_length (gee->entry));
+		gtk_editable_set_position (GTK_EDITABLE (gee->entry), -1);
+		gtk_editable_select_region (GTK_EDITABLE (gee->entry), 0, -1);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]