[gtkmm] Remove ComboBoxEntry and ComboBoxEntryText.



commit 684a372b04b0737446f002e465f73824039bdc24
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Oct 14 12:26:29 2010 +0200

    Remove ComboBoxEntry and ComboBoxEntryText.
    
    * gtk/src/comboboxentry.[h|ccg]: Remove this because it has been replaced
      with a has-entry construct-time property.
    * gtk/gtkmm/comboboxentrytext.[h|cc]: Remove this because it derives
      from ComboBoxEntry. People should use ComboBoxText instead.
      * gtk/src/combobox.hg: Changed constructors to add an optional has_entry
      parameter.

 ChangeLog                      |   11 ++++
 gtk/gtkmm/comboboxentrytext.cc |  118 ----------------------------------------
 gtk/gtkmm/comboboxentrytext.h  |   99 ---------------------------------
 gtk/gtkmm/filelist.am          |    2 -
 gtk/src/combobox.ccg           |   15 ++++-
 gtk/src/combobox.hg            |   59 ++++++++++++--------
 gtk/src/comboboxentry.ccg      |   50 -----------------
 gtk/src/comboboxentry.hg       |  107 ------------------------------------
 gtk/src/filelist.am            |    1 -
 9 files changed, 59 insertions(+), 403 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 345b915..8dc982c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-10-14  Murray Cumming  <murrayc murrayc com>
 
+	Remove ComboBoxEntry and ComboBoxEntryText.
+
+	* gtk/src/comboboxentry.[h|ccg]: Remove this because it has been replaced
+  with a has-entry construct-time property.
+	* gtk/gtkmm/comboboxentrytext.[h|cc]: Remove this because it derives
+  from ComboBoxEntry. People should use ComboBoxText instead.
+  * gtk/src/combobox.hg: Changed constructors to add an optional has_entry
+  parameter.
+
+2010-10-14  Murray Cumming  <murrayc murrayc com>
+
 	Remove WrapBox.
 
   * gtk/src/filelist.am:
diff --git a/gtk/gtkmm/filelist.am b/gtk/gtkmm/filelist.am
index 0a91b8b..f28189e 100644
--- a/gtk/gtkmm/filelist.am
+++ b/gtk/gtkmm/filelist.am
@@ -8,7 +8,6 @@ gtkmm_files_extra_cc =			\
 	accelkey.cc			\
 	accelmap.cc			\
 	cellrenderer_generation.cc	\
-	comboboxentrytext.cc		\
 	comboboxtext.cc			\
 	listviewtext.cc			\
 	object.cc \
@@ -26,7 +25,6 @@ gtkmm_files_extra_h =			\
 	base.h				\
 	border.h			\
 	cellrenderer_generation.h	\
-	comboboxentrytext.h		\
 	comboboxtext.h			\
 	listviewtext.h			\
 	object.h \
diff --git a/gtk/src/combobox.ccg b/gtk/src/combobox.ccg
index 981db1f..dd2292d 100644
--- a/gtk/src/combobox.ccg
+++ b/gtk/src/combobox.ccg
@@ -1,7 +1,7 @@
 // -*- c++ -*-
 /* $Id: combobox.ccg,v 1.9 2006/05/10 20:59:27 murrayc Exp $ */
 
-/* 
+/*
  *
  * Copyright 2003 The gtkmm Development Team
  *
@@ -28,6 +28,16 @@
 namespace Gtk
 {
 
+ComboBox::ComboBox(bool has_entry)
+:
+  _CONSTRUCT("has-entry", gboolean(has_entry))
+{}
+
+ComboBox::ComboBox(const Glib::RefPtr<TreeModel>& model, bool has_entry)
+:
+  _CONSTRUCT("model", Glib::unwrap(model), "has-entry", gboolean(has_entry))
+{}
+
 void ComboBox::unset_active()
 {
   gtk_combo_box_set_active(gobj(), -1 /* see GTK+ docs */);
@@ -45,7 +55,7 @@ TreeModel::iterator ComboBox::get_active()
     //It must be given the model, because the C++ wrapper has extra information.
     iter.set_model_gobject(model->gobj());
   }
-  
+
   return iter;
 }
 
@@ -89,4 +99,3 @@ void ComboBox::unset_row_separator_func()
 }
 
 } // namespace Gtk
