gtkmm  3.4.0
Public Member Functions | Static Public Member Functions | Related Functions
Gtk::ToolPalette Class Reference

A ToolPalette allows you to add ToolItems to a palette-like container with various categories and drag and drop support. More...

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

List of all members.

Public Member Functions

virtual ~ToolPalette ()
GtkToolPalette* gobj ()
 Provides access to the underlying C GtkObject.
const GtkToolPalette* gobj () const
 Provides access to the underlying C GtkObject.
 ToolPalette ()
void set_group_position (ToolItemGroup& group, int position)
 Sets the position of the group as an index of the tool palette.
void set_exclusive (ToolItemGroup& group, bool exclusive)
 Sets whether the group should be exclusive or not.
void set_expand (ToolItemGroup& group, bool expand=true)
 Sets whether the group should be given extra space.
int get_group_position (ToolItemGroup& group) const
 Gets the position of group in palette as index.
bool get_exclusive (ToolItemGroup& group) const
 Gets whether group is exclusive or not.
bool get_expand (ToolItemGroup& group) const
 Gets whether group should be given extra space.
void set_icon_size (IconSize icon_size)
 Sets the size of icons in the tool palette.
void unset_icon_size ()
 Unsets the tool palette icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.
void set_style (ToolbarStyle style)
 Sets the style (text, icons or both) of items in the tool palette.
void unset_style ()
 Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.
IconSize get_icon_size () const
 Gets the size of icons in the tool palette.
ToolbarStyle get_style () const
 Gets the style (icons, text or both) of items in the tool palette.
ToolItemget_drop_item (int x, int y)
 Gets the item at position (x, y).
const ToolItemget_drop_item (int x, int y) const
 Gets the item at position (x, y).
ToolItemGroupget_drop_group (int x, int y)
 Gets the group at position (x, y).
const ToolItemGroupget_drop_group (int x, int y) const
 Gets the group at position (x, y).
ToolItemget_drag_item (const SelectionData& selection)
 Get the dragged item from the selection.
const ToolItemget_drag_item (const SelectionData& selection) const
 Get the dragged item from the selection.
void set_drag_source (ToolPaletteDragTargets targets=TOOL_PALETTE_DRAG_ITEMS)
 Sets the tool palette as a drag source.
void add_drag_dest (Gtk::Widget& widget, DestDefaults flags=DEST_DEFAULT_ALL, ToolPaletteDragTargets targets=TOOL_PALETTE_DRAG_ITEMS, Gdk::DragAction actions=Gdk::ACTION_COPY)
 Sets palette as drag source (see set_drag_source()) and sets widget as a drag destination for drags from palette.
Glib::PropertyProxy< IconSizeproperty_icon_size ()
 Size of icons in this tool palette.
Glib::PropertyProxy_ReadOnly
< IconSize
property_icon_size () const
 Size of icons in this tool palette.
Glib::PropertyProxy< bool > property_icon_size_set ()
 Whether the icon-size property has been set.
Glib::PropertyProxy_ReadOnly
< bool > 
property_icon_size_set () const
 Whether the icon-size property has been set.
Glib::PropertyProxy< ToolbarStyleproperty_toolbar_style ()
 Style of items in the tool palette.
Glib::PropertyProxy_ReadOnly
< ToolbarStyle
property_toolbar_style () const
 Style of items in the tool palette.

Static Public Member Functions

static TargetEntry get_drag_target_item ()
 Gets the target entry for a dragged Gtk::ToolItem.
static TargetEntry get_drag_target_group ()
 Get the target entry for a dragged Gtk::ToolItemGroup.

Related Functions

(Note that these are not member functions.)

Gtk::ToolPalettewrap (GtkToolPalette* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

A ToolPalette allows you to add ToolItems to a palette-like container with various categories and drag and drop support.

ToolItems cannot be added directly to a ToolPalette - instead they are added to a ToolItemGroup which can than be added to a ToolPalette. To add a ToolItemGroup to a ToolPalette, use Gtk::Container::add().

The easiest way to use drag and drop with ToolPalette is to call add_drag_dest() with the desired drag source palette and the desired drag target widget. Then get_drag_item() can be used to get the dragged item in the "drag-data-received" signal handler of the drag target.

Since gtkmm 2.20:

Constructor & Destructor Documentation

virtual Gtk::ToolPalette::~ToolPalette ( ) [virtual]

Member Function Documentation

Sets palette as drag source (see set_drag_source()) and sets widget as a drag destination for drags from palette.

See gtk_drag_dest_set().

Since gtkmm 2.20:
Parameters:
widgetA Gtk::Widget which should be a drag destination for palette.
flagsThe flags that specify what actions GTK+ should take for drops on that widget.
targetsThe Gtk::ToolPaletteDragTargets which the widget should support.
actionsThe Gdk::DragActions which the widget should suppport.

Get the dragged item from the selection.

This could be a Gtk::ToolItem or a Gtk::ToolItemGroup.

Since gtkmm 2.20:
Parameters:
selectionA Gtk::SelectionData.
Returns:
The dragged item in selection.
const ToolItem* Gtk::ToolPalette::get_drag_item ( const SelectionData selection) const

Get the dragged item from the selection.

This could be a Gtk::ToolItem or a Gtk::ToolItemGroup.

Since gtkmm 2.20:
Parameters:
selectionA Gtk::SelectionData.
Returns:
The dragged item in selection.

Get the target entry for a dragged Gtk::ToolItemGroup.

Since gtkmm 2.20:
Returns:
The Gtk::TargetEntry for a dragged group.

Gets the target entry for a dragged Gtk::ToolItem.

Since gtkmm 2.20:
Returns:
The Gtk::TargetEntry for a dragged item.

Gets the group at position (x, y).

Since gtkmm 2.20:
Parameters:
xThe x position.
yThe y position.
Returns:
The Gtk::ToolItemGroup at position or 0 if there is no such group.
const ToolItemGroup* Gtk::ToolPalette::get_drop_group ( int  x,
int  y 
) const

Gets the group at position (x, y).

Since gtkmm 2.20:
Parameters:
xThe x position.
yThe y position.
Returns:
The Gtk::ToolItemGroup at position or 0 if there is no such group.
ToolItem* Gtk::ToolPalette::get_drop_item ( int  x,
int  y 
)

Gets the item at position (x, y).

See get_drop_group().

Since gtkmm 2.20:
Parameters:
xThe x position.
yThe y position.
Returns:
The Gtk::ToolItem at position or 0 if there is no such item.
const ToolItem* Gtk::ToolPalette::get_drop_item ( int  x,
int  y 
) const

Gets the item at position (x, y).

See get_drop_group().

Since gtkmm 2.20:
Parameters:
xThe x position.
yThe y position.
Returns:
The Gtk::ToolItem at position or 0 if there is no such item.

Gets whether group is exclusive or not.

See set_exclusive().

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup which is a child of palette.
Returns:
true if group is exclusive.

Gets whether group should be given extra space.

See set_expand().

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup which is a child of palette.
Returns:
true if group should be given extra space, false otherwise.

Gets the position of group in palette as index.

See set_group_position().

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup.
Returns:
The index of group or -1 if group is not a child of palette.

Gets the size of icons in the tool palette.

See set_icon_size().

Since gtkmm 2.20:
Returns:
The Gtk::IconSize of icons in the tool palette.

Gets the style (icons, text or both) of items in the tool palette.

Since gtkmm 2.20:
Returns:
The Gtk::ToolbarStyle of items in the tool palette.
GtkToolPalette* Gtk::ToolPalette::gobj ( ) [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

const GtkToolPalette* Gtk::ToolPalette::gobj ( ) const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

Size of icons in this tool palette.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Size of icons in this tool palette.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Whether the icon-size property has been set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Whether the icon-size property has been set.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Style of items in the tool palette.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Style of items in the tool palette.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

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

Sets the tool palette as a drag source.

Enables all groups and items in the tool palette as drag sources on button 1 and button 3 press with copy and move actions. See Gtk::DragSource::set().

Since gtkmm 2.20:
Parameters:
targetsThe Gtk::ToolPaletteDragTargets which the widget should support.
void Gtk::ToolPalette::set_exclusive ( ToolItemGroup group,
bool  exclusive 
)

Sets whether the group should be exclusive or not.

If an exclusive group is expanded all other groups are collapsed.

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup which is a child of palette.
exclusiveWhether the group should be exclusive or not.
void Gtk::ToolPalette::set_expand ( ToolItemGroup group,
bool  expand = true 
)

Sets whether the group should be given extra space.

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup which is a child of palette.
expandWhether the group should be given extra space.
void Gtk::ToolPalette::set_group_position ( ToolItemGroup group,
int  position 
)

Sets the position of the group as an index of the tool palette.

If position is 0 the group will become the first child, if position is -1 it will become the last child.

Since gtkmm 2.20:
Parameters:
groupA Gtk::ToolItemGroup which is a child of palette.
positionA new index for group.

Sets the size of icons in the tool palette.

Since gtkmm 2.20:
Parameters:
icon_sizeThe Gtk::IconSize that icons in the tool palette shall have.

Sets the style (text, icons or both) of items in the tool palette.

Since gtkmm 2.20:
Parameters:
styleThe Gtk::ToolbarStyle that items in the tool palette shall have.

Unsets the tool palette icon size set with set_icon_size(), so that user preferences will be used to determine the icon size.

Since gtkmm 2.20:

Unsets a toolbar style set with set_style(), so that user preferences will be used to determine the toolbar style.

Since gtkmm 2.20:

Friends And Related Function Documentation

Gtk::ToolPalette* wrap ( GtkToolPalette *  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.

The documentation for this class was generated from the following file: