gtkmm 3.24.7
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gtk::CellAreaBox Class Reference

A cell area that renders CellRenderers into a row or a colum, depending on its orientation. More...

#include <gtkmm/cellareabox.h>

Inheritance diagram for Gtk::CellAreaBox:
Inheritance graph
[legend]

Public Member Functions

 CellAreaBox (CellAreaBox && src) noexcept
 
CellAreaBoxoperator= (CellAreaBox && src) noexcept
 
 ~CellAreaBox () noexcept override
 
GtkCellAreaBox * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkCellAreaBox * gobj () const
 Provides access to the underlying C GObject. More...
 
GtkCellAreaBox * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
void pack_start (CellRenderer & renderer, bool expand=false, bool align=true, bool fixed=false)
 Adds renderer to box, packed with reference to the start of box. More...
 
void pack_end (CellRenderer & renderer, bool expand=false, bool align=true, bool fixed=false)
 Adds renderer to box, packed with reference to the end of box. More...
 
int get_spacing () const
 Gets the spacing added between cell renderers. More...
 
void set_spacing (int spacing)
 Sets the spacing to add between cell renderers in box. More...
 
Glib::PropertyProxy< int > property_spacing ()
 The amount of space to reserve between cells. More...
 
Glib::PropertyProxy_ReadOnly< int > property_spacing () const
 The amount of space to reserve between cells. More...
 
- Public Member Functions inherited from Gtk::CellArea
 CellArea (CellArea && src) noexcept
 
CellAreaoperator= (CellArea && src) noexcept
 
 ~CellArea () noexcept override
 
GtkCellArea * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkCellArea * gobj () const
 Provides access to the underlying C GObject. More...
 
GtkCellArea * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
void add (CellRenderer & renderer)
 Adds renderer to area with the default child cell properties. More...
 
void remove (CellRenderer & renderer)
 Removes renderer from area. More...
 
bool has_renderer (CellRenderer & renderer)
 Checks if area contains renderer. More...
 
void foreach (const SlotForeach & slot)
 Calls the slot for every CellRenderer in the CellArea. More...
 
void foreach (const Glib::RefPtr< CellAreaContext > & context, Widget * widget, const Gdk::Rectangle & cell_area, const Gdk::Rectangle & background_area, const SlotForeachAlloc & slot)
 Calls the slot for every CellRenderer in the CellArea with the allocated rectangle inside the cell_area rectangle. More...
 
int event (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, GdkEvent * gdk_event, const Gdk::Rectangle & cell_area, GtkCellRendererState flags)
 Delegates event handling to a Gtk::CellArea. More...
 
void render (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, const ::Cairo::RefPtr< ::Cairo::Context > & cr, const Gdk::Rectangle & background_area, const Gdk::Rectangle & cell_area, CellRendererState flags, bool paint_focus)
 Renders area’s cells according to area’s layout onto widget at the given coordinates. More...
 
void get_cell_allocation (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, CellRenderer & renderer, const Gdk::Rectangle & cell_area, Gdk::Rectangle & allocation)
 Derives the allocation of renderer inside area if area were to be renderered in cell_area. More...
 
CellRendererget_cell_at_position (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, const Gdk::Rectangle & cell_area, int x, int y, Gdk::Rectangle & alloc_area)
 Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area. More...
 
const CellRendererget_cell_at_position (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, const Gdk::Rectangle & cell_area, int x, int y, Gdk::Rectangle & alloc_area) const
 Gets the Gtk::CellRenderer at x and y coordinates inside area and optionally returns the full cell allocation for it inside cell_area. More...
 
Glib::RefPtr< CellAreaContextcreate_context () const
 Creates a Gtk::CellAreaContext to be used with area for all purposes. More...
 
Glib::RefPtr< CellAreaContextcopy_context (const Glib::RefPtr< const CellAreaContext > & context)
 This is sometimes needed for cases where rows need to share alignments in one orientation but may be separately grouped in the opposing orientation. More...
 
SizeRequestMode get_request_mode () const
 Gets whether the area prefers a height-for-width layout or a width-for-height layout. More...
 
