Copyright © 2008, 2009 Arndt Roger Schneider
»stripesCommand« is used in combination with »adjustCommand«. These two properties allow to replace the default stripes with a custom variant. »stripesCommand« is responsible to fill the background of the stripes window, whereas »adjustCommad« realigns the background after a resize event has happened.
A predefined »stripesCommand«, called »nilstripes«, is provided with gstripes. Use »nilstripes« to gain the best performance.
static property.
Boolean value, default is »1«, on.
»touch« controls whether or not the created Gstripes window interacts with hijacked windows or not. When »touch« is set to 1, the window Z-Order is altered. Event handlers are registered between Gstripes and hijacked windows.
A Gstripes window, where touch is disabled (0), is used as a pre-print preview for an already striped dialog.
Gstripes creates white space. A striped window –a dialog– uses a gstripes window for rendering its background.
The gstripes created white space can be enriched with various elements such as background frames, contours , images, vector graphics, labels, messages checkbutton, radiobutton, button, menubutton, menus, menubars and groups .
Menu hijacking is only possible under X11.
The radiobutton and checkbutton indicators can be replaced with a »vector«. This vector is defined for the individual radiobutton, checkbutton via the option database entry »indicatorVector«.
The above Example A.24, “Indicators” , from the »grefadvance« template, replaces the standard checkbutton indicator –a checkmark – with a triangle button. This »triangleButton« is used to represent visual disclosure. The vector »triangleButton« also contains a »focusframe« element for highlighting.
A Window created through the gstripes 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 gstripes 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 gstripes command.
Cover the stripes window with a semi-transparent sheet. To indicate that this dialog is no longer accessible. See also goolbar, activate. See Open Issues.
Trace handler for checkbutton and radiobutton kind of controls.
Test whether the expected gradient was destroyed. Return 1, when a gradient is expected but not available.
Changes the visual state of the item to resemble a pressed button. The way how pressed is done depends on the state model selected for the »window«.
Applies for menubutton, button and checkbutton, radiobuttons inside of »groups«.
A Group is a collection of button, checkbutton and radiobutton treated as a single control. The outer elements do receive rounded corners while the inner elements are square. Images (and later compound???) are allowed for grouped elements! Images are left alone.
See also the revision notice inside the commentary for »modifyGroup«.
Realign the items inside of a group, so that text and space is even distributed among the group members.
Call the »repairCommand« when registered And report the repair result back to the caller.
Currently only used by stripesmenu. Intended to repair selection failures.
RELATED TO A BUG INSIDE TKPATH 0.2.4‥0.2.7, NOT NEEDED ANYMORE, ISSUE SOLVED.
...from leave. Left is called in response to an enter event. That is when another control receives the input focus left is executed. This delay is needed in order to prevent flicker effects with layered graphical objects –belonging to the same control. left may also being triggered due to a after timer event.
Do call adjust each time the window gets visible. Only the stripes should be aligned, not the hijacked or individual stuff. Also the modulo value must be definable. As "moduloY"" and "moduloX" inside the option database.
A control may feature a shadow. Shadows are only allowed for groups, menubuttons, buttons if the control in question has rounded corners and shadow is activated for it.
Create the bidirectional bindings for the »window« and its stripes imposter –identified via »tags«.
Creates a striped menu from the »menu« in question. »menu« must be the real window, that is a clone when it is part of a menubar. hijackmenu iterates over the menuentries and creates striped representations for each entry.
Draws a Radio indicator. This is a circle using an radial gradient. If »window« is selected, then the selecColor is used for the indicator background and an opaque inner circle is drawn to indicate selection.
Replacement for »hijack« see description at »hijack«. The procedure »alienhijack« allows the hijacking of alien templates, that is the the stripes window need not to be part of the templates hierarchy.
Test whether or not the item is selected. The procedure returns false if the associated variable does not, yet, exist.
Externalize the hijacking of images. can be used inside hijackprototype and label.
This code is currently unused (no need). Has to be used directly.
Formats the proper event handler for the Map Event. Hijacked windows must be reevaluated whenever the template is remapped.
Hijack a menu entry of »menu« given by it's index »i«. The Height »height« is used to position the text where it belongs.
Shift-Option-Command-x There is some trouble with UTF-8, CAIRO and tkpath, therefore not used, yet.
Default glyphs from »gestalt.ttf«:
option add *Menu.keyboardfont {gestalt} option add *Menu.controlkey b option add *Menu.optionkey d option add *Menu.shiftkey r
option add *Menu.keyboardfont {apple symbols} option add *Menu.controlkey ⌃ option add *Menu.optionkey ⌥ option add *Menu.shiftkey ⇧
option add *Menu.deletekey ⌫ option add *Menu.Upkey ↑ option add *Menu.downkey ↓ option add *Menu.leftkey ← option add *Menu.rightkey → option add *Menu.homekey ↖ option add *Menu.endkey ↘ option add *Menu.pageupkey ⇞ option add *Menu.pagedownkey ⇟ option add *Menu.cascade ▸
Creates a indicator for the item »i« inside of »menu«. The indicator is placed in a rather complicated fashion. First it is created off-screen and later –when the menu is striped– moved on-screen. That is why »tx« –caption x-position– is used here.
The official way for hijacking a window, group or contour. The template related functions –hijack, stripes and substripes– do also use »hijackwindow«. Be careful when using it! It should be used in response to a <Configure> and/or <Map> event for the same dialog.
The over all design will follow Aqua & Tk. sunken / raised for the indicator. Highlight around the indicator. The indicator receives the background color / selectColor. The text will not feature a background, but partakes in the active state.
Event handler isolated. Sets the previous colors back to their default values --through menuupdate.
Needed, because the event can occur after the stripes window and the menu have been destroyed.
Draws a series of focus frames. These technique is mainly used under AQUA®. The inner focus frames are also darker than the outer frames.
Does hijack messages or labels. »window« is the pathname to the message window.
See description for »borders«.
»left« and »right« partake in the local caché strategy demanded by tkkpath 0.3.0.
Hijacks a label or message window. These window must be a sibling to the stripes window. This version is intended for template based dialogs ... use the lower level functions for dialogs based on another model.
A group may contain multiple classes, but not a frame; a contour only frames.
Modify the associated canvas item in response to a Configure event for the stripes parent window. This may alter the geometry of the associated window.
Hijack a frame and send the hijacked element to the background–behind stripes.
Experimental hijacking a button when tkpath is present ... doesn't make sense for vanilla Tk, hence not implemented for tk.
Create a tkpath gradient from the background color and draw a prect rectangle around it.
Creates borders to the left and right side of buttons, menubuttons and groups featuring radius- An element without a radius does not receive a border, the same applies for checkmark and radio- mark. Disable borders from the option database by defining »borders: 0« for the window in question.
Creates a gstripes window. Recommended, use the »stripes« function for a template to manage stripes. The »stripes« function then creates a gstripes window.
Custom destroy. This is a special destroy, needed to circumvent default-destroy breakup. A messageBox is used in this case and thus default-destroy won’t be performed.
Images and Accelerators (short-cuts). Short-cuts are added to the right side on a menu. the exact same location is also used for images. An image is a graphical short-cut.
Images are recessive to keyboard short-cuts.
A glyph should be used inside menus to represent images. Specify this inside th option database.
option add *Menu.sampleImage x option add *Menu.glyphfont {apple symbols}
Under »AQUA« two gradients are used for controls. The gradient »aquagradient« creates is layered beneath the normal gradient. The conventional normal gradient is semi transparent under AQUA. Use opaque gradients for custom-made gradients directly added to the gradient cache.
And »left« control the mouse movement inside a stripe object. <Enter> and <Leave> events must be handled with great care! Otherwise a deadlock will ensue in various circumstances (e.g. modal dialogs). To delay the <Leave> event until a new <Enter> event arrives allows to carry the active state over to an reentrant call in another item of the same element – which is how it is used.
Can’t be used in response to a configure action to its associated »window«. It is required to integrate this function in the host template instead –can’t be done automatically. Preferred way to notify the text item about changes in its associated »window«
Retrieve the leading window for the »group«, of which »window« is a member.
Create a tkpath gradient for the given control, or reuse a suitable gradient, if it does exist. Do check the gradients before reuse – might have gone missing.
SEE ALSO REPAIRSTRIPES AND REPAIRCOMMAND.
With »tkpath« gradient can be pre-defined. Pre-defined gradients are used as they are.
New tkpath 0.3.0 requires a local caché, therefor ported to gcache.
Internal used! Is called to trace selection inside of »menu«. The menu entry »i« is the current selected menu entry and its colors must change to reflect this selection inside of the stripes window »base«. A prior menu entry might have had the selection –very likely– and thus the colors must be restored for this entry, too.
As with the »leave« event in general, menuupdate may be called post-mortem.
Test wheter »gradient« is indeed a gradient. Returns 0 for a simple color.
Create AQUA stripes inside the canvas. These stripes are semi-transparent when 'tkpath' is present.
Produces the bindings needed to navigate and communicate position for the »menu« and its associated stripes child window.
Called from within hijackgroup if the first item in args is of class "Frame".
Interact handler for hijacked buttons and menubuttons. Only selected events are processed by interactive.