dockbar - Create and manipulate a dock bar
SYNOPSIS
dockbar pathName ?options?
STANDARD OPTIONS
activeBackground
activeForeground
background
borderWidth
cursor
|
disabledForeground
font
foreground
highlightBackground
highlightColor
|
highlightThickness
insertBackground
insertForeground
orient
selectBackground
|
selectBorderWidth
selectColor
selectForeground
state
troughColor
|
See the "options" manual entry for details on the standard options. For widgets
added to the toolbar, these options will be propogated if the widget supports
the option. For example, all widgets that support a font option will be changed
if the the toolbar's font option is configured.
WIDGET-SPECIFIC OPTIONS
Name: balloonBackground
Class: BalloonBackground
Command-Line Switch: -ballooonbackground
Specifies the background color of the balloon help displayed at the bottom
center of a widget on the toolbar that has a non empty string for its
balloonStr option. The default color is yellow.
Name: balloonDelay1
Class: BalloonDelay1
Command-Line Switch: -balloondelay1
Specifies the length of time (in milliseconds) to wait before initially
posting a balloon help hint window. This delay is in effect whenever 1)
the mouse leaves the toolbar, or 2) a toolbar item is selected with the
mouse button.
Name: balloonDelay2
Class: BalloonDelay2
Command-Line Switch: -balloondelay2
Specifies the length of time (in milliseconds) to wait before continuing to
post balloon help hint windows. This delay is in effect after the first
time a balloon hint window is activated. It remains in effect until 1) the
mouse leaves the toolbar, or 2) a toolbar item is selected with the mouse
button.
Name: balloonFont
Class: BalloonFont
Command-Line Switch: -balloonfont
Specifies the font of the balloon help text displayed at the bottom center
of a widget on the toolbar that has a non empty string for its
balloonStr option. The default font is 6x10.
Name: balloonForeground
Class: BalloonForeground
Command-Line Switch: -ballooonforeground
Specifies the foreground color of the balloon help displayed at the
bottom center of a widget on the toolbar that has a non empty string for
its balloonStr option. The default color is black.
Name: helpVariable
Class: HelpVariable
Command-Line Switch: -helpvariable
Specifies the global variable to update whenever the mouse is in motion
over a toolbar widget. This global variable is updated with the current
value of the active widget's helpStr. Other widgets can "watch" this
variable with the trace command, or as is the case with entry or label
widgets, they can set their textVariable to the same global variable. This
allows for a simple implementation of a help status bar. Whenever the
mouse leaves a menu entry, the helpVariable is set to the empty string {}.
Name: orient
Class: Orient
Command-Line Switch: -orient
Specifies the orientation of the toolbar. Must be either horizontal or
vertical.
DESCRIPTION
The dockbar command creates a frame (given by the pathName
argument) to hold toolbars. Additional options,
described above may be specified on the command line or in the option
database to configure aspects of the toolbar such as its colors, font,
and orientation. The dockbar command returns its pathName argument. At
the time this command is invoked, there must not exist a window named
pathName, but pathName's parent must exist.
A dockbar is a widget that displays a collection of toolbar widgets arranged
either in a row. Each toolbar may contain any number of widgets that are usually for
user convenience to give access to a set of commands or settings. Any widget may be
placed on a toolbar. However, command or value-oriented widgets (such as button, radiobutton,
etc.) are usually the most useful kind of widgets to appear on a toolbar.
Each toolbar within the dockbar may be shown or hidden and the user can rearrange the
toolbars simply by grabbing and dragging the handle on each toolbar. A popup menu is
available via the RMB that will control the visibility of each toolbar.
Many of the configuration options available in the dockbar are passed down to the
individual toolbars. (see the toolbar manual for more information)
WIDGET-SPECIFIC METHODS
The dockbar command creates a new Tcl command whose name is pathName. This
command may be used to invoke various operations on the widget. It has the
following general form:
pathName option ?arg arg ...?
Option and args determine the exact behavior of the command.
Many of the widget commands for a dockbar take as one argument an indicator of
which widget item of the toolbar to operate on. The indicator is called
an index and may be specified in any of the following forms:
- number
- Specifies the toolbar numerically, where 0 corresponds to the first
toolbar in the notebook, 1 to the second, and so on. (For horizontal, 0 is the
leftmost; for vertical, 0 is the topmost).
- end
- Specifes the last toolbar in the dockbar's index. If the dockbar is
empty this will return -1.
- last
- Same as end.
- pattern
- If the index doesn't satisfy any of the above forms, then this form is
used. Pattern is pattern-matched against the name of each toolbar in the
dockbar, in order from the first to the last toolbar, until a matching entry is
found. An exact match must occur.
The following commands are possible for toolbar widgets:
- pathName add toolbarName ?option value?
- Adds a toolbar whose name is toolbarName to the
toolbar. If additional arguments are present, they are the set of available options
that the toolbar supports.
- pathName cget option
- Returns the current value of the configuration option given by option.
- pathName configure ?option value?
- Query or modify the configuration options of the widget. If no option is
specified, returns a list describing all of the available options for pathName
(see Tk_ConfigureInfo for information on the format of this list). If
option is specified with no value, then the command returns a
list describing the one
named option (this list will be identical to the corresponding sublist of the
value returned if no option is specified). If one or more option-value pairs
are specified, then the command modifies the given widget option(s) to have the
given value(s); in this case the command returns an empty string.
- pathName hide index
- This command will remove the toolbar specified by index from the display.
(The toolbar is not destroyed.)
- pathName index index
- Returns the toolbar's numerical index for the entry corresponding
to index. If index is not found, -1 is returned.
- pathName itemcget index option
- Returns the current value of the configuration option given by option for
index. The item type of index determines the valid available options.
- pathName itemconfigure index ?option value?
- Query or modify the configuration options of the widget of the toolbar
specified by index. If no option is specified,
returns a list describing all of
the available options for index
(see Tk_ConfigureInfo for information on the
format of this list). If option is specified with no value,
then the command
returns a list describing the one named option (this list will be identical to
the corresponding sublist of the value returned if no option is specified). If
one or more option-value pairs are specified, then the command modifies the
given widget option(s) to have the given value(s); in this case the command
returns an empty string. The item type of index determines the valid
available options. The set of available options is the same as specified
in the add command.
- pathName itemname index
- This command will return the name of the toolbar specified by index.
- pathName move index x y
- This command will move the toolbar specified by index to the
location given by x and y.
- pathName remove index
- This command deletes the toolbar specified by index.
The toolbar is destroyed.
- pathName show index
- This command makes the toolbar specified by index visible.
EXAMPLE
package require Mtiwidgets
mtiwidgets::dockbar .db ;# -helpvariable statusVar
pack .db -side top -expand 1 -fill x
set edit [.db add edit -wrap 0]
$edit add button item1 \
-helpstr "Select Area" \
-bitmap @${::iwidgets::library}/demos/images/box.xbm \
-balloonstr "Select" \
-command {puts "Select command"}
$edit add button item2 \
-helpstr "Cut Selected" \
-image [image create photo -file ${::iwidgets::library}/demos/images/cut.gif] \
-balloonstr "Cut" \
-command {puts "Cut command"}
$edit add button item3 \
-helpstr "Copy Selected" \
-image [image create photo -file ${iwidgets::library}/demos/images/copy.gif] \
-balloonstr "Copy" \
-command {puts "Copy command"}
$edit add button item4 \
-helpstr "Paste from Clipboard" \
-image [image create photo -file ${::iwidgets::library}/demos/images/paste.gif] \
-balloonstr "Paste" \
-command {puts "Paste command"}
$edit add button item5 \
-image [image create photo -file ${::iwidgets::library}/demos/images/close.gif] \
-helpstr "Close" \
-command {puts "Close command"}
set tool [.db add tool -wrap 0]
$tool add radiobutton item6 \
-bitmap @${::iwidgets::library}/demos/images/oval.xbm \
-command {puts "Oval mode $result"} \
-variable result \
-value OPEN \
-helpstr "Draw Oval" \
-balloonstr "Oval"
$tool add radiobutton item7 \
-bitmap @${::iwidgets::library}/demos/images/line.xbm \
-command {puts "Line mode $result"} \
-variable result \
-value CLOSED
$tool add checkbutton item8 \
-bitmap @${::iwidgets::library}/demos/images/text.xbm \
-command {puts "Text text mode $checkit"} \
-variable checkit \
-onvalue on \
-offvalue off
$tool add checkbutton check2 \
-bitmap @${::iwidgets::library}/demos/images/points.xbm \
-command {puts "Points mode $checkit2"} \
-variable checkit2 \
-onvalue on \
-offvalue off
AUTHOR
Brian Griffin
KEYWORDS
dockbar, toolbar, button, radiobutton, checkbutton, iwidgets, widget, mtiwidgets