Copyright © 2009 Arndt Roger Schneider
The RTL based option creator is used
to instantiate the template rtl_mlistbox 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.
Integer value, amount of listbox columns.
List of column dimensions.
The rtl_mlistbox in Example 3.3, “Listbox Dimensions” has two columns the first column is 333 pixel and the last column 222 pixel width.
Call back command, this script is evaluated in response to a double-click event onto the rtl_mlistbox.
call back command. This script is evaluated, whenever a drag operation begins.
Call back command. This script is evaluated, whenever a drag operation commences.
call back command. This script is evaluated, whenever a drag operation ends.
List of strings. The string values of »-headings« is used for the header row. It contains the descriptions for the columns.
List of anchor definitions. Defines how the column headers are aligned. Possible values are »e«, »center« and »w«.
Boolean value. Allows to interactively resize the columns inside the rtl_mlistbox.
Call back Tcl Command,called each time a selection in the rtl_mlistbox is done. Calling rtl_mlistbox widget and selected line index are appended to call.
Each column has a tag serving as handle for configuration. The tags of all columns may be set via this option. Default tags are the column numbers.
NOTE: duplicate tags are allowed but only first column with a duplicated tag is reachable via columnconfigure.
The font for the column descriptions.
Either »2D« or »3D«. Defines the visual appearance for the rtl_mlistbox header. A 2D fashioned windows uses a flat appearance, where the header row uses inverted foreground and background colors. A 3D fashioned a pseudo 3D appearance. The header row repeats the colors from their respective columns.
The internal listbox. The kind of the internal listbox can be defined prior creation. listType is a static property.
The used list must conform to the Tk listbox interface.
Rtl_mlistbox, hugelist or listbox can be used.
A color. »-gridColor« is used for vertical and horizontal lines inside the window.
Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either single, browse, multiple, or extended; the default value is browse.
Boolean value. This rtl_mlistbox accepts drag-and-drop for single selection.
Only rtl_mlistbox windows with »-selectMode« set to »single« support drag-and-drop.
Boolean value. A »-sortable« rtl_mlistbox allows the sorting of columns.
Sorting is not built-in the rtl_mlistbox, any sort operation is delegated to the registered »-sortcommand«.
Call back command. Registers what command has to be evaluated in response to a sort operation.
Example 3.7. Using Sort
proc sortnotifier { mlistbox sortedColumn sortby } { … } # Register sorting and sort notifier. rtl_mlistbox .mlistbox \ -sortable 1 \ -sortcommand sortnotifier ...
See also »-sortable«.
Menu window path name. This menu is posted in response to a right-click (context) on the header row.
Boolean value. Allows individual colors for the contained columns.
The specific column color is retrieved from the option database. The various option database entries are »color0« for the first column, »color1« for the second column, »color2« for the third column ...
The »rtl_mlistbox« command creates a »rtl_mlistbox« window.
»rtl_mlistbox« is a multi-column listbox. The internal used »listbox« class can be replaced –before creation– via the »-listtype« property.
To-Do: checklength --lock using it until a map event arrived, so that out-of-order customization is possible ; or seek a mechanism which applies the properties in their correct order.
Should work, through the attributes list.
Version 3.0: Multi-selection is possible, now. Including browse, extended, single. Not tested is »multiple«. This various selection modes are only possible by using the real (emulated) listbox interface, introduced in this version. The drag-and-drop feature remains available in single select mode, only. Otherwise it is disabled as a side-effect of setting »selectMode«.
-state -dragable -selectmode -takefocus
The rtl_mlistbox version 3.0 allows cascading designs. A rtl_mlistbox may be used inside of another rtl_mlistbox, in truth there is no limit to how many cascading rtl_mlistboxes are being used. In addition Drag-and-Drop is isolated from normal bindings. this makes it possible to support other »selecMode« operations. Many bindings have been revised, too. The rtl_mlistbox behaves now like any other listbox. In consequence the interface is almost identical to a Tk listbox.
- headingsanchor Modified, synchronizes anchor and justify. Needed for SVG code generation.
pathName selection pathName see pathName scan pathName index
Many new interface elements for listbox compliance: selection (replaces select), see, scan, index.
aquamlistbox
--more specific see for the triangle color usage, this is currently not yet correct. Not a part of the RTL, there is a »aquahead« inside the »Gestalt Items«, which turns the rtl_mlistbox header row into an AQUA compliant header, including gradient, select color, triangle back color, activate and deactivate.
Version 2.0: -fashion -headerFont -sortable -sortCommand -listtype -gridColor -menu -useColumnColors
Sort & Reorder. These two functions are the missing ones to complete the multi-list-box implementation. Sort –as sort always should be done– is done where the data is stored. The multi-listbox is just a representation of this data. Therefore the multi-listbox is not allowed to sort it's listbox contents on its own. A call back mechanism is provided to notify the sorting type as well as what column is to be sorted. Second thought about TypeOf: In essence any abitrary window type could substitute the listboxes. This means rtl_mlistbox is in effect also a so-called paned window. New properties:
headerFont: allow a separate font for the header row, required for OSX –the AQUA header font is application 10 bold.
Added selectforeground to complement selectbackground.
New Color Schema: The Header Color should be the inverse color of the list boxes -foreground/background. There should be a single line separating listboxes.
New properties: fashion & listtype (internal as: fashion & typeOf).
Fashion allows to switch between a positive and negative header schema. The negative header schema is described above. The two fashions are defined as 2D & 3D –3D because there is a raised border between the listboxes and the header section.
Listtype: Provides the ability to replace the internal used listbox control with something else. Most likely a virtual listbox –lets call it vistbox.
A Window created through the rtl_mlistbox command exposes various functions. Using these functions has the following general form:
(option object ?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 rtl_mlistbox 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 rtl_mlistbox command.
The last element of a drag and drop operation. Here the interactive dnd bindings must be eliminated again. Revision : 12/17/2008, Roger
Reduce associative list $alist to sorted list according to column tags of rtl_mlistbox. For Column tags not contained as key within $alist, empty list elements are inserted.
Execute a given code sequence in the realm of Tk... usually a listbox command. Originates from an event handler.
Creates a backup of private Tk data and applies the same initial data before any window is invoked. This function does not work with cascading mlistboxes.
tkCommand is endangered. The mutlti-column-listbox has gained a full listbox interface. tkCommand is a crude way to bypass the implementation of such an interface. Rewritten : 12/17/2008, Roger
Execute command on first column if specified widget exists. Revision : 08/20/2009, Roger -list & guarded
Scroll command interface- This is called from the scrollbars, and makes a detour through yview ... as yscrollcommand. Double values for PageDown and Up originate from hugelist, not from rtl_mlistbox.
fixme (Roger) 12/18/2008 : Hugelist, do-yscroll may be called n-times this can be identified by looking whether »widget« is a listbox_n and not listbox_0. Not possible here.
Has to be dealt with inside the event handler. There are real events such as B2-Motion which will be disrupted. Cause is inside hugelist. The scroll behavior is correct for »listbox«.
Issue solved inside »yview«. yview uses a semaphore to lock against recursive calls. This will have no effect on listbox, but prevents recurring yview calls originating from a hugelist.
Revision : 12/18/2008, Roger
Check length of value list fixme (Roger) 12/13/2008 :checklength must be altered so that it is technically feasible to predefine any data needed to customize the given mlistbox. Test against »headeranchor«, »headings«, »columns« and »headerfont«.
Restart of a drag and drop operation. Similar to »button-press-cb«, a underway drag and drop operation is violated. And a new one gets started. Revision : 12/17/2008, Roger
Drag'n'Drop. This section is only valid for single selected listboxes, hence the property dragable.
Whenever selectmode is altered and not equal to »single« »dragable« is turned off.
DND bindings are applied on a special bindgroup. This allows temporary dnd operations on a single rtl_mlistbox without interfering with other usages. Revision : 12/17/2008, Roger
procedures for column width resize per drag-and-drop
Iterate over the sort indicators for the given »column«. Written : 2006, Roger
Tells the rtl_mlistbox to sort »column«. Written : 2006, Roger
Propagate see to each contained listbox. Written : 11/19/2008, Roger
Build associative list from $vallist. $vallist usually looks like result from method 'get'.
Get specified lines from listboxes
Resize canvas when frame was resized. Revision : 06/12/2008, Roger –Added troughColor adjust.
Set visible interval in y-direction.
A semaphore is used to block recursive calls, initiated from a hugelist array. See also comment on »do-yscroll«.
Position retrievable is still allowed.
Affected events: B2-Motion, PageUp, PageDown, Multi -Down and -Up such as generated by a Wacom tabloid scrollwheel. Possibly affected ScrollWheel.
Tested for cascading designs, too. Revision : 12/18/2008, Roger
Search column specified by $tag for pattern $pattern.
Execute same command on specified component in each column of mlb.
Get line indices of current selection
Select line (not existing for single listbox)
OBSOLETE
The listbox interface (selection set is used), replaces this event handler... it exists only for backward compatibly. DO NOT USE ANYMORE
See event handler <1>. Revision : 12/17/2008, Roger
Get line count of rtl_mlistbox, that is the 'size' of the first listbox.
Propagate scan to each contained listbox. Written : 12/17/2008, Roger
COMMENT: Collecting the items for the columns instead of inserting them row wise may slow down the process because 'eval' is needed to perform the insertion operation. On Windows systems, for which this procedure is optimized, this version is faster.
Clear up data storage for widget instance and destroy widget. fixme (Roger) 12/13/2008 :inject the trace for aqua headers into this procedure ...
Set content of column specified by tag.
Missing selection interface. This interface is used for any sort of selection. Most definite by browse and extended selectMode It is also needed in case of cascading listboxes. That is, whenever rtl_mlistboxes are deployed by rtl_mlistboxes... can be multiple levels! Written : 11/06 + 12/17/2008, Roger
Comfortable resize of width of specific column. Revision : 09/07/2009, Roger- ResIn.
Missing interface element. Written : 11/06/2008, Roger
Secondary constructor for widgets of type mlistbox. Initialize instance specific variable. Revision : 12/17/2008, Roger
A drag and drop operation is underway and the visual feedback --a simple toplevel window-- gets moved according to the current position. Revision : 12/17/2008, Roger
Call back »-command« is evaluated, whenever a double-click happened inside a listbox. Rewritten : 12/18/2008, Roger–Simplified.
Get content of column specified by tag.