void get_preferred_width (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int & minimum_width, int & natural_width)
 Retrieves a cell area’s initial minimum and natural width. More...
 
void get_preferred_height_for_width (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int width, int & minimum_height, int & natural_height)
 Retrieves a cell area’s minimum and natural height if it would be given the specified width. More...
 
void get_preferred_height (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int & minimum_height, int & natural_height)
 Retrieves a cell area’s initial minimum and natural height. More...
 
void get_preferred_width_for_height (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int height, int & minimum_width, int & natural_width)
 Retrieves a cell area’s minimum and natural width if it would be given the specified height. More...
 
Glib::ustring get_current_path_string () const
 Gets the current Gtk::TreePath string for the currently applied Gtk::TreeIter, this is implicitly updated when apply_attributes() is called and can be used to interact with renderers from Gtk::CellArea subclasses. More...
 
void apply_attributes (const Glib::RefPtr< TreeModel > & tree_model, const TreeModel::iterator & iter, bool is_expander, bool is_expanded)
 Applies any connected attributes to the renderers in area by pulling the values from tree_model. More...
 
void attribute_connect (CellRenderer & renderer, const Glib::ustring & attribute, int column)
 Connects an attribute to apply values from column for the Gtk::TreeModel in use. More...
 
void attribute_disconnect (CellRenderer & renderer, const Glib::ustring & attribute)
 Disconnects attribute for the renderer in area so that attribute will no longer be updated with values from the model. More...
 
int attribute_get_column (CellRenderer & renderer, const Glib::ustring & attribute) const
 Returns the model column that an attribute has been mapped to, or -1 if the attribute is not mapped. More...
 
void cell_set_property (CellRenderer & renderer, const Glib::ustring & property_name, const Glib::ValueBase & value)
 Sets a cell property for renderer in area. More...
 
void cell_get_property (CellRenderer & renderer, const Glib::ustring & property_name, Glib::ValueBase & value)
 Gets the value of a cell property for renderer in area. More...
 
bool is_activatable () const
 Returns whether the area can do anything when activated, after applying new attributes to area. More...
 
bool activate (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, const Gdk::Rectangle & cell_area, CellRendererState flags, bool edit_only)
 Activates area, usually by activating the currently focused cell, however some subclasses which embed widgets in the area can also activate a widget if it currently has the focus. More...
 
bool focus (DirectionType direction)
 This should be called by the area’s owning layout widget when focus is to be passed to area, or moved within area for a given direction and row data. More...
 
void set_focus_cell (CellRenderer & renderer)
 Explicitly sets the currently focused cell to renderer. More...
 
CellRendererget_focus_cell ()
 Retrieves the currently focused cell for area. More...
 
const CellRendererget_focus_cell () const
 Retrieves the currently focused cell for area. More...
 
void add_focus_sibling (CellRenderer & renderer, CellRenderer & sibling)
 Adds sibling to renderer’s focusable area, focus will be drawn around renderer and all of its siblings if renderer can focus for a given row. More...
 
void remove_focus_sibling (CellRenderer & renderer, CellRenderer & sibling)
 Removes sibling from renderer’s focus sibling list (see add_focus_sibling()). More...
 
bool is_focus_sibling (CellRenderer & renderer, CellRenderer & sibling)
 Returns whether sibling is one of renderer’s focus siblings (see add_focus_sibling()). More...
 
std::vector< CellRenderer * > get_focus_siblings (CellRenderer & renderer)
 Gets the focus sibling cell renderers for renderer. More...
 
std::vector< const CellRenderer * > get_focus_siblings (const CellRenderer & renderer) const
 Gets the focus sibling cell renderers for renderer. More...
 
CellRendererget_focus_from_sibling (CellRenderer & renderer)
 Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling. More...
 
const CellRendererget_focus_from_sibling (CellRenderer & renderer) const
 Gets the Gtk::CellRenderer which is expected to be focusable for which renderer is, or may be a sibling. More...
 
CellRendererget_edited_cell ()
 Gets the Gtk::CellRenderer in area that is currently being edited. More...
 
