Ardour  9.0-pre0-582-g084a23a80d
treeview.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEW_H
4 #define _GTKMM_TREEVIEW_H
5 
6 #include <gtkmmconfig.h>
7 
8 
9 #include <glibmm/ustring.h>
10 #include <sigc++/sigc++.h>
11 
12 /* Copyright(C) 2002 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or(at your option) any later version.
18  *
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  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser 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.
27  */
28 
29  // This is for including the config header before any code (such as
30 // the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
31 
32 
33 #include <glibmm/listhandle.h>
34 #include <gtkmm/container.h>
35 #include <gtkmm/adjustment.h>
36 #include <gdkmm/pixmap.h>
37 #include <gtkmm/treeviewcolumn.h>
38 #include <gtkmm/treeselection.h>
39 #include <gtkmm/treemodelcolumn.h>
40 #include <gtkmm/cellrenderer.h>
41 #include <gtkmm/targetentry.h>
42 #include <gtkmm/entry.h>
43 #include <gtkmm/tooltip.h>
44 
45 
46 #include <cstdlib>
47 
48 using std::strtod;
49 
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 typedef struct _GtkTreeView GtkTreeView;
52 typedef struct _GtkTreeViewClass GtkTreeViewClass;
53 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
54 
55 
56 namespace Gtk
57 { class TreeView_Class; } // namespace Gtk
58 namespace Gtk
59 {
60 
61 
69 {
74 };
75 
76 } // namespace Gtk
77 
78 
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80 namespace Glib
81 {
82 
83 template <>
84 class Value<Gtk::TreeViewDropPosition> : public Glib::Value_Enum<Gtk::TreeViewDropPosition>
85 {
86 public:
87  static GType value_type() G_GNUC_CONST;
88 };
89 
90 } // namespace Glib
91 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
92 
93 
94 namespace Gtk
95 {
96 
102 {
107 };
108 
109 } // namespace Gtk
110 
111 
112 #ifndef DOXYGEN_SHOULD_SKIP_THIS
113 namespace Glib
114 {
115 
116 template <>
117 class Value<Gtk::TreeViewGridLines> : public Glib::Value_Enum<Gtk::TreeViewGridLines>
118 {
119 public:
120  static GType value_type() G_GNUC_CONST;
121 };
122 
123 } // namespace Glib
124 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
125 
126 
127 namespace Gtk
128 {
129 
130 
131 #ifndef DOXYGEN_SHOULD_SKIP_THIS
132 
133 class TreeView;
134 
135 namespace TreeView_Private
136 {
137 /* This helper function is not a member of TreeView just for the reason that
138  * there are compilers that have problems compiling it otherwise. E.g. in gcc
139  * 2.95.3 a compiler bug prevents member functions from refering to specialized
140  * member function templates and that's what we do here: In function
141  * _connect_auto_store_editable_signal_handler we build a slot from
142  * TreeView::_auto_store_on_cellrenderer_*_edited. (The latter must be member
143  * functions of TreeView since we connect them to signals and we want the
144  * connections to vanish when the TreeView dies, of course.)
145  */
146  template <class ColumnType> inline
147  void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<ColumnType>& model_column);
148 
149  template<class ColumnType> inline
150  void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
151 
152  template <class ColumnType> inline
153  void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
154 
155  template <class ColumnType> inline
156  void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
157 }
158 
159 #endif //DOXYGEN_SHOULD_SKIP_THIS
160 
161 
162 //class TreeViewColumn;
163 class TreeModel;
164 
182 class TreeView : public Container
183 {
184  public:
185 #ifndef DOXYGEN_SHOULD_SKIP_THIS
186  typedef TreeView CppObjectType;
187  typedef TreeView_Class CppClassType;
188  typedef GtkTreeView BaseObjectType;
189  typedef GtkTreeViewClass BaseClassType;
190 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
191 
192  virtual ~TreeView();
193 
194 #ifndef DOXYGEN_SHOULD_SKIP_THIS
195 
196 private:
197  friend class TreeView_Class;
198  static CppClassType treeview_class_;
199 
200  // noncopyable
201  TreeView(const TreeView&);
202  TreeView& operator=(const TreeView&);
203 
204 protected:
205  explicit TreeView(const Glib::ConstructParams& construct_params);
206  explicit TreeView(GtkTreeView* castitem);
207 
208 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
209 
210 public:
211 #ifndef DOXYGEN_SHOULD_SKIP_THIS
212  static GType get_type() G_GNUC_CONST;
213 
214 
215  static GType get_base_type() G_GNUC_CONST;
216 #endif
217 
219  GtkTreeView* gobj() { return reinterpret_cast<GtkTreeView*>(gobject_); }
220 
222  const GtkTreeView* gobj() const { return reinterpret_cast<GtkTreeView*>(gobject_); }
223 
224 
225 public:
226  //C++ methods used to invoke GTK+ virtual functions:
227 
228 protected:
229  //GTK+ Virtual Functions (override these to change behaviour):
230 
231  //Default Signal Handlers::
233  virtual void on_set_scroll_adjustments(Adjustment* hadjustment, Adjustment* vadjustment);
235  virtual void on_row_activated(const TreeModel::Path& path, TreeViewColumn* column);
237  virtual bool on_test_expand_row(const TreeModel::iterator& iter, const TreeModel::Path& path);
241  virtual void on_row_expanded(const TreeModel::iterator& iter, const TreeModel::Path& path);
243  virtual void on_row_collapsed(const TreeModel::iterator& iter, const TreeModel::Path& path);
245  virtual void on_cursor_changed();
247  virtual void on_columns_changed();
248 
249 
250 private:
251 
252 
253 public:
257 
268  explicit TreeView(const Glib::RefPtr<TreeModel>& model);
269 
270 
276  Glib::RefPtr<TreeModel> get_model();
277 
283  Glib::RefPtr<const TreeModel> get_model() const;
284 
291  void set_model(const Glib::RefPtr<TreeModel>& model);
292 
297  void unset_model();
298 
299 
304  Glib::RefPtr<TreeSelection> get_selection();
305 
310  Glib::RefPtr<const TreeSelection> get_selection() const;
311 
318 
324  const Adjustment* get_hadjustment() const;
325 
330  void set_hadjustment(Adjustment& adjustment);
331 
336 
337 
344 
350  const Adjustment* get_vadjustment() const;
351 
356  void set_vadjustment(Adjustment& adjustment);
357 
362 
363 
368  bool get_headers_visible() const;
369 
374  void set_headers_visible(bool headers_visible = true);
375 
380 
385  bool get_headers_clickable() const;
386 
391  void set_headers_clickable(bool setting = true);
392 
408  void set_rules_hint(bool setting = true);
409 
414  bool get_rules_hint() const;
415 
416 
425 
444  template <class ColumnType> inline
445  int append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
446 
456  template <class ColumnType> inline
457  int append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
458 
459  //TODO: danielk suggested use of Glib::Value to simplify/improve this.
473  template <class ColumnType> inline
474  int append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column);
475 
487  template <class ColumnType> inline
488  int append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format);
489 
490 
492  int append_column(const Glib::ustring& title, CellRenderer& cell);
493 
494 
501 
504 
505 
516 
524  int insert_column(const Glib::ustring& title, CellRenderer& cell, int position);
525 
526 
534  template <class ColumnType> inline
535  int insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
536 
549  template <class ColumnType> inline
550  int insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position);
551 
553 
565  int insert_column_with_data_func(int position, const Glib::ustring& title, CellRenderer& cell, const SlotCellData& slot);
566 
567 
575 
582  const TreeViewColumn* get_column(int n) const;
583 
584  //The column index is of the view, not the model, so we do not need TreeViewColumn* get_column(TreeViewColumn& base_column).
585 
594 
595  //TODO: Add TreeViewColumn* get_column_cell_renderer(TreeViewColumn& base_column); and a const one.
596 
597 
606 
607 
612  Glib::ListHandle<TreeViewColumn*> get_columns();
613 
618  Glib::ListHandle<const TreeViewColumn*> get_columns() const;
619 
620 
626  void move_column_after(TreeViewColumn& column, TreeViewColumn& base_column);
627 
633 
634 
640 
645 
646 
653 
660 
669  typedef sigc::slot<bool, TreeView*, TreeViewColumn*, TreeViewColumn*, TreeViewColumn*> SlotColumnDrop;
670 
682 
683 
688 
689 
701  void scroll_to_point(int tree_x, int tree_y);
702 
717  void scroll_to_cell(const TreeModel::Path& path, TreeViewColumn& column, float row_align, float col_align);
718 
719 
733 
745  void scroll_to_row(const TreeModel::Path& path, float row_align);
746 
759 
770  void scroll_to_column(TreeViewColumn& column, float col_align);
771 
783 
784 
791 
794  void expand_all();
795 
798  void collapse_all();
799 
806 
813  bool expand_row(const TreeModel::Path& path, bool open_all);
814 
821 
825  typedef sigc::slot<void, TreeView*, const TreeModel::Path&> SlotMapping;
826 
830  void map_expanded_rows(const SlotMapping& slot);
831 
832 
839 
856  void set_reorderable(bool reorderable = true);
857 
863  bool get_reorderable() const;
864 
865  //TODO: Add set_cursor(path, ModelColumnBase&, start_editing)?
866 
879  void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, bool start_editing = false);
880 
881 
902  void set_cursor(const TreeModel::Path& path, TreeViewColumn& focus_column, CellRenderer& focus_cell, bool start_editing = false);
903 
904 
913 
920 
921 /* Layout information */
922 
930  Glib::RefPtr<Gdk::Window> get_bin_window();
931 
939  Glib::RefPtr<const Gdk::Window> get_bin_window() const;
940 
941  #ifndef GTKMM_DISABLE_DEPRECATED
942 
945  bool get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y);
946  #endif // GTKMM_DISABLE_DEPRECATED
947 
948 
975  bool get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, int& cell_y) const;
976 
995  bool get_path_at_pos(int x, int y, TreeModel::Path& path) const;
996 
997 
998 #ifndef GTKMM_DISABLE_DEPRECATED
999 
1015 #endif // GTKMM_DISABLE_DEPRECATED
1016 
1017 
1018 //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
1019 
1020 
1034 
1035 
1036 #ifndef GTKMM_DISABLE_DEPRECATED
1037 
1053 #endif // GTKMM_DISABLE_DEPRECATED
1054 
1055 
1069  //We ignore the fact that one of the arguments can be 0 - it does not seem useful.
1070 
1071 
1072 #ifndef GTKMM_DISABLE_DEPRECATED
1073 
1084  void get_visible_rect(Gdk::Rectangle& visible_rect);
1085 #endif // GTKMM_DISABLE_DEPRECATED
1086 
1087 
1096  void get_visible_rect(Gdk::Rectangle& visible_rect) const;
1097 
1098 
1099 #ifndef GTKMM_DISABLE_DEPRECATED
1100 
1116  void widget_to_tree_coords(int wx, int wy, int& tx, int& ty);
1117 #endif // GTKMM_DISABLE_DEPRECATED
1118 
1119 
1120 #ifndef GTKMM_DISABLE_DEPRECATED
1121 
1135  void widget_to_tree_coords(int wx, int wy, int& tx, int& ty) const;
1136 #endif // GTKMM_DISABLE_DEPRECATED
1137 
1138 
1139 #ifndef GTKMM_DISABLE_DEPRECATED
1140 
1156  void tree_to_widget_coords(int tx, int ty, int& wx, int& wy);
1157 #endif // GTKMM_DISABLE_DEPRECATED
1158 
1159 
1160 #ifndef GTKMM_DISABLE_DEPRECATED
1161 
1175  void tree_to_widget_coords(int tx, int ty, int& wx, int& wy) const;
1176 #endif // GTKMM_DISABLE_DEPRECATED
1177 
1178 
1179  bool get_visible_range(TreeModel::Path& start_path, TreeModel::Path& end_path) const;
1180 
1181 
1182 /* Drag-and-Drop support */
1183 
1184 
1193  Gdk::ModifierType start_button_mask = Gdk::MODIFIER_MASK,
1195 
1196  // Uses the default "GTK_TREE_MODEL_ROW" target, which the TreeView can handle automatically.
1197 
1205 
1206 
1213 
1220 
1221 
1225 
1226 
1230 
1231 
1232  /* These are useful to implement your own custom stuff. */
1233 
1234 
1241 
1248 
1256  bool get_dest_row_at_pos(int drag_x, int drag_y, TreeModel::Path& path, TreeViewDropPosition& pos) const;
1257 
1258 
1265  Glib::RefPtr<Gdk::Pixmap> create_row_drag_icon(const TreeModel::Path& path);
1266 
1267 /* Interactive search */
1268 
1277  void set_enable_search(bool enable_search = true);
1278 
1284  bool get_enable_search() const;
1285 
1290  int get_search_column() const;
1291 
1305 
1318  void set_search_column(int column);
1319 
1321  typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, int, const Glib::ustring&, const TreeModel::iterator&> SlotSearchEqual;
1322  //SlotSearchEqual get_search_equal_func();
1323 
1324 
1330 
1331 
1339 
1346  const Entry* get_search_entry() const;
1347 
1356  void set_search_entry(Entry& entry);
1357 
1359  typedef sigc::slot<void, Gtk::Widget* /* search_dialog */> SlotSearchPosition;
1361 
1362 
1371  void convert_widget_to_tree_coords(int wx, int wy, int& tx, int& ty) const;
1372 
1381  void convert_tree_to_widget_coords(int tx, int ty, int& wx, int& wy) const;
1382 
1391  void convert_widget_to_bin_window_coords(int wx, int wy, int& bx, int& by) const;
1392 
1401  void convert_bin_window_to_widget_coords(int bx, int by, int& wx, int& wy) const;
1402 
1411  void convert_tree_to_bin_window_coords(int tx, int ty, int& bx, int& by) const;
1412 
1421  void convert_bin_window_to_tree_coords(int bx, int by, int& tx, int& ty) const;
1422 
1423 
1432  void set_fixed_height_mode(bool enable = true);
1433 
1439 
1447  void set_hover_selection(bool hover = true);
1448 
1453  bool get_hover_selection() const;
1454 
1461  void set_hover_expand(bool expand = true);
1462 
1467  bool get_hover_expand() const;
1468 
1475  void set_rubber_banding(bool enable = true);
1476 
1483  bool get_rubber_banding() const;
1484 
1485  //TODO: Rename to get_is?
1486 
1494 
1498  typedef sigc::slot<bool, const Glib::RefPtr<TreeModel>&, const TreeModel::iterator&> SlotRowSeparator;
1499 
1501 
1502 
1509 
1516 
1517 
1523  void set_enable_tree_lines(bool enable = true);
1524 
1531 
1532 
1543  void set_show_expanders(bool enabled = true);
1544 
1550  bool get_show_expanders() const;
1551 
1560  void set_level_indentation(int indentation);
1561 
1569 
1570 
1579  void set_tooltip_row(const Glib::RefPtr<Tooltip>& tooltip, const TreePath& path);
1580 
1581  //Note that we use pointers instead of references because any one of the 3 arguments may be NULL, and we don't want that many method overloads:
1582 
1583 
1601  void set_tooltip_cell(const Glib::RefPtr<Tooltip>& tooltip, const TreeModel::Path* path, TreeViewColumn* column, CellRenderer* cell);
1602 
1603 
1624  bool get_tooltip_context_path(int& x, int& y,
1625  bool keyboard_tip,
1627 
1648  bool get_tooltip_context_iter(int& x, int& y,
1649  bool keyboard_tip,
1650  Gtk::TreeModel::iterator& iter);
1651 
1652 
1666  void set_tooltip_column(int column);
1667 
1674  int get_tooltip_column() const;
1675 
1676 
1677 //TODO: Ignore this? It's in many widgets and seems internals.
1678 
1685  Glib::SignalProxy2< void,Adjustment*,Adjustment* > signal_set_scroll_adjustments();
1686 
1687 
1694  Glib::SignalProxy2< void,const TreeModel::Path&,TreeViewColumn* > signal_row_activated();
1695 
1696 
1703  Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_expand_row();
1704 
1705 
1712  Glib::SignalProxy2< bool,const TreeModel::iterator&,const TreeModel::Path& > signal_test_collapse_row();
1713 
1714 
1721  Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_expanded();
1722 
1723 
1730  Glib::SignalProxy2< void,const TreeModel::iterator&,const TreeModel::Path& > signal_row_collapsed();
1731 
1732 
1739  Glib::SignalProxy0< void > signal_cursor_changed();
1740 
1741 
1748  Glib::SignalProxy0< void > signal_columns_changed();
1749 
1750 
1751  //Don't wrap these. They are keybinding signals, and their API broke for GTK+ 2.2.
1752 
1753 
1759  Glib::PropertyProxy< Glib::RefPtr<TreeModel> > property_model() ;
1760 
1766  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<TreeModel> > property_model() const;
1767 
1773  Glib::PropertyProxy< Adjustment* > property_hadjustment() ;
1774 
1780  Glib::PropertyProxy_ReadOnly< Adjustment* > property_hadjustment() const;
1781 
1787  Glib::PropertyProxy< Adjustment* > property_vadjustment() ;
1788 
1794  Glib::PropertyProxy_ReadOnly< Adjustment* > property_vadjustment() const;
1795 
1801  Glib::PropertyProxy< bool > property_headers_visible() ;
1802 
1808  Glib::PropertyProxy_ReadOnly< bool > property_headers_visible() const;
1809 
1815  Glib::PropertyProxy< bool > property_headers_clickable() ;
1816 
1822  Glib::PropertyProxy_ReadOnly< bool > property_headers_clickable() const;
1823 
1829  Glib::PropertyProxy< TreeViewColumn* > property_expander_column() ;
1830 
1836  Glib::PropertyProxy_ReadOnly< TreeViewColumn* > property_expander_column() const;
1837 
1843  Glib::PropertyProxy< bool > property_reorderable() ;
1844 
1850  Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const;
1851 
1857  Glib::PropertyProxy< bool > property_rules_hint() ;
1858 
1864  Glib::PropertyProxy_ReadOnly< bool > property_rules_hint() const;
1865 
1871  Glib::PropertyProxy< bool > property_enable_search() ;
1872 
1878  Glib::PropertyProxy_ReadOnly< bool > property_enable_search() const;
1879 
1885  Glib::PropertyProxy< int > property_search_column() ;
1886 
1892  Glib::PropertyProxy_ReadOnly< int > property_search_column() const;
1893 
1899  Glib::PropertyProxy< bool > property_fixed_height_mode() ;
1900 
1906  Glib::PropertyProxy_ReadOnly< bool > property_fixed_height_mode() const;
1907 
1913  Glib::PropertyProxy< bool > property_hover_selection() ;
1914 
1920  Glib::PropertyProxy_ReadOnly< bool > property_hover_selection() const;
1921 
1927  Glib::PropertyProxy< bool > property_hover_expand() ;
1928 
1934  Glib::PropertyProxy_ReadOnly< bool > property_hover_expand() const;
1935 
1941  Glib::PropertyProxy< bool > property_show_expanders() ;
1942 
1948  Glib::PropertyProxy_ReadOnly< bool > property_show_expanders() const;
1949 
1955  Glib::PropertyProxy< bool > property_level_indentation() ;
1956 
1962  Glib::PropertyProxy_ReadOnly< bool > property_level_indentation() const;
1963 
1969  Glib::PropertyProxy< bool > property_rubber_banding() ;
1970 
1976  Glib::PropertyProxy_ReadOnly< bool > property_rubber_banding() const;
1977 
1983  Glib::PropertyProxy< bool > property_enable_grid_lines() ;
1984 
1990  Glib::PropertyProxy_ReadOnly< bool > property_enable_grid_lines() const;
1991 
1997  Glib::PropertyProxy< bool > property_enable_tree_lines() ;
1998 
2004  Glib::PropertyProxy_ReadOnly< bool > property_enable_tree_lines() const;
2005 
2011  Glib::PropertyProxy< int > property_tooltip_column() ;
2012 
2018  Glib::PropertyProxy_ReadOnly< int > property_tooltip_column() const;
2019 
2020 
2022  Glib::RefPtr<Gtk::TreeModel> _get_base_model();
2023 
2024 protected:
2025 
2026 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2027  template<class ColumnType> friend
2028  void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2029 
2030  template <class ColumnType> friend
2031  void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2032 
2033  void _auto_store_on_cellrenderer_toggle_edited_with_model(const Glib::ustring& path_string, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2034 
2035  // This is no longer used, but we must keep it to prevent linker errors with already-compiled applications,
2036  // For instance, applications that were compiled with the older versions of the templates that did use this method.
2037  // TODO: Remove this when we can break API.
2038  void _auto_store_on_cellrenderer_toggle_edited(const Glib::ustring& path_string, int model_column);
2039 
2040  template<class ColumnType> friend
2041  void TreeView_Private::_connect_auto_store_editable_signal_handler(TreeView*, CellRenderer*, const TreeModelColumn<ColumnType>&);
2042 
2043 #endif //DOXYGEN_SHOULD_SKIP_THIS
2044 
2045 
2046 };
2047 
2048 
2049 template <class ColumnType> inline
2050 int TreeView::append_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
2051 {
2052  // compilation will fail if there is no appropriate TreeViewColumn
2053  // constructor for this model column type.
2054  TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2055 
2056  return append_column(*pViewColumn);
2057 }
2058 
2059 //This is here because sigc::bind once did not work on all platforms, but now it does..
2060 #define GTKMM_HAVE_SIGC_BIND 1
2061 
2062 #ifdef GTKMM_HAVE_SIGC_BIND
2063 
2064 template <class ColumnType> inline
2065 int TreeView::append_column_numeric(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
2066 {
2067  TreeViewColumn* const pViewColumn = Gtk::manage( new TreeViewColumn(title) );
2068 
2069  //Use a CellRendererText:
2070  //We don't use TreeView::Column::append_column(model_column) to generate an appropriate CellRenderer,
2071  //because that uses set_renderer(), which renders the model value using the automatic glib "transformations" (number-string conversions). As well as being unnecessary here, those automatic conversions can't handle all numeric types.
2072  CellRenderer* pCellRenderer = manage( new CellRendererText() );
2073  pViewColumn->pack_start(*pCellRenderer);
2074 
2075 
2076  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2077  typedef void (*type_fptr)(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format);
2078  type_fptr fptr = TreeView_Private::_auto_cell_data_func<ColumnType>;
2079 
2080  //Connect a cell_data callback, to show the number's text representation in the specified format:
2081  //We use sigc::bind<-1> twice here, instead of sigc::bind() once, because some compilers need the extra hint.
2082  Gtk::TreeViewColumn::SlotCellData slot = sigc::bind<-1>(
2083  sigc::bind<-1>( sigc::ptr_fun(fptr), format),
2084  model_column.index()
2085  );
2086 
2087  pViewColumn->set_cell_data_func(*pCellRenderer, slot);
2088 
2089  return append_column(*pViewColumn);
2090 }
2091 
2092 #endif //GTKMM_HAVE_SIGC_BIND
2093 
2094 template <class ColumnType> inline
2095 int TreeView::append_column_numeric_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, const Glib::ustring& format)
2096 {
2097  int cols_count = append_column_numeric(title, model_column, format);
2098 
2099  //connect signal handlers for auto-storing of edited cell data
2100  //Note: This will only work for base-10 (decimal) formatted numbers:
2101  CellRenderer *const cell = get_column_cell_renderer(cols_count - 1);
2102  if(cell)
2103  {
2104  TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, cell, model_column);
2105  }
2106 
2107  return cols_count;
2108 }
2109 
2110 template <class ColumnType> inline
2111 int TreeView::append_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column)
2112 {
2113  //Don't use this in a header, because it gives warnings when disabled: g_assert(model_column.type() != 0);
2114 
2115  // compilation will fail if there is no appropriate TreeViewColumn
2116  // constructor for this model column type.
2117  TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2118 
2119  //connect signal handlers for auto-storing of edited cell data
2120  CellRenderer* pCellRender = pViewColumn->get_first_cell();
2121  TreeView_Private::_connect_auto_store_editable_signal_handler<ColumnType>(this, pCellRender, model_column);
2122 
2123  return append_column(*pViewColumn);
2124 }
2125 
2126 template <class ColumnType> inline
2127 int TreeView::insert_column(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
2128 {
2129  // compilation will fail if there is no appropriate TreeViewColumn
2130  // constructor for this model column type.
2131  TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2132 
2133  return insert_column(*pViewColumn, position);
2134 }
2135 
2136 template <class ColumnType> inline
2137 int TreeView::insert_column_editable(const Glib::ustring& title, const TreeModelColumn<ColumnType>& model_column, int position)
2138 {
2139  // compilation will fail if there is no appropriate TreeViewColumn
2140  // constructor for this model column type.
2141  TreeViewColumn *const pViewColumn = Gtk::manage( new TreeViewColumn(title, model_column) );
2142 
2143  //connect signal handlers for auto-storing of edited cell data
2144  CellRenderer* pCellRender = pViewColumn->get_first_cell();
2145  TreeView_Private::_connect_auto_store_editable_signal_handler(this, pCellRender, model_column);
2146 
2147  return insert_column(*pViewColumn, position);
2148 }
2149 
2150 
2151 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2152 namespace TreeView_Private
2153 {
2154 
2155 //Template specializations, for different model column types:
2156 //TODO: Move these specializations into the .ccg file - I tried, but the int specialization was not used by the compiler. murrayc.
2157 
2158 #ifdef GTKMM_HAVE_SIGC_BIND
2159 
2160 //bool specialization:
2161 template<> inline
2162 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<bool>& model_column)
2163 {
2164  Gtk::CellRendererToggle* pCellToggle = dynamic_cast<Gtk::CellRendererToggle*>(pCellRenderer);
2165  if(pCellToggle)
2166  {
2167  //Set the appropriate property,
2168  pCellToggle->property_activatable() = true;
2169 
2170  //Connect to the appropriate signal, sending the model_column too
2171 
2172  sigc::slot<void, const Glib::ustring&, int> slot_temp =
2173  sigc::bind<-1>(
2174  sigc::mem_fun(*this_p, &Gtk::TreeView::_auto_store_on_cellrenderer_toggle_edited_with_model),
2175  this_p->_get_base_model()
2176  );
2177 
2178  pCellToggle->signal_toggled().connect(
2179  sigc::bind<-1>(
2180  slot_temp,
2181  model_column.index()
2182  )
2183  );
2184 
2185  //We use bind<1> instead of bind because some compilers need the extra hint.
2186  }
2187 }
2188 
2189 //int specialization:
2190 template<> inline
2191 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<int>& model_column)
2192 {
2193  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2194  if(pCellText)
2195  {
2196  //Set the appropriate property,
2197  pCellText->property_editable() = true;
2198 
2199  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2200  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2201  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<int>;
2202 
2203  //Connect to the appropriate signal, sending the model_column too,
2204  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2205  pCellText->signal_edited().connect(
2206  sigc::bind<-1>(
2207  sigc::bind<-1>(
2208  sigc::ptr_fun(fptr),
2209  this_p->_get_base_model() ),
2210  model_column.index()
2211  )
2212  );
2213 
2214  }
2215 }
2216 
2217 //unsigned int specialization:
2218 template<> inline
2219 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<unsigned int>& model_column)
2220 {
2221  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2222  if(pCellText)
2223  {
2224  //Set the appropriate property,
2225  pCellText->property_editable() = true;
2226 
2227  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2228  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2229  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned int>;
2230 
2231  //Connect to the appropriate signal, sending the model_column too,
2232  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2233  pCellText->signal_edited().connect(
2234  sigc::bind<-1>(
2235  sigc::bind<-1>(
2236  sigc::ptr_fun(fptr),
2237  this_p->_get_base_model() ),
2238  model_column.index()
2239  )
2240  );
2241 
2242  }
2243 }
2244 
2245 //long specialization:
2246 template<> inline
2247 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<long>& model_column)
2248 {
2249  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2250  if(pCellText)
2251  {
2252  //Set the appropriate property,
2253  pCellText->property_editable() = true;
2254 
2255  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2256  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2257  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<long>;
2258 
2259  //Connect to the appropriate signal, sending the model_column too,
2260  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2261  pCellText->signal_edited().connect(
2262  sigc::bind<-1>(
2263  sigc::bind<-1>(
2264  sigc::ptr_fun(fptr),
2265  this_p->_get_base_model() ),
2266  model_column.index()
2267  )
2268  );
2269 
2270  }
2271 }
2272 
2273 //unsigned long specialization:
2274 template<> inline
2275 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<unsigned long>& model_column)
2276 {
2277  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2278  if(pCellText)
2279  {
2280  //Set the appropriate property,
2281  pCellText->property_editable() = true;
2282 
2283  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2284  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2285  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<unsigned long>;
2286 
2287  //Connect to the appropriate signal, sending the model_column too,
2288  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2289  pCellText->signal_edited().connect(
2290  sigc::bind<-1>(
2291  sigc::bind<-1>(
2292  sigc::ptr_fun(fptr),
2293  this_p->_get_base_model() ),
2294  model_column.index()
2295  )
2296  );
2297 
2298  }
2299 }
2300 
2301 //float specialization:
2302 template<> inline
2303 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<float>& model_column)
2304 {
2305  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2306  if(pCellText)
2307  {
2308  //Set the appropriate property,
2309  pCellText->property_editable() = true;
2310 
2311  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2312  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2313  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<float>;
2314 
2315  //Connect to the appropriate signal, sending the model_column too,
2316  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2317  pCellText->signal_edited().connect(
2318  sigc::bind<-1>(
2319  sigc::bind<-1>(
2320  sigc::ptr_fun(fptr),
2321  this_p->_get_base_model() ),
2322  model_column.index()
2323  )
2324  );
2325  }
2326 }
2327 
2328 //double specialization:
2329 template<> inline
2330 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<double>& model_column)
2331 {
2332  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2333  if(pCellText)
2334  {
2335  //Set the appropriate property,
2336  pCellText->property_editable() = true;
2337 
2338  //Some compilers don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2339  typedef void (*type_fptr)(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model);
2340  type_fptr fptr = _auto_store_on_cellrenderer_text_edited_numerical<double>;
2341 
2342  //Connect to the appropriate signal, sending the model_column too,
2343  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2344  pCellText->signal_edited().connect(
2345  sigc::bind<-1>(
2346  sigc::bind<-1>(
2347  sigc::ptr_fun(fptr),
2348  this_p->_get_base_model() ),
2349  model_column.index()
2350  )
2351  );
2352  }
2353 }
2354 
2355 #endif //GTKMM_HAVE_SIGC_BIND
2356 
2357 } // namespace TreeView_Private
2358 #endif //DOXYGEN_SHOULD_SKIP_THIS
2359 
2360 
2361 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2362 namespace TreeView_Private
2363 {
2364 
2365 #ifdef GTKMM_HAVE_SIGC_BIND
2366 
2367 template <class ColumnType> inline
2368 void _connect_auto_store_editable_signal_handler(Gtk::TreeView* this_p, Gtk::CellRenderer* pCellRenderer, const Gtk::TreeModelColumn<ColumnType>& model_column)
2369 {
2370  //Don't use this in a header, because it gives warnings when disabled: g_assert(model_column.type() != 0);
2371 
2372  //The different CellRenderers have different "edited" signals,
2373  //and numerical values need to convert the text value to a number,
2374  //so there are specializations for this tempate.
2375 
2376  Gtk::CellRendererText* pCellText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
2377 
2378  //Set the appropriate property,
2379  //and connect to the appropriate signal, sending the model_column too,
2380  if(pCellText)
2381  {
2382  pCellText->property_editable() = true;
2383 
2384  //Some compilers (IRIX MipsPro) don't like us to give the pointer to a template function directly to sigc::ptr_fun():
2385  typedef void (*type_func)(const Glib::ustring&, const Glib::ustring&, int, const Glib::RefPtr<Gtk::TreeModel>&);
2386  type_func func = &(_auto_store_on_cellrenderer_text_edited_string<ColumnType>);
2387  sigc::slot<void, const Glib::ustring&, const Glib::ustring&, int, const Glib::RefPtr<Gtk::TreeModel>&> theslot =
2388  sigc::ptr_fun(func);
2389 
2390  //We use bind<-1> twice here, instead of using bind() once, because some compilers need the extra hint.
2391  pCellText->signal_edited().connect(
2392  sigc::bind<-1>(
2393  sigc::bind<-1>( theslot, this_p->_get_base_model()),
2394  model_column.index()
2395  )
2396  );
2397  }
2398 }
2399 
2400 #endif //GTKMM_HAVE_SIGC_BIND
2401 
2402 template <class ColumnType> inline
2403 void _auto_store_on_cellrenderer_text_edited_string(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model)
2404 {
2405  Gtk::TreePath path(path_string);
2406 
2407  //Get the row from the path:
2408  if(model)
2409  {
2410  Gtk::TreeModel::iterator iter = model->get_iter(path);
2411  if(iter)
2412  {
2413  //Store the user's new text in the model:
2414  Gtk::TreeRow row = *iter;
2415  row.set_value(model_column, (ColumnType)new_text);
2416  }
2417  }
2418 }
2419 
2420 template <class ColumnType> inline
2421 void _auto_store_on_cellrenderer_text_edited_numerical(const Glib::ustring& path_string, const Glib::ustring& new_text, int model_column, const Glib::RefPtr<Gtk::TreeModel>& model)
2422 {
2423  //This is used on numerical model columns:
2424 
2425  Gtk::TreePath path(path_string);
2426 
2427  //Get the row from the path:
2428  if(model)
2429  {
2430  Gtk::TreeModel::iterator iter = model->get_iter(path);
2431  if(iter)
2432  {
2433  //std::istringstream astream(new_text); //Put it in a stream.
2434  //ColumnType new_value = ColumnType();
2435  //new_value << astream; //Get it out of the stream as the numerical type.
2436 
2437  //Convert the text to a number, using the same logic used by GtkCellRendererText when it stores numbers.
2438  char* pchEnd = 0;
2439  ColumnType new_value = static_cast<ColumnType>( strtod(new_text.c_str(), &pchEnd) );
2440 
2441  //Store the user's new text in the model:
2442  Gtk::TreeRow row = *iter;
2443  row.set_value(model_column, (ColumnType)new_value);
2444  }
2445  }
2446 }
2447 
2448 template <class ColumnType> inline
2449 void _auto_cell_data_func(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter, int model_column, const Glib::ustring& format)
2450 {
2451  Gtk::CellRendererText* pTextRenderer = dynamic_cast<Gtk::CellRendererText*>(cell);
2452  if(!pTextRenderer)
2453  {
2454  g_warning("gtkmm: TextView: append_column_numeric() was used with a non-numeric type.");
2455  }
2456  else
2457  {
2458  if(iter)
2459  {
2460  //Get the value from the model.
2461  Gtk::TreeModel::Row row = *iter;
2462  ColumnType value = ColumnType();
2463  row.get_value(model_column, value);
2464 
2465  //Convert it to a string representation:
2466  char buff[20];
2467  int used = g_snprintf(buff, sizeof(buff), format.c_str(), value); //value must be a numeric type.
2468  if(used > 0)
2469  {
2470  //Show the text representation in the view:
2471  pTextRenderer->property_text() = buff;
2472  }
2473  }
2474  }
2475 }
2476 
2477 } // namespace TreeView_Private
2478 #endif //DOXYGEN_SHOULD_SKIP_THIS
2479 
2480 } // namespace Gtk
2481 
2482 
2483 namespace Glib
2484 {
2493  Gtk::TreeView* wrap(GtkTreeView* object, bool take_copy = false);
2494 } //namespace Glib
2495 
2496 
2497 #endif /* _GTKMM_TREEVIEW_H */
2498 
Glib::PropertyProxy< Glib::ustring > property_text()
Glib::PropertyProxy< bool > property_editable()
Glib::SignalProxy2< void, const Glib::ustring &, const Glib::ustring & > signal_edited()
Glib::SignalProxy1< void, const Glib::ustring & > signal_toggled()
Glib::PropertyProxy< bool > property_activatable()
ColumnType get_value(const TreeModelColumn< ColumnType > &column) const
void set_value(const TreeModelColumn< ColumnType > &column, const ColumnType &data) const
void pack_start(CellRenderer &cell, bool expand=true)
sigc::slot< void, CellRenderer *, const Gtk::TreeModel::iterator & > SlotCellData
void set_cell_data_func(CellRenderer &cell_renderer, const SlotCellData &slot)
CellRenderer * get_first_cell()
void set_reorderable(bool reorderable=true)
void set_cursor(const TreeModel::Path &path, TreeViewColumn &focus_column, CellRenderer &focus_cell, bool start_editing=false)
bool get_hover_expand() const
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< TreeModel > > property_model() const
Glib::PropertyProxy_ReadOnly< bool > property_reorderable() const
const TreeViewColumn * get_column(int n) const
void unset_hadjustment()
Glib::SignalProxy2< void, const TreeModel::iterator &, const TreeModel::Path & > signal_row_expanded()
void get_background_area(const TreeModel::Path &path, TreeViewColumn &column, Gdk::Rectangle &rect)
Glib::PropertyProxy< bool > property_enable_grid_lines()
void scroll_to_column(TreeViewColumn &column)
virtual void on_set_scroll_adjustments(Adjustment *hadjustment, Adjustment *vadjustment)
This is a default handler for the signal signal_set_scroll_adjustments().
Glib::PropertyProxy< bool > property_headers_clickable()
Glib::SignalProxy2< void, Adjustment *, Adjustment * > signal_set_scroll_adjustments()
int append_column(TreeViewColumn &column)
void set_search_entry(Entry &entry)
void get_visible_rect(Gdk::Rectangle &visible_rect) const
void scroll_to_column(TreeViewColumn &column, float col_align)
Glib::PropertyProxy_ReadOnly< bool > property_rules_hint() const
Glib::PropertyProxy_ReadOnly< int > property_search_column() const
int insert_column_with_data_func(int position, const Glib::ustring &title, CellRenderer &cell, const SlotCellData &slot)
sigc::slot< bool, TreeView *, TreeViewColumn *, TreeViewColumn *, TreeViewColumn * > SlotColumnDrop
Definition: treeview.h:669
sigc::slot< bool, const Glib::RefPtr< TreeModel > &, const TreeModel::iterator & > SlotRowSeparator
Definition: treeview.h:1498
bool get_rubber_banding() const
Glib::PropertyProxy_ReadOnly< bool > property_enable_grid_lines() const
int append_column_editable(const Glib::ustring &title, const TreeModelColumn< ColumnType > &model_column)
Definition: treeview.h:2111
void set_column_drag_function(const SlotColumnDrop &slot)
int insert_column_editable(const Glib::ustring &title, const TreeModelColumn< ColumnType > &model_column, int position)
Definition: treeview.h:2137
void enable_model_drag_source(Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
void set_search_position_func(const SlotSearchPosition &slot)
Glib::PropertyProxy< Glib::RefPtr< TreeModel > > property_model()
bool expand_row(const TreeModel::Path &path, bool open_all)
Glib::PropertyProxy_ReadOnly< bool > property_enable_search() const
void set_enable_tree_lines(bool enable=true)
bool get_rules_hint() const
void get_visible_rect(Gdk::Rectangle &visible_rect)
Glib::PropertyProxy< bool > property_fixed_height_mode()
void set_vadjustment(Adjustment &adjustment)
void set_model(const Glib::RefPtr< TreeModel > &model)
Glib::PropertyProxy_ReadOnly< bool > property_enable_tree_lines() const
sigc::slot< void, Gtk::Widget * > SlotSearchPosition
void on_search_position(Gtk::Widget* search_dialog)
Definition: treeview.h:1359
int insert_column(TreeViewColumn &column, int position)
Glib::PropertyProxy< bool > property_hover_expand()
Adjustment * get_vadjustment()
Glib::PropertyProxy_ReadOnly< bool > property_show_expanders() const
Glib::PropertyProxy< bool > property_headers_visible()
bool get_tooltip_context_path(int &x, int &y, bool keyboard_tip, TreeModel::Path &path)
Glib::PropertyProxy< bool > property_enable_tree_lines()
virtual ~TreeView()
bool get_show_expanders() const
void enable_model_drag_dest(Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
void convert_tree_to_bin_window_coords(int tx, int ty, int &bx, int &by) const
bool get_path_at_pos(int x, int y, TreeModel::Path &path, TreeViewColumn *&column, int &cell_x, int &cell_y)
void set_search_column(int column)
const Adjustment * get_vadjustment() const
void expand_to_path(const TreeModel::Path &path)
TreeViewColumn * get_column(int n)
Glib::SignalProxy2< bool, const TreeModel::iterator &, const TreeModel::Path & > signal_test_collapse_row()
bool get_enable_search() const
void set_tooltip_column(int column)
void set_search_column(const TreeModelColumnBase &column)
void set_row_separator_func(const SlotRowSeparator &slot)
Glib::RefPtr< Gdk::Window > get_bin_window()
Glib::PropertyProxy_ReadOnly< bool > property_level_indentation() const
Glib::PropertyProxy< int > property_search_column()
bool get_path_at_pos(int x, int y, TreeModel::Path &path) const
TreeViewGridLines get_grid_lines() const
bool get_visible_range(TreeModel::Path &start_path, TreeModel::Path &end_path) const
void get_cursor(TreeModel::Path &path, TreeViewColumn *&focus_column)
int get_tooltip_column() const
void set_enable_search(bool enable_search=true)
void widget_to_tree_coords(int wx, int wy, int &tx, int &ty) const
void unset_vadjustment()
void set_search_equal_func(const SlotSearchEqual &slot)
void scroll_to_cell(const TreeModel::Path &path, TreeViewColumn &column, float row_align, float col_align)
Glib::RefPtr< Gtk::TreeModel > _get_base_model()
Get the treeview's model, but actually get the child model if it's a TreeModelFilter.
bool get_hover_selection() const
sigc::slot< void, TreeView *, const TreeModel::Path & > SlotMapping
Definition: treeview.h:825
void set_cursor(const TreeModel::Path &path)
virtual void on_columns_changed()
This is a default handler for the signal signal_columns_changed().
bool get_path_at_pos(int x, int y, TreeModel::Path &path, TreeViewColumn *&column, int &cell_x, int &cell_y) const
Glib::RefPtr< const TreeSelection > get_selection() const
sigc::slot< bool, const Glib::RefPtr< TreeModel > &, int, const Glib::ustring &, const TreeModel::iterator & > SlotSearchEqual
void on_search_equal(const Glib::RefPtr<TreeModel>& model, int column, const Glib::ustring& key,...
Definition: treeview.h:1321
Glib::PropertyProxy_ReadOnly< TreeViewColumn * > property_expander_column() const
bool get_fixed_height_mode() const
Glib::PropertyProxy< Adjustment * > property_vadjustment()
void widget_to_tree_coords(int wx, int wy, int &tx, int &ty)
Glib::PropertyProxy_ReadOnly< bool > property_headers_visible() const
void map_expanded_rows(const SlotMapping &slot)
void set_expander_column(TreeViewColumn &column)
bool collapse_row(const TreeModel::Path &path)
void convert_bin_window_to_tree_coords(int bx, int by, int &tx, int &ty) const
void move_column_to_start(TreeViewColumn &column)
Glib::PropertyProxy_ReadOnly< bool > property_hover_expand() const
void unset_rows_drag_source()
Entry * get_search_entry()
TreeViewColumn * get_expander_column()
void set_headers_visible(bool headers_visible=true)
Glib::PropertyProxy< bool > property_rubber_banding()
void convert_bin_window_to_widget_coords(int bx, int by, int &wx, int &wy) const
int append_column_numeric(const Glib::ustring &title, const TreeModelColumn< ColumnType > &model_column, const Glib::ustring &format)
Definition: treeview.h:2065
void set_hadjustment(Adjustment &adjustment)
void collapse_all()
Glib::RefPtr< const TreeModel > get_model() const
Glib::PropertyProxy_ReadOnly< bool > property_hover_selection() const
Glib::PropertyProxy< bool > property_level_indentation()
void unset_column_drag_function()
const TreeViewColumn * get_expander_column() const
void get_background_area(const TreeModel::Path &path, TreeViewColumn &column, Gdk::Rectangle &rect) const
Glib::PropertyProxy< bool > property_hover_selection()
void set_rubber_banding(bool enable=true)
void remove_all_columns()
Removes all View columns.
Glib::ListHandle< const TreeViewColumn * > get_columns() const
void move_column_after(TreeViewColumn &column, TreeViewColumn &base_column)
virtual bool on_test_expand_row(const TreeModel::iterator &iter, const TreeModel::Path &path)
This is a default handler for the signal signal_test_expand_row().
GtkTreeView * gobj()
Provides access to the underlying C GtkObject.
Definition: treeview.h:219
void convert_tree_to_widget_coords(int tx, int ty, int &wx, int &wy) const
int remove_column(TreeViewColumn &column)
void set_grid_lines(TreeViewGridLines grid_lines)
void scroll_to_cell(const TreeModel::Path &path, TreeViewColumn &column)
void scroll_to_point(int tree_x, int tree_y)
bool get_headers_clickable() const
Glib::PropertyProxy_ReadOnly< bool > property_fixed_height_mode() const
const GtkTreeView * gobj() const
Provides access to the underlying C GtkObject.
Definition: treeview.h:222
int get_search_column() const
Glib::PropertyProxy_ReadOnly< bool > property_rubber_banding() const
const Entry * get_search_entry() const
int insert_column(const Glib::ustring &title, CellRenderer &cell, int position)
int append_column_numeric_editable(const Glib::ustring &title, const TreeModelColumn< ColumnType > &model_column, const Glib::ustring &format)
Definition: treeview.h:2095
Glib::PropertyProxy_ReadOnly< Adjustment * > property_hadjustment() const
void enable_model_drag_source(const ArrayHandle_TargetEntry &targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
const Adjustment * get_hadjustment() const
Glib::SignalProxy2< void, const TreeModel::Path &, TreeViewColumn * > signal_row_activated()
Glib::SignalProxy2< void, const TreeModel::iterator &, const TreeModel::Path & > signal_row_collapsed()
void tree_to_widget_coords(int tx, int ty, int &wx, int &wy) const
void set_show_expanders(bool enabled=true)
bool get_reorderable() const
Glib::PropertyProxy< bool > property_rules_hint()
bool get_enable_tree_lines() const
bool get_tooltip_context_iter(int &x, int &y, bool keyboard_tip, Gtk::TreeModel::iterator &iter)
Glib::PropertyProxy< int > property_tooltip_column()
CellRenderer * get_column_cell_renderer(int n)
void convert_widget_to_bin_window_coords(int wx, int wy, int &bx, int &by) const
void set_level_indentation(int indentation)
TreeViewColumn Column
Definition: treeview.h:256
void set_hover_selection(bool hover=true)
Glib::SignalProxy2< bool, const TreeModel::iterator &, const TreeModel::Path & > signal_test_expand_row()
bool is_rubber_banding_active() const
void scroll_to_row(const TreeModel::Path &path, float row_align)
void get_cell_area(const TreeModel::Path &path, TreeViewColumn &column, Gdk::Rectangle &rect)
TreeSelection Selection
Definition: treeview.h:260
Glib::PropertyProxy_ReadOnly< int > property_tooltip_column() const
const CellRenderer * get_column_cell_renderer(int n) const
void set_drag_dest_row(const TreeModel::Path &path, TreeViewDropPosition pos)
Glib::PropertyProxy< bool > property_reorderable()
TreeView(const Glib::RefPtr< TreeModel > &model)
TreeViewColumn::SlotCellData SlotCellData
Definition: treeview.h:552
Glib::RefPtr< Gdk::Pixmap > create_row_drag_icon(const TreeModel::Path &path)
Glib::PropertyProxy< TreeViewColumn * > property_expander_column()
Glib::SignalProxy0< void > signal_columns_changed()
Glib::PropertyProxy< Adjustment * > property_hadjustment()
void expand_all()
void get_drag_dest_row(TreeModel::Path &path, TreeViewDropPosition &pos) const
void enable_model_drag_dest(const ArrayHandle_TargetEntry &targets, Gdk::DragAction actions=Gdk::ACTION_COPY|Gdk::ACTION_MOVE)
void columns_autosize()
Glib::PropertyProxy_ReadOnly< bool > property_headers_clickable() const
void convert_widget_to_tree_coords(int wx, int wy, int &tx, int &ty) const
virtual void on_row_activated(const TreeModel::Path &path, TreeViewColumn *column)
This is a default handler for the signal signal_row_activated().
void set_fixed_height_mode(bool enable=true)
virtual bool on_test_collapse_row(const TreeModel::iterator &iter, const TreeModel::Path &path)
This is a default handler for the signal signal_test_collapse_row().
Glib::RefPtr< const Gdk::Window > get_bin_window() const
void unset_model()
Glib::RefPtr< TreeModel > get_model()
void scroll_to_row(const TreeModel::Path &path)
bool get_dest_row_at_pos(int drag_x, int drag_y, TreeModel::Path &path, TreeViewDropPosition &pos) const
Glib::SignalProxy0< void > signal_cursor_changed()
virtual void on_cursor_changed()
This is a default handler for the signal signal_cursor_changed().
Glib::PropertyProxy_ReadOnly< Adjustment * > property_vadjustment() const
void set_headers_clickable(bool setting=true)
void set_tooltip_row(const Glib::RefPtr< Tooltip > &tooltip, const TreePath &path)
virtual void on_row_expanded(const TreeModel::iterator &iter, const TreeModel::Path &path)
This is a default handler for the signal signal_row_expanded().
void row_activated(const TreeModel::Path &path, TreeViewColumn &column)
void tree_to_widget_coords(int tx, int ty, int &wx, int &wy)
Glib::ListHandle< TreeViewColumn * > get_columns()
void set_tooltip_cell(const Glib::RefPtr< Tooltip > &tooltip, const TreeModel::Path *path, TreeViewColumn *column, CellRenderer *cell)
Glib::RefPtr< TreeSelection > get_selection()
void set_cursor(const TreeModel::Path &path, TreeViewColumn &focus_column, bool start_editing=false)
void reset_expander_column()
int append_column(const Glib::ustring &title, CellRenderer &cell)
Creates a View column containing the CellRenderer, and appends it.
Glib::PropertyProxy< bool > property_show_expanders()
Adjustment * get_hadjustment()
Glib::PropertyProxy< bool > property_enable_search()
void set_hover_expand(bool expand=true)
virtual void on_row_collapsed(const TreeModel::iterator &iter, const TreeModel::Path &path)
This is a default handler for the signal signal_row_collapsed().
void get_cell_area(const TreeModel::Path &path, TreeViewColumn &column, Gdk::Rectangle &rect) const
bool get_headers_visible() const
bool row_expanded(const TreeModel::Path &path)
Gtk::TreeView * wrap(GtkTreeView *object, bool take_copy=false)
int get_level_indentation() const
void set_rules_hint(bool setting=true)
void unset_rows_drag_dest()
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
DragAction
Definition: dragcontext.h:68
@ ACTION_MOVE
Definition: dragcontext.h:71
@ ACTION_COPY
Definition: dragcontext.h:70
TreeViewDropPosition
Definition: treeview.h:69
TreeViewGridLines
Definition: treeview.h:102
@ TREE_VIEW_DROP_BEFORE
Definition: treeview.h:70
@ TREE_VIEW_DROP_INTO_OR_BEFORE
Definition: treeview.h:72
@ TREE_VIEW_DROP_AFTER
Definition: treeview.h:71
@ TREE_VIEW_DROP_INTO_OR_AFTER
Definition: treeview.h:73
@ TREE_VIEW_GRID_LINES_HORIZONTAL
Definition: treeview.h:104
@ TREE_VIEW_GRID_LINES_VERTICAL
Definition: treeview.h:105
@ TREE_VIEW_GRID_LINES_BOTH
Definition: treeview.h:106
@ TREE_VIEW_GRID_LINES_NONE
Definition: treeview.h:103
Definition: ardour_ui.h:188
T * manage(T *obj)
Definition: object.h:58
Glib::ArrayHandle< TargetEntry, TargetEntry_Traits > ArrayHandle_TargetEntry
Definition: targetentry.h:91
Definition: lobject.h:100