GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::ToolItem Class Reference

A GtkToolItem C++ wrapper class. More...

#include <gfc/gtk/toolitem.hh>

Inheritance diagram for GFC::Gtk::ToolItem:

GFC::Gtk::Bin GFC::Gtk::Container GFC::Gtk::Widget GFC::Gtk::Object GFC::Atk::Implementor GFC::G::Object GFC::G::TypeInterface GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable GFC::Gtk::SeparatorToolItem GFC::Gtk::ToolButton GFC::Gtk::ToggleToolButton GFC::Gtk::RadioToolButton List of all members.

Signal Prototypes

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkToolItem C++ wrapper class.

ToolItems are widgets that can appear on a toolbar. To construct a toolbar item that contains something other than a button, use ToolItem(). Use Gtk::Container::add() to add a child widget to the tool item.

For toolbar items that contain buttons, see the Gtk::ToolButton, Gtk::ToggleToolButton and Gtk::RadioToolButton classes. See the Gtk::Toolbar class for a description of the toolbar widget.


Constructor & Destructor Documentation

GFC::Gtk::ToolItem::ToolItem GtkToolItem *  tool_item,
bool  owns_reference = false
[explicit, protected]
 

Construct a new ToolItem from an existing GtkToolItem.

Parameters:
tool_item A pointer to a GtkToolItem.
owns_reference Set false if the initial reference count is floating, set true if it's not.

The tool_item can be a newly created GtkToolItem or an existing GtkToolItem (see G::Object::Object).

GFC::Gtk::ToolItem::ToolItem Widget widget  )  [explicit]
 

Constructs a new tool item that displays widget.

Parameters:
widget The widget to set as the tool item's content.


Member Function Documentation

bool GFC::Gtk::ToolItem::get_expand  )  const
 

Determines whether the tool item is allocated extra space (see set_expand()).

Returns:
true if then tool item is allocated extra space.

bool GFC::Gtk::ToolItem::get_homogeneous  )  const
 

Determines whether the tool item is the same size as other homogeneous items (see set_homogeneous()).

Returns:
true if the item is the same size as other homogeneous items.

IconSize GFC::Gtk::ToolItem::get_icon_size  )  const
 

Gets the icon size used for the tool item.

Returns:
A Gtk::IconSize indicating the icon size used for the tool item.

Custom subclasses of ToolItem should call this function to find out what size icons they should use.

bool GFC::Gtk::ToolItem::get_is_important  )  const
 

Determines whether the tool item is considered important (see set_is_important()).

Returns:
true if the tool item is considered important.

Orientation GFC::Gtk::ToolItem::get_orientation  )  const
 

Gets the orientation used for the tool item.

Returns:
A Gtk::Orientation indicating the orientation used for the tool item.

Custom subclasses of ToolItem should call this function to find out the orientation of they should use.

Widget* GFC::Gtk::ToolItem::get_proxy_menu_item const String menu_item_id  )  const
 

If menu_item_id matches the string passed to set_proxy_menu_item() returns the corresponding GtkMenuItem.

Parameters:
menu_item_id A string used to identify the menu item.
Returns:
The MenuItem passed to set_proxy_menu_item(), if the menu_item_ids match.

Custom subclasses of ToolItem should use this function to update their menu item when the ToolItem changes. That the menu_item_ids must match ensures that a ToolItem will not inadvertently change a menu item that they did not create.

ReliefStyle GFC::Gtk::ToolItem::get_relief_style  )  const
 

Gets the relief style of the tool item (see set_relief_style().

Returns:
A Gtk::ReliefStyle indicating the relief style used for the tool item.

Custom subclasses of ToolItem should call this function in the handler of the ToolItem "toolbar_reconfigured" signal to find out the relief style of the buttons.

ToolbarStyle GFC::Gtk::ToolItem::get_toolbar_style  )  const
 

Gets the toolbar style used for the tool item.

Returns:
A Gtk::ToolbarStyle indicating the toolbar style used for the tool item.

Custom subclasses of ToolItem should call this function in the handler of the ToolItem "toolbar_reconfigured" signal to find out in what style the toolbar is displayed and change themselves accordingly. The possibilities are: Gtk::TOOLBAR_BOTH, meaning the tool item should show both an icon and a label, stacked vertically, Gtk::TOOLBAR_ICONS, meaning the toolbar shows only icons, Gtk::TOOLBAR_TEXT, meaning the tool item should only show text and Gtk::TOOLBAR_BOTH_HORIZ, meaning the tool item should show both an icon and a label, arranged horizontally.

bool GFC::Gtk::ToolItem::get_use_drag_window  )  const
 

Determines whether the tool item has a drag window (see set_use_drag_window()).

Returns:
true if the tool item uses a drag window.

bool GFC::Gtk::ToolItem::get_visible_horizontal  )  const
 

Determines whether the tool item is visible on toolbars that are docked horizontally.

Returns:
true if the tool item is visible on toolbars that are docked horizontally.

bool GFC::Gtk::ToolItem::get_visible_vertical  )  const
 

Determines whether the tool item is visible when the toolbar is docked vertically (see set_visible_vertical()).

Returns:
Whether the tool item is visible when the toolbar is docked vertically.

Widget* GFC::Gtk::ToolItem::retrieve_proxy_menu_item  )  const
 

Retrieves the MenuItem that was last set by set_proxy_menu_item(), that is, the MenuItem that is going to appear in the overflow menu.

Returns:
The MenuItem that is going to appear in the overflow menu for the tool item.

void GFC::Gtk::ToolItem::set_expand bool  expand  ) 
 

Sets whether the tool item is allocated extra space when there is more room on the toolbar than needed for the items.

Parameters:
expand Whether the tool item is allocated extra space.

The effect is that the item gets bigger when the toolbar gets bigger and smaller when the toolbar gets smaller.

void GFC::Gtk::ToolItem::set_homogeneous bool  homogeneous  ) 
 

Sets whether the tool item is to be allocated the same size as other homogeneous items.

Parameters:
homogeneous Whether the tool item is the same size as other homogeneous items.

The effect is that all homogeneous items will have the same width as the widest of the items.

void GFC::Gtk::ToolItem::set_is_important bool  is_important  ) 
 

Sets whether the tool item should be considered important.

Parameters:
is_important Whether the tool item should be considered important.

The ToolButton class uses this property to determine whether to show or hide its label when the toolbar style is Gtk::TOOLBAR_BOTH_HORIZ. The result is that only tool buttons with the "is_important" property set have labels, an effect known as "priority text".

void GFC::Gtk::ToolItem::set_proxy_menu_item const String menu_item_id,
Widget menu_item
 

Sets the MenuItem used in the toolbar overflow menu.

Parameters:
menu_item_id A string used to identify menu_item.
menu_item A MenuItem to be used in the overflow menu.

The menu_item_id is used to identify the caller of this function and should also be used with get_proxy_menu_item(). If menu_item is null the MenuItem last set will not appear in the overflow menu (see sig_create_menu_proxy()).

void GFC::Gtk::ToolItem::set_tooltip Tooltips tooltips,
const String tip_text,
const String tip_private = 0
 

Sets the Tooltips object to be used for the tool item, the text to be displayed as tooltip on the item and the private text to be used (see Gtk::Tooltips::set_tip()).

Parameters:
tooltips The Tooltips object to be used.
tip_text The text to be used as tooltip text for the tool item.
tip_private The text to be used as private tooltip text.

void GFC::Gtk::ToolItem::set_use_drag_window bool  use_drag_window  ) 
 

Sets whether toolitem has a drag window.

Parameters:
use_drag_window Whether the tool item has a drag window.

When use_drag_window is true the tool item can be used as a drag source through Gtk::Widget::drag_source_set(). When the tool item has a drag window it will intercept all events, even those that would otherwise be sent to a child of toolitem.

void GFC::Gtk::ToolItem::set_visible_horizontal bool  visible_horizontal  ) 
 

Sets whether the tool item is visible when the toolbar is docked horizontally.

Parameters:
visible_horizontal Whether the tool item is visible when in horizontal mode.

void GFC::Gtk::ToolItem::set_visible_vertical bool  visible_vertical  ) 
 

Sets whether the tool item is visible when the toolbar is docked vertically.

Parameters:
visible_vertical Whether the tool item is visible when the toolbar is in vertical mode.

Some tool items, such as text entries, are too wide to be useful on a vertically docked toolbar. If visible_vertical is false the tool item will not appear on toolbars that are docked vertically.

const CreateMenuProxySignalProxy GFC::Gtk::ToolItem::sig_create_menu_proxy  ) 
 

Connect to the create_menu_proxy_signal; emitted when the toolbar is displaying an overflow menu.

In response the tool item should call Gtk::ToolItem::set_proxy_menu_item() with either with a null pointer and return true to indicate that the item should not appear in the overflow menu, or with a new menu item and return true, or return false to indicate that the signal was not handled by the item. This means that the item will not appear in the overflow menu unless a later handler installs a menu item.

const ToolbarReconfiguredSignalProxy GFC::Gtk::ToolItem::sig_toolbar_reconfigured  ) 
 

Connect to the toolbar_reconfigured_signal; emitted when some property of the toolbar that the item is a child of changes.

For custom subclasses of Gtk::ToolItem, the default handler of this signal uses the functions Gtk::Toolbar::get_orientation(), Gtk::Toolbar::get_style(), Gtk::Toolbar::get_icon_size() and Gtk::Toolbar::get_relief_style() to find out what the toolbar should look like and change themselves accordingly.


Member Data Documentation

const CreateMenuProxySignalType GFC::Gtk::ToolItem::create_menu_proxy_signal [static, protected]
 

Create menu proxy signal (see sig_create_menu_proxy()).

Calls a slot with the signature:

             bool function();
             // return: true if the signal was handled, false if not.   

const SetTooltipSignalType GFC::Gtk::ToolItem::set_tooltip_signal [static, protected]
 

Set tooltip signal (see sig_set_tooltip()).

Calls a slot with the signature:

             bool function(Tooltips& tooltips, const String& tip_text, const String& tip_private);
             // tooltips: The Gtk::Tooltips. 
             // tip_text: The tooltip text. 
             // tip_private: The tooltip private text. 
             // return: true if the signal was handled, false if not.

const ToolbarReconfiguredSignalType GFC::Gtk::ToolItem::toolbar_reconfigured_signal [static, protected]
 

Toolbar reconfigured signal (see sig_toolbar_reconfigured()).

Calls a slot with the signature:

             void function();


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:43 2004 for GFC-UI by doxygen 1.3.8