gnumeric r16892 - in trunk: . src/dialogs



Author: guelzow
Date: Sat Oct 18 03:00:49 2008
New Revision: 16892
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16892&view=rev

Log:
2008-10-17  Andreas J. Guelzow <aguelzow pyrshep ca>

	* function-select.glade: we should not have a viewport
	  around the textview
	* dialog-function-select.c (dialog_function_select_init):
	  set a mark at the beginning ot the textview
	(cb_dialog_function_select_cat_selection_changed): scroll to
	  top of function list
	(cb_dialog_function_select_fun_selection_changed): scroll to
	  top of description
	(FunctionSelectState): store the textview not the buffer (and change
	  the accesses to the buffer throughout)




Modified:
   trunk/NEWS
   trunk/src/dialogs/ChangeLog
   trunk/src/dialogs/dialog-function-select.c
   trunk/src/dialogs/function-select.glade

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sat Oct 18 03:00:49 2008
@@ -27,6 +27,7 @@
 	* Update some of the analysis tools documentation.
 	* Add non-numeric frequency tables tool. [#134166]
 	* Add basic Kaplan-Meier Estimates Tool. [#453765]
+	* Fix scrolling issue in function selector. [#556718]
 
 Jean:
 	* Fix printing of rotated text. [#539734]

Modified: trunk/src/dialogs/dialog-function-select.c
==============================================================================
--- trunk/src/dialogs/dialog-function-select.c	(original)
+++ trunk/src/dialogs/dialog-function-select.c	Sat Oct 18 03:00:49 2008
@@ -64,7 +64,7 @@
 	GtkTreeView   *treeview;
 	GtkListStore  *model_f;
 	GtkTreeView   *treeview_f;
-	GtkTextBuffer   *description;
+	GtkTextView   *description_view;
 
 	GSList *recent_funcs;
 
@@ -439,8 +439,15 @@
 	GtkTreeIter  iter;
 	GtkTreeModel *model;
 	GnmFunc const *func;
+	GtkTextBuffer *description;
+	GtkTextMark *mark;
 
-	gtk_text_buffer_set_text (state->description, "", 0);
+	description =  gtk_text_view_get_buffer (state->description_view);
+
+	mark = gtk_text_buffer_get_mark (description, "start-mark");
+	gtk_text_view_scroll_to_mark (state->description_view, mark,
+				      0.1, TRUE, 0.0, 0.0);
+	gtk_text_buffer_set_text (description, "", 0);
 
 	if (gtk_tree_selection_get_selected (the_selection, &model, &iter)) {
 		gtk_tree_model_get (model, &iter,
@@ -450,11 +457,12 @@
 		gnm_func_load_if_stub ((GnmFunc *)func);
 
 		if (func->help == NULL)
-			gtk_text_buffer_set_text (state->description, "?", -1);
+			gtk_text_buffer_set_text (description, "?", -1);
 		else if (func->help[0].type == GNM_FUNC_HELP_OLD)
-			describe_old_style (state->description, func);
+			describe_old_style (description, func);
 		else
-			describe_new_style (state->description, func);
+			describe_new_style (description, func);
+
 		gtk_widget_set_sensitive (state->ok_button, TRUE);
 	} else {
 		gtk_widget_set_sensitive (state->ok_button, FALSE);
@@ -508,6 +516,8 @@
 			}
 		}
 
+		gtk_tree_view_scroll_to_point (state->treeview_f, 0, 0);
+
 		if (funcs != state->recent_funcs)
 			g_slist_free (funcs);
 	}
@@ -519,7 +529,8 @@
 	GtkWidget *scrolled;
 	GtkTreeViewColumn *column;
 	GtkTreeSelection *selection;
-	GtkTextView *textview;
+	GtkTextIter where;
+	GtkTextBuffer *description;
 
 	dialog_function_load_recent_funcs (state);
 
@@ -572,8 +583,10 @@
 	gtk_paned_set_position (GTK_PANED (glade_xml_get_widget
 					   (state->gui, "vpaned1")), 300);
 
-	textview = GTK_TEXT_VIEW (glade_xml_get_widget (state->gui, "description"));
-	state->description =  gtk_text_view_get_buffer (textview);
+	state->description_view = GTK_TEXT_VIEW (glade_xml_get_widget (state->gui, "description"));
+	description = gtk_text_view_get_buffer (state->description_view);
+	gtk_text_buffer_get_start_iter (description, &where);
+	gtk_text_buffer_create_mark (description, "start-mark", &where, TRUE);
 
 	state->ok_button = glade_xml_get_widget (state->gui, "ok_button");
 	gtk_widget_set_sensitive (state->ok_button, FALSE);

Modified: trunk/src/dialogs/function-select.glade
==============================================================================
--- trunk/src/dialogs/function-select.glade	(original)
+++ trunk/src/dialogs/function-select.glade	Sat Oct 18 03:00:49 2008
@@ -114,16 +114,11 @@
                     <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                     <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
                     <child>
-                      <widget class="GtkViewport" id="viewport1">
+                      <widget class="GtkTextView" id="description">
                         <property name="visible">True</property>
-                        <child>
-                          <widget class="GtkTextView" id="description">
-                            <property name="visible">True</property>
-                            <property name="editable">False</property>
-                            <property name="wrap_mode">GTK_WRAP_WORD</property>
-                            <property name="cursor_visible">False</property>
-                          </widget>
-                        </child>
+                        <property name="editable">False</property>
+                        <property name="wrap_mode">GTK_WRAP_WORD</property>
+                        <property name="cursor_visible">False</property>
                       </widget>
                     </child>
                   </widget>



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