const CellRendererget_edited_cell () const
 Gets the Gtk::CellRenderer in area that is currently being edited. More...
 
CellEditableget_edit_widget ()
 Gets the Gtk::CellEditable widget currently used to edit the currently edited cell. More...
 
const CellEditableget_edit_widget () const
 Gets the Gtk::CellEditable widget currently used to edit the currently edited cell. More...
 
bool activate_cell (Widget & widget, CellRenderer & renderer, GdkEvent * gdk_event, const Gdk::Rectangle & cell_area, CellRendererState flags)
 This is used by Gtk::CellArea subclasses when handling events to activate cells, the base Gtk::CellArea class activates cells for keyboard events for free in its own GtkCellArea->activate() implementation. More...
 
void stop_editing (bool canceled)
 Explicitly stops the editing of the currently edited cell. More...
 
void inner_cell_area (Widget & widget, const Gdk::Rectangle & cell_area, Gdk::Rectangle & inner_area)
 This is a convenience function for Gtk::CellArea implementations to get the inner area where a given Gtk::CellRenderer will be rendered. More...
 
void request_renderer (CellRenderer & renderer, Orientation orientation, Widget & widget, int for_size, int & minimum_size, int & natural_size)
 This is a convenience function for Gtk::CellArea implementations to request size for cell renderers. More...
 
- Public Member Functions inherited from Gtk::Buildable
 Buildable (Buildable && src) noexcept
 
Buildableoperator= (Buildable && src) noexcept
 
 ~Buildable () noexcept override
 
GtkBuildable * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkBuildable * gobj () const
 Provides access to the underlying C GObject. More...
 
void set_name (const Glib::ustring & name)
 Sets the name of the buildable object. More...
 
Glib::ustring get_name () const
 Gets the name of the buildable object. More...
 
- Public Member Functions inherited from Gtk::CellLayout
 CellLayout (CellLayout && src) noexcept
 
CellLayoutoperator= (CellLayout && src) noexcept
 
 ~CellLayout () noexcept override
 
GtkCellLayout * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkCellLayout * gobj () const
 Provides access to the underlying C GObject. More...
 
template<class ColumnType >
void pack_start (const TreeModelColumn< ColumnType > & model_column, bool expand=true)
 
void pack_start (CellRenderer & cell, bool expand=true)
 Packs the cell into the beginning of cell_layout. More...
 
void pack_end (CellRenderer & cell, bool expand=true)
 Adds the cell to the end of cell_layout. More...
 
std::vector< CellRenderer * > get_cells ()
 Return value: a list of cell renderers. More...
 
std::vector< const CellRenderer * > get_cells () const
 Return value: a list of cell renderers. More...
 
CellRendererget_first_cell ()
 Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. More...
 
const CellRendererget_first_cell () const
 Gets the CellRenderer for the first column if any has been added, or nullptr otherwise. More...
 
void clear ()
 Unsets all the mappings on all renderers on cell_layout and removes all renderers from cell_layout. More...
 
void add_attribute (CellRenderer & cell, const Glib::ustring & attribute, int column)
 Adds an attribute mapping to the list in cell_layout. More...
 
void add_attribute (const Glib::PropertyProxy_Base & property, const TreeModelColumnBase & column)
 
void add_attribute (CellRenderer & cell, const Glib::ustring & attribute, const TreeModelColumnBase & column)
 
void set_cell_data_func (CellRenderer & cell, const SlotCellData & slot)
 
void clear_attributes (CellRenderer & cell)
 Clears all existing attributes previously set with set_attributes(). More...
 
void reorder (CellRenderer & cell, int position)
 Re-inserts cell at position. More...
 
Glib::RefPtr< CellAreaget_area ()
 Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout. More...
 
Glib::RefPtr< const CellAreaget_area () const
 Returns the underlying Gtk::CellArea which might be cell_layout if called on a Gtk::CellArea or might be nullptr if no Gtk::CellArea is used by cell_layout. More...
 
template<class T_ModelColumnType >
void pack_start (const TreeModelColumn< T_ModelColumnType > & column, bool expand)
 
