2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TREEVIEWCOLUMN_H
4 #define _GTKMM_TREEVIEWCOLUMN_H
10 /* Copyright(C) 2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or(at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #include <gtkmm/object.h>
28 #include <gtkmm/treeiter.h>
29 #include <gtkmm/widget.h>
30 #include <gdkmm/window.h>
31 #include <gtkmm/treemodel.h>
32 #include <glibmm/listhandle.h>
33 #include <gtkmm/cellrenderer_generation.h>
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkTreeViewColumn GtkTreeViewColumn;
38 typedef struct _GtkTreeViewColumnClass GtkTreeViewColumnClass;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
43 { class TreeViewColumn_Class; } // namespace Gtk
48 /** @addtogroup gtkmmEnums Enums and Flags */
53 enum TreeViewColumnSizing
55 TREE_VIEW_COLUMN_GROW_ONLY,
56 TREE_VIEW_COLUMN_AUTOSIZE,
57 TREE_VIEW_COLUMN_FIXED
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68 class Value<Gtk::TreeViewColumnSizing> : public Glib::Value_Enum<Gtk::TreeViewColumnSizing>
71 static GType value_type() G_GNUC_CONST;
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 /** Typedefed as Gtk::TreeView::Column.
83 * This is a visible column in a Gtk::TreeView widget. It determines the geometry, type.
88 class TreeViewColumn : public Gtk::Object
91 #ifndef DOXYGEN_SHOULD_SKIP_THIS
92 typedef TreeViewColumn CppObjectType;
93 typedef TreeViewColumn_Class CppClassType;
94 typedef GtkTreeViewColumn BaseObjectType;
95 typedef GtkTreeViewColumnClass BaseClassType;
96 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
98 virtual ~TreeViewColumn();
100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
103 friend class TreeViewColumn_Class;
104 static CppClassType treeviewcolumn_class_;
107 TreeViewColumn(const TreeViewColumn&);
108 TreeViewColumn& operator=(const TreeViewColumn&);
111 explicit TreeViewColumn(const Glib::ConstructParams& construct_params);
112 explicit TreeViewColumn(GtkTreeViewColumn* castitem);
114 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
118 static GType get_type() G_GNUC_CONST;
119 static GType get_base_type() G_GNUC_CONST;
122 ///Provides access to the underlying C GtkObject.
123 GtkTreeViewColumn* gobj() { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
125 ///Provides access to the underlying C GtkObject.
126 const GtkTreeViewColumn* gobj() const { return reinterpret_cast<GtkTreeViewColumn*>(gobject_); }
130 //C++ methods used to invoke GTK+ virtual functions:
133 //GTK+ Virtual Functions (override these to change behaviour):
135 //Default Signal Handlers::
136 virtual void on_clicked();
143 typedef TreeViewColumn Column;
147 explicit TreeViewColumn(const Glib::ustring& title);
148 TreeViewColumn(const Glib::ustring& title, CellRenderer& cell);
150 /** Create a default view column for the given model column type.
152 template<class T_ModelColumnType>
153 TreeViewColumn(const Glib::ustring& title, const TreeModelColumn<T_ModelColumnType>& column);
156 /** Packs the @a cell into the beginning of the column. If @a expand is <tt>false</tt>, then
157 * the @a cell is allocated no more space than it needs. Any unused space is divided
158 * evenly between cells for which @a expand is <tt>true</tt>.
159 * @param cell The Gtk::CellRenderer.
160 * @param expand <tt>true</tt> if @a cell is to be given extra space allocated to @a tree_column .
162 void pack_start(CellRenderer& cell, bool expand = true);
164 /** Adds the @a cell to end of the column. If @a expand is <tt>false</tt>, then the @a cell
165 * is allocated no more space than it needs. Any unused space is divided
166 * evenly between cells for which @a expand is <tt>true</tt>.
167 * @param cell The Gtk::CellRenderer.
168 * @param expand <tt>true</tt> if @a cell is to be given extra space allocated to @a tree_column .
170 void pack_end(CellRenderer& cell, bool expand = true);
172 /** Creates an appropriate CellRenderer for the @a column, and packs that cell into the beginning of the column.
173 * If @a expand is <tt>false</tt>, then
174 * the cell is allocated no more space than it needs. Any unused space is divided
175 * evenly between cells for which @a expand is <tt>true</tt>.
177 * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
179 * @param column The model column that will be rendered by the view cell.
180 * @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
182 template<class T_ModelColumnType>
183 void pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
185 /** Creates an appropriate CellRenderer for the @a column, and packs that cell at the end of the column.
186 * If @a expand is <tt>false</tt>, then
187 * the cell is allocated no more space than it needs. Any unused space is divided
188 * evenly between cells for which @a expand is <tt>true</tt>.
190 * You can use get_first_cell_renderer() or get_cell_renderers() to access the generated CellRenderer.
192 * @param column The model column that will be rendered by the view cell.
193 * @param expand <tt>true</tt> if the cell is to be given extra space allocated to the view column.
195 template<class T_ModelColumnType>
196 void pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand = true);
199 /** Unsets all the mappings on all renderers on the @a tree_column .
203 /** Gets the CellRenderer for the column.
204 * You should dynamic_cast<> to the expected derived CellRenderer type.
205 * This assumes that the TreeViewColumn contains only one CellRenderer.
207 CellRenderer* get_first_cell_renderer();
209 /** Gets the CellRenderer for the column.
210 * You should dynamic_cast<> to the expected derived CellRenderer type.
211 * This assumes that the TreeViewColumn contains only one CellRenderer.
213 const CellRenderer* get_first_cell_renderer() const;
216 /** Returns a list of all the cell renderers in the column,
217 * in no particular order.
218 * @return A list of Gtk::CellRenderers.
220 Glib::ListHandle<CellRenderer*> get_cell_renderers();
222 /** Returns a list of all the cell renderers in the column,
223 * in no particular order.
224 * @return A list of Gtk::CellRenderers.
226 Glib::ListHandle<const CellRenderer*> get_cell_renderers() const;
229 /** Adds an attribute mapping to the list in @a tree_column . The @a column is the
230 * column of the model to get a value from, and the @a attribute is the
231 * parameter on @a cell_renderer to be set from the value. So for example
232 * if column 2 of the model contains strings, you could have the
233 * "text" attribute of a Gtk::CellRendererText get its values from
235 * @param cell_renderer The Gtk::CellRenderer to set attributes on.
236 * @param attribute An attribute on the renderer.
237 * @param column The column position on the model to get the attribute from.
239 void add_attribute(CellRenderer& cell_renderer, const Glib::ustring& attribute, int column);
241 void add_attribute(const Glib::PropertyProxy_Base& property, const TreeModelColumnBase& column);
244 /** Associate a view CellRenderer with a model column, so that the CellRenderer renders the data in the model column.
246 * @param renderer The view cell renderer which will render the model column.
247 * @param column The model column to be renderered by this view.
249 void set_renderer(Gtk::CellRenderer& renderer, const TreeModelColumnBase& column);
251 // _WRAP_METHOD(void set_attributes(CellRenderer& cell_renderer, ...), )
254 * void on_cell_data(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
256 * This function is used instead of the standard attributes mapping for setting the column value, and should set the
257 * value of the column's cell renderer as appropriate.
259 typedef sigc::slot<void, CellRenderer*, const Gtk::TreeModel::iterator&> SlotCellData;
261 /** Sets the slot callback to use for the column.
262 * This callback function is used instead of the standard attributes mapping for setting the column value, and should set the
263 * value of the column's cell renderer as appropriate.
265 * See also unset_cell_data_func().
267 * @param cell_renderer A Gtk::CellRenderer
268 * @param slot The callback slot to use. Create this with sigc::mem_fun(), or sigc::ptr_fun().
270 void set_cell_data_func(CellRenderer& cell_renderer, const SlotCellData& slot);
272 /** Removes a previously set callback slot. See set_cell_data_func().
274 void unset_cell_data_func(CellRenderer& cell_renderer);
277 /** Clears all existing attributes previously set with
279 * @param cell_renderer A Gtk::CellRenderer to clear the attribute mapping on.
281 void clear_attributes(CellRenderer& cell_renderer);
283 /** Sets the spacing field of @a tree_column , which is the number of pixels to
284 * place between cell renderers packed into it.
285 * @param spacing Distance between cell renderers in pixels.
287 void set_spacing(int spacing);
289 /** Returns the spacing of @a tree_column .
290 * @return The spacing of @a tree_column .
292 int get_spacing() const;
294 /** Sets the visibility of @a tree_column .
295 * @param visible <tt>true</tt> if the @a tree_column is visible.
297 void set_visible(bool visible = true);
299 /** Returns <tt>true</tt> if @a tree_column is visible.
300 * @return Whether the column is visible or not. If it is visible, then
301 * the tree will show the column.
303 bool get_visible() const;
305 /** If @a resizable is <tt>true</tt>, then the user can explicitly resize the column by
306 * grabbing the outer edge of the column button. If resizable is <tt>true</tt> and
307 * sizing mode of the column is Gtk::TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
308 * mode is changed to Gtk::TREE_VIEW_COLUMN_GROW_ONLY.
309 * @param resizable <tt>true</tt>, if the column can be resized.
311 void set_resizable(bool resizable = true);
313 /** Returns <tt>true</tt> if the @a tree_column can be resized by the end user.
314 * @return <tt>true</tt>, if the @a tree_column can be resized.
316 bool get_resizable() const;
318 /** Sets the growth behavior of @a tree_column to @a type .
319 * @param type The Gtk::TreeViewColumnSizing.
321 void set_sizing(TreeViewColumnSizing type);
323 /** Returns the current type of @a tree_column .
324 * @return The type of @a tree_column .
326 TreeViewColumnSizing get_sizing();
328 /** Returns the current size of @a tree_column in pixels.
329 * @return The current width of @a tree_column .
331 int get_width() const;
333 /** Gets the fixed width of the column. This value is only meaning may not be
334 * the actual width of the column on the screen, just what is requested.
335 * @return The fixed width of the column.
337 int get_fixed_width() const;
339 /** Sets the size of the column in pixels. This is meaningful only if the sizing
340 * type is Gtk::TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
341 * the min/max width for the column. Please note that the min/max width of the
342 * column doesn't actually affect the "fixed_width" property of the widget, just
343 * the actual size when displayed.
344 * @param fixed_width The size to set @a tree_column to. Must be greater than 0.
346 void set_fixed_width(int fixed_width);
348 /** Sets the minimum width of the @a tree_column . If @a min_width is -1, then the
349 * minimum width is unset.
350 * @param min_width The minimum width of the column in pixels, or -1.
352 void set_min_width(int min_width);
354 /** Returns the minimum width in pixels of the @a tree_column , or -1 if no minimum
356 * @return The minimum width of the @a tree_column .
358 int get_min_width() const;
360 /** Sets the maximum width of the @a tree_column . If @a max_width is -1, then the
361 * maximum width is unset. Note, the column can actually be wider than max
362 * width if it's the last column in a view. In this case, the column expands to
363 * fill any extra space.
364 * @param max_width The maximum width of the column in pixels, or -1.
366 void set_max_width(int max_width);
368 /** Returns the maximum width in pixels of the @a tree_column , or -1 if no maximum
370 * @return The maximum width of the @a tree_column .
372 int get_max_width() const;
374 /** Emits the "clicked" signal on the column. This function will only work if
375 * @a tree_column is clickable.
380 /** Sets the title of the @a tree_column . If a custom widget has been set, then
381 * this value is ignored.
382 * @param title The title of the @a tree_column .
384 void set_title(const Glib::ustring& title);
386 /** Returns the title of the widget.
387 * @return The title of the column. This string should not be
390 Glib::ustring get_title() const;
393 /** Sets the column to take available extra space. This space is shared equally
394 * amongst all columns that have the expand set to <tt>true</tt>. If no column has this
395 * option set, then the last column gets all extra space. By default, every
396 * column is created with this <tt>false</tt>.
400 void set_expand(bool expand = true);
402 /** Return <tt>true</tt> if the column expands to take any available space.
403 * @return <tt>true</tt>, if the column expands
407 bool get_expand() const;
410 /** Sets the header to be active if @a active is <tt>true</tt>. When the header is active,
411 * then it can take keyboard focus, and can be clicked.
412 * @param clickable <tt>true</tt> if the header is active.
414 void set_clickable(bool clickable = true);
416 /** Returns <tt>true</tt> if the user can click on the header for the column.
417 * @return <tt>true</tt> if user can click the column header.
419 bool get_clickable() const;
421 /** Sets the widget in the header to be @a widget . If widget is <tt>0</tt>, then the
422 * header button is set with a Gtk::Label set to the title of @a tree_column .
423 * @param widget A child Gtk::Widget, or <tt>0</tt>.
425 void set_widget(Gtk::Widget& widget);
427 /** Returns the Gtk::Widget in the button on the column header. If a custom
428 * widget has not been set then <tt>0</tt> is returned.
429 * @return The Gtk::Widget in the column header, or <tt>0</tt>.
431 Widget* get_widget();
433 /** Returns the Gtk::Widget in the button on the column header. If a custom
434 * widget has not been set then <tt>0</tt> is returned.
435 * @return The Gtk::Widget in the column header, or <tt>0</tt>.
437 const Widget* get_widget() const;
440 /** Sets the alignment of the title or custom widget inside the column header.
441 * The alignment determines its location inside the button -- 0.0 for left, 0.5
442 * for center, 1.0 for right.
443 * @param xalign The alignment, which is between [0.0 and 1.0] inclusive.
445 void set_alignment(float xalign);
447 /** Sets the alignment of the title or custom widget inside the column header.
448 * The alignment determines its location inside the button -- 0.0 for left, 0.5
449 * for center, 1.0 for right.
450 * @param xalign The alignment, which is between [0.0 and 1.0] inclusive.
452 void set_alignment(AlignmentEnum xalign);
455 /** Returns the current x alignment of @a tree_column . This value can range
456 * between 0.0 and 1.0.
457 * @return The current alignent of @a tree_column .
459 float get_alignment() const;
461 /** If @a reorderable is <tt>true</tt>, then the column can be reordered by the end user
462 * dragging the header.
463 * @param reorderable <tt>true</tt>, if the column can be reordered.
465 void set_reorderable(bool reorderable = true);
467 /** Returns <tt>true</tt> if the @a tree_column can be reordered by the user.
468 * @return <tt>true</tt> if the @a tree_column can be reordered by the user.
470 bool get_reorderable() const;
473 /** Sets the logical @a sort_column_id that this column sorts on when this column
474 * is selected for sorting. Doing so makes the column header clickable.
475 * @param sort_column_id The @a sort_column_id of the model to sort on.
477 void set_sort_column(const TreeModelColumnBase& sort_column_id);
479 /** Sets the logical @a sort_column_id that this column sorts on when this column
480 * is selected for sorting. Doing so makes the column header clickable.
481 * @param sort_column_id The @a sort_column_id of the model to sort on.
483 void set_sort_column(int sort_column_id);
485 #ifndef GTKMM_DISABLE_DEPRECATED
486 /** @deprecated Use set_sort_column() instead.
488 void set_sort_column_id(const TreeModelColumnBase& sort_column_id);
490 /** @deprecated Use set_sort_column() instead.
492 void set_sort_column_id(int sort_column_id);
493 #endif //GTKMM_DISABLE_DEPRECATED
496 /** Gets the logical @a sort_column_id that the model sorts on when this
497 * column is selected for sorting.
498 * See set_sort_column_id().
499 * @return The current @a sort_column_id for this column, or -1 if
500 * this column can't be used for sorting.
502 int get_sort_column_id() const;
504 /** Call this function with a @a setting of <tt>true</tt> to display an arrow in
505 * the header button indicating the column is sorted. Call
506 * set_sort_order() to change the direction of
508 * @param setting <tt>true</tt> to display an indicator that the column is sorted.
510 void set_sort_indicator(bool setting);
512 /** Gets the value set by set_sort_indicator().
513 * @return Whether the sort indicator arrow is displayed.
515 bool get_sort_indicator() const;
517 /** Changes the appearance of the sort indicator.
519 * This <em>does not</em> actually sort the model. Use
520 * set_sort_column_id() if you want automatic sorting
521 * support. This function is primarily for custom sorting behavior, and should
522 * be used in conjunction with gtk_tree_sortable_set_sort_column() to do
523 * that. For custom models, the mechanism will vary.
525 * The sort indicator changes direction to indicate normal sort or reverse sort.
526 * Note that you must have the sort indicator enabled to see anything when
527 * calling this function; see set_sort_indicator().
528 * @param order Sort order that the sort indicator should indicate.
530 void set_sort_order(SortType order);
532 /** Gets the value set by set_sort_order().
533 * @return The sort order the sort indicator is indicating.
535 SortType get_sort_order() const;
538 /** Sets the cell renderer based on the @a tree_model and @a iter . That is, for
539 * every attribute mapping in @a tree_column , it will get a value from the set
540 * column on the @a iter , and use that value to set the attribute on the cell
541 * renderer. This is used primarily by the Gtk::TreeView.
542 * @param tree_model The Gtk::TreeModel to to get the cell renderers attributes from.
543 * @param iter The Gtk::TreeIter to to get the cell renderer's attributes from.
544 * @param is_expander <tt>true</tt>, if the row has children.
545 * @param is_expanded <tt>true</tt>, if the row has visible children.
547 void cell_set_cell_data(const Glib::RefPtr<TreeModel>& tree_model, const TreeModel::iterator& iter, bool is_expander, bool is_expanded);
549 /** Obtains the width and height needed to render the column. This is used
550 * primarily by the Gtk::TreeView.
551 * @param cell_area The area a cell in the column will be allocated.
552 * @param x_offset Location to return x offset of a cell relative to @a cell_area .
553 * @param y_offset Location to return y offset of a cell relative to @a cell_area .
554 * @param width Location to return width needed to render a cell.
555 * @param height Location to return height needed to render a cell.
557 void cell_get_size(Gdk::Rectangle& cell_area, int& x_offset, int& y_offset, int& width, int& height) const;
559 /** Returns <tt>true</tt> if any of the cells packed into the @a tree_column are visible.
560 * For this to be meaningful, you must first initialize the cells with
561 * cell_set_cell_data()
562 * @return <tt>true</tt>, if any of the cells packed into the @a tree_column are currently visible.
564 bool cell_is_visible() const;
566 /** Sets the current keyboard focus to be at @a cell , if the column contains
567 * 2 or more editable and activatable cells.
570 * @param cell A Gtk::CellRenderer.
572 void focus_cell(CellRenderer& cell);
575 /** Obtains the horizontal position and size of a cell in a column. If the
576 * cell is not found in the column, @a start_pos and @a width are not changed and
577 * <tt>false</tt> is returned.
578 * @param cell_renderer A Gtk::CellRenderer.
579 * @param start_pos Return location for the horizontal position of @a cell within
581 * @param width Return location for the width of @a cell .
582 * @return <tt>true</tt> if @a cell belongs to @a tree_column .
584 bool get_cell_position(const CellRenderer& cell_renderer, int& start_pos, int& width) const;
587 Glib::SignalProxy0< void > signal_clicked();
590 /** Whether to display the column.
592 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
593 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
594 * the value of the property changes.
596 Glib::PropertyProxy<bool> property_visible() ;
598 /** Whether to display the column.
600 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
601 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
602 * the value of the property changes.
604 Glib::PropertyProxy_ReadOnly<bool> property_visible() const;
606 /** Current width of the column.
608 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
609 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
610 * the value of the property changes.
612 Glib::PropertyProxy_ReadOnly<int> property_width() const;
615 /** Resize mode of the column.
617 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
618 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
619 * the value of the property changes.
621 Glib::PropertyProxy<TreeViewColumnSizing> property_sizing() ;
623 /** Resize mode of the column.
625 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
626 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
627 * the value of the property changes.
629 Glib::PropertyProxy_ReadOnly<TreeViewColumnSizing> property_sizing() const;
631 /** Current fixed width of the column.
633 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
634 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
635 * the value of the property changes.
637 Glib::PropertyProxy<int> property_fixed_width() ;
639 /** Current fixed width of the column.
641 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
642 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
643 * the value of the property changes.
645 Glib::PropertyProxy_ReadOnly<int> property_fixed_width() const;
647 /** Minimum allowed width of the column.
649 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
650 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
651 * the value of the property changes.
653 Glib::PropertyProxy<int> property_min_width() ;
655 /** Minimum allowed width of the column.
657 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
658 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
659 * the value of the property changes.
661 Glib::PropertyProxy_ReadOnly<int> property_min_width() const;
663 /** Maximum allowed width of the column.
665 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
666 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
667 * the value of the property changes.
669 Glib::PropertyProxy<int> property_max_width() ;
671 /** Maximum allowed width of the column.
673 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
674 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
675 * the value of the property changes.
677 Glib::PropertyProxy_ReadOnly<int> property_max_width() const;
679 /** Title to appear in column header.
681 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
682 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
683 * the value of the property changes.
685 Glib::PropertyProxy<Glib::ustring> property_title() ;
687 /** Title to appear in column header.
689 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
690 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
691 * the value of the property changes.
693 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
695 /** Column gets share of extra width allocated to the widget.
697 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
698 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
699 * the value of the property changes.
701 Glib::PropertyProxy<bool> property_expand() ;
703 /** Column gets share of extra width allocated to the widget.
705 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
706 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
707 * the value of the property changes.
709 Glib::PropertyProxy_ReadOnly<bool> property_expand() const;
711 /** Whether the header can be clicked.
713 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
714 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
715 * the value of the property changes.
717 Glib::PropertyProxy<bool> property_clickable() ;
719 /** Whether the header can be clicked.
721 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
722 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
723 * the value of the property changes.
725 Glib::PropertyProxy_ReadOnly<bool> property_clickable() const;
727 /** Widget to put in column header button instead of column title.
729 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
730 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
731 * the value of the property changes.
733 Glib::PropertyProxy<Widget*> property_widget() ;
735 /** Widget to put in column header button instead of column title.
737 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
738 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
739 * the value of the property changes.
741 Glib::PropertyProxy_ReadOnly<Widget*> property_widget() const;
743 /** X Alignment of the column header text or widget.
745 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
746 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
747 * the value of the property changes.
749 Glib::PropertyProxy<float> property_alignment() ;
751 /** X Alignment of the column header text or widget.
753 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
754 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
755 * the value of the property changes.
757 Glib::PropertyProxy_ReadOnly<float> property_alignment() const;
759 /** Whether the column can be reordered around the headers.
761 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
762 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
763 * the value of the property changes.
765 Glib::PropertyProxy<bool> property_reorderable() ;
767 /** Whether the column can be reordered around the headers.
769 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
770 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
771 * the value of the property changes.
773 Glib::PropertyProxy_ReadOnly<bool> property_reorderable() const;
775 /** Whether to show a sort indicator.
777 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
778 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
779 * the value of the property changes.
781 Glib::PropertyProxy<bool> property_sort_indicator() ;
783 /** Whether to show a sort indicator.
785 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
786 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
787 * the value of the property changes.
789 Glib::PropertyProxy_ReadOnly<bool> property_sort_indicator() const;
791 /** Sort direction the sort indicator should indicate.
793 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
794 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
795 * the value of the property changes.
797 Glib::PropertyProxy<SortType> property_sort_order() ;
799 /** Sort direction the sort indicator should indicate.
801 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
802 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
803 * the value of the property changes.
805 Glib::PropertyProxy_ReadOnly<SortType> property_sort_order() const;
808 #ifndef DOXYGEN_SHOULD_SKIP_THIS
810 // Only necessary because of the templated ctor, see below.
811 static const Glib::Class& class_init_();
812 #endif //DOXYGEN_SHOULD_SKIP_THIS
817 #ifndef DOXYGEN_SHOULD_SKIP_THIS
819 template<class T_ModelColumnType>
820 void TreeViewColumn::pack_start(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
822 //Generate appropriate Renderer for the column:
823 CellRenderer* pCellRenderer = manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
826 pack_start(*pCellRenderer, expand);
827 set_renderer(*pCellRenderer, column);
830 template<class T_ModelColumnType>
831 void TreeViewColumn::pack_end(const TreeModelColumn<T_ModelColumnType>& column, bool expand)
833 //Generate appropriate Renderer for the column:
834 CellRenderer* pCellRenderer= manage( CellRenderer_Generation::generate_cellrenderer<T_ModelColumnType>() );
837 pack_end(*pCellRenderer, expand);
838 set_renderer(*pCellRenderer, column);
842 template <class T_ModelColumnType>
843 TreeViewColumn::TreeViewColumn(const Glib::ustring& title,
844 const TreeModelColumn<T_ModelColumnType>& column)
846 Glib::ObjectBase(0), // not (yet) a custom class
847 Gtk::Object(Glib::ConstructParams(class_init_(), "title", title.c_str(), (char*) 0))
849 pack_start(column, true /* expand */);
853 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
860 /** @relates Gtk::TreeViewColumn
861 * @param object The C instance
862 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
863 * @result A C++ instance that wraps this C instance.
865 Gtk::TreeViewColumn* wrap(GtkTreeViewColumn* object, bool take_copy = false);
867 #endif /* _GTKMM_TREEVIEWCOLUMN_H */