[gtkmm/gtkmm-2-24] ComboEntryText: Add append(), prepend() and insert().



commit 3634e1dc5ff30b55429ab95f3591150c331446a8
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Feb 1 12:23:20 2011 +0100

    ComboEntryText: Add append(), prepend() and insert().
    
    * gtk/gtkmm/comboboxentrytext.[h|cc]: Add append(), prepend() and insert()
    to make this API more like the API in gtkmm, deprecating append_text(),
    prepend_text() and insert_text(). Note that this whole class is deprecated
    anyway.

 ChangeLog                      |    9 +++++++++
 gtk/gtkmm/comboboxentrytext.cc |   23 ++++++++++++++++++++---
 gtk/gtkmm/comboboxentrytext.h  |   21 +++++++++++++++++++++
 3 files changed, 50 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b6b81af..75e8da2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-02-01  Murray Cumming  <murrayc murrayc com>
 
+	ComboEntryText: Add append(), prepend() and insert().
+
+	* gtk/gtkmm/comboboxentrytext.[h|cc]: Add append(), prepend() and insert() 
+	to make this API more like the API in gtkmm, deprecating append_text(), 
+	prepend_text() and insert_text(). Note that this whole class is deprecated 
+	anyway.
+
+2011-02-01  Murray Cumming  <murrayc murrayc com>
+
 	Make sure that all deprecated API is in an ifdef.
 
 	* gdk/src/display.ccg:
diff --git a/gtk/gtkmm/comboboxentrytext.cc b/gtk/gtkmm/comboboxentrytext.cc
index eb03c66..6515c2b 100644
--- a/gtk/gtkmm/comboboxentrytext.cc
+++ b/gtk/gtkmm/comboboxentrytext.cc
@@ -50,7 +50,7 @@ ComboBoxEntryText::ComboBoxEntryText(GtkComboBoxEntry* castitem)
   set_text_column(m_text_columns.m_column);
 }
 
-void ComboBoxEntryText::append_text(const Glib::ustring& text)
+void ComboBoxEntryText::append(const Glib::ustring& text)
 {
   //We can not use gtk_combo_box_append_text() here, because that can only be used if gtk_combo_box_new_text() has been used.
 
@@ -66,13 +66,13 @@ void ComboBoxEntryText::append_text(const Glib::ustring& text)
   }
 }
 
-void ComboBoxEntryText::insert_text(int position, const Glib::ustring& text)
+void ComboBoxEntryText::insert(int position, const Glib::ustring& text)
 {
   //TODO: We should not use gtk_combo_box_insert_text() here, because that can only be used if gtk_combo_box_new_text() has been used.
   gtk_combo_box_insert_text(GTK_COMBO_BOX(gobj()), position, text.c_str());
 }
 
-void ComboBoxEntryText::prepend_text(const Glib::ustring& text)
+void ComboBoxEntryText::prepend(const Glib::ustring& text)
 {
   //We can not use gtk_combo_box_prepend_text() here, because that can only be used if gtk_combo_box_new_text() has been used.
 
@@ -88,6 +88,23 @@ void ComboBoxEntryText::prepend_text(const Glib::ustring& text)
   }
 }
 
+
+void ComboBoxEntryText::append_text(const Glib::ustring& text)
+{
+  append(text);
+}
+
+void ComboBoxEntryText::insert_text(int position, const Glib::ustring& text)
+{
+  insert(position, text);
+}
+
+void ComboBoxEntryText::prepend_text(const Glib::ustring& text)
+{
+  prepend(text);
+}
+
+
 void ComboBoxEntryText::clear_items()
 {
   //Ideally, we would just store the ListStore as a member variable, but we forgot to do that and not it would break the ABI.
diff --git a/gtk/gtkmm/comboboxentrytext.h b/gtk/gtkmm/comboboxentrytext.h
index 1067d4d..944971e 100644
--- a/gtk/gtkmm/comboboxentrytext.h
+++ b/gtk/gtkmm/comboboxentrytext.h
@@ -62,14 +62,35 @@ public:
   /** Add an item to the end of the drop-down list.
    * @param text The text for the item.
    */
+  void append(const Glib::ustring& text);
+
+  void insert(int position, const Glib::ustring& text);
+
+  /** Add an item to the beginning of the drop-down list.
+   * @param text The text for the item.
+   */
+  void prepend(const Glib::ustring& text);
+
+#ifndef GTKMM_DISABLE_DEPRECATED
+  /** Add an item to the end of the drop-down list.
+   * @param text The text for the item.
+   *
+   * @deprecated Use append().
+   */
   void append_text(const Glib::ustring& text);
 
+  /**
+   * @deprecated Use insert().
+   */
   void insert_text(int position, const Glib::ustring& text);
 
   /** Add an item to the beginning of the drop-down list.
    * @param text The text for the item.
+   *
+   * @deprecated Use prepend().
    */
   void prepend_text(const Glib::ustring& text);
+#endif //GTKMM_DISABLE_DEPRECATED
 
   //@deprecated Use get_entry()->get_text() to get the actual entered text.
   Glib::ustring get_active_text() const;



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