[gtkmm/gtkmm-2-24] ComobBoxText: Add append(), prepend() and insert(), deprecating *_text().



commit 659fa907581ae9dcbfe8c73ef5d97b93c2dcc3d0
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 14 17:54:59 2011 +0100

    ComobBoxText: Add append(), prepend() and insert(), deprecating *_text().
    
    	* gtk/gtkmm/comboboxtext.[h|cc]: Add append(), prepend() and insert(),
    	depreacting append_text(), prepend_text() and insert_text(), so that the API
    	matches the on in gtkmm 3 more. However, there is a bug open about
    	making sure that this is consistent across other classes.

 ChangeLog                 |    9 +++++++++
 gtk/gtkmm/comboboxtext.cc |   22 +++++++++++++++++++---
 gtk/gtkmm/comboboxtext.h  |   23 ++++++++++++++++++++++-
 3 files changed, 50 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a7a8f10..b64741d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-01-14  Murray Cumming  <murrayc murrayc com>
 
+	ComobBoxText: Add append(), prepend() and insert(), deprecating *_text().
+
+	* gtk/gtkmm/comboboxtext.[h|cc]: Add append(), prepend() and insert(),
+	depreacting append_text(), prepend_text() and insert_text(), so that the API
+	matches the on in gtkmm 3 more. However, there is a bug open about 
+	making sure that this is consistent across other classes.
+
+2011-01-14  Murray Cumming  <murrayc murrayc com>
+
 	Widget: Deprecated hide_all().
 
 	* gtk/src/widget.hg: The existing hide() method should be used instead.
diff --git a/gtk/gtkmm/comboboxtext.cc b/gtk/gtkmm/comboboxtext.cc
index c23cc7d..6094ccf 100644
--- a/gtk/gtkmm/comboboxtext.cc
+++ b/gtk/gtkmm/comboboxtext.cc
@@ -54,8 +54,7 @@ ComboBoxText::ComboBoxText(GtkComboBox* castitem)
   pack_start(m_text_columns.m_column);
 }
 
-
-void ComboBoxText::append_text(const Glib::ustring& text)
+void ComboBoxText::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.
 
@@ -71,13 +70,30 @@ void ComboBoxText::append_text(const Glib::ustring& text)
   }
 }
 
+#ifndef GTKMM_DISABLE_DEPRECATED
+void ComboBoxText::append_text(const Glib::ustring& text)
+{
+  append(text);
+}
+
+void ComboBoxText::prepend_text(const Glib::ustring& text)
+{
+  append(text);
+}
+
 void ComboBoxText::insert_text(int position, const Glib::ustring& text)
 {
+  insert(position, text);
+}
+#endif //GTKMM_DISABLE_DEPRECATED
+
+void ComboBoxText::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(gobj(), position, text.c_str());
 }
 
-void ComboBoxText::prepend_text(const Glib::ustring& text)
+void ComboBoxText::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.
 
diff --git a/gtk/gtkmm/comboboxtext.h b/gtk/gtkmm/comboboxtext.h
index 631b9f5..2534c8f 100644
--- a/gtk/gtkmm/comboboxtext.h
+++ b/gtk/gtkmm/comboboxtext.h
@@ -69,14 +69,35 @@ public:
   /** Add an item to the end of the drop-down list.
    * @param text The text for the item.
    */
-  void append_text(const Glib::ustring& text);
+  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
 
   /** Get the currently-chosen item.
    * @result The text of the active item.



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