- Public Member Functions inherited from Gtk::Orientable
 Orientable (Orientable && src) noexcept
 
Orientableoperator= (Orientable && src) noexcept
 
 ~Orientable () noexcept override
 
GtkOrientable * gobj ()
 Provides access to the underlying C GObject. More...
 
const GtkOrientable * gobj () const
 Provides access to the underlying C GObject. More...
 
void set_orientation (Orientation orientation)
 Sets the orientation of the orientable. More...
 
Orientation get_orientation () const
 Retrieves the orientation of the orientable. More...
 
Glib::PropertyProxy< Orientationproperty_orientation ()
 The orientation of the orientable. More...
 
Glib::PropertyProxy_ReadOnly< Orientationproperty_orientation () const
 The orientation of the orientable. More...
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< CellAreaBoxcreate ()
 
- Static Public Member Functions inherited from Gtk::CellArea
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
- Static Public Member Functions inherited from Gtk::Buildable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
- Static Public Member Functions inherited from Gtk::CellLayout
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
- Static Public Member Functions inherited from Gtk::Orientable
static void add_interface (GType gtype_implementer)
 
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 

Protected Member Functions

 CellAreaBox ()
 
- Protected Member Functions inherited from Gtk::CellArea
 CellArea ()
 
Glib::SignalProxy< void, const Glib::RefPtr< TreeModel > &, const TreeModel::iterator &, bool, bool > signal_apply_attributes ()
 
Glib::SignalProxy< void, CellRenderer *, CellEditable *, const Gdk::Rectangle &, const Glib::ustring & > signal_add_editable ()
 
Glib::SignalProxy< void, CellRenderer *, CellEditable * > signal_remove_editable ()
 
Glib::SignalProxy< void, CellRenderer *, const Glib::ustring & > signal_focus_changed ()
 
virtual SizeRequestMode get_request_mode_vfunc () const
 
virtual void get_preferred_width_vfunc (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int & minimum_width, int & natural_width)
 
virtual void get_preferred_height_for_width_vfunc (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int width, int & minimum_height, int & natural_height)
 
virtual void get_preferred_height_vfunc (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int & minimum_height, int & natural_height)
 
virtual void get_preferred_width_for_height_vfunc (const Glib::RefPtr< CellAreaContext > & context, Widget & widget, int height, int & minimum_width, int & natural_width)
 
Glib::PropertyProxy< CellRenderer * > property_focus_cell ()
 The cell in the area that currently has focus. More...
 
Glib::PropertyProxy_ReadOnly< CellRenderer * > property_focus_cell () const
 The cell in the area that currently has focus. More...
 
Glib::PropertyProxy_ReadOnly< CellRenderer * > property_edited_cell () const
 The cell in the area that is currently edited. More...
 
Glib::PropertyProxy_ReadOnly< CellEditable * > property_edit_widget () const
 The widget currently editing the edited cell. More...
 
- Protected Member Functions inherited from Gtk::Buildable
 Buildable ()
 You should derive from this class to use it. More...
 
- Protected Member Functions inherited from Gtk::CellLayout
 CellLayout ()
 You should derive from this class to use it. More...
 
virtual void pack_start_vfunc (CellRenderer * cell, bool expand)
 
virtual void pack_end_vfunc (CellRenderer * cell, bool expand)
 
virtual void clear_vfunc ()
 
virtual void add_attribute_vfunc (CellRenderer * cell, const Glib::ustring & attribute, int column)
 
virtual void clear_attributes_vfunc (CellRenderer * cell)
 
virtual void reorder_vfunc (CellRenderer * cell, int position)
 
