mdiframe - Create and manipulate a Multiple Document Interface (MDI) frame widget

SYNOPSIS

mtiwidgets::mdiframe pathName ?options?

INHERITANCE

itk::Widget <- mdiframe

STANDARD OPTIONS

activeBackground
activeForeground
background
borderWidth
command
font
relief
takeFocus





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

WIDGET-SPECIFIC OPTIONS

Name:                   clientBorderwidth
Class: ClientBorderwidth
Command-Line Switch: -clientborderwidth
Name:                   clientRelief
Class: ClientRelief
Command-Line Switch: -clientrelief
Name:                   inactiveBackground
Class: InactiveBackground
Command-Line Switch: -inactivebackground
Name:                   inactiveForeground
Class: InactiveForeground
Command-Line Switch: -inactiveforeground
Name:                   minheight
Class: Height
Command-Line Switch: -minheight
Name:                   minwidth
Class: Width
Command-Line Switch: -minwidth
Name:                   wallpaper
Class: Wallpaper
Command-Line Switch: -wallpaper
Name:                   command
Class: Command
Command-Line Switch: -command
Name:                   plusCommand
Class: Command
Command-Line Switch: -pluscommand
Name:                   plusImage
Class: PlusImage
Command-Line Switch: -plusimage
Name:                   minusImage
Class: MinusImage
Command-Line Switch: -minusimage
Name:                   showTabs
Class: ShowTabs
Command-Line Switch: -showtabs
Name:                   wallpaperMode
Class: WallpaperMode
Command-Line Switch: -wallpapermode
Name:                   orient
Class: Orient
Command-Line Switch: -orient
Name:                   tabpos
Class: TabPos
Command-Line Switch: -tabpos
Name:                   mode
Class: Mode
Command-Line Switch: -mode

DESCRIPTION

The mdiframe command creates a widget which is a framed area that manages multiple sub windows.  MDI stands for Multiple Document Interface.  Each subwindow, or client, is created by calling the client method.  This method returns the pathname to a childsite within the window.  The user can then install any widget within the childsite; something like a scrolled textwidget. The mdiframe supports two major modes of operation, classic and tabbed. In classic mode the mdiframe will manage the windows much like the window manager does on your desktop.  Currently the mdiclient command creates a decorating frame that is similar to Windows 9x windows, however, it should be possible to derive a new class from Mdiclient that provides a different decoration.

In tabbed mode, the windows look just like classic mode when a window is maximized. Views can be switched using the tabs. The frame, however, can be split, creating a new group of tabs. Windows can then be moved from one group to another. This split can be done up to the number of windows placed in the mdiframe. When the last window in a tab group is closed, the tab group is removed. The orientation of the split is controlled via the -orient option. A popup menu is provided on the tabs, themselves, to access management option for each window.

This work is derived from the Mysund_MDI implementation written by Jesper Svensson.

METHODS

The mdiframe 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 TabExists label
Returns true if a tab with label label already exists.
pathName TabSelected tabname ix
Selects the tab in tab group tabname, tab index ix.
pathName action action args
Currently a no-op, simply returns 0.
pathName actionstate action args
Used to determine the widget state under various actions. Will return either normal, or disabled, for each possible action.  Valid actions are: can_hidetabs, can_orient, can_moveprev, can_movenext, or can_split. The response is based on the current active tab.
pathName activate name
Make client window name the activate window.
pathName childsite ?name?
Returns the childsite frame for client name. If name is not give, returns the childsite of the active window.
pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the mdiframe command.
pathName childsite name
Returns the pathame of the childsite within the client window name.
pathName client name ?option option ...?
This method creates a new client window name.  A number of options may be specified.  These options are passed to the mdiclient command used to construct the client window.  Optionally, the option "-class clientclass" may be specified.  This will cause the client method to use the command clientclass in place of mdiclient to construct the client.  The class clientclass must be derived from mdiclient.  This can be done to provide different decorations or behavior for the client windows.  This method returns the pathname to the client's childsite (not the client itself), unless the -class option is specified in which case the pathname the client window is returned.
pathName clients
Returns a list of current client names.
pathName closeclient name
This method will close and destroy the client window name.
pathName findclient win
Given a subwindow of a client, will return the name of the client.
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 mdiframe command.
pathName geometry name ?args...?
This method will return the geometry of the client window name, or if an optional geometry is specified, will set the client window name to the given geometry.
pathName getcurrent
This method will return the name of the currently active client window.  If no client is currently active, an empty string will be returned.
pathName index label
This will return the client name of the window whos tab label is label.
pathName lastcurrent
This method will return the name of the currently active client window.  If no client is currently active, it will return the name of the last client window that was active.  If there are no client windows, then an empty string is returned.
pathName layout what
This method will rearrange all the client windows according to the what argument, where what may be one of cascade, horizontal, or vertical.  If the current client window is maximized, it will first be returned to a normal state before performing the layout. This method is only valid in classic mode.
pathName maxclient name
This method will maximize the client window.  A maximized window will take over the area of the mdiframe as if it is the sole window. This method is only valid in classic mode.
pathName minclient name
This method will minimize the client window.  The window is reduced to a simple fixed size title bar. This method is only valid in classic mode.
pathName move name group
This will move client name to tab group group.
pathName normclient name
This method will return a client window to its original size an location from either the maximized or minimized state. This method is only valid in classic mode. This method is only valid in classic mode.
pathName raiseclient name
Same as activate, but does not make window active (highlight).
pathName setcurrent name
This method will make the client window name the currently active window.
pathName split name
Will create a new tab group, moving client name into it.
pathName status name
This method will return the current state of client window name, which is one of normal, minimized, or maximized.
pathName SetTitle name title ?tab_label?
Sets the tile for client name to title and optionally set the tab label to tab_label.
pathName SetMark name mark
This will add mark to the tab label for client name. Mark is typically '*" to denote that the contents of an edit window, say, has been modified. Marks do not affect looking up clients via tab label.
pathName tabcget name option
Returns the value of option for client name's tab.
pathName tabconfigure name ?option ?value? ...?
Query or modify the option(s) on client name's tab.
pathName tabnext name
Makes the tab after client name active. Returns an error if name is the last tab.
pathName tabprev name
Makes the tab before client name active. Returns an error if name is the first tab.
pathName makeResizeCorner cornerPathname client
This method is used by the mdiclient widget to build a small box widget which is typically placed in the lower right corner of the client window.  This widget allows easier resize and move operations of the client window.  The client cannot do this internally since the mdiframe handles these operations.

COMPONENTS

Name:                   client
Class: Mdiclient

EXAMPLE

package require Mtiwidgets

mtiwidgets::mdiframe .mdi -borderwidth 2 -relief sunken -mode classic
pack .mdi -side top -fill both -expand 1

.mdi client 0 -title "Example Code"
set cs [.mdi childsite 0]
iwidgets::scrolledtext $cs.st -hscrollmode dynamic -vscrollmode dynamic -wrap none
pack $cs.st -side top -expand 1 -fill both
set f1 [open [file join ${::mtiwidgets::library} demos mdiframe]]
$cs.st insert insert [read $f1]
close $f1

.mdi client 1 -title "MDI Source Code"
set cs [.mdi childsite 1]
iwidgets::scrolledtext $cs.st -hscrollmode dynamic -vscrollmode dynamic -wrap none
pack $cs.st -side top -expand 1 -fill both
set f1 [open [file join ${::mtiwidgets::library} scripts mdi.itk]]
$cs.st insert insert [read $f1]
close $f1

AUTHOR

Brian Griffin

KEYWORDS

client, MDI, Multiple Document Interface, frame, widget, classic, tabbed