[gtkmm] Entry: Added get_text_area() and get_icon_area().



commit 64d24dbc7c1464741668306bf6ca6283226fc1ca
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Oct 22 23:02:30 2010 +0200

    Entry: Added get_text_area() and get_icon_area().
    
    * gtk/src/entry.[hg|ccg]: Added get_text_area() and get_icon_area().

 ChangeLog         |    6 ++++++
 gtk/src/entry.ccg |   13 +++++++++++++
 gtk/src/entry.hg  |   27 +++++++++++++++++++++++++++
 3 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 35c4402..3425092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-10-22  Murray Cumming  <murrayc murrayc com>
 
+	Entry: Added get_text_area() and get_icon_area().
+
+	* gtk/src/entry.[hg|ccg]: Added get_text_area() and get_icon_area().
+
+2010-10-22  Murray Cumming  <murrayc murrayc com>
+
 	Fix the build with latest GTK+, adding Scrollable interface.
 
   * gtk/src/gtk_methods.defs: Regenerated with h2defs.py.
diff --git a/gtk/src/entry.ccg b/gtk/src/entry.ccg
index 296213c..c77ec32 100644
--- a/gtk/src/entry.ccg
+++ b/gtk/src/entry.ccg
@@ -66,5 +66,18 @@ void Entry::set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gd
   gtk_entry_set_icon_drag_source(gobj(), ((GtkEntryIconPosition)(icon_pos)), const_cast<GtkTargetList*>(Glib::unwrap(target_list)), ((GdkDragAction)(actions))); 
 }
 
+Gdk::Rectangle Entry::get_text_area() const
+{
+  Gdk::Rectangle result;
+  gtk_entry_get_text_area(const_cast<GtkEntry*>(gobj()), result.gobj());
+  return result;
+}
 
+Gdk::Rectangle Entry::get_icon_area(EntryIconPosition icon_pos) const
+{
+  Gdk::Rectangle result;
+  gtk_entry_get_icon_area(const_cast<GtkEntry*>(gobj()), (GtkEntryIconPosition)icon_pos, result.gobj());
+  return result;
+}
+  
 } //namespace Gtk
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index dc86b47..91289c0 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -67,6 +67,19 @@ public:
   _WRAP_METHOD(Glib::RefPtr<EntryBuffer> get_buffer(), gtk_entry_get_buffer, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const EntryBuffer> get_buffer() const, gtk_entry_get_buffer, refreturn, constversion)
 
+
+  /** Returns the area where the entry's text is drawn. 
+   * This function is useful when drawing something to the entry in a draw callback.
+   *
+   * See also get_icon_area().
+   *
+   * @result The location for the text area.
+   *
+   * @newin{3,0}
+   **/
+  Gdk::Rectangle get_text_area() const;
+  _IGNORE(gtk_entry_get_text_area)
+                                                 
   _WRAP_METHOD(void set_buffer(const Glib::RefPtr<EntryBuffer>& buffer), gtk_entry_set_buffer)
   _WRAP_METHOD(void set_visibility(bool visible = true), gtk_entry_set_visibility)
   _WRAP_METHOD(bool get_visibility() const, gtk_entry_get_visibility)
@@ -165,6 +178,20 @@ public:
   void set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list, Gdk::DragAction actions = Gdk::ACTION_COPY, EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY);
   _IGNORE(gtk_entry_set_icon_drag_source)
 
+  /** Returns the area where entry's icon at @a icon_pos is drawn.
+   * This function is useful when drawing something to the
+   * entry in a draw callback.
+   *
+   * See also get_text_area().
+   *
+   * @param icon_pos Icon position.
+   * @result The location for the icon area.
+   *
+   * @newin{3,0}
+   */
+  Gdk::Rectangle get_icon_area(EntryIconPosition icon_pos = ENTRY_ICON_PRIMARY) const;
+  _IGNORE(gtk_entry_get_icon_area)
+                                                          
   _WRAP_METHOD(int get_current_icon_drag_source(), gtk_entry_get_current_icon_drag_source)
   _WRAP_METHOD(bool im_context_filter_keypress(GdkEventKey* event), gtk_entry_im_context_filter_keypress)
   _WRAP_METHOD(void reset_im_context(), gtk_entry_reset_im_context)



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