panemanager - Create and manipulate a Pane Manager
widget
SYNOPSIS
mtiwidgets::panemanager pathName ?options?
INHERITANCE
itk::Widget <- panemanager
STANDARD OPTIONS
background
borderWidth
cursor
|
height
relief
width
|
See the "options" manual entry for details on the standard options.
WIDGET-SPECIFIC OPTIONS
Name: handlePad
Class: HandlePad
Command-Line Switch: -handlepad
Specifies the distance from the top or
left end of the sash (depending on the orientation of the pane) at
which to draw the handle. May be any value accepted by
Tk_GetPixels.
Name: handleSize
Class: HandleSize
Command-Line Switch: -handlesize
Specifies the side length of a sash
handle. Handles are always drawn as squares. May be any value accepted
by Tk_GetPixels.
Name: layoutName
Class: LayoutName
Command-Line Switch: -layoutname
Name of the current window pane configuration. This is used when saving
properties of the widget.
Name: minsize
Class: MinSize
Command-Line Switch: -minsize
Sets the minimum size for a window pane.
Name: opaqueResize
Class: OpaqueResize
Command-Line Switch: -opaqueresize
Specifies whether panes should be resized as a sash is moved (true), or
if resizing should be deferred until the sash is placed (false).
Name: propertyCommand
Class: PropertyCommand
Command-Line Switch: -propertycommand
Defines a command to use to save and restore widget properties.
Name: sashCursor
Class: SashCursor
Command-Line Switch: -sashcursor
Mouse cursor to use when over a sash. If null, sb_h_double_arrow will
be used for horizontal panedwindows, and sb_v_double_arrow will be used
for vertical panedwindows.
Name: sashPad
Class: SashPad
Command-Line Switch: -sashpad
Specifies the amount of padding to leave of each side of a sash. May be
any value accepted by Tk_GetPixels.
Name: sashRelief
Class: SashRelief
Command-Line Switch: -sashrelief
Relief to use when drawing a sash. May be any of the standard Tk relief
values.
Name: sashWidth
Class: SashWidth
Command-Line Switch: -sashwidth
Specifies the width of each sash. May be any value accepted by
Tk_GetPixels.
Name: showHandle
Class: ShowHandle
Command-Line Switch: -showhandle
Specifies whether sash handles should be shown. May be any valid Tcl
boolean value.
DESCRIPTION
The panemanager creates a recursive panedwindow (see Tk panedwindow).
Panedframes can be added by inserting, appending or splitting. The
panedframe is used to provide a header handle that can be manipulated
by the user to rearrange panes into different configurations. Windows
can be added directly to the panedmanager, but these windows cannot be
moved via the mouse.
Note:
The current Paneframe implementation depends on the [wm toplevel]
enhancement (TIP #125), which has not yet been approved by TCLCORE.
METHODS
The panemanager 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
None
WIDGET-SPECIFIC METHODS
pathName _dragging
window header x y
pathName _enddrag
window header x y
pathName _report_map
x y
pathName _startdrag
window childsite header x y
These methods are for internal use in
conjunction with the panedframe widget.
pathName _see_map_
pathName _hide_map_
pathName _makedragmap
This methods are for manipulating the
drag map window. The drag map window is for debugging purposes
only.
pathName _pane_tree_
This is a internal debuggin tool. It
will display a tree showing the pane hierarchy. It requires the
mtihierarchy widget which is not part of the mtiwidgets package.
pathName add window
target where ?arg arg ...?
The widget window is inserted into the
panemanager. The target
widget is a reference location and maybe empty ({}). The location where is relative to the target widget and must be one of
the values n, s, e,
w, above, below, right, or left. The compass directions are
used to split the target
pane, placing the
pathName cget option
Returns the current value of the
configuration option given by option. Option may have any of the values
accepted by the panedwindow command.
pathName configure
?option? ?arg arg ...?
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 panemanager command.
pathName hide window
The pane specified by window is removed from the display.
It's configuration and location are remembered, but the window is no
longer displayed. The show
command is used to make the window visible.
pathName join window
This command will dock the window, returning it to the
panemanagers main frame. This operation is the inverse to the rip command.
pathName maximize
window
This command causes window to be the only visible
window in the panemanagers frame; all other windows are hidden.
pathName normal
This command will return a maximized
window state back to the original layout.
pathName panecget
window option
Query a management option for window. Option may be any value allowed by
the paneconfigure subcommand
pathName paneconfigure
window ?arg arg ...?
Query or modify the management options
for window. 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. The following options are
supported:
-after window
Insert the window after the window specified. window should be the name of a
window already managed by pathName.
-before window
Insert the window before the window specified. window should be the name of a
window already managed by pathName.
-height size
Specify a height for the window. The
height will be the outer dimension of the window including its border,
if any. If size is an empty
string, or if -height is not
specified, then the height requested internally by the window will be
used initially; the height may later be adjusted by the movement of
sashes in the panedwindow. Size
may be any value accepted by Tk_GetPixels.
-hide boolean
With a value 0, the window is unmapped
from the screen as if deleted. The windows location and configuration
options are retained. With a value of 1, the window will be mapped to
the screen.
-minsize n
Specifies that the size of the window
cannot be made less than n.
This constraint only affects the size of the widget in the paned
dimension -- the x dimension for horizontal panedwindows, the y
dimension for vertical panedwindows. May be any value accepted by
Tk_GetPixels.
-padx n
Specifies a non-negative value
indicating how much extra space to leave on each side of the window in
the X-direction. The value may have any of the forms accepted by
Tk_GetPixels.
-pady n
Specifies a non-negative value
indicating how much extra space to leave on each side of the window in
the Y-direction. The value may have any of the forms accepted by
Tk_GetPixels.
-sticky style
If a window's pane is larger than the
requested dimensions of the window, this option may be used to position
(or stretch) the window within its pane. Style is a string that contains
zero or more of the characters n,
s, e or w. The string can optionally
contains spaces or commas, but they are ignored. Each letter refers to
a side (north, south, east, or west) that the window will "stick" to.
If both n and s (or e and w) are specified, the window will be
stretched to fill the entire height (or width) of its cavity.
-stretch when
When the panemanager has too much or
not enough space for all the managed windows, this option determines
how the surplus or debt space is distributed. When is one of the values always, first, middle, last, or never. The when option determines if a window
is considered or not in the allocation of space. If a window is
considered, it is then allocated space in proportion to it's relative
size amongst all the windows in the panedwindow. A window is always considered, only considered
if it's the first window (top
most if vertical, left most if horizontal), only considered if it's in
the middle, only considered if
it's the last window, or never considered. By default,
windows are assigned a value of last
for -stretch.
-width size
Specify a width for the window. The
width will be the outer dimension of the window including its border,
if any. If size is an empty
string, or if -width is not specified, then the width requested
internally by the window will be used initially; the width may later be
adjusted by the movement of sashes in the panedwindow. Size may be any value accepted by
Tk_GetPixels.
pathName panes ?nested?
This subcommand will return a list of
windows currently managed by the panemanager. If the boolean flag nested is given, then the list will
be hierarchical, representing the recursive layout of the managed
windows.
pathName rip window x y
width height
The specified window is undocked from the
panemanagers frame and made a seperate toplevel window. The x, y, width, and height options will define the
initial location of the new toplevel window.
pathName sash cmd ?arg
arg ...?
This command is not currently
supported.
This command is used to query and change the position of sashes in the
panedwindow. It can take any of the following forms:
pathName
sash coord index
Return the current x and y
coordinate pair for the sash given by index. Index must be an integer
between 0 and 1 less than the number of panes in the panedwindow. The
coordinates given are those of the top left corner of the region
containing the sash. pathName sash dragto index x y This command
computes the difference between the given coordinates and the
coordinates given to the last sash coord command for the given sash. It
then moves that sash the computed difference. The return value is the
empty string.
pathName
sash mark index x y
Records x and y for the sash
given by index; used in conjunction with later dragto commands to move
the sash.
pathName
sash place index x y
Place the sash given by index at
the given coordinates.
pathName serialize
This subcommand returns a single string
that represents the current layout of windows, including hidden and ripped (undocked) windows. This
string can be given to the unserialize
subcommand to return the windows this exact layout.
pathName show window
This subcommand will make window visible again, mapping it to
the screen. This command is the inverse of the hide subcommand.
pathName state window
This subcommand will return the current
layout state of window which
will be one of the values normal,
hidden, zoomed, or undocked. The zoomed state means the window is
maximized. The undocked state
means the window has been ripped.
The others should be obvious.
pathName subpanes
This subcommand will return a list of
the nested panedwindow widgets in the panemanager.
pathName togglemax
window
This subcommand will toggle the
maximize state of the window
specified. If the window is maximized, it will make it normal,
otherwise it will maximize the window.
pathName togglerip
window
This subcommand will toggle the dock
state of the window
specified. If the window is undocked, it will make the window docked,
otherwise it will undock the window.
pathName unserialize
state
This subcommand will take a layout
specification, returned by a serialize command, and configure the
current layout to accordingly.
COMPONENTS
Name: cs
Class: Panedwindow
The only components are the client window(s) created by the application
and nested Panedwindows.
EXAMPLE
package require Itcl
# This is currently required by the paneframe:
namespace import ::itcl::*
package require Mtiwidgets
# Create the pane manager
mtiwidgets::panemanager .mp
# Create a pane frame and place a text widget inside
mtiwidgets::paneframe .mp.t1
set cs [.mp.t1 childsite]
text $cs.t
# Let the paneframe know where focus belongs
.mp.t1 configure -window $cs.t
pack $cs.t -side top -fill both -expand 1
# Put the paneframe into the manager
.mp add .mp.t1 {} w
# Create a second pane frame and place a text widget inside
mtiwidgets::paneframe .mp.t2
set cs2 [.mp.t2 childsite]
text $cs2.t
# Let the paneframe know where focus belongs
.mp.t2 configure -window $cs2.t
pack $cs2.t -side top -fill both -expand 1
# Put the second frame into the manager to the right of the first pane
.mp add .mp.t2 .mp.t1 e
# Map the whole thing to the screen
pack .mp -side top -fill both -expand 1
AUTHOR
Brian Griffin
KEYWORDS
paneframe, panedwindow, dock, zoom