ToolItem is the base class of widgets that can be added to ToolBar objects.
ToolItems are widgets that can appear on a toolbar. To create a toolbar
item that contain something else than a button, use new
ToolItem()
.
Use
Container.add(Widget)
to add a child widget to the tool item.
For toolbar items that contain buttons, see the
ToolButton
,
ToggleToolButton
and
RadioToolButton
classes.
see
ToolBar
class for a description of the toolbar widget.
getExpand
public boolean getExpand()
Returns whether ToolItem is allocated extra space.
TRUE
if ToolItem is allocated extra space
getHomogeneous
public boolean getHomogeneous()
Returns whether the item is the same size as other homogeneous items.
TRUE
if the item is the same size as other homogeneous items
getIconSize
public IconSize getIconSize()
Returns the icon size used for ToolItem. Custom subclasses of ToolItem should
call this function to find out what size icons they should use.
- a
IconSize
indicating the icon size used for ToolItem
getIsImportant
public boolean getIsImportant()
Returns whether ToolItem is considered important.
TRUE
if ToolItem is considered important
setIsImportant(boolean)
getOrientation
public Orientation getOrientation()
Returns the orientation used for ToolItem. Custom subclasses of ToolItem should
call this function to find out what size icons they should use.
- a
Orientation
indicating the orientation used for ToolItem
getProxyMenuItem
public MenuItem getProxyMenuItem(String menuItemId)
If
menuItemId
matches the string passed to setProxyMenuItem(String,MenuItem)
returns the corresponding MenuItem
.
Custom subclasses of ToolItem should use this function to update their menu
item when the ToolItem changes. That the
menuItemId
must match ensures
that a ToolItem will not inadvertently change a menu item that they did not
create.
menuItemId
- a string used to identify the menu item
- the
MenuItem
passed to setProxyMenuItem(String,MenuItem)
if the menuItemId matches
getReliefStyle
public ReliefStyle getReliefStyle()
Returns the relief style of ToolItem. See
Button.setRelief(ReliefStyle)
.
Custom subclasses of ToolItem should call this function in the handler of the
GtkToolItem::toolbar_reconfigured signal to find out the relief style of buttons.
- a
ReliefStyle
indicating the relief style used for ToolItem
getToolbarStyle
public ToolBarStyle getToolbarStyle()
Returns the toolbar style used for ToolItem. Custom subclasses
of ToolItem should call this function in the handler of the
GtkToolItem::toolbar_reconfigured signal to find out in what
style the toolbar is displayed and change themselves
accordingly.
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.
- GTK_TOOLBAR_BOTH_HORIZ, meaning the tool item should show
both an icon and a label, arranged horizontally (however, note
the GtkToolButton::has_text_horizontally that makes tool
buttons not show labels when the toolbar style is
GTK_TOOLBAR_BOTH_HORIZ.
- a
ToolBarStyle
indicating the toolbar style
used for ToolItem.
getUseDragWindow
public boolean getUseDragWindow()
Returns whether ToolItem has a drag window.
TRUE
if toolitem uses a drag window
setUseDragWindow(boolean)
getVisibleHorizontal
public boolean getVisibleHorizontal()
Returns whether the ToolItem is visible on toolbars that are docked horizontally.
TRUE
if ToolItem is visible on toolbars that are docked horizontally
setVisibleHorizontal(boolean)
getVisibleVertical
public boolean getVisibleVertical()
Returns whether ToolItem is visible on toolbars that are docked vertically.
TRUE
if ToolItem is visible on toolbars that are docked vertically
setVisibleVertical(boolean)
gtk_tool_item_get_expand
protected static final boolean gtk_tool_item_get_expand(Handle toolitem)
gtk_tool_item_get_homogeneous
protected static final boolean gtk_tool_item_get_homogeneous(Handle toolitem)
gtk_tool_item_get_icon_size
protected static final int gtk_tool_item_get_icon_size(Handle toolitem)
gtk_tool_item_get_is_important
protected static final boolean gtk_tool_item_get_is_important(Handle toolitem)
gtk_tool_item_get_orientation
protected static final int gtk_tool_item_get_orientation(Handle toolitem)
gtk_tool_item_get_proxy_menu_item
protected static final Handle gtk_tool_item_get_proxy_menu_item(Handle toolitem,
String menuItemId)
gtk_tool_item_get_relief_style
protected static final int gtk_tool_item_get_relief_style(Handle toolitem)
gtk_tool_item_get_toolbar_style
protected static final int gtk_tool_item_get_toolbar_style(Handle toolitem)
gtk_tool_item_get_type
protected static final int gtk_tool_item_get_type()
gtk_tool_item_get_use_drag_window
protected static final boolean gtk_tool_item_get_use_drag_window(Handle toolitem)
gtk_tool_item_get_visible_horizontal
protected static final boolean gtk_tool_item_get_visible_horizontal(Handle toolitem)
gtk_tool_item_get_visible_vertical
protected static final boolean gtk_tool_item_get_visible_vertical(Handle toolitem)
gtk_tool_item_new
protected static final Handle gtk_tool_item_new()
gtk_tool_item_retrieve_proxy_menu_item
protected static final Handle gtk_tool_item_retrieve_proxy_menu_item(Handle toolitem)
gtk_tool_item_set_expand
protected static final void gtk_tool_item_set_expand(Handle toolitem,
boolean expand)
gtk_tool_item_set_homogeneous
protected static final void gtk_tool_item_set_homogeneous(Handle toolitem,
boolean homogeneous)
gtk_tool_item_set_is_important
protected static final void gtk_tool_item_set_is_important(Handle toolitem,
boolean isImportant)
gtk_tool_item_set_proxy_menu_item
protected static final void gtk_tool_item_set_proxy_menu_item(Handle toolitem,
String menuItemId,
Handle menuItem)
gtk_tool_item_set_tooltip
protected static final void gtk_tool_item_set_tooltip(Handle toolitem,
Handle tooltips,
String tipText,
String tipPrivate)
gtk_tool_item_set_use_drag_window
protected static final void gtk_tool_item_set_use_drag_window(Handle toolitem,
boolean useDragWindow)
gtk_tool_item_set_visible_horizontal
protected static final void gtk_tool_item_set_visible_horizontal(Handle toolitem,
boolean visibleHorizontal)
gtk_tool_item_set_visible_vertical
protected static final void gtk_tool_item_set_visible_vertical(Handle toolitem,
boolean visibleVertical)
rebuildMenu
public void rebuildMenu()
Calling this function signals to the toolbar that the overflow
menu item for this ToolItem has changed. If the overflow menu
is visible when this function is called, the menu will be
rebuilt.
retrieveProxyMenuItem
public MenuItem retrieveProxyMenuItem()
- the
MenuItem
that is going to appear in the
overflow menu for tool_item.
setExpand
public void setExpand(boolean expand)
Sets whether the ToolItem is allocated extra space when there is more room
on the ToolBar than needed by the ToolItems. The effect is that the item gets
bigger when the ToolBar gets bigger and smaller when the ToolBar gets smaller.
expand
- whether ToolItem is allocated extra space
setHomogeneous
public void setHomogeneous(boolean homogeneous)
Sets whether the ToolItem is to be allocated 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.
homogeneous
- TRUE
if the item is the same size as other homogeneous items
setIsImportant
public void setIsImportant(boolean isImportant)
Sets whether ToolItem should be considered important. The
ToolButton
class
uses this property to determine whether to show or hide its label when the
toolbar style is
ToolBarStyle.BOTH_HORIZ
. The result is that only
tool buttons with the IS_IMPORTANT property set have labels, an effect known
as "priority text".
isImportant
- whether the tool item should be considered important
setProxyMenuItem
public void setProxyMenuItem(String menuItemId,
MenuItem menuItem)
Sets the
MenuItem
used in the toolbar overflow menu. The
menuItemId
is used to identify the caller of this function and should also be used with
getProxyMenuItem(String)
.
menuItemId
- a string used to identify menuItem
menuItem
- a MenuItem
to be used in the overflow menu
setToolTip
public void setToolTip(ToolTips toolTips,
String tipText,
String tipPrivate)
Sets the
ToolTips
object to be used for ToolItem, the text to be
displayed as tooltip on the item and the private text to be used.
toolTips
- the ToolTips
object to be usedtipText
- text to be used as tooltip text for ToolItemtipPrivate
- text to be used as private tooltip text
ToolTips.setTip(Widget,String,String)
setTooltip
public void setTooltip(ToolTips toolTips,
String tipText,
String tipPrivate)
Sets the
ToolTips
object to be used for ToolItem, the text to be
displayed as tooltip on the item and the private text to be used.
toolTips
- the ToolTips
object to be usedtipText
- text to be used as tooltip text for ToolItemtipPrivate
- text to be used as private tooltip text
ToolTips.setTip(Widget,String,String)
setUseDragWindow
public void setUseDragWindow(boolean useDragWindow)
Sets whether ToolItem has a drag window. When TRUE
the ToolItem
can be used as a drag source through DragSource. When ToolItem
has a drag window it will intercept all events, even those that would otherwise
be sent to a child of ToolItem.
useDragWindow
- whether ToolItem has a drag window
setVisibleHorizontal
public void setVisibleHorizontal(boolean visibleHorizontal)
Sets whether ToolItem is visible when the toolbar is docked horizontally.
visibleHorizontal
- whether ToolItem is visible when the toolbar is in horizontal mode
setVisibleVertical
public void setVisibleVertical(boolean visibleVertical)
Sets whether ToolItem is visible when the toolbar is docked vertically.
Some tool items, such as text entries, are too wide to be useful on a vertically
docked toolbar. If visibleVertical
is FALSE
ToolItem will not
appear on toolbars that are docked vertically.
visibleVertical
- whether toolitem is visible when the toolbar is in vertical mode