[gtkmm] Gtk::SearchEntry: Add handle_event() and new signals



commit 0188550a916ce5c3002cfbd1a4b213849eb0b11c
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Tue Mar 31 15:02:36 2015 +0200

    Gtk::SearchEntry: Add handle_event() and new signals
    
    * gtk/src/searchbar.hg: Correct the description of the constructor.
    * gtk/src/searchentry.hg: Add handle_event(), signal_next_match(),
    signal_previous_match(), signal_stop_search().

 gtk/src/searchbar.hg   |    3 +--
 gtk/src/searchentry.hg |   22 +++++++++++++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/gtk/src/searchbar.hg b/gtk/src/searchbar.hg
index c341fd1..a177a04 100644
--- a/gtk/src/searchbar.hg
+++ b/gtk/src/searchbar.hg
@@ -52,8 +52,7 @@ public:
   /** Creates a Gtk::SearchBar.
    *
    * You will need to tell it about which widget is going to be your 
-   * text entry using Gtk::SearchBar::set_entry().
-   *
+   * text entry using Gtk::SearchBar::connect_entry().
    */
   _CTOR_DEFAULT
 
diff --git a/gtk/src/searchentry.hg b/gtk/src/searchentry.hg
index dc34ede..c64eda9 100644
--- a/gtk/src/searchentry.hg
+++ b/gtk/src/searchentry.hg
@@ -41,19 +41,39 @@ namespace Gtk
  * emits the signal_search_changed() signal which can
  * be used instead of the Gtk::Editable::signal_changed() signal.
  *
+ * The signal_previous_match(), signal_next_match()
+ * and signal_stop_search() signals can be uesd to implement
+ * moving between search results and ending the search.
+ *
+ * Often, Gtk::SearchEntry will be fed events by means of being
+ * placed inside a Gtk::SearchBar. If that is not the case,
+ * you can use handle_event() to pass events.
+ *
  * @ingroup Widgets
  * @newin{3,6}
  */
 class SearchEntry
 : public Entry
 {
-  _CLASS_GTKOBJECT(SearchEntry, GtkSearchEntry, GTK_SEARCH_ENTRY, Gtk::Entry,GtkEntry)
+  _CLASS_GTKOBJECT(SearchEntry, GtkSearchEntry, GTK_SEARCH_ENTRY, Gtk::Entry, GtkEntry)
 public:
 
   _CTOR_DEFAULT
 
+  //TODO: Use Gdk::EventKey, if we ever use Gdk::Event elsewhere in the API:
+//We use GdkEventKey* rather than GdkEvent*. See GTK+ bug https://bugzilla.gnome.org/show_bug.cgi?id=709544
+#m4 _CONVERSION(`GdkEventKey*',`GdkEvent*',`(($2)($3))')
+  _WRAP_METHOD(bool handle_event(GdkEventKey* event), gtk_search_entry_handle_event)
+
   //TODO: Remove no_default_handler when we can break ABI:
   _WRAP_SIGNAL(void search_changed(), "search-changed", no_default_handler)
+  // Although next-match, previous-match and stop-search are keybinding signals,
+  // applications shall connect to them.
+  _WRAP_SIGNAL(void next_match(), "next-match", no_default_handler)
+  _WRAP_SIGNAL(void previous_match(), "previous-match", no_default_handler)
+  _WRAP_SIGNAL(void stop_search(), "stop-search", no_default_handler)
+
+  // Gtk::SearchEntry has no properties nor vfuncs as of 3.16.
 };
 
 } /* namespace Gtk */


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