2 // Generated by gtkmmproc -- DO NOT MODIFY!
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <glibmm/listhandle.h>
30 #include <glibmm/helperlist.h>
31 #include <gtkmm/box.h>
32 #include <gtkmm/button.h>
33 #include <gtkmm/entry.h>
34 #include <gtkmm/item.h>
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 typedef struct _GtkListItem GtkListItem;
39 typedef struct _GtkListItemClass GtkListItemClass;
40 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
44 { class ComboDropDownItem_Class; } // namespace Gtk
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 typedef struct _GtkList GtkList;
47 typedef struct _GtkListClass GtkListClass;
48 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
52 { class ComboDropDown_Class; } // namespace Gtk
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 typedef struct _GtkCombo GtkCombo;
55 typedef struct _GtkComboClass GtkComboClass;
56 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
60 { class Combo_Class; } // namespace Gtk
65 /** An item in a ComboDropDownList.
67 * Items in a ComboDropDownList inherit Item. Two signals are added.
69 * @deprecated Use the ComboBox widget instead.
72 class ComboDropDownItem : public Gtk::Item
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 typedef ComboDropDownItem CppObjectType;
77 typedef ComboDropDownItem_Class CppClassType;
78 typedef GtkListItem BaseObjectType;
79 typedef GtkListItemClass BaseClassType;
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 virtual ~ComboDropDownItem();
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87 friend class ComboDropDownItem_Class;
88 static CppClassType combodropdownitem_class_;
91 ComboDropDownItem(const ComboDropDownItem&);
92 ComboDropDownItem& operator=(const ComboDropDownItem&);
95 explicit ComboDropDownItem(const Glib::ConstructParams& construct_params);
96 explicit ComboDropDownItem(GtkListItem* castitem);
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
101 #ifndef DOXYGEN_SHOULD_SKIP_THIS
102 static GType get_type() G_GNUC_CONST;
103 static GType get_base_type() G_GNUC_CONST;
106 ///Provides access to the underlying C GtkObject.
107 GtkListItem* gobj() { return reinterpret_cast<GtkListItem*>(gobject_); }
109 ///Provides access to the underlying C GtkObject.
110 const GtkListItem* gobj() const { return reinterpret_cast<GtkListItem*>(gobject_); }
114 //C++ methods used to invoke GTK+ virtual functions:
117 //GTK+ Virtual Functions (override these to change behaviour):
119 //Default Signal Handlers::
120 virtual void on_scroll_horizontal(ScrollType scroll_type, float position);
121 virtual void on_scroll_vertical(ScrollType scroll_type, float position);
131 Glib::SignalProxy2< void,ScrollType,float > signal_scroll_horizontal();
134 Glib::SignalProxy2< void,ScrollType,float > signal_scroll_vertical();
140 namespace ComboDropDown_Helpers
143 typedef Gtk::ComboDropDownItem Element;
146 class ComboDropDownList : public Glib::HelperList< ComboDropDownItem, const Element, Glib::List_Cpp_Iterator<GtkListItem,ComboDropDownItem> >
150 explicit ComboDropDownList(GtkList* gparent);
151 ComboDropDownList(const ComboDropDownList& src);
152 virtual ~ComboDropDownList() {}
154 ComboDropDownList& operator=(const ComboDropDownList& src);
156 typedef Glib::HelperList< ComboDropDownItem, const Element, Glib::List_Cpp_Iterator<GtkListItem,ComboDropDownItem> > type_base;
159 const GtkList* gparent() const;
161 virtual GList*& glist() const; // front of list
163 virtual void erase(iterator start, iterator stop);
164 virtual iterator erase(iterator); //Implented as custom or by LIST_CONTAINER_REMOVE
165 virtual void remove(const_reference); //Implented as custom or by LIST_CONTAINER_REMOVE
167 /// This is order n. (use at own risk)
168 reference operator[](size_type l) const;
171 iterator insert(iterator position, element_type& e); //custom-implemented.
173 template <class InputIterator>
174 inline void insert(iterator position, InputIterator first, InputIterator last)
176 for(;first != last; ++first)
177 position = insert(position, *first);
180 inline void push_front(element_type& e)
181 { insert(begin(), e); }
182 inline void push_back(element_type& e)
183 { insert(end(), e); }
186 iterator find(const_reference c);
187 iterator find(Widget&);
192 } /* namespace ComboDropDown_Helpers */
197 /** The dropdown list of a Combo.
199 * A combo is a compound widget which crosses a text entry area and a pull
200 * down list. The dropdown list is implemented with the deprecated GtkList
201 * widget on the gtk+ side. ComboDropDown is a thin wrapper around GtkList
202 * containing just the functionality necessary for a Combo's list. To add
203 * and remove items use the STL-style interface that is accessible through
204 * ComboDropDown::children().
206 * @deprecated Use the ComboBox widget instead.
209 class ComboDropDown : public Gtk::Container
212 #ifndef DOXYGEN_SHOULD_SKIP_THIS
213 typedef ComboDropDown CppObjectType;
214 typedef ComboDropDown_Class CppClassType;
215 typedef GtkList BaseObjectType;
216 typedef GtkListClass BaseClassType;
217 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
219 virtual ~ComboDropDown();
221 #ifndef DOXYGEN_SHOULD_SKIP_THIS
224 friend class ComboDropDown_Class;
225 static CppClassType combodropdown_class_;
228 ComboDropDown(const ComboDropDown&);
229 ComboDropDown& operator=(const ComboDropDown&);
232 explicit ComboDropDown(const Glib::ConstructParams& construct_params);
233 explicit ComboDropDown(GtkList* castitem);
235 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
238 #ifndef DOXYGEN_SHOULD_SKIP_THIS
239 static GType get_type() G_GNUC_CONST;
240 static GType get_base_type() G_GNUC_CONST;
243 ///Provides access to the underlying C GtkObject.
244 GtkList* gobj() { return reinterpret_cast<GtkList*>(gobject_); }
246 ///Provides access to the underlying C GtkObject.
247 const GtkList* gobj() const { return reinterpret_cast<GtkList*>(gobject_); }
251 //C++ methods used to invoke GTK+ virtual functions:
254 //GTK+ Virtual Functions (override these to change behaviour):
256 //Default Signal Handlers::
257 virtual void on_select_child(Widget& item);
258 virtual void on_selection_changed();
259 virtual void on_unselect_child(Widget& item);
266 typedef ComboDropDown_Helpers::ComboDropDownList ComboDropDownList;
274 void scroll_horizontal(ScrollType scroll_type, float position);
276 void scroll_vertical(ScrollType scroll_type, float position);
278 ComboDropDownList& children();
279 const ComboDropDownList& children() const;
282 Glib::SignalProxy1< void,Widget& > signal_select_child();
285 Glib::SignalProxy0< void > signal_selection_changed();
288 Glib::SignalProxy1< void,Widget& > signal_unselect_child();
292 #ifndef DOXYGEN_SHOULD_SKIP_THIS
293 mutable ComboDropDownList children_proxy_;
294 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
300 class ScrolledWindow;
303 /** A text entry field with a dropdown list.
305 * A combo is a compound widget which crosses a text entry area and a pull
306 * down list. It may allow text entry or it may just allow list
307 * values depending on the settings.
309 * Access members allow altering of the widget components.
311 * @deprecated Use the ComboBox widget instead.
314 class Combo : public HBox
317 #ifndef DOXYGEN_SHOULD_SKIP_THIS
318 typedef Combo CppObjectType;
319 typedef Combo_Class CppClassType;
320 typedef GtkCombo BaseObjectType;
321 typedef GtkComboClass BaseClassType;
322 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
326 #ifndef DOXYGEN_SHOULD_SKIP_THIS
329 friend class Combo_Class;
330 static CppClassType combo_class_;
334 Combo& operator=(const Combo&);
337 explicit Combo(const Glib::ConstructParams& construct_params);
338 explicit Combo(GtkCombo* castitem);
340 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
343 #ifndef DOXYGEN_SHOULD_SKIP_THIS
344 static GType get_type() G_GNUC_CONST;
345 static GType get_base_type() G_GNUC_CONST;
348 ///Provides access to the underlying C GtkObject.
349 GtkCombo* gobj() { return reinterpret_cast<GtkCombo*>(gobject_); }
351 ///Provides access to the underlying C GtkObject.
352 const GtkCombo* gobj() const { return reinterpret_cast<GtkCombo*>(gobject_); }
356 //C++ methods used to invoke GTK+ virtual functions:
359 //GTK+ Virtual Functions (override these to change behaviour):
361 //Default Signal Handlers::
371 /** Allow direct text entry
372 * Whether the text in the entry must be or not be in the list.
374 * @param value Set to true if the value must be in list.
375 * @param empty Set to true if the text area is allowed to be empty.
378 void set_value_in_list(bool value = true, bool empty = false);
380 /** Set arrows keys to change value
381 * Up and down will scroll through the list items.
382 * Useful when there is a small list of value that the
385 * @param arrows_on true indicates the arrow keys scroll.
388 void set_use_arrows(bool arrows_on = true);
390 /** Set arrows keys to change if value not in list
391 * Up and down will scroll through the list items but only
392 * change the current value if the text does not match a list item..
393 * Useful when there is a small list of value that the
396 * @param arrows_always true indicates the value will change.
399 void set_use_arrows_always(bool arrows_always = true);
401 /** Sets list case sensitive
402 * Determines if the list items and text comparisons for
403 * set_use_arrows_always() should be case sensitive.
406 void set_case_sensitive(bool val = true);
408 /** Set the current entry Glib::ustring
409 * Call this function on an item if it isn't a label or you
410 * want it to have a different value to be displayed in the entry
413 void set_item_string(Gtk::Item& item, const Glib::ustring& item_value);
414 void remove_item_string(Gtk::Item& item);
416 /// Insert a list of items.
418 void set_popdown_strings(const Glib::ListHandle<Glib::ustring>& strings);
420 Glib::ListHandle<Glib::ustring> get_popdown_strings() const;
423 void disable_activate();
426 const Entry* get_entry() const;
427 ComboDropDown* get_list();
428 const ComboDropDown* get_list() const;
430 /** Whether the arrow keys move through the list of items.
432 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
433 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
434 * the value of the property changes.
436 Glib::PropertyProxy<bool> property_enable_arrow_keys() ;
438 /** Whether the arrow keys move through the list of items.
440 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
441 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
442 * the value of the property changes.
444 Glib::PropertyProxy_ReadOnly<bool> property_enable_arrow_keys() const;
446 /** Obsolete property
448 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
449 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
450 * the value of the property changes.
452 Glib::PropertyProxy<bool> property_enable_arrows_always() ;
454 /** Obsolete property
456 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
457 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
458 * the value of the property changes.
460 Glib::PropertyProxy_ReadOnly<bool> property_enable_arrows_always() const;
462 /** Whether list item matching is case sensitive.
464 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
465 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
466 * the value of the property changes.
468 Glib::PropertyProxy<bool> property_case_sensitive() ;
470 /** Whether list item matching is case sensitive.
472 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
473 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
474 * the value of the property changes.
476 Glib::PropertyProxy_ReadOnly<bool> property_case_sensitive() const;
478 /** Whether an empty value may be entered in this field.
480 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
481 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
482 * the value of the property changes.
484 Glib::PropertyProxy<bool> property_allow_empty() ;
486 /** Whether an empty value may be entered in this field.
488 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
489 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
490 * the value of the property changes.
492 Glib::PropertyProxy_ReadOnly<bool> property_allow_empty() const;
494 /** Whether entered values must already be present in the list.
496 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
497 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
498 * the value of the property changes.
500 Glib::PropertyProxy<bool> property_value_in_list() ;
502 /** Whether entered values must already be present in the list.
504 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
505 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
506 * the value of the property changes.
508 Glib::PropertyProxy_ReadOnly<bool> property_value_in_list() const;
514 } /* namespace Gtk */
519 /** @relates Gtk::ComboDropDownItem
520 * @param object The C instance
521 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
522 * @result A C++ instance that wraps this C instance.
524 Gtk::ComboDropDownItem* wrap(GtkListItem* object, bool take_copy = false);
528 /** @relates Gtk::ComboDropDown
529 * @param object The C instance
530 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
531 * @result A C++ instance that wraps this C instance.
533 Gtk::ComboDropDown* wrap(GtkList* object, bool take_copy = false);
537 /** @relates Gtk::Combo
538 * @param object The C instance
539 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
540 * @result A C++ instance that wraps this C instance.
542 Gtk::Combo* wrap(GtkCombo* object, bool take_copy = false);
544 #endif /* _GTKMM_COMBO_H */