[Gnucash-changes] r12939 - gnucash/trunk/src/gnome-utils - Add support for setting these widgets as the target of a GtkLabel

David Hampton hampton at cvs.gnucash.org
Sun Jan 22 13:54:57 EST 2006


Author: hampton
Date: 2006-01-22 13:54:56 -0500 (Sun, 22 Jan 2006)
New Revision: 12939
Trac: http://svn.gnucash.org/trac/changeset/12939

Modified:
   gnucash/trunk/src/gnome-utils/gnc-date-edit.c
   gnucash/trunk/src/gnome-utils/gnc-date-edit.h
   gnucash/trunk/src/gnome-utils/gnc-general-select.c
   gnucash/trunk/src/gnome-utils/gnc-general-select.h
Log:
Add support for setting these widgets as the target of a GtkLabel
access key.


Modified: gnucash/trunk/src/gnome-utils/gnc-date-edit.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-date-edit.c	2006-01-22 10:56:47 UTC (rev 12938)
+++ gnucash/trunk/src/gnome-utils/gnc-date-edit.c	2006-01-22 18:54:56 UTC (rev 12939)
@@ -992,6 +992,23 @@
 }
 
 
+/** Sets the editable field from a GNCDateEdit widget as the target
+ *  for the specified label's access key.
+ *
+ *  @param gde The date editor to set as the target.
+ *
+ *  @param label The label whose access key should set focus to this
+ *  widget. */
+void
+gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label)
+{
+	if (!gde)
+		return;
+
+	gtk_label_set_mnemonic_widget (GTK_LABEL(label), gde->date_entry);
+}
+
+
 /*
   Local Variables:
   c-basic-offset: 8

Modified: gnucash/trunk/src/gnome-utils/gnc-date-edit.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-date-edit.h	2006-01-22 10:56:47 UTC (rev 12938)
+++ gnucash/trunk/src/gnome-utils/gnc-date-edit.h	2006-01-22 18:54:56 UTC (rev 12939)
@@ -129,4 +129,6 @@
 int       gnc_date_edit_get_flags       (GNCDateEdit *gde);
 
 void      gnc_date_activates_default    (GNCDateEdit *gde, gboolean state);
+
+void      gnc_date_make_mnemonic_target (GNCDateEdit *gde, GtkWidget *label);
 #endif

Modified: gnucash/trunk/src/gnome-utils/gnc-general-select.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-general-select.c	2006-01-22 10:56:47 UTC (rev 12938)
+++ gnucash/trunk/src/gnome-utils/gnc-general-select.c	2006-01-22 18:54:56 UTC (rev 12939)
@@ -314,6 +314,24 @@
         return gsl->selected_item;
 }
 
+/** Sets the editable field from a general selection widget as the
+ *  target for the specified label's access key.
+ *
+ *  @param gde The date editor to set as the target.
+ *
+ *
+ *  @param label The label whose access key should set focus to this
+ *  widget. */
+void
+gnc_general_select_make_mnemonic_target (GNCGeneralSelect *gsl, GtkWidget *label)
+{
+        g_return_if_fail(gsl);
+        g_return_if_fail(GNC_IS_GENERAL_SELECT(gsl));
+        g_return_if_fail(label);
+
+	gtk_label_set_mnemonic_widget (GTK_LABEL(label), gsl->entry);
+}
+
 /*
   Local Variables:
   c-basic-offset: 8

Modified: gnucash/trunk/src/gnome-utils/gnc-general-select.h
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-general-select.h	2006-01-22 10:56:47 UTC (rev 12938)
+++ gnucash/trunk/src/gnome-utils/gnc-general-select.h	2006-01-22 18:54:56 UTC (rev 12939)
@@ -78,6 +78,8 @@
 					      gpointer selection);
 GType      gnc_general_select_get_type       (void);
 
+void       gnc_general_select_make_mnemonic_target (GNCGeneralSelect *gsl, GtkWidget *label);
+
 #endif
 
 /*



More information about the gnucash-changes mailing list