mapscrollbar - Create and manipulate a scrollbar widget w/colormap

SYNOPSIS

mtiwidgets::mapscrollbar pathName ?options?

INHERITANCE

itk::Widget <- mapscrollbar

STANDARD OPTIONS

background
borderwidth
cursor

highlightthickness
jump
orient

relief
repeatdelay
repeatinterval
takefocus



See the "options" manual entry for details on the standard options.

WIDGET-SPECIFIC OPTIONS

Name:                   activeRelief
Class: ActiveRelief
Command-Line Switch: -activerelief
Specifies the relief to use when displaying the element that is active, if any. Elements other than the active element are always displayed with a raised relief.

Name: command
Class: Command
Command-Line Switch: -command
Specifies the prefix of a Tcl command to invoke to change the view in the widget associated with the scrollbar. When a user requests a view change by manipulating the scrollbar, a Tcl command is invoked. The actual command consists of this option followed by additional information as described later. This option almost always has a value such as .t xview or .t yview, consisting of the name of a widget and either xview (if the scrollbar is for horizontal scrolling) or yview (for vertical scrolling). All scrollable widgets have xview and yview commands that take exactly the additional arguments appended by the scrollbar as described in SCROLLING COMMANDS in the scrollbar manual.

Name: elementBorderWidth
Class: ElementBorderWidth
Command-Line Switch: -elementborderwidth
Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to Tk_GetPixels. If this value is less than zero, the value of the borderWidth option is used in its place.
Name:                   mapcmd
Class: Command
Command-Line Switch: -mapcmd
Defines a callback command for colormap definition. The callback is made when the scrollbar set method is called and the range has changed.  The return value of the function is used as the new color map for the scrollbar (see setmap below.)

Name: mapcolor
Class: Color
Command-Line Switch: -mapcolor

Name: width
Class: Width
Command-Line Switch: -width
Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical scrollbars this will be the width and for horizontal scrollbars this will be the height. The value may have any of the forms acceptable to Tk_GetPixels.


DESCRIPTION

The mapscrollbar command creates a new window (given by the pathName argument) and makes it into a scrollbar widget.  This widget is compatable with the standard Tk scrollbar and has the additional ability to display a colored map within the trough of the scrollbar.  This colored map can be used to indicate regions of interest.

METHODS

The colbutton 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 the args determine the exact behavior of the command. The following commands are possible for button widgets:

ASSOCIATED METHODS

activate *
delta *
fraction *
get *
identify *
moveto *
scroll *
set *
refreshmap
setmap

(*) See the "scrollbar" manual entry for details on the associated methods.

WIDGET-SPECIFIC METHODS

pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the button command.
pathName configure ?option? ?value 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. Option may have any of the values accepted by the mapscrollbar command.

pathName refreshmap option
The refreshmap method recreates the color map from the data.

pathName setmap map
The setmap method defines the colormap for the scrollbar.  A map is a list of ranges which may have one of the following forms:
frac        Range is frac to frac of color -mapcolor

frac1 frac2            Range is frac1 to frac2 of color -mapcolor

frac1 frac2 color    Range is frac1 to frac2 of color color

ELEMENTS

A scrollbar displays five elements, which are referred to in the widget commands for the scrollbar:


arrow1
The top or left arrow in the scrollbar.

trough1
The region between the slider and arrow1.

slider
The rectangle that indicates what is visible in the associated widget.

trough2
The region between the slider and arrow2.

arrow2
The bottom or right arrow in the scrollbar.

COMPONENTS

Name:                   mapCanvas
Class:                  Canvas

EXAMPLE

mtiwidgets::mapscrollbar .sb \
-orient vertical \
-mapcolor red \
-relief sunken \
-borderwidth 1
.sb setmap [list 0.2 {0.5 0.6 blue} {0.75 0.85}]
.sb set 0.1 0.3
pack .sb -expand 1 -fill y

AUTHOR

Brian Griffin

KEYWORDS

scrollbar, map, widget