- Protected Member Functions inherited from Gtk::Orientable
 Orientable ()
 You should derive from this class to use it. More...
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gtk::CellAreaBoxwrap (GtkCellAreaBox * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Additional Inherited Members

- Public Types inherited from Gtk::CellArea
typedef sigc::slot< bool, CellRenderer * > SlotForeach
 For instance, bool on_foreach(Gtk::CellRenderer* renderer);. More...
 
typedef sigc::slot< bool, CellRenderer *, const Gdk::Rectangle &, const Gdk::Rectangle & > SlotForeachAlloc
 For instance, bool on_foreach(Gtk::CellRenderer* renderer, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& background_area);. More...
 
- Public Types inherited from Gtk::CellLayout
typedef sigc::slot< void, const TreeModel::const_iterator & > SlotCellData
 

Detailed Description

A cell area that renders CellRenderers into a row or a colum, depending on its orientation.

This class uses a notion of packing. Packing refers to adding cell renderers with reference to a particular position in a CellAreaBox. There are two reference positions: the start and the end of the box. When the CellAreaBox is oriented in the Gtk::ORIENTATION_VERTICAL orientation, the start is defined as the top of the box and the end is defined as the bottom. In the Gtk::ORIENTATION_HORIZONTAL orientation start is defined as the left side and the end is defined as the right side.

Alignments of CellRenderers rendered in adjacent rows can be configured by configuring the align_child cell property with CellArea::cell_set_property() or by specifying the "align" argument to pack_start() or pack_end().

Since gtkmm 3.0:

Constructor & Destructor Documentation

◆ CellAreaBox() [1/2]

Gtk::CellAreaBox::CellAreaBox ( CellAreaBox &&  src)
noexcept

◆ ~CellAreaBox()

Gtk::CellAreaBox::~CellAreaBox ( )
overridenoexcept

◆ CellAreaBox() [2/2]

Gtk::CellAreaBox::CellAreaBox ( )
protected

Member Function Documentation

◆ create()

static Glib::RefPtr< CellAreaBox > Gtk::CellAreaBox::create ( )
static

◆ get_spacing()

int Gtk::CellAreaBox::get_spacing ( ) const

Gets the spacing added between cell renderers.

Since gtkmm 3.0:
Returns
The space added between cell renderers in box.

◆ get_type()

static GType Gtk::CellAreaBox::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GtkCellAreaBox * Gtk::CellAreaBox::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GtkCellAreaBox * Gtk::CellAreaBox::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GtkCellAreaBox * Gtk::CellAreaBox::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ operator=()

CellAreaBox & Gtk::CellAreaBox::operator= ( CellAreaBox &&  src)
noexcept

◆ pack_end()

void Gtk::CellAreaBox::pack_end ( CellRenderer renderer,
bool  expand = false,
bool  align = true,
bool  fixed = false 
)

Adds renderer to box, packed with reference to the end of box.

The renderer is packed after (away from end of) any other Gtk::CellRenderer packed with reference to the end of box.

Since gtkmm 3.0:
Parameters
rendererThe Gtk::CellRenderer to add.
expandWhether renderer should receive extra space when the area receives more than its natural size.
alignWhether renderer should be aligned in adjacent rows.
fixedWhether renderer should have the same size in all rows.

◆ pack_start()

void Gtk::CellAreaBox::pack_start ( CellRenderer renderer,
bool  expand = false,
bool  align = true,
bool  fixed = false 
)

Adds renderer to box, packed with reference to the start of box.

The renderer is packed after any other Gtk::CellRenderer packed with reference to the start of box.

Since gtkmm 3.0:
Parameters
rendererThe Gtk::CellRenderer to add.
expandWhether renderer should receive extra space when the area receives more than its natural size.
alignWhether renderer should be aligned in adjacent rows.
fixedWhether renderer should have the same size in all rows.

◆ property_spacing() [1/2]

Glib::PropertyProxy< int > Gtk::CellAreaBox::property_spacing ( )

The amount of space to reserve between cells.

Since gtkmm 3.0:

Default value: 0

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_spacing() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::CellAreaBox::property_spacing ( ) const

The amount of space to reserve between cells.

Since gtkmm 3.0:

Default value: 0

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_spacing()

void Gtk::CellAreaBox::set_spacing ( int  spacing)

Sets the spacing to add between cell renderers in box.

Since gtkmm 3.0:
Parameters
spacingThe space to add between Gtk::CellRenderers.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gtk::CellAreaBox > wrap ( GtkCellAreaBox *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.