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

gEDA-cvs: branch: master updated (1.1.1.20070708-29-gae2ddeb)



The branch, master has been updated
       via  ae2ddeb6839ae4e2c9e9c73272b0372c63810717 (commit)
      from  31f65059cf1ce5be9b8a0987d4538fed075a6805 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/x_multiattrib.c |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)


=================
 Commit Messages
=================

commit ae2ddeb6839ae4e2c9e9c73272b0372c63810717
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Jul 25 15:36:42 2007 +0100

    Don't blank the add attribute boxes in the Multiattrib dialog.
    
    Leaving the text present after adding an attribute makes it is easier to
    add the same attribute to multiple objects. Instead we add a "grab-focus"
    signal handler to select the text box contents as we tab into it.

:100644 100644 8152907... 6010291... M	gschem/src/x_multiattrib.c

=========
 Changes
=========

commit ae2ddeb6839ae4e2c9e9c73272b0372c63810717
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Jul 25 15:36:42 2007 +0100

    Don't blank the add attribute boxes in the Multiattrib dialog.
    
    Leaving the text present after adding an attribute makes it is easier to
    add the same attribute to multiple objects. Instead we add a "grab-focus"
    signal handler to select the text box contents as we tab into it.

diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 8152907..6010291 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -1100,6 +1100,26 @@ static gboolean multiattrib_callback_value_key_pressed(GtkWidget *widget,
   return retval;
 }
 
+
+/*! \brief GtkWidget "grab-focus" signal handler
+ *
+ *  \par Function Description
+ *  Select the text in the GtkTextView so it may be over-typed quickly
+ */
+static void multiattrib_callback_value_grab_focus (GtkWidget *widget,
+                                                   gpointer user_data)
+{
+  GtkTextView *textview = GTK_TEXT_VIEW (widget);
+  GtkTextBuffer *textbuffer;
+  GtkTextIter startiter, enditer;
+
+  textbuffer = gtk_text_view_get_buffer (textview);
+  gtk_text_buffer_get_iter_at_offset (textbuffer, &startiter, 0);
+  gtk_text_buffer_get_iter_at_offset (textbuffer, &enditer, -1);
+  gtk_text_buffer_select_range (textbuffer, &enditer, &startiter);
+}
+
+
 /*! \todo Finish function documentation
  *  \brief
  *  \par Function Description
@@ -1145,22 +1165,8 @@ static void multiattrib_callback_button_add(GtkButton *button,
                                     name, value,
                                     visible, shownv);
   g_free (value);
-  
-  /* clear fields of lower frame */
-  /*   - resets entry for name */
-  gtk_list_select_item (GTK_LIST (multiattrib->combo_name->list), 0);
-  /*   - resets entry for value */
-  gtk_text_buffer_set_text (buffer, "", 0);
-  /*   - resets entry for visibility */
-  g_object_set (multiattrib->button_visible,
-                "active", TRUE,
-                NULL);
-  /*   - resets entry for show name/value */
-  gtk_option_menu_set_history (multiattrib->optionmenu_shownv,
-                               0);
-  
+
   multiattrib_update (multiattrib);
-  
 }
 
 /*! \todo Finish function documentation
@@ -1737,6 +1743,10 @@ static void multiattrib_init(Multiattrib *multiattrib)
 		    "key_press_event",
 		    G_CALLBACK (multiattrib_callback_value_key_pressed),
 		    multiattrib);
+  g_signal_connect (textview,
+                    "grab-focus",
+                    G_CALLBACK (multiattrib_callback_value_grab_focus),
+                    multiattrib);
   gtk_container_add (GTK_CONTAINER (scrolled_win), textview);
   multiattrib->textview_value = GTK_TEXT_VIEW (textview);
   gtk_table_attach (GTK_TABLE (table), label,




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs