Copyright © 2008, 2009 Arndt Roger Schneider
The RTL based option creator is used
to instantiate the template galette with a
Tk Window. The used creator window must have a
-class
property.
Acceptable Tk Windows are: toplevel for floating windows, and frame for embedded windows.
See the options manual entry for details on the standard options.
The Tcl/Tk package for deployed by this galette.
The »require« property isn’t used by the galette and may be abused as an external test condition, stored inside the galette.
The above scenario is, how I do use »require« within my own software. It is not likely to change in the future.
»gridSize« expects a distance denoting the size of a cell. An item may occupy one or more of such cells.
»gridSize« is used in a fuzzy-like way. If the dimensions of neighboring items are small in compared to the actual item, then the actual item may share some space from its neighbors. The same applies if the actual item is small compare to the neighboring items –it does yield some space to them.
This »command« fragment is executed when an item in the toolbar is activated. The Goolbar items may have their own independent commands, replacing the galette »command« property.
Expression, the result of the »ensure« expression enables or disables all items inside the galette.
»ensure« is deployed by the ensure function. The »ensure« function parameter »parentWidget« is feed via »format« into the »ensure« expression. Thus valid substitution for ensure are »%s« and »%1$s«, place holders for »parentWidget«.
»undo« holds a code fragment informing how an action from this particular Galette can be undone.
Toolbar items may be visible or invisible. This setting is controlled via the »show« property. Suppose there are four items inside the toolbar named »a«, »b«, »c« and »d« in this situation all items will be initial visible –right after they were added to the toolbar, unless »show« was specified prior to the add commands.
Example A.14. Implicit Visible Items
# Create the toolbar without specifying # show makes all added items visible. .toolbar add command a … .toolbar add command b … .toolbar add command c … .toolbar add command d …
Example A.15. Explicit Visible Items
# Example hide d – and add variable space (~) .toolbar configure -show {a b ~ c}
»-hidetitle« tells the window to unmap an integrated title bar.
For a Galette: the integrated toolbar automatically opens, when the title is hidden.
»useToken« activates the glyph vector graphics system implemented in the toolbar. If »useToken« is set to »1« (true), then the item property »iconFont« is evaluated and the provided image substituted through the glyph given by the property: »token«.
The item properties »bgImage« and »image« are recessive to »token«, whenever »useToken« is set.
The »vectorSize« is reported to the canvas graphics based vectors.
In the future: Vectors, glyphs and images may become fully interactively resize-able –with a scroll-wheel. This feature requires that all vector graphics originate from TkPath.
It is OK to ignore the size parameter, when creating a vector.
Always use resolution independent values like »24p« –24 points. 24p is the »vectorSize« default value.
The Zoolbar already supports »vectorSize« for images.
A toolbar customization function.
The »customizeCommand« will be accessible from the toolbar context menu.
Use the »customizeCommand« in order to invoke the Gooleditor for this toolbar.
Example A.16. Calling a Gooleditor
goolbar .toolbar -customizeCommand \ [list customizeToolbar .toolbar] proc customizeToolbar toolbar { if ![winfo exists $toolbar] return # An embedded dialog set fmt myicons # A different embedded dialog for glyphs: if [$toolbar cget -useToken] { set fmt mytbicons } # Display the toolbar editor inside # the parent window. gooleditor [winfo parent $toolbar].custom \ -goolbar $toolbar -custom $fmt }
The »hideCommand« is used inside the toolbar context menu. The conventional response to this command is to invoke the »Hide Toolbar« menu entry in the »View« menu.
Example A.17. Hide Toolbar
# The application Toolbar: goolbar .toolbar -hidecommand { .menubar.view invoke ?index of entry? } # The Application Menubar: menu .menubar . configure -menu .menubar # The Menubar entry »View«: .menubar add cascade \ -label "View" \ -menu .menubar.view # The »Hide Toolbar« command inside the # »View« menu: Record the index of this # command: .menubar.view add command \ -label "Hide Toolbar" -command ...
Galette (Palette): Implements a special-type toolbar. Galette features multiple lines of entries and deploys a gridwin for scrollbar management. The customization and context menu is reused from the toolbar.
Revision : 05/18/2009, Roger 1.1 06/26/2009
The extended interface from the goolbar is used. Focus-Ring and -takefocus management exported via the template interface.
ActiveForeground, ActiveBackground and Highlighting exported via template interface.
Synthetic events on visibility changes.
Revision : 11/19/2009, Roger 1.2 Additional properties from the toolbar mapped into the galette interface. Chiefly to deal with code generation.
A Window created through the galette command exposes various functions. Using these functions has the following general form:
pathName option ?arg arg ...?
PathName is the same as the window path name. Option and the args determine the exact behavior of the command. The following commands are possible for this window:
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the galette command.
Query or modify the configuration options of the 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 window 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 galette command.
Change the visibility of the galette toolbar. This function interrelate with property »hideTitle«. The toolbar stays visible when hideTitle is active.
Side effect : Creates displaying synthetic events. Hiding and Showing.
Monitor this events to implement auto- hide/show the content of other galettes. Rewritten : 02/28/2008, Roger Revision : 06/26/2009, Roger-events
Queries inside the given »interp« for the »-ensure« property. And thus controls the visibility of all the items inside the contained »toolbar«.
Test if the current items are applicable in the current situation ...
Retrieve the contained toolbar ... the toolbar should be filled directly ...
The secondary constructor for template »galette«. Mostly deals with stripes and also floating window customization. Internal used by the template procedure.
A Drag-n-Drop operation is under progress. That is, a galette is moved inside of its container. The galette must be managed by grid, for using this code.
As with every template, the galette supports multiple creation windows. And for that reason a galette may be represented embedded and floating.
For a galette the creation state can be changed after creation. Thus when a floating galette is recreated as an embedded window »fallback« gets called and re-integrates this window into its previous container.
Only for the »grid« geometry manager.
Forwards itemconfigure calls to the internal »toolbar«.
Doesn’t operate on the galette, itself.
Normally »resize« operations should be done on the parent level. This is however –for some picky reasons— not done here. Therefore resize is an internal function of the galette.
Executes the global »-command« property for the item »type« and applies »name« and »args« to the invoke call.
This call can be omitted, when the »toolbar« item features a non-standard »-command«.
Palette is moved inside parent to another cell.
When the palette gets moved, determine in which row/ column it was placed to.
Calls »occupied« in order to tidy-up the grid of its container window.
Counterpart to »fallback«. »tearoff« is called for an embedded galette, in order to convert it into a floating window. The coordinates »x, y« denote the place of the left and top corner of the created floating galette.
The »fallback« procedure is registered for the window destroy command. The window will be re-managed when it is supposed to be destroyed.