|<B>-fontB>||Font for tab text.|
|<B>-raisecmdB>||Code ref invoked on a raise event; passed the caption of the raised page. <B>NOTE:B>This behavior is different than Tk::Notebook, which passes the widget to the callback.|
|<B>-raisecolorB>||Sets the default raisecolor; overridden by <B>add(-raisecolor)B> option. Default is current widget background color.|
|<B>-tabcloseB>||Add small close button to each tab; if set to a coderef, the coderef is invoked when the close button is pressed, and is passed both the Tk::DynaTabFrame object, and the caption of the associated tab. If set to a true scalar value, invokes the delete method on the associated tab. Default is no close button. When enabled with -tablock enabled, -tablock is silently ignored.|
|<B>-tabcolorB>, <B>-backpagecolorB>||Sets the default tabcolor; overridden by the add<B>(-tabcolor)B> option. Default is current widget background color.|
|<B>-tabcurveB>||Curve to use for top corners of tabs; set to the number of pixels of spacing between adjoining tab borders. Default 2; rarely needs adjustement.|
|<B>-tablockB>||Locks the resize of the tabs; when set to a true value, the tabs will not be rearranged when the enclosing window is resized; default off (ie, tabs are rearranged on resize). Silently ignored when -tabclose is enabled. Note that this options does not effect the tab raise event behavior (tab rows rotate inward). See the -tabrotate option to disable that behavior.|
|<B>-tabpadxB>||Padding on left and right of the tab contents|
|<B>-tabpadyB>||Padding on top and bottom of the tab contents|
|<B>-tabrotateB>||When enabled (the default), when a tab is raised in a row other than the innermost, frame-adjacent row, tab rows are rotated inward until the raised tab is frame adjacent. Disabling this option will leave the raised tabs row at its current location until a resize event occurs. (See -tablock to lock down tab locations on resize events).|
Side of notebook to align tabs; acceptable values:
|<B>-tabscrollB> (not yet implemented)||When set to a true value, causes tabs to be restricted to a single row, with small arrow buttons placed at either end of the row to permit scrolling the tabs into/out of the window. When a tab is programmatically raised, the tabs will be scrolled until the raised tab is visible.|
|<B>-textalignB>||Aligns text to the tab orientation. When enabled (i.e., set to a true scalar, the default), text in tabs is aligned to the tab orientation (i.e., top and bottom tabs have horizontal text, side tabs have vertical text). When disabled (i.e., set to undef or 0), text will be vertical for top and bottom tabs, and horizontal for side tabs.|
|<B>-tipcolorB>||Sets the background color of any tabtips (default white). Causes creation of a Tk::Balloon widget if none yet exists.|
|<B>-tiptimeB>||Sets the integer number of milliseconds to delay between the time the mouse enters a tab and the display of any defined tabtip. Default 450. Causes creation of a Tk::Balloon widget if none yet exists.|
|<B>-currentB>, <B>-raisedB>||Returns the currently raised frame.|
|<B>-raised_nameB>||Returns the page name of the currently raised frame|
|<B>-tabsB>||Returns a hashref of the tab Button widgets, keyed by the associated caption.|
The following methods may be used with a DynaTabFrame object in addition to standard methods.
<B>add(B>[ pageName, ] options<B>)B> Adds a page with name pageName (if provided) to the notebook. Returns an object of type <B>FrameB>. If no pageName is supplied, then the <B>-captionB> option value will be used. If neither is provided, then the name is the string representation of the created pages frame. Recognized options are:
<B>-captionB> Specifies the identifying name for the page. Also used for the tab text if no <B>-labelB> or <B>-imageB> is specified. If this option is specified, and the optional pageName argument is specified, pageName overrides this option. <B>-hiddenB> When set to a true value, causes the resulting tab to be hidden from view; can later be set to a false value to force the tab to be visible again. <B>-imageB> Specifies an image to display on the tab of this page. The image is displayed only if the <B>-labelB> option is not specified. <B>-labelB> Specifies the text string to display on the tab of this page. <B>-raisecmdB> Specifies a callback to be called whenever this page is raised by the user. Overrides the widget-level <B>-raisecmdB> option only for this tab. <B>NOTE:B> This options behavior is different from the Tk::Notebook, in that the callback is passed the name of the page, rather than the widget. <B>-raisecolorB> Specifies the raised background color for the tab. Overrides the widget-level <B>-raisecolorB> option for only this tab. <B>-tabcolorB> Specifies the unraised background color for the tab. Overrides the widget-level <B>-tabcolor/-backpagecolorB> option for only this tab. <B>-tabtipB> Specifies the text of a tabtip to attach to the created tab. Causes creation of a Tk::Balloon widget if none yet exists.
<B>deflash(B>pageName<B>)B> Turns off flashing for the specified pageName. <B>delete(B>pageName<B>)B> Deletes the page identified by pageName. <B>flash(B>pageName, options<B>)B> Flashes the tab for the specified pageName. Flashing continues until either the <B>-durationB> has expired, the tab is raised (either by clicking the tab, or programmatically), or deflash is called on the page. options include
<B>-colorB> Color to use for flashing. Flashing alternates between the current -tabcolor (or -raisecolor if the tab is raised), and this color. Default is blue. <B>-intervalB> Number of milliseconds between flashes. Default is 300. <B>-durationB> Duration of the flash in milliseconds. Default is 5000 (i.e., 5 secs).
<B>pagecget(B>pageName, -option<B>)B> Returns the current value of the configuration option given by -option in the page given by pageName. -option may be any of the values accepted in the add method, plus the <B>-stateB> option. <B>pageconfigure(B>pageName, -option<B>)B> Like configure for the page indicated by pageName. -options may be any of the options accepted by the add method, plus the <B>-stateB> option.
Note that configuring the -tabtip option to undef will remove the tabtip from the page.
<B>pagesB> Returns a list consisting of the names of all currently defined pages, i.e., those created with the <B>addB> method. <B>raise(B>pageName<B>)B> Raise the page identified by pageName. Returns the Frame widget of the page. <B>B>raised()<B>B>, <B>B>current()<B>B> Returns the currently raised Frame widget. <B>NOTE:B> This method behavior differs from the Tk::Notebook method of the same, which returns the page name. Use the raised_name() method to mimic Tk::Notebook behavior. <B>B>raised_name()<B>B> Returns the page name of the currently raised frame
<B>OptionalB> horizontal scrolled frames (ie, os) seem to cause some race conditions (Config events keep resizing the frame up, then down). Use mandatory scrollbars if you need horizontal scrollbars.
Support for rotated text in left or right side tabs is lacking, due to the lack of a consistent text rotation method in Perl/Tk. While the issue can be alleviated using the -textalign option, another possible solution may be either Tk::Win32RotLabel on Win32 platforms, or Tk::CanvasRottext for *nix platforms. Unfortunately, vertical text is less than aesthetically pleasing, and can consume a rather large vertical area; using images with attached balloons may be a preferable alternative.
As of v. 0.20, better compatibility with Tk::Notebook has been provided. However, DTF is not yet fully backward compatible, as some methods and options of the same name could not be changed from prior versions of DTF in order to preserve backward compatibility.
As of V 0.20, the maximum number of tab rows is 21. This arbitrary limit is imposed due to odd behavior when redrawing the tabs on a resize event. Pseudo tabs are used to provide the illusion of tabs embedded into a frame-spanning row. If these pseudotabs are destroyed and recreated during a resize event <B>while the mouse button is still held down on the window resizerB>, the window will snap back to its original dimensions when the new pseudotabs are <B>B>place()<B>dB>. The only solution seems to be to create a fixed number of pseudotabs at startup, and <B>B>place()<B>B> them as needed during the redraw. Eventually, a widget attribute may be added to specify the max number of rows to permit.
-tabclose and -tablock are mutually exclusive; if both are enabled, -tablock will be silently ignored.
Canvas based tabs Currently tabs are drawn as frames with a button (plus optional close button), and the text or image is added to the button. This limits the layout of tabs to square boxes. By converting the ButtonFrame to a Canvas, and just building, binding, and moving objects on the canvas when a redraw occurs, we can have a much more flexible tab layout (image+text, nice curved tabs, etc.). Configurable <B>-tabcloseB> button Currently, only a close button is implemented with a fixed image. In future, the button image may be configurable, e.g., set to a minimize image and set a minimize callback for an MDI-type notebook. Configurable <B>-tabsideB> <B>configure(B>-tabside<B>)B> should be permitted after pages are added. Rotated tab text using GD Newer versions of GD provides better font support, with 90 degree rotation. By using GD to render and rotate the tab text as an image, sideways text can be used in tabs as images. Single row, scrolled tabs Support for scrolling tabs, rather than stacking, should be added with small arrow buttons added at either end of the tab row when some tabs exist beyond the beginning/end of the row.
Dean Arnold <firstname.lastname@example.org>
Portions of the POD derived from Tk::Notebook.
Copyright(c) 2003-2005, Dean Arnold, Presicient Corp., USA. All rights reserved.
Portions Copyright(c) 1998-1999 Damion K. Wilson, all rights reserved.
This code and documentation may be distributed under the same conditions as Perl itself.
May 22, 2005 : Ver. 0.22 - added -hidden page option
- added -tiptime, -tipcolor global attributes
- added -tabtip page option
January 10, 2005 : Ver. 0.20 - added -tabclose
- added -tabside
- added -image attribute to add() to support images in tabs
- added -label attribute to add() to support alternate text in tabs
- fixed -raisecolor behavior to revert color of prior raised tab
- fixed roaming tab connector frame
- code mods for performance
- added -tabcolor/-backpagecolor, -raisecolor widget level options
- added -raisecmd attribute to add() to support event callback
- added some Tk::Notebook drop-in compatibility (pagecget(), pageconfigure(), pages(), raised())
- POD enhancements
- added -textalign
- added -tabrotate
- added flash(), deflash()
March 14, 2004 : Ver. 0.07 - added -raisecolor to set the color of a tab when raised
- increased ConfigDebounce width threshold for ptk804.025beta
January 16, 2004 : Ver. 0.06 - fixed programmatic raise
- added (simple) install test
- added programmatic raise button to demo app
- added flash()
January 13, 2004 : Ver. 0.05 - added pseudo-tabs to backfill the space between the right side of last tab in a row, and the right side of the enclosing frame January 6, 2004 : Ver. 0.04 - fixed TabRemove for remove from arbitrary position
- updated demo app to exersize arbitrary position removal
- fixed apparent timing issue with TabRemove and resizing that caused occasional phantom client entries
January 5, 2004 : Ver. 0.03 - added raised_name() method/-raised_name property to return caption of currently raised page
- fixed tab ordering on resize when raised tab gets moved to other than bottom row
December 29, 2003 : Ver. 0.02 - improve raise behavior
- improve tab font behavior (use platform/application default when none specified)
- added tablock option
December 25, 2003 : Ver. 0.01 - Converted from Tk::TabFrame
Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 2697: =over without closing =back
|perl v5.20.3||DYNATABFRAME (3)||2005-05-25|