-
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index e2a179d..1ffc062 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -1,7 +1,7 @@
 /* $Id: combobox.hg,v 1.17 2006/09/19 20:08:42 murrayc Exp $ */
 
 /* combobox.h
- * 
+ *
  * Copyright (C) 2003 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -36,15 +36,15 @@ namespace Gtk
 
 /** A widget used to choose from a list of items.
  *
- * A ComboBox is a widget that allows the user to choose from a list of valid choices. The ComboBox displays the 
- * selected choice. When activated, the ComboBox displays a popup which allows the user to make a new choice. The 
- * style in which the selected value is displayed, and the style of the popup is determined by the current theme. 
+ * A ComboBox is a widget that allows the user to choose from a list of valid choices. The ComboBox displays the
+ * selected choice. When activated, the ComboBox displays a popup which allows the user to make a new choice. The
+ * style in which the selected value is displayed, and the style of the popup is determined by the current theme.
  * It may be similar to a OptionMenu, or similar to a Windows-style combo box.
  *
- * The ComboBox uses the model-view pattern; the list of valid choices is specified in the form of a tree model, 
- * and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in 
- * a tree view. This is possible since ComboBox implements the CellLayout interface. The tree model holding the 
- * valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree 
+ * The ComboBox uses the model-view pattern; the list of valid choices is specified in the form of a tree model,
+ * and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in
+ * a tree view. This is possible since ComboBox implements the CellLayout interface. The tree model holding the
+ * valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree
  * structure.
  *
  * The ComboBox widget looks like this:
@@ -63,11 +63,20 @@ class ComboBox
   _IMPLEMENTS_INTERFACE(CellLayout)
   _IMPLEMENTS_INTERFACE(CellEditable)
 public:
-  _CTOR_DEFAULT()
-  
+
+  /** Creates a new empty #GtkComboBox, optionally with an entry.
+   * @param has_entry If this is true then this will have an Entry widget.
+   */
+  explicit ComboBox(bool has_entry = false);
+  _IGNORE(gtk_combo_box_new_with_entry)
+
   /** Creates a new ComboBox with the model initialized to @a model.
+   * @param model The model containing data to display in the ComboBox.
+   * @param has_entry If this is true then this will have an Entry widget.
    */
-  _WRAP_CTOR(ComboBox(const Glib::RefPtr<TreeModel>& model), gtk_combo_box_new_with_model)
+  explicit ComboBox(const Glib::RefPtr<TreeModel>& model, bool has_entry = false);
+  _IGNORE(gtk_combo_box_new_with_model)
+
   _IGNORE(gtk_combo_box_new, gtk_combo_box_new_text) //See ComboBoxText for an equivalent of gtk_combo_box_new_text().
 
 
@@ -96,16 +105,16 @@ public:
    * @result The iterator.
    */
   TreeModel::iterator get_active();
-  
+
   /** Gets an iterator that points to the current active item, if it exists.
    * @result The iterator.
    */
   TreeModel::const_iterator get_active() const;
   _IGNORE(gtk_combo_box_get_active_iter)
-    
+
   _WRAP_METHOD(void set_active(int index), gtk_combo_box_set_active)
   _WRAP_METHOD(void set_active(const TreeModel::iterator& iter), gtk_combo_box_set_active_iter)
-  
+
   /** Causes no item to be active. See also set_active().
    */
   void unset_active();
@@ -122,15 +131,15 @@ public:
    */
   void unset_model();
 
-  typedef TreeView::SlotRowSeparator SlotRowSeparator;  
-  
-  /** Sets the row separator function, which is used to determine whether a row should be drawn as a separator. 
+  typedef TreeView::SlotRowSeparator SlotRowSeparator;
+
+  /** Sets the row separator function, which is used to determine whether a row should be drawn as a separator.
    * See also unset_row_separator_func().
-   * 
+   *
    * @param slot The callback.
    */
   void set_row_separator_func(const SlotRowSeparator& slot);
-  
+
   /** Causes no separators to be drawn.
    */
   void unset_row_separator_func();
@@ -139,6 +148,11 @@ public:
   _WRAP_METHOD(void set_button_sensitivity(SensitivityType sensitivity), gtk_combo_box_set_button_sensitivity)
   _WRAP_METHOD(SensitivityType get_button_sensitivity() const, gtk_combo_box_get_button_sensitivity)
 
+
+  _WRAP_METHOD(bool get_has_entry() const, gtk_combo_box_get_has_entry)
+  _WRAP_METHOD(void set_entry_text_column(int text_column), gtk_combo_box_set_entry_text_column)
+  _WRAP_METHOD(int get_entry_text_column() const, gtk_combo_box_get_entry_text_column)
+
   _WRAP_METHOD(void popup(), gtk_combo_box_popup)
   _WRAP_METHOD(void popup(const Glib::RefPtr<Gdk::Device>& device), gtk_combo_box_popup_for_device)
   _WRAP_METHOD(void popdown(), gtk_combo_box_popdown)
@@ -162,17 +176,16 @@ public:
 
   /** The changed signal gets emitted when the active
    * item is changed. This can be due to the user selecting
-   * a different item from the list, or due to a 
+   * a different item from the list, or due to a
    * call to set_active_iter().
    */
   _WRAP_SIGNAL(void changed(), "changed")
 
   //Key-binding signals:
   _IGNORE_SIGNAL("move-active")
-  _IGNORE_SIGNAL("popup")  
-  _IGNORE_SIGNAL("popdown")                                           
+  _IGNORE_SIGNAL("popup")
+  _IGNORE_SIGNAL("popdown")
 };
 
 
 } // namespace Gtk
-
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 9a0adfe..0eb6b47 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -52,7 +52,6 @@ gtkmm_files_any_hg =		\
 	colorbutton.hg		\
 	colorselection.hg	\
 	combobox.hg	\
-	comboboxentry.hg	\
 	container.hg		\
 	dialog.hg		\
 	drawingarea.hg		\



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