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

GFC::Gtk::Toolbar Class Reference

A GtkToolbar C++ wrapper class. More...

#include <gfc/gtk/toolbar.hh>

Inheritance diagram for GFC::Gtk::Toolbar:

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 List of all members.

Signal Prototypes

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkToolbar C++ wrapper class.

A toolbar can contain instances of a subclass of Gtk::ToolItem. To add a ToolItem to the a toolbar, use append(), prepend() or insert(). To remove an item from the toolbar use Gtk::Container::remove(). To add a button to the toolbar, add an instance of Gtk::ToolButton.

Toolbar items can be visually grouped by adding instances of Gtk::SeparatorToolItem to the toolbar. If a SeparatorToolItem has the 'expand' property set to true and the 'draw' property set to false the effect is to force all following items to the end of the toolbar. Creating a context menu for the toolbar can be done by connecting to the Gtk::Toolbar popup_context_menu signal (see sig_popup_context_menu()).


Constructor & Destructor Documentation

GFC::Gtk::Toolbar::Toolbar GtkToolbar *  toolbar,
bool  owns_reference = false
[explicit, protected]
 

Construct a new Toolbar from an existing GtkToolbar.

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

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

GFC::Gtk::Toolbar::Toolbar  ) 
 

Construct a new default toolbar.

The default toolbar is a horizontal toolbar that displays both icons and text.

GFC::Gtk::Toolbar::Toolbar Orientation  orientation  )  [explicit]
 

Construct a new toolbar with the specifed orientation.

Parameters:
orientation The Orientation, either horizontal or vertical.

By default this toolbar displays both icons and text. To change the toolbar style call Gtk::Toolbar::set_style();

GFC::Gtk::Toolbar::Toolbar Orientation  orientation,
ToolbarStyle  style
 

Constrcut a new toolbar with the specified orientation and style.

Parameters:
orientation The Orientation, either horizontal or vertical.
style The style for the toolbar.


Member Function Documentation

void GFC::Gtk::Toolbar::append ToolItem item,
const String tooltip
 

Appends a ToolItem to the end of the toolbar.

Parameters:
item A ToolItem.
tooltip The tooltip to display for the item.

int GFC::Gtk::Toolbar::get_drop_index int  x,
int  y
const
 

Obtains the position corresponding to the indicated point on the toolbar.

Parameters:
x The X coordinate of a point on the toolbar, in toolbar coordinates.
y The Y coordinate of a point on the toolbar, in toolbar coordinates.
Returns:
The position corresponding to the point (x, y) on the toolbar.

This is useful when dragging items to the toolbar. This method returns the position a new item should be inserted.

IconSize GFC::Gtk::Toolbar::get_icon_size  )  const
 

Gets the current icon size for the icons on the toolbar (see set_icon_size()).

Returns:
The current icon size.

int GFC::Gtk::Toolbar::get_item_index const ToolItem item  )  const
 

Obtains the position of item on the toolbar, starting from 0.

Parameters:
item A ToolItem that is a child of the toolbar.
Returns:
The position of item on the toolbar.

It is an error if item is not a child of the toolbar.

int GFC::Gtk::Toolbar::get_n_items  )  const
 

Gets the number of items on the toolbar.

Returns:
The number of items on the toolbar.

ToolItem* GFC::Gtk::Toolbar::get_nth_item int  n  )  const
 

Gets the tool item at position n on the toolbar, or null if the toolbar does not contain an n'th item.

Parameters:
n A zero-based position on the toolbar.
Returns:
The nth ToolItem on the toolbar, or null if there isn't an nth item.

Orientation GFC::Gtk::Toolbar::get_orientation  )  const
 

Gets the current orientation of the toolbar (see set_orientation()).

Returns:
The current orientation.

ReliefStyle GFC::Gtk::Toolbar::get_relief_style  )  const
 

Gets the relief style of buttons on the toolbar (see Gtk::Button::set_relief_style()).

Returns:
The relief style of buttons on the toolbar.

bool GFC::Gtk::Toolbar::get_show_arrow  )  const
 

Determines whether the toolbar has an overflow menu (see set_show_arrow()).

Returns:
true if the toolbar has an overflow menu.

ToolbarStyle GFC::Gtk::Toolbar::get_style  )  const
 

Retrieves whether the toolbar has text, icons, or both (see set_style()).

Returns:
The current style of the toolbar.

Reimplemented from GFC::Gtk::Widget.

bool GFC::Gtk::Toolbar::get_tooltips  )  const
 

Determines whether tooltips are enabled (see set_tooltips()).

Returns:
true if tooltips are enabled.

void GFC::Gtk::Toolbar::insert ToolItem item,
int  pos,
const String tooltip
 

Insert a ToolItem into the toolbar at position pos.

Parameters:
item A ToolItem.
pos The position of the new item.
tooltip The tooltip to display for the item.

If pos is 0 the item is prepended to the start of the toolbar. If pos is -1, the item is appended to the end of the toolbar. Otherwise the tool item is inserted at position pos.

void GFC::Gtk::Toolbar::insert_separator int  pos  ) 
 

Inserts a new separator tool item into the toolbar at the specified position.

Parameters:
pos The number of tool items to insert the space after.

If pos is -1 the separator is added to the end of the toolbar. If pos is 0 the separator is added to the beginning of the toolbar. Otherwise the separator is inserted at position pos.

void GFC::Gtk::Toolbar::prepend ToolItem item,
const String tooltip
 

Prepends a ToolItem to the start of the toolbar.

Parameters:
item A ToolItem.
tooltip The tooltip to display for the item.

void GFC::Gtk::Toolbar::set_drop_highlight_item ToolItem item,
int  index
 

Highlights the toolbar to give an idea of what it would look like if item was added to the toolbar at the position indicated by index.

Parameters:
item A ToolItem.
index A position on the toolbar.

The tool item passed to this function must not be part of any widget hierarchy. When an item is set as drop highlight item it can not added to any widget hierarchy or used as highlight item for another toolbar.

void GFC::Gtk::Toolbar::set_orientation Orientation  orientation  ) 
 

Sets whether a toolbar should appear horizontally or vertically.

Parameters:
orientation The new Orientation.

void GFC::Gtk::Toolbar::set_show_arrow bool  show_arrow  ) 
 

Sets whether to show an overflow menu when toolbar doesn't have room for all items on it.

Parameters:
show_arrow Set true to show an overflow menu.

If show_arrow is true, items that there are not room for are available through an overflow menu.

void GFC::Gtk::Toolbar::set_style ToolbarStyle  style  ) 
 

Alters the view of toolbar to display either icons only, text only, or both.

Parameters:
style The new style for the toolbar.

void GFC::Gtk::Toolbar::set_tooltip ToolItem item,
const String tip_text,
const String tip_private = 0
 

Sets the tooltip to be used for the tool item, the text to be displayed as tooltip on the item and the private text to be used, if any.

Parameters:
item A ToolItem.
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.

Calling this convenience method is equivalent to calling Gtk::ToolItem::set_tooltip().

void GFC::Gtk::Toolbar::set_tooltips bool  enable  ) 
 

Sets if the tooltips of a toolbar should be active or not.

Parameters:
enable Set to false to disable the tooltips, or true to enable them.


Member Data Documentation

const OrientationChangedSignalType GFC::Gtk::Toolbar::orientation_changed_signal [static, protected]
 

Orientation changed signal (see sig_orientation_changed()).

Calls a slot with the signature:

             void function(Gtk::Orientation orientation);
             // orientation: The new Orientation of the toolbar.

const PopupContextMenuSignalType GFC::Gtk::Toolbar::popup_context_menu_signal [static, protected]
 

Popup context menu signal (see sig_popup_context_menu()).

Calls a slot with the signature:

             bool function(int x, int y, int button);
             // x: The x coordinate of the point where the menu should appear.
             // y: The y coordinate of the point where the menu should appear.
             // button: The mouse button the user pressed, or -1.
             // return: true if the signal was handled, <EM>false</EM> if not.

const StyleChangedSignalType GFC::Gtk::Toolbar::style_changed_signal [static, protected]
 

Style changed signal (see sig_style_changed())

Calls a slot with the signature:

             void function(Gtk::ToolbarStyle style);
             // style: The new ToolbarStyle of toolbar.


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