Manpower

Check-in [b1cd9f7086]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rev bump
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b1cd9f708623260ea276b4898b1a3531ceb05acd
User & Date: kevin 2018-04-23 02:05:08
Context
2018-04-26
03:20
Fix errors in softwareupdate package check-in: f97787a0ac user: kevin tags: trunk
2018-04-23
02:05
Rev bump check-in: b1cd9f7086 user: kevin tags: trunk
2017-12-09
05:27
Further tweak of services api check-in: 9950b08b34 user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to libs/machelp/help.txt.

   140    140    * The "rman" tool for man page formatting. Website and license: [http://polyglotman.sourceforge.net/].
   141    141    * The "aem" package for custom Apple Event handling.  Website and license: [http://fossil.codebykevin.com].
   142    142   
   143    143   
   144    144   -------------------
   145    145   title: Manpower Version History
   146    146   alias: Version History
          147  +
          148  +'''6.7 (April 20, 2018):'''
          149  + * Migrate to new source code server. 
          150  + * Minor bug fixes.
   147    151   
   148    152   '''6.6 (December 1, 2017):'''
   149    153    * UI enhancements.
   150    154   
   151    155   '''6.5 (May 1, 2017):'''
   152    156    * Improved scrolling performance, security support on macOS.
   153    157   
................................................................................
   241    245   
   242    246   -------------------
   243    247   title: License
   244    248   alias: License
   245    249    
   246    250   '''The MIT License (MIT)'''
   247    251   
   248         -Manpower source code: [http://fossil.codebykevin.com/fossil.cgi/manpower/]
          252  +Manpower source code: [https://www.codebykevin.com/fossil.cgi/manpower/]
   249    253   
   250         -Copyright (c) 2017 WordTech Communications LLC
          254  +Copyright (c) 2018 WordTech Communications LLC
   251    255   
   252    256   Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
   253    257   
   254    258   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
   255    259   
   256    260   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changes to libs/manpower/manpower-main.tcl.

     1      1   # Manpower: Man page browser and viewer 
     2      2   
     3         -#Copyright (C) 2017  WordTech Communications LLC
            3  +#Copyright (C) 2018  WordTech Communications LLC
     4      4   
     5      5   #MIT license
     6      6   
     7      7   #let's get started
     8      8   
     9      9   package require Img
    10     10   package require BWidget
................................................................................
  1241   1241       global appversion
  1242   1242       global datadir
  1243   1243       global rmanpath
  1244   1244       global cachedir
  1245   1245       global searchterm
  1246   1246       global mynode
  1247   1247       
  1248         -    appname::setAppName Manpower 6.6
         1248  +    appname::setAppName Manpower 6.7
  1249   1249   
  1250   1250   
  1251   1251       set rmanpath [file join [file dirname [info script]] rman]
  1252   1252   
  1253   1253       
  1254   1254       #check for app support directory
  1255   1255       set appdir [file join $::env(HOME) "Library" "Application Support" "Manpower"]
................................................................................
  1363   1363       singleManPage
  1364   1364   }
  1365   1365   
  1366   1366   
  1367   1367   #custom "about" dialog
  1368   1368   proc aboutWindow {} {
  1369   1369   
  1370         - tk_messageBox -parent . -icon info -title "About Manpower" -message "Manpower: Man Page Viewer" -detail "Version 6.6\n(c)2017 WordTech Communications LLC"
         1370  + tk_messageBox -parent . -icon info -title "About Manpower" -message "Manpower: Man Page Viewer" -detail "Version 6.7\n(c)2018 WordTech Communications LLC"
  1371   1371   
  1372   1372   }
  1373   1373   
  1374   1374   #raise window if closed--dock click
  1375   1375   proc ::tk::mac::ReopenApplication {} {
  1376   1376   
  1377   1377       if { [wm state .] == "withdrawn"} {

Changes to libs/softwareupdate/softwareupdate.tcl.

    61     61   	variable currentversion
    62     62   	variable versionnumber
    63     63   
    64     64   	set appname $app
    65     65   
    66     66   	softwareupdate::checkingForUpdates
    67     67   
    68         -	set versionurl https://www.codebykevin.com/$appname-version.tcl
           68  +	set versionurl [string tolower https://www.codebykevin.com/$appname-version.tcl]
    69     69   	http::config -useragent "$appname Update Check"
    70     70   
    71     71   	if [catch {http::geturl $versionurl} msg] {
    72         -	    puts "error: $msg"
           72  +	    if {[tk windowingsystem] ne "win32"} { puts "error: $msg"}
    73     73   	    tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent .
    74     74   	catch {destroy .updateprogress}
    75     75   	    return
    76     76   	} 
    77     77   
    78     78   	set versionnumber [string trim [http::data [http::geturl $versionurl]]]
    79     79   	if [expr $currentversion < $versionnumber] {
................................................................................
   130    130   
   131    131   	catch {destroy .updateprogress}
   132    132   
   133    133   	catch {destroy .update}
   134    134   	
   135    135   	variable appname
   136    136   
   137         -	set changeurl https://www.codebykevin.com/$appname-changes.tcl
          137  +	set changeurl [string tolower https://www.codebykevin.com/$appname-changes.tcl]
   138    138   
   139    139           if [catch {http::geturl $changeurl} msg] {
   140         -	    puts "error: $msg"
          140  +	    if {[tk windowingsystem] ne "win32"} { puts "error: $msg"}
   141    141   	    tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent .
   142    142   	    catch {destroy .updateprogress}
   143    143   	    return
   144    144   	} 
   145    145   
   146    146   
   147    147   	set changelist [http::data [http::geturl $changeurl]]

Deleted libs/tablelist5.16/CHANGES.txt.

     1         -What is new in Tablelist 5.16?
     2         -------------------------------
     3         -
     4         -1.  Added the "-autofinishediting" configuration option, relevant for
     5         -    interactive cell editing via a combobox or menubutton widget (thanks
     6         -    to Alexandru Dadalau for his proposal).
     7         -
     8         -2.  On Windows Vista, 7, 8, and 10, the sort arrows are now shown
     9         -    horizontally centered in the header labels and attached to their top
    10         -    edges.
    11         -
    12         -3.  Added the arrow style "photo7x4" as well as its automatically scaled
    13         -    versions "photo9x5", "photo11x6", and "photo15x8", used as defaults
    14         -    on Windows Vista, 7, and 8.
    15         -
    16         -4.  Added the tree style "mint2", suiting version 18 of the Linux Mint
    17         -    distribution.
    18         -
    19         -5.  Support for fully qualified edit window names of the form "::ttk::*"
    20         -    (thanks to Adrian Medrano Calvo for his proposal).
    21         -
    22         -6.  Worked around a text widget issue introduced in Tk 8.6.6 (thanks to
    23         -    Peter Spjuth, Harald Oehlmann, and Rene Zaumseil for their valuable
    24         -    input).
    25         -
    26         -7.  Improvements related to the "move" and "movecolumn" subcommands as
    27         -    well as to the management of the images used in sort arrows (thanks
    28         -    to Adrian Medrano Calvo and Torsten Berg for their proposals).
    29         -
    30         -8   Drastically increased the speed of the "collapse" and "collapseall"
    31         -    subcommands with the "-fully" option (thanks to Ulrich Seidl for
    32         -    reporting the pure performance of "collapseall -fully").
    33         -
    34         -9.  Adapted the implementation of the "delete" subcommand to the changed
    35         -    text widget behavior in Tk 8.6.5 (thanks to Ulrich Seidl for his bug
    36         -    report).
    37         -
    38         -10. Fixed a bug related to the "curcellselection" subcommand (thanks to
    39         -    Juge for his bug report).
    40         -
    41         -What was new in Tablelist 5.15?
    42         --------------------------------
    43         -
    44         -1. Support for Windows 10, including the new tree style "win10", whose
    45         -   size is automatically adapted to the display's scaling level.
    46         -
    47         -2. Added the arrow styles "flatAngle11x6" and "flatAngle15x8", needed
    48         -   for automatic scaling of the default arrow style "flatAngle7x4" on
    49         -   Windows 10.
    50         -
    51         -3. The variable "tablelist::scalingpct", used by Tablelist when adapting
    52         -   the sizes of several tree styles to the display's DPI scaling level,
    53         -   is now documented in Tablelist Programmer's Guide.
    54         -
    55         -4. Worked around a text widget bug introduced in Tk 8.5.18 and 8.6.4
    56         -   (fixed for the next Tk versions).
    57         -
    58         -5. Fixed a bug that prevented the subcommands "see end", "see last", and
    59         -   "yview moveto 1" from working as expected if the tablelist widget
    60         -   contains multi-line cells or large images (thanks to Harald Oehlmann
    61         -   for his bug report and to Francois Vogel for discussions on this
    62         -   subject).
    63         -
    64         -What was new in Tablelist 5.14?
    65         --------------------------------
    66         -
    67         -1. Added the "-colorizecommand" configuration option, enabling you to
    68         -   change the colors of arbitrary character regions within the cells of
    69         -   the currently visible tablelist rows (thanks to Peter Spjuth for his
    70         -   proposal).
    71         -
    72         -2. The "curcellselection" and "curselection" subcommands now accept an
    73         -   optional argument with the possible values "-all", "-nonhidden", and
    74         -   "-viewable" (thanks to Will Duquette for his proposal).
    75         -
    76         -3. Added the tree styles "plain1", ..., "plain4", "bicolor1", ...,
    77         -   "bicolor4", and "classic1", ..., "classic4", suitable for use with
    78         -   large fonts and images (needed on high-resolution displays).  In
    79         -   addition, the sizes used by the tree styles "vistaAero",
    80         -   "vistaClassic", "win7Aero", and "win7Classic" are now automatically
    81         -   adapted to the display's scaling level (thanks to Harald Oehlmann for
    82         -   his proposal).
    83         -
    84         -4. On Windows Vista and later, automatic scaling is now performed for
    85         -   the default arrow style, too.  This made is necessary to add the
    86         -   arrow styles "flat11x6" and "flat15x8".
    87         -
    88         -5  Added the arrow style "flat8x4" and the tree style "ubuntu2", suiting
    89         -   version 15.04 of the Ubuntu Linux distribution.  Similarly, added the
    90         -   tree style "yuyo", inspired by the GTK+ theme Yuyo on Ubuntu MATE.
    91         -
    92         -6. Changed the default arrow color "" and arrow style "sunken10x9" to
    93         -   "black" and "flat7x5" on the windowing system "x11" and for the tile
    94         -   themes "alt", "clam", "default", "kroc", "sriv", "srivlg", and "step"
    95         -   (POTENTIAL INCOMPATIBILITY!).
    96         -
    97         -7. In case of "-selecttype cell", the row containing the active cell is
    98         -   now displayed with raised relief (thanks to Holger Jakobs for his
    99         -   proposal).
   100         -
   101         -8. Guarded against invocations of the "update" command from within
   102         -   binding scripts associated with the <<TablelistSelect>> virtual
   103         -   event (thanks to Martyn Smith for his bug report and discussions on
   104         -   this topic).
   105         -
   106         -9. Worked around some unexpected events in certain X11 environments,
   107         -   which prevented Tablelist 5.13 from starting the interactive cell
   108         -   editing in such environments (thanks to Toni Giorgino for his bug
   109         -   report and helping me to reproduce this problem).
   110         -
   111         -What was new in Tablelist 5.13?
   112         --------------------------------
   113         -
   114         -1. Added support for Mac OS X 10.10 (Yosemite) (thanks to Kevin Walzer
   115         -   for his proposal).
   116         -
   117         -2. Renamed the four arrow styles having the shape of an angle from
   118         -   "flat7x5", ..., "flat10x6" to "flatAngle7x5", ..., "flatAngle10x6"
   119         -   (POTENTIAL INCOMPATIBILITY!); added the arrow styles "flat7x5",
   120         -   "flat9x6", "flatAngle7x4" (which is now the default on Yosemite),
   121         -   "flatAngle9x5", and "flatAngle10x7".
   122         -
   123         -3. Added the tree style "mate", inspired by a few GTK+ themes of the
   124         -   MATE desktop.
   125         -
   126         -4. Added the "-showeditcursor" configuration option, used to let the
   127         -   cursor take on the shape of a pencil whenever a mouse click would
   128         -   start an editing session (thanks to Rene Zaumseil and Cesare
   129         -   Bavazzano for their proposals).
   130         -
   131         -5. New column configuration option "-changetitlesnipside", which allows
   132         -   you to override the alignment-specific default snip side for the
   133         -   column's title (thanks to John Vella for his proposal).
   134         -
   135         -6. Support for the word "last" as row, column, cell, or child index,
   136         -   indicating the last row/column/cell of the tablelist or the last
   137         -   child of a given parent node (remember that the meaning of "end" as a
   138         -   row, column, or child index is subcommand-specific).
   139         -
   140         -7. The description of the "imagelabelpath" subcommand in the reference
   141         -   manual now contains an example showing how to define bindings for the
   142         -   embedded images.
   143         -
   144         -8. Eliminated the endless loop generated by the "yview" subcommand when
   145         -   synchronizing two or more tablelist widgets (thanks to Paul Obermeier
   146         -   for his bug report).
   147         -
   148         -What was new in Tablelist 5.12.1?
   149         ----------------------------------
   150         -
   151         -This is a bugfix-only release.  The corrected files in the "scripts"
   152         -directory are "tablelistEdit.tcl" and "tablelistUtil.tcl".
   153         -
   154         -1. Appended the missing 4th argument to the two invocations of the
   155         -   procedure "tablelist::moveOrActivate" in the file
   156         -   "tablelistEdit.tcl" (thanks to Patrick Fradin and Ralf Fassel for
   157         -   their bug reports).
   158         -
   159         -2. Fixed a typo in the file "tablelistUtil.tcl" (Thanks to Patrick
   160         -   Fradin for reporting this bug).
   161         -
   162         -What was new in Tablelist 5.12?
   163         --------------------------------
   164         -
   165         -1. Added the "-customdragsource" configuration option, used to indicate
   166         -   whether the tablelist widget is a drag source for some drag & drop
   167         -   implementation other than TkDND and the drag & drop framework
   168         -   included in BWidget.
   169         -
   170         -2. Improvements and extensions in the default binding scripts.  Besides
   171         -   providing full compatibility with the Tk listbox, they now perform an
   172         -   automatic drag-friendly handling of the selection and of pointer
   173         -   movements with mouse button 1 down if the "-customdragsource" option
   174         -   was set to true or the tablelist's body was registered as a TkDND or
   175         -   BWidget drag source (thanks to Will Duquette for his proposal).  The
   176         -   same holds true for the local drag & drop via the "move" subcommand.
   177         -
   178         -3. Added the "hidetargetmark", "showtargetmark", "targetmarkpath", and
   179         -   "targetmarkpos" subcommands, for enhanced drop target support (thanks
   180         -   to Trevor Williams for his proposal).
   181         -
   182         -4. Added a "Drag & Drop Support" section to the reference manual, with
   183         -   examples demonstrating the use of the new subcommands mentioned
   184         -   above in a tablelist widget registered as a TkDND or BWidget drop
   185         -   target.
   186         -
   187         -5. The visibility of the horizontal separator placed just below the last
   188         -   tablelist row if the value of the "-showseparators" option is true
   189         -   and that of the "-fullseparators" option is false, can now be 
   190         -   controlled with the aid of the new "-showhorizseparator"
   191         -   configuration option (thanks to Martyn Smith for his proposal).
   192         -
   193         -6. New values "flat5x3" and "flat5x4" for the "-arrowstyle"
   194         -   configuration option, suiting current versions of the Ubuntu Linux
   195         -   distribution.
   196         -
   197         -7. Adapted the look & feel of the tree styles "adwaita", "ubuntu", and
   198         -   "mint" to current versions of the GTK+ 3 theme Adwaita and of the
   199         -   Linux distributions Ubuntu Linux and Linux Mint, respectively.
   200         -
   201         -8. Fixed a long-standing bug related to horizontal scrolling in an empty
   202         -   tablelist widget with positve "-titlecolumns" value (thanks to Ulrich
   203         -   Seidl for his bug report).
   204         -
   205         -What was new in Tablelist 5.11?
   206         --------------------------------
   207         -
   208         -1. Added the "findrowname" and "findcolumnname" subcommands (thanks to
   209         -   Adrian Medrano Calvo for his proposal and discussions on this
   210         -   subject).
   211         -
   212         -2. Collapsing a row no longer leads to renumbering the lines for the
   213         -   purpose of updating a column configured to display the line numbers
   214         -   (thanks to Will Duquette for his proposal).
   215         -
   216         -3. For improved appearance, if the value of the "-showseparators" option
   217         -   is true and that of the "-fullseparators" option is false, then a
   218         -   horizontal separator is now placed just below the last tablelist row
   219         -   (thanks to Allan Silverstein for his proposal).
   220         -
   221         -4. Worked around a peculiarity of Tk on Windows, which caused problems
   222         -   when resizing the tablelist window in the presence of embedded images
   223         -   or multi-line elements (thanks to Will Duquette for his bug report).
   224         -
   225         -5. Added the missing actualization of the active and anchor row indices
   226         -   after moving an item to a different position (thanks to Will Duquette
   227         -   for his bug report).
   228         -
   229         -6. Fixed two bugs in Tablelist_tile, related to header labels with
   230         -   embedded images (thanks to Ulrich Seidl for his bug reports).
   231         -
   232         -7. Numerous further improvements in the code and documentation.
   233         -
   234         -What was new in Tablelist 5.10?
   235         --------------------------------
   236         -
   237         -1.  Added the "-acceptdropcommand" configuration option, used to control
   238         -    whether the local drag & drop may move a specified item just before
   239         -    a given row (thanks to Nagu and Georgios Petasis for discussions on
   240         -    this subject).
   241         -
   242         -2.  Added the "-instanttoggle" configuration option, related to the cell
   243         -    editing with the aid of a Tk or tile checkbutton (thanks to Rich
   244         -    Wellner for his proposal and discussions on this topic).
   245         -
   246         -3.  Added the "-tight" configuration option, used to eliminate the
   247         -    one-pixel additional space left below each tablelist row for Tk
   248         -    listbox compatibility (thanks to Koen Breugelmans for his proposal
   249         -    and discussions on this subject).
   250         -
   251         -4.  Added the "isviewable" and "viewablerowcount" subcommands (thanks to
   252         -    Nagu for proposing the latter).
   253         -
   254         -5.  Improvements related to the value of the "-data" option for the
   255         -    virtual events <<TablelistColumnMoved>> and <<TablelistRowMoved>>
   256         -    (thanks to Georgios Petasis for discussions on this topic).
   257         -
   258         -6.  The item deletion has become significantly faster, especially in
   259         -    tablelists used as tree widgets and in the presence of embedded
   260         -    images and/or multi-line elements (thanks to Rob Ratcliff and Rene
   261         -    Zaumseil for requesting this performance improvement).
   262         -
   263         -7.  Guarded against column deletions from within non-default binding
   264         -    scripts for the header labels (thanks to Ulrich Seidl for his
   265         -    input).
   266         -
   267         -8.  Restored the support for Tcl/Tk versions earlier than 8.3, by
   268         -    cleaning up the use of elided text in the underlying text widget.
   269         -    Similarly, restored the support for Tcl/Tk 8.0, by cleaning up the
   270         -    use of "regsub" and that of the <MouseWheel> event (thanks to Joerg
   271         -    Mueck for reporting the first two issues).
   272         -
   273         -9.  Improved the package loading mechanism (thanks to Paul Obermeier for
   274         -    his bug report).
   275         -
   276         -10. Guarded against potential item insertions or deletions from within
   277         -    the command specified as the value of the "-editendcommand" option
   278         -    (thanks to Julian H J Loaring for his bug report).
   279         -
   280         -11. Guarded against deletion of embedded images or windows from within
   281         -    the command specified as the value of the "-tooltipaddcommand"
   282         -    option (thanks to Jan Kandziora for his bug report).
   283         -
   284         -12. Fixed a bug related to column deletion if the "-selecttype" option
   285         -    has the value "cell" (thanks to Ulrich Seidl for his bug report).
   286         -
   287         -13. Several further code improvements and minor bug fixes.
   288         -
   289         -What was new in Tablelist 5.9?
   290         -------------------------------
   291         -
   292         -1. Added the "-valign" column and cell configuration option, for
   293         -   controlling the vertical alignment of embedded images and windows
   294         -   (thanks to Trevor Williams for his proposal).
   295         -
   296         -2. The "-stripebackground" and "-stripeforeground" options can now be
   297         -   specified at column level, too (thanks to Christian Gollwitzer for
   298         -   his proposal).
   299         -
   300         -3. Improvements related to the Windows 7 platform.
   301         -
   302         -4. Worked around a text widget bug in Tk versions 8.5 and later, related
   303         -   to getting the index of the last line in the window if some of the
   304         -   lines are elided (thanks to Bernhard Wallner for his bug report).
   305         -
   306         -5. Corrected a typo in the implementation of the "rowconfigure"
   307         -   subcommand, introduced in the last Tablelist version (thanks to Jerzy
   308         -   Witkowski for reporting this bug).
   309         -
   310         -6. Fixed a bug related to resetting the "-(select)background" and
   311         -   "-(select)foreground options at column, row, and cell levels,
   312         -   introduced in the previous Tablelist version (thanks to Christian
   313         -   Gollwitzer for his bug report).
   314         -
   315         -7. Several further improvements in the code, demo scripts, and
   316         -   documentation.
   317         -
   318         -What was new in Tablelist 5.8?
   319         -------------------------------
   320         -
   321         -1.  Support for interactive cell editing with the aid of the ctext
   322         -    widget (thanks to Sait Dogru for his proposal).
   323         -
   324         -2.  Added the "canceledediting" subcommand (thanks to Martyn Smith for
   325         -    his proposal).
   326         -
   327         -3.  The "selection" and "cellselection" subcommands have become by
   328         -    orders of magnitude faster (thanks to Jean-Francois Beaud for his
   329         -    input that motivated me to speed up these subcommands).
   330         -
   331         -4.  The "-(select)background" and "-(select)foreground options at
   332         -    column, row, and cell levels now impose by far less performance
   333         -    penalty than in earlier Tablelist versions.
   334         -
   335         -5.  The keyboard traversal during interactive cell editing is now aware
   336         -    of changes like appending a new row, performed by the procedure
   337         -    specified as the value of the "-editendcommand" configuration option
   338         -    (thanks to Andreas Leitgeb for his proposal).
   339         -
   340         -6.  For Tk versions 8.5 or later, most virtual events are now generated
   341         -    with the "-data" option set to a suitable event-specific value
   342         -    (thanks to Christian Gollwitzer, Andreas Leitgeb, and Nagu for their
   343         -    proposals).
   344         -
   345         -7.  Improvements related to the selection mode "extended".
   346         -
   347         -8.  Worked around a peculiarity of Tk on Windows, related to deleting an
   348         -    embedded window while resizing a text widget interactively (thanks
   349         -    to Harald Oehlmann for his bug report and discussions on this
   350         -    topic).
   351         -
   352         -9.  Eliminated a regression introduced in Tablelist version 5.6, related
   353         -    to vertical scrolling under Tk 8.5 or later in the presence of
   354         -    embedded images or windows (thanks to Patrick Fradin for reporting
   355         -    this bug).
   356         -
   357         -10. Fixed a screen refresh problem introduced in Tablelist version 5.6,
   358         -    related to wrapped multiline elements (thanks to Rob for his bug
   359         -    report).
   360         -
   361         -11. Further code improvements (thanks to Harald Oehlmann for his
   362         -    valuable contribution).
   363         -
   364         -12. Added a "Virtual Events" section to the reference manual (thanks to
   365         -    Andreas Leitgeb for his proposal).
   366         -
   367         -What was new in Tablelist 5.7?
   368         -------------------------------
   369         -
   370         -1.  Added the "cellbbox" subcommand.
   371         -
   372         -2.  Added the "editinfo" subcommand (thanks to Trevor Williams for his
   373         -    proposal).
   374         -
   375         -3.  Adapted the tree styles "ubuntu" and "mint" to the latest Ubuntu
   376         -    Linux and Linux Mint releases.
   377         -
   378         -4.  Minor change related to the ttk::combobox widget used as edit window
   379         -    (thanks to Julian H J Loaring for his input).
   380         -
   381         -5.  Improved the multi-platform support by increased use of virtual
   382         -    events.
   383         -
   384         -6.  Worked around a bug in some earlier Tk versions, related to
   385         -    checkbuttons without indicator (thanks to Allan Silverstein for his
   386         -    input).
   387         -
   388         -7.  Restored the support for Tcl/Tk versions earlier than 8.4, which has
   389         -    been broken since the previous Tablelist release, due to the use of
   390         -    the "namespace exists" command, introduced in Tcl 8.4 (thanks to
   391         -    Ralf Fassel for drawing my attention to this issue).
   392         -
   393         -8.  Fixed a copy & paste bug related to embedded windows, introduced in
   394         -    the previous Tablelist version (thanks to Heng Li and David Hanks
   395         -    for their bug reports).
   396         -
   397         -9.  Fixed a long-standing bug related to the "cancelediting" subcommand
   398         -    and the "-forceeditendcommand" option (thanks to Julian H J Loaring
   399         -    for his bug report).
   400         -
   401         -10. Fixed a long-standing minor bug that caused the "-labelbg" column
   402         -    configuration option to be accepted by Tablelist_tile, contrary to
   403         -    the option of the same name at widget level (thanks to Bernhard
   404         -    Wallner for his bug report).
   405         -
   406         -11. Several further improvements in the code and demo scripts (thanks to
   407         -    Patrick Fradin for his valuable contribution and to Marianne Baumann
   408         -    for her input related to the "-showlabels" option).
   409         -
   410         -What was new in Tablelist 5.6?
   411         -------------------------------
   412         -
   413         -1.  Added the tree styles "adwaita", "mint", and "ubuntu", inspired by a
   414         -    few GTK+ 3 themes on popular Linux distributions.
   415         -
   416         -2.  Added the "-windowupdate" cell configuration option (thanks to
   417         -    Trevor Williams for his valuable contribution).
   418         -
   419         -3.  The item insertion and sorting have become significantly faster,
   420         -    especially when using static-width columns.
   421         -
   422         -4.  Embedded windows are now hidden during interactive cell editing
   423         -    (thanks to Trevor Williams for discussions on this subject).
   424         -
   425         -5.  Extended the support for the "tileqt" theme to work on KDE 4, too.
   426         -
   427         -6.  Improvements in the documentation (thanks to Glenn Herteg for his
   428         -    proposal).
   429         -
   430         -7.  Guarded against the case that a tablelist widget is deleted and its
   431         -    name is reused for a widget of a different class (thanks to Roger
   432         -    Niva for his valuable input).
   433         -
   434         -8.  Guarded against scripts that start by destroying all children of the
   435         -    root window (thanks to Helmut Giese and Gerhard Kraus for drawing my
   436         -    attention to this case).
   437         -
   438         -9.  Fixed two bugs related to the "move" subcommand, introduced in
   439         -    Tablelist version 5.2 (thanks to "DrS" and Trevor Williams for their
   440         -    bug reports).
   441         -
   442         -10. Several further improvements and minor bug fixes.
   443         -
   444         -What was new in Tablelist 5.5?
   445         -------------------------------
   446         -
   447         -1. Hidden tablelist elements are no longer excluded from the selection
   448         -   (thanks to Martyn Smith for his proposal).  (They are, however,
   449         -   ignored when exporting the selection.)
   450         -
   451         -2. Added the "cornerpath" and "cornerlabelpath" subcommands.  The first
   452         -   one makes it quite easy to respect the native Mac OS X look & feel,
   453         -   where the vertical scrollbar appears placed under the header (thanks
   454         -   to Torsten Berg for a related page on the Wiki, which provided me the
   455         -   idea for these subcommands).  The "cornerpath" subcommand is now used
   456         -   in all demo scrips that contain vertical scrollbars.
   457         -
   458         -3. Added support for the appearance-related changes introduced in Mac
   459         -   OS X 10.7 (Lion).
   460         -
   461         -4. On Mac OS X Aqua, the default values of the "-move(column)cursor"
   462         -   and "-resizecursor" options are now native cursors.  Besides
   463         -   improving the look & feel of tablelist widgets on the Mac, this
   464         -   change also works around the problem that on Mac OS X 10.7, Tk
   465         -   versions 8.5 and 8.6 can only use native and native-mapped cursors.
   466         -
   467         -5. Removed the "-labelbackground" option from Tablelist_tile, because
   468         -   current versions of the tile engine no longer support setting the
   469         -   background color for the header labels (and even with earlier tile
   470         -   versions, some themes ignored any attempt to change the background
   471         -   color of the header labels).
   472         -
   473         -6. Adapted the code to some changes in current tile versions, to make
   474         -   sure that in disabled state the tile-based column labels will appear
   475         -   in the theme-specific disabled foreground color, as it was the case
   476         -   with earlier tile versions (thanks to "tombert" for his related
   477         -   posting on comp.lang.tcl).
   478         -
   479         -7. Improved a few binding scripts (thanks to Ulrich Seidl for his bug
   480         -   report and testing).
   481         -
   482         -8. Fixed a bug related to embedded windows in a tablelist used as a
   483         -   tree widget (again, thanks to Ulrich Seidl for his bug report and
   484         -   testing).
   485         -
   486         -9. Several further improvements in the code, demo scripts, and
   487         -   documentation.
   488         -
   489         -What was new in Tablelist 5.4?
   490         -------------------------------
   491         -
   492         -1. Added the "-populatecommand" configuration option, used by the
   493         -   "searchcolumn" subcommand to insert child items on demand before
   494         -   checking whether they contain the specified pattern.
   495         -   
   496         -2. Added the "-autoscan" configuration option, which can be used to
   497         -   deactivate the automatic scrolling triggered by leaving the
   498         -   tablelist window with mouse button 1 down, in order to avoid any
   499         -   conflicts with drag & drop via tkdnd (thanks to Patrick Fradin for
   500         -   his valuable contribution).
   501         -
   502         -3. New "isexpanded" subcommand.
   503         -
   504         -4. New value "flat9x6" for the "-arrowstyle" configuration option.
   505         -
   506         -5. Adapted the tree style "oxygen2" to the look of current KDE 4
   507         -   versions.
   508         -
   509         -6. Worked around some peculiarities of Tk on Mac OS X Aqua (thanks to
   510         -   Torsten Berg for her problem report and discussions on this topic).
   511         -
   512         -7. Improved the check for PNG support in Tk (thanks to Ian Gay for his
   513         -   posting on the Wiki related to this subject).
   514         -
   515         -8. Fixed a bug related to the tree style "aqua", introduced in
   516         -   Tablelist version 5.3 (thanks to Julian H J Loaring for his bug
   517         -   report).
   518         -
   519         -9. Numerous further improvements in the code and documentation.
   520         -
   521         -What was new in Tablelist 5.3.1?
   522         ---------------------------------
   523         -
   524         -This release contains just one bug-fix and an enhancement:
   525         -
   526         -1. Fixed a bug related to the "-hide" row configuration option,
   527         -   introduced in the previous Tablelist version (thanks to Ralf Fassel
   528         -   and Michal Sosnowski for their bug reports).
   529         -
   530         -2. Extended the support for the native "Aqua-blue" background for the
   531         -   header label of the sort column (which in the previous Tablelist
   532         -   release was restricted to Tk versions 8.6 and above) to the Cocoa-
   533         -   based Tk patch levels 8.5.9 and above (thanks to Kevin Walzer for
   534         -   discussions on this topic and to Paul Obermeier for enabling me to
   535         -   access the ActiveTcl 8.5.8 distribution for the Mac).
   536         -
   537         -What was new in Tablelist 5.3?
   538         -------------------------------
   539         -
   540         -1. The interactive row move operation (i.e., local drag & drop) now
   541         -   supports moving an item outside its parent and dropping it under
   542         -   another item as a child (thanks to Dr. Detlef Groth for his
   543         -   proposal, thorough testing, and discussions on this topic).
   544         -
   545         -2. Added the "-acceptchildcommand" configuration option, related to the
   546         -   local drag & drop.
   547         -
   548         -3. New "searchcolumn" subcommand, supporting a rich set of options
   549         -   (thanks to Matthew Callaghan, Adrian Davis, and Jeff Godfrey for
   550         -   their proposals).
   551         -
   552         -4. New "getformatted", "getformattedcolumns", and "getformattedcells"
   553         -   subcommands.
   554         -
   555         -5. Support for interactive cell editing with the aid of the Tk core and
   556         -   tile menubutton widgets (thanks to Georgios Petasis for his
   557         -   proposal).
   558         -
   559         -6. Support for the row indices "top" and "bottom" (thanks to Julian H J
   560         -   Loaring and Paul Obermeier for their proposals).  Likewise, support
   561         -   for the column indices "left" and "right".
   562         -
   563         -7. New value "photo7x7" for the "-arrowstyle" configuration option,
   564         -   needed for the "aqua" theme.
   565         -
   566         -8. Adapted the appearance of tablelist widgets on the Macintosh to
   567         -   current versions of OS X Aqua.
   568         -
   569         -9. Numerous further improvements and minor bug fixes.
   570         -
   571         -What was new in Tablelist 5.2?
   572         -------------------------------
   573         -
   574         -1.  Added the "-fullseparators" configuration option (thanks to Kevin
   575         -    Partin, Martyn Smith, and Harald Oehlmann for their proposals).
   576         -
   577         -2.  Added the tree styles "ambiance", "dust", "dustSand", "newWave",
   578         -    "plastik", and "radiance".
   579         -
   580         -3.  The implementation of the "collapse(all)" and "expand(all)"
   581         -    subcommands no longer makes use of the "-hide" row configuration
   582         -    option, hence you are now free to set the latter (via
   583         -    "rowconfigure", "configrowlist", "configrows", or "togglerowhide"),
   584         -    regardless of whether the tablelist widget displays a tree
   585         -    hierarchy or just a plain list.
   586         -
   587         -4.  The "move" subcommand now supports moving an item outside its
   588         -    parent.
   589         -
   590         -5.  Deleting the whole content of a tablelist widget has become
   591         -    significantly faster (thanks to Harold Campbell for his input).
   592         -
   593         -6.  Worked around a peculiarity of the text widget related to tag
   594         -    handling when deleting a range of lines from its end (thanks to
   595         -    Batox for his bug report).
   596         -
   597         -7.  Minor improvements and bug-fixes in the binding scripts (thanks to
   598         -    Bernhard Wallner, Batox, and Roger Niva for their bug reports).
   599         -
   600         -8.  Fixed a bug related to the "-selecttype cell" configuration option,
   601         -    (re)introduced in Tablelist version 5.0 (thanks to Harold Campbell
   602         -    and Dietmar Mueller for their bug reports).
   603         -
   604         -9.  Fixed a bug related to row hiding via "configrowlist" or
   605         -    "configrows", introduced in Tablelist version 5.0 (thanks to Michal
   606         -    Sosnowski for his bug report).
   607         -
   608         -10. Fixed a long-standing bug related to tooltip support (thanks to
   609         -    Trevor Williams for his bug report).
   610         -
   611         -11. Several further improvements and minor bug fixes.
   612         -
   613         -What was new in Tablelist 5.1?
   614         -------------------------------
   615         -
   616         -This is a bugfix-only release.  The corrected files in the "scripts"
   617         -directory are "tablelistBind.tcl", "tablelistSort.tcl",
   618         -"tablelistUtil.tcl", and "tablelistWidget.tcl".
   619         -
   620         -1. Fixed a bug related to item deletion, introduced in the previous
   621         -   Tablelist version (thanks to Aric Bills and Roger Niva for their bug
   622         -   reports).
   623         -
   624         -2. Fixed a bug related to multi-column sorting, introduced in the
   625         -   previous Tablelist version (thanks to Albrecht Mucha for his bug
   626         -   report).
   627         -
   628         -3. Fixed a long-standing bug related to column deletion (thanks to
   629         -   Liang Sian Yin for his bug report).
   630         -
   631         -4. Fixed a few further minor bugs and typos, introduced in the previous
   632         -   Tablelist version (thanks to Patrick Fradin, Roger Niva, Harald
   633         -   Oehlmann, and Peter Spjuth for their bug reports).
   634         -
   635         -What was new in Tablelist 5.0?
   636         -------------------------------
   637         -
   638         -1.  A tablelist widget is now not only a multi-column listbox, but also
   639         -    a multi-column tree widget (thanks to Sebastien Barre, Tillmann
   640         -    Basien, Jos Decoster, Dr. Detlef Groth, Kai Morich, Georgios
   641         -    Petasis, and Kevin Walzer for their proposals, as well as to Paul
   642         -    Obermeier for testing the preliminary version).  This is achieved
   643         -    with the aid of the new configuration options "-collapsecommand",
   644         -    "-expandcommand", "-treecolumn", and "-treestyle", along with the
   645         -    new subcommands "childcount", "childindex", "childkeys", "collapse",
   646         -    "collapseall", "depth", "descendantcount", "expand", "expandall",
   647         -    "expandedkeys", "insertchild(ren)", "insertchildlist", "noderow",
   648         -    "parentkey", and "toplevelkey".
   649         -
   650         -2.  Added the "-editselectedonly" configuration option, related to
   651         -    starting the interactive cell editing with mouse button 1 (thanks to
   652         -    Julian H J Loaring for discussions on this topic).
   653         -
   654         -3.  New values "flat6x4", "flat9x7", and "flat10x6" for the
   655         -    "-arrowstyle" configuration option.
   656         -
   657         -4.  New value "asciinocase" for the "-sortmode" column configuration
   658         -    option.
   659         -
   660         -5.  New subcommands "applysorting", "getfullkeys", and "refreshsorting".
   661         -
   662         -6.  Two new demo scripts (and their tile-based counterparts)
   663         -    illustrating the use of a tablelist as multi-column tree widget.
   664         -
   665         -7.  The subcommands "insert", "insertlist", "insertchild(ren)", and
   666         -    "insertchildlist" now return the list of full keys corresponding to
   667         -    the items just inserted.
   668         -
   669         -8.  Fixed a long-standing bug related to the "-labelfont" option (thanks
   670         -    to Jacek Jendrysik for his bug report).
   671         -
   672         -9.  Fixed a bug related to the "-text" column configuration option
   673         -    (thanks to Paul Obermeier for his bug report).
   674         -
   675         -10. Fixed a long-standing bug related to embedded windows in right-
   676         -    aligned columns (thanks to Jerzy Witkowski for his bug report).
   677         -
   678         -11. Numerous further improvements in the code and documentation.
   679         -
   680         -What was new in Tablelist 4.12?
   681         --------------------------------
   682         -
   683         -1.  Added the "labeltag" subcommand and the helper command "tablelist::
   684         -    getTablelistColumn", designed to be used in non-default binding
   685         -    scripts for the header labels.
   686         -
   687         -2.  Support for interactive cell editing with the aid of the tile
   688         -    spinbox widget.  The demo script "tileWidgets.tcl" now uses this
   689         -    widget when available.
   690         -
   691         -3.  Support for interactive cell editing with the aid of the new mentry
   692         -    widget for IPv6 addresses.
   693         -
   694         -4.  Improved the support for Windows Vista and added explicit support
   695         -    for the "vista" theme.
   696         -
   697         -5.  Updated the support for the themes "plastik" and "keramik"; added
   698         -    support for the "keramik_alt" theme.
   699         -
   700         -6.  Support for the native "Aqua-blue" background, set for the header
   701         -    label of the sort column (thanks to Kevin Walzer for his proposal
   702         -    and valuable contribution).  For technical reasons, this feature is
   703         -    only supported for Mac-Tk versions using Cocoa.
   704         -
   705         -7.  Further improvements in the support for Mac OS X Aqua (thanks to
   706         -    Daniel Steffen and Kevin Walzer for their valuable feedback).
   707         -
   708         -8.  Improvements in the binding scripts related to interactive cell
   709         -    editing (thanks to Hadas Porat for discussions on this subject).
   710         -
   711         -9.  The binding for the <Double-Button-1> event in the resize area of a
   712         -    column header now works as expected for large lists, too.
   713         -
   714         -10. Eliminated a minor regression related to interactive cell editing,
   715         -    introduced in the previous Tablelist version (thanks to Kai Morich
   716         -    for his valuable input).
   717         -
   718         -11. Fixed a small bug related to interactive cell editing with the aid
   719         -    of a text widget (thanks to Bryan Oakley for his bug report and
   720         -    valuable suggestion).
   721         -
   722         -12. Fixed a long-standing bug related to the "-listvariable" option in
   723         -    disabled state (thanks to Ralf Fassel for his bug report).
   724         -
   725         -13. Added a version-related hint to the "How to use it?" section of the
   726         -    Tablelist Programmer's Guide.
   727         -
   728         -What was new in Tablelist 4.11?
   729         --------------------------------
   730         -
   731         -1.  Added the "-columntitles" configuration option, which is mainly a
   732         -    simplified form of the "-columns" option (thanks to Roy Terry for
   733         -    his proposal).
   734         -
   735         -2.  Added the virtual events <<TablelistColHiddenStateChanged>> and
   736         -    <<TablelistRowHiddenStateChanged>>, generated after toggling the
   737         -    hidden state of a column or row, respectively (thanks to Jeff 
   738         -    Godfrey for his proposal).
   739         -
   740         -3.  Besides with <Button-3>, the optimal column width can now be set
   741         -    with <Double-Button-1> in the resize area of the column's header.
   742         -    Similarly, the effect of <Shift-Button-3> can also be achieved with
   743         -    <Shift-Double-Button-1> in the column label's resize area.
   744         -
   745         -4.  Support for Windows Vista (thanks to Jeremy Cowgar for his input).
   746         -
   747         -5.  The recommended package name is now "tablelist" rather than
   748         -    "Tablelist", for compatibility with the ActiveTcl distribution; the
   749         -    demo scripts have been changed accordingly.
   750         -
   751         -6.  Made sure that the "-tooltipdelcommand" configuration option won't
   752         -    affect other widgets (thanks to Jeff Godfrey for drawing my
   753         -    attention to this issue).
   754         -
   755         -7.  Fixed a long-standing nasty bug related to the "yview" subcommand
   756         -    (thanks to Nestor Patino for his bug report and very helpful example
   757         -    script).
   758         -
   759         -8.  Fixed two bugs related to the "-listvariable" configuration option
   760         -    (again, thanks to Nestor Patino for his valuable input).
   761         -
   762         -9.  Fixed a bug related to the item deletion when using Tcl/Tk 8.5
   763         -    (thanks to Jos Decoster and Sven Wuytack for their valuable
   764         -    contribution to finding and fixing this bug).
   765         -
   766         -10. Fixed a bug related to the "-windowdestroy" cell configuration
   767         -    option, introduced in Tablelist 4.9 (thanks to Sebastien Barre for
   768         -    his bug report).
   769         -
   770         -What was new in Tablelist 4.10?
   771         --------------------------------
   772         -
   773         -1.  Support for individual binding scripts controlling the interactive
   774         -    cell editing, with the aid of the new "editwintag" subcommand
   775         -    (thanks to Oscar Fuentes for his valuable input).
   776         -
   777         -2.  Complemented the "attrib" subcommand with the new subcommands
   778         -    "hasattrib" and "unsetattrib".
   779         -
   780         -3.  Support for column-, row-, and cell-specific attributes, with the
   781         -    aid of the new subcommands "columnattrib", "hascolumnattrib",
   782         -    "unsetcolumnattrib", "rowattrib", "hasrowattrib", "unsetrowattrib",
   783         -    "cellattrib", "hascellattrib", and "unsetcellattrib".
   784         -
   785         -4.  Support for interactive cell editing with the aid of the new mentry
   786         -    widget of type "DateTime", introduced in version 3.2 of the Mentry
   787         -    package (thanks to Florian Murr for his proposal).
   788         -
   789         -5.  Made sure that the default bindings are set up immediately when
   790         -    loading the package, prior to creating any tablelist widget (thanks
   791         -    to Schelte Bron for his proposal and discussions on this topic).
   792         -
   793         -6.  Re-established the support for tile widgets as edit windows in non-
   794         -    tile-based tablelist widgets (again, thanks to Schelte Bron for
   795         -    reporting that this was broken in the last few Tablelist versions).
   796         -
   797         -7.  Adapted the handling of the tile checkbutton as edit window in the
   798         -    "xpnative" theme to some changes made in tile 0.8 (thanks to Jeff
   799         -    Godfrey for his bug report).
   800         -
   801         -8.  Guarded against potential widget deletion from within user-defined
   802         -    binding scripts or "update (idletasks)" (thanks to Schelte Bron and
   803         -    Jan Kandziora for their bug reports).
   804         -
   805         -9.  Updated the (very rarely needed) distribution file "repair.tcl" to
   806         -    work with current Tablelist versions (thanks to Robert Stollf for
   807         -    his bug report).
   808         -
   809         -10. Corrected the description of the "-height" option in the reference
   810         -    manual (thanks to Glenn Herteg for his bug report concerning the
   811         -    case "-height 0").
   812         -
   813         -11. Improved the color handling in the "disabled" state (thanks to Rolf
   814         -    Ade for his bug report and discussions on this topic).
   815         -
   816         -12. Made the handling of elided text more robust (thanks to Jos Decoster
   817         -    for his bug report and valuable contribution).
   818         -
   819         -13. Several further improvements and minor bug fixes (thanks to Albrecht
   820         -    Mucha for his valuable input).
   821         -
   822         -What was new in Tablelist 4.9?
   823         -------------------------------
   824         -
   825         -1.  Added the "-wrap" column configuration option, which makes it
   826         -    possible to display long texts in word-wrapped multi-line rather
   827         -    than snipped form (thanks to Alexander Schoepe and Anant Adke for
   828         -    their proposals).  Also, added support for interactive cell editing
   829         -    with a word- or char-wrapped text widget when using Tk 8.5 (thanks
   830         -    to Juberi Rajib for discussions on this topic).
   831         -
   832         -2.  Support for dynamic-width embedded windows, with the aid of the new
   833         -    "-stretchwindow" cell configuration option (thanks to Kurt Kurczyk,
   834         -    Bryan Oakley, and Rasmus Debitsch for their proposals). The demo
   835         -    script "embeddedWindows.tcl" and its tile-based counterpart now make
   836         -    use of this option.
   837         -
   838         -3.  New "formatinfo" subcommand, returning information about the cell
   839         -    whose content is being formatted by a command specified as the value
   840         -    of the "-formatcommand" column configuration option (thanks to Goran
   841         -    Ivankovic and Sebastien Barre for their proposals).
   842         -
   843         -4.  Changed the default value of the "-activestyle" configuration option
   844         -    from "underline" to "frame" and that of the "-setfocus" option from
   845         -    0 to 1, making them conform to similar changes in Tk 8.5 related to
   846         -    the listbox widget.
   847         -
   848         -5.  Improved the appearance of the header labels for the "aqua" theme
   849         -    (thanks to Torsten Berg for discussing this topic on the Wiki).
   850         -
   851         -6.  Eliminated the potential invocation of the "unknown" command from
   852         -    within the Tablelist code (thanks to Roger Niva for discussions on
   853         -    this topic).
   854         -
   855         -7.  When starting the interactive cell editing with the aid of a
   856         -    combobox widget, the list associated with the latter is only dropped
   857         -    down if the combobox is read-only (thanks to Bryan Oakley for his
   858         -    proposal).
   859         -
   860         -8.  The "setThemeDefaults" command no longer throws an error if the
   861         -    current theme is not explicitly supported by Tablelist.  Instead, it
   862         -    uses the options set by the current theme and falls back to the
   863         -    "default" one for the rest (thanks to Schelte Bron for his valuable
   864         -    contribution).
   865         -
   866         -9.  Improved the tablelist widget's appearance when the header labels
   867         -    are not shown (thanks to Mark Garvey for his input).
   868         -
   869         -10. Fixed two bugs related to the optimized item insertion (thanks to
   870         -    Harold Campbell and Bryan Oakley for their bug reports).
   871         -
   872         -11. Fixed a bug related to the "-showlinenumbers" column configuration
   873         -    option (thanks to Martin Lemburg for his bug report).
   874         -
   875         -12. Several further improvements and minor bug fixes.
   876         -
   877         -What was new in Tablelist 4.8?
   878         -------------------------------
   879         -
   880         -This release fixes a few nasty bugs related to the optimized item
   881         -insertion, introduced in the previous Tablelist version (thanks to
   882         -Harold Campbell, Roger Niva, and Joerg Klingseisen for their bug
   883         -reports).
   884         -
   885         -What was new in Tablelist 4.7?
   886         -------------------------------
   887         -
   888         -1.  Significant performance improvements related to the "insert",
   889         -    "rowconfigure", "sort", "sortbycolumn", and "sortbycolumnlist"
   890         -    subcommands (thanks to Harold Campbell for his valuable
   891         -    contribution to speeding up the item insertion).  The extent of the
   892         -    speed-up depends on the configuration options present at column,
   893         -    row, and cell levels.
   894         -
   895         -2.  Support for cell- and column label-specific balloon help, with the
   896         -    aid of the new configuration options "-tooltipaddcommand" and
   897         -    "-tooltipdelcommand".
   898         -
   899         -3.  New subcommands "iselemsnipped" and "istitlesnipped", which make it
   900         -    very easy to display the full cell texts and column titles as
   901         -    tooltips for cells and header labels with snipped contents.
   902         -
   903         -4.  New subcommands "configcolumnlist", "configcolumns",
   904         -    "configrowlist", "configrows", "configcelllist", and "configcells",
   905         -    which allow you to configure several columns/rows/cells with a
   906         -    single command invocation (thanks to Harold Campbell, Jeff Godfrey,
   907         -    and Paul Obermeier for their proposals).
   908         -
   909         -5.  Worked around some performance problems regarding the "switch"
   910         -    command in Tcl 8.5a6/8.5b1 and ActiveTcl 8.4.14.
   911         -
   912         -6.  Made sure that ActiveState's "style::as" package won't break the
   913         -    mousewheel bindings (thanks to Michael Schlenker for drawing my
   914         -    attention to this problem).
   915         -
   916         -7.  Improved the focus handling when resizing a column interactively
   917         -    (thanks to Jorge Enderr for his bug report).
   918         -
   919         -8.  Corrected a typo in the adaptation of vertical scrolling to the
   920         -    text widget changes made in Tk 8.5 (thanks to Julian M Noble for
   921         -    his posting on the Wiki related to this subject).
   922         -
   923         -9.  Fixed a bug related to hidden rows when having "-selecttype cell",
   924         -    introduced in Tablelist version 4.3 (thanks to Harold Campbell for
   925         -    his bug report and discussions on this subject).
   926         -
   927         -10. Fixed a bug in the "cellconfigure" subcommand, introduced in the
   928         -    previous Tablelist release (thanks to Roy Terry for reporting this
   929         -    problem on the Wiki).
   930         -
   931         -11. Fixed a bug in the "-changesnipside" option (thanks to Kai Morich
   932         -    for his bug report).
   933         -
   934         -12. Numerous further improvements in the code and documentation.
   935         -
   936         -What was new in Tablelist 4.6?
   937         -------------------------------
   938         -
   939         -1.  Tablelist_tile now supports tile 0.8 and Tk 8.5a6/8.5b1 (where tile
   940         -    is integrated in the core).  The new commands "tablelist::setTheme",
   941         -    "tablelist::getCurrentTheme", and "tablelist::getThemes" enable you
   942         -    to set and get the current theme and to query the available ones,
   943         -    without having to worry about the incompatibilities between the
   944         -    various tile versions.
   945         -
   946         -2.  New column configuration option "-changesnipside", which allows you
   947         -    to override the alignment-specific default snip side (thanks to
   948         -    Georgios Petasis for his proposal).
   949         -
   950         -3.  New "columnwidth" subcommand, with the options "-requested",
   951         -    "-stretched", and "-total" (thanks to Matthew Callaghan, Richard
   952         -    Finstad, Lieven Forrez, and Tom Roeder for their proposals).
   953         -
   954         -4.  Support for the new virtual event <<TablelistColumnResized>>,
   955         -    generated after resizing a column interactively (thanks to Kurt
   956         -    Kurczyk for his proposal).
   957         -
   958         -5.  Visual improvement:  Within an active row, the gap to the left or
   959         -    right of an embedded image or window no longer appears underlined
   960         -    (when the "-activestyle" option has its default value "underline").
   961         -
   962         -6.  Embedded images and windows are no longer hidden during interactive
   963         -    cell editing (except the editing with the aid of a Tk or tile
   964         -    checkbutton widget).
   965         -
   966         -7.  Significantly improved the redraw and stretching behavior when
   967         -    resizing a column interactively.
   968         -
   969         -8.  Eliminated some annoying visual effects caused by hidden columns
   970         -    when displaying the items of an already visible tablelist widget
   971         -    (thanks to Rolf Ade for discussions on this topic).
   972         -
   973         -9.  Adapted the implementation of vertical scrolling to the text widget
   974         -    changes made in Tk 8.5 (thanks to Julian M Noble for his posting on
   975         -    the Wiki related to this subject).
   976         -
   977         -10. Fixed a bug related to hidden rows, introduced in Tablelist version
   978         -    4.3 (thanks to Matthew Callaghan for his bug report).
   979         -
   980         -11. Eliminated the possible endless loop caused by some option database
   981         -    settings in the "seecell" subcommand (thanks to Erik Allaert and
   982         -    Mauro Comin for reporting this bug).
   983         -
   984         -12. Added a detailed performance-related hint to the description of the
   985         -    "-listvariable" configuration option.
   986         -
   987         -13. Numerous further improvements and minor bug fixes.
   988         -
   989         -What was new in Tablelist 4.5?
   990         -------------------------------
   991         -
   992         -1.  Static-width columns are now displayed much faster than in earlier
   993         -    Tablelist releases.
   994         -
   995         -2.  Quite significantly reduced the performance penalty imposed by
   996         -    various column, row, and cell configuration options when sorting,
   997         -    redisplaying, moving, or deleting tablelist items.
   998         -
   999         -3.  Embedded images are now handled much more efficiently and are
  1000         -    displayed much faster than in earlier Tablelist versions.
  1001         -
  1002         -4.  New column configuration option "-showlinenumbers" (thanks to Rolf
  1003         -    Schroedter and Sean Xu for their proposals and to Kathrin Klaes for
  1004         -    testing the implementation).
  1005         -
  1006         -5.  Support for tile-based multi-entry widgets (introduced in Mentry
  1007         -    3.0) used as edit windows.
  1008         -
  1009         -6.  Significantly improved the handling of the <<ThemeChanged>> virtual
  1010         -    event.
  1011         -
  1012         -7.  Defined more reasonable windowing system- and theme-specific default
  1013         -    values for the "-arrowdisabledcolor" option.
  1014         -
  1015         -8.  Improved and simplified the package loading mechanism (thanks to
  1016         -    Andreas Kupries for his valuable contribution).
  1017         -
  1018         -9.  Eliminated the "togglevisibility" subcommand, which was deprecated
  1019         -    in the previous Tablelist version in favor of "togglecolumnhide".
  1020         -
  1021         -10. Fixed a bug in the implementation of the "deletecolumns" subcommand,
  1022         -    introduced in the previous Tablelist release (thanks to Kai Morich,
  1023         -    Kurt Kurczyk, and Dave Leslie for their bug reports).
  1024         -
  1025         -11. Fixed two binding-related bugs (thanks to Mark Garvey and Kurt
  1026         -    Kurczyk for their bug reports).
  1027         -
  1028         -12. Fixed a bug related to the handling of the "tileqt" theme (thanks to
  1029         -    Andres Garcia for his bug report).
  1030         -
  1031         -13. Fixed a small but annoying bug related to the "-maxwidth" column
  1032         -    configuration option, introduced in the previous Tablelist version.
  1033         -
  1034         -14. Numerous further improvements and minor bug fixes (thanks to
  1035         -    Patrick Fradin and Georgios Petasis for their valuable feedback).
  1036         -
  1037         -What was new in Tablelist 4.4?
  1038         -------------------------------
  1039         -
  1040         -1.  New row configuration option "-hide" (thanks to Jeff Godfrey,
  1041         -    Patrick Fradin. Hemang Lavana, and Martyn Smith for their
  1042         -    proposals, and especially to Harold Campbell for providing the
  1043         -    initial implementation and testing the final one.)  For performance
  1044         -    reasons this option is implemented by using elided text in the
  1045         -    underlying text widget, and therefore it is not supported for Tk
  1046         -    versions earlier than 8.3.
  1047         -
  1048         -2.  New subcommand "togglerowhide" for hiding/unhiding several rows at
  1049         -    a time (not supported for Tk versions earlier than 8.3).
  1050         -
  1051         -3.  Renamed the "togglevisibility" subcommand to "togglecolumnhide".
  1052         -    The old name is still supported, but will be eliminated in the next
  1053         -    Tablelist release.
  1054         -
  1055         -4.  New command "tablelist::setThemeDefaults", which can be used to
  1056         -    make sure that classical Tk widgets, e.g., text, will have a theme-
  1057         -    specific appearance, just like the tile widgets.  The tile-based
  1058         -    demo scripts now make use of this command.
  1059         -
  1060         -5.  When using the "tileqt" theme, the version number of TileQt must be
  1061         -    0.3 or higher (thanks to Georgios Petasis for providing the new
  1062         -    "tileqt" features used in this Tablelist release).
  1063         -
  1064         -6.  For Tk 8.3 or later, hidden columns are now handled by using elided
  1065         -    text, which results in very significant performance improvements
  1066         -    (thanks to Harold Campbell for his valuable contribution).
  1067         -
  1068         -7.  Improved the handling of the "-listvariable" option in connection
  1069         -    with snit widgetadaptors (thanks to Rolf Ade for his bug-fix).
  1070         -
  1071         -8.  Corrected a typo in the implementation of the "move" subcommand,
  1072         -    introduced in the previous release (thanks to Jerome Siot for his
  1073         -    bug report).
  1074         -
  1075         -9.  Improved the handling of the virtual event <<ThemeChanged>> (thanks
  1076         -    to Wofgang Grosser for his bug report).
  1077         -
  1078         -10. Fixed a long-standing bug related to hidden columns (thanks to Dave
  1079         -    Leslie for his bug report).
  1080         -
  1081         -11. Worked around a peculiarity of the "place" command on Windows,
  1082         -    which caused refresh problems in column labels with images (thanks
  1083         -    to Sebastien Barre for his bug report).
  1084         -
  1085         -12. Numerous further improvements and minor bug fixes.
  1086         -
  1087         -What was new in Tablelist 4.3?
  1088         -------------------------------
  1089         -
  1090         -1. Support for multi-line cells:  Newline characters now force line
  1091         -   breaks when displaying the items (thanks to Sebastien Barre,
  1092         -   Tillmann Basien, Cameron Laird, Kai Morich, and Vaclav Snajdr for
  1093         -   their proposals).  In addition, interactive cell editing can now
  1094         -   take place with the aid of a text widget, too (this has caused a few
  1095         -   minor changes in the default key bindings for the edit window).
  1096         -
  1097         -2. Support for multi-column sorting with the aid of the new subcommands
  1098         -   "sortbycolumnlist", "sortcolumnlist", and "sortorderlist", as well
  1099         -   as of the new command "tablelist::addToSortColumns".  The latter is
  1100         -   designed to be specified as the value of the new widget and column
  1101         -   configuration option "-labelcommand2", whose value is invoked on 
  1102         -   <Shift-Button-1> events.  Multi-column sorting is visualized by
  1103         -   means of multiple sort arrows, which are displayed together with the
  1104         -   corresponding sort ranks.  (Thanks to Harold Campbell for proposing
  1105         -   most of these features, providing the initial implementation, and
  1106         -   testing the final one.)
  1107         -
  1108         -3. New configuration option "-setfocus", specifying whether mouse
  1109         -   button 1 should set the focus to the tablelist's body (thanks to
  1110         -   Tillmann Basien for discussions on this topic).
  1111         -
  1112         -4. Replaced the contents of the directory "images" with a script file
  1113         -   containing procedures that create the bitmap images from inline data
  1114         -   (thanks to Mats Bengtsson, Patrick Fradin, and Kai Morich for their
  1115         -   proposals).
  1116         -
  1117         -5. Fixed a bug related to the use of a tile entry within a non-tile-
  1118         -   based tablelist widget on Windows XP (thanks to Schelte Bron for his
  1119         -   bug report).
  1120         -
  1121         -6. The handling of <Command-Key> events during interactive cell editing
  1122         -   is now explicitly restricted to Mac OS Classic and Mac OS X Aqua,
  1123         -   because, strangely enough, on Windows these events are generated by
  1124         -   simple keypresses if Num Lock is active.
  1125         -
  1126         -7. Numerous further code improvements, minor bug-fixes, and support for
  1127         -   several recent changes in tile.
  1128         -
  1129         -8. Cleaned up the documentation, to make sure that the HTML files
  1130         -   generated for the ActiveTcl distribution with the tool HTML Tidy
  1131         -   will be syntactically identical to the original ones.
  1132         -
  1133         -What was new in Tablelist 4.2?
  1134         -------------------------------
  1135         -
  1136         -1.  The resize area of the header labels now consists of a few pixels
  1137         -    on both sides of the right edge (thanks to Bryan Oakley for
  1138         -    suggesting this improvement).
  1139         -
  1140         -2.  Made sure that the header labels have the right appearance in the
  1141         -    "aqua" theme when using tile version 0.6.4 or later (thanks to
  1142         -    Bryan Oakley for his bug report).
  1143         -
  1144         -3.  Several further improvements related to Mac OS X Aqua (for example,
  1145         -    support for the "Command" key during keyboard navigation between
  1146         -    the editable cells).
  1147         -
  1148         -4.  Fixed a very long-standing bug in the "containing" subcommand
  1149         -    (thanks to Mats Bengtsson, Schelte Bron, and Mark Garvey for their
  1150         -    bug reports).
  1151         -
  1152         -5.  Fixed a bug related to the "xpnative" theme, introduced in the
  1153         -    previous release (thanks to Mark Garvey, Jeff Godfrey, and Uwe
  1154         -    Koloska for their bug reports).
  1155         -
  1156         -6.  Fixed another very long-standing bug, related to insertion and
  1157         -    deletion of columns having images in their labels (thanks to
  1158         -    Sebastien Barre for his bug report).
  1159         -
  1160         -7.  Fixed an old bug related to embedding images or windows into hidden
  1161         -    cells (again, thanks to Sebastien Barre for reporting this bug).
  1162         -
  1163         -8.  The demo scripts now work independently of their location (this
  1164         -    small improvement reflects the fact that Tablelist is now included
  1165         -    in tklib, where the examples are in a location different from
  1166         -    "$tablelist::library/demos").
  1167         -
  1168         -9.  Adapted two tile-based demo scripts to the recently released tile
  1169         -    version 0.7.
  1170         -
  1171         -10. Several further improvements in the code and documentation (thanks
  1172         -    to Patrick Fradin for his valuable contribution).
  1173         -
  1174         -What was new in Tablelist 4.1?
  1175         -------------------------------
  1176         -
  1177         -1.  Significantly extended the tile support in the Tablelist_tile
  1178         -    package:  Header labels now look and behave like the column
  1179         -    headings of treeview widgets, and over a dozen configuration
  1180         -    options have theme-specific default values (thanks to Paul
  1181         -    Obermeier for his excellent "poImgview" application, which helped
  1182         -    me a lot during this work, as well as to Georgios Petasis for his
  1183         -    Qt-related hints).
  1184         -
  1185         -2.  Header labels containing the mouse cursor are now set into active
  1186         -    state.  Their appearance is controlled in the Tablelist package by
  1187         -    the new configuration options "-labelactivebackground" and
  1188         -    "-labelactiveforeground", while the Tablelist_tile package uses
  1189         -    theme-specific background and foreground colors for the active and
  1190         -    pressed states of the labels.
  1191         -
  1192         -3.  New configuration option "-arrowstyle", specifying the flat or
  1193         -    sunken relief and the dimensions of the arrow indicating the
  1194         -    sorting order.  This option has windowing system- and theme-
  1195         -    specific default values.
  1196         -
  1197         -4.  New configuration option "-protecttitlecolumns", used to protect
  1198         -    the title column boundary from being crossed when moving a column
  1199         -    interactively (thanks to Schelte Bron for his proposal).
  1200         -
  1201         -5.  New configuration option "-spacing", specifying additional space to
  1202         -    provide above and below each tablelist row (thanks to Sebastien
  1203         -    Barre for his proposal).
  1204         -
  1205         -6.  New column configuration option "-stretchable", complementing the
  1206         -    global "-stretch" option (thanks to Sebastien Barre for his
  1207         -    proposal).
  1208         -
  1209         -7.  New row configuration option "-name", whose value can also be used
  1210         -    as a row index and as the first component of a cell index (thanks
  1211         -    to John Kozura for his proposal).
  1212         -
  1213         -8.  New cell configuration option "-windowdestroy", specifying a script
  1214         -    to be invoked when a window embedded into the cell is destroyed
  1215         -    (thanks to Sebastien Barre for his proposal).
  1216         -
  1217         -9.  New "imagelabelpath" subcommand (thanks to Schelte Bron for his
  1218         -    proposal).
  1219         -
  1220         -10. Keyboard navigation during interactive cell editing now works on
  1221         -    Mac OS X Aqua, too.
  1222         -
  1223         -11. Restored the support for Tcl/Tk versions earlier than 8.3, by
  1224         -    cleaning up the handling of the "-titlecolumns" option (thanks to
  1225         -    Andreas Flach and Brian O'Hagan for their bug reports).
  1226         -
  1227         -12. Restored the support for Tcl/Tk versions earlier than 8.0.4, which
  1228         -    has been broken since release 3.5, due to the use of the
  1229         -    <MouseWheel> event, introduced in Tk 8.0.4 (thanks to Brian O'Hagan
  1230         -    for his valuable contribution).
  1231         -
  1232         -13. Worked around a peculiarity of the text widget's "dump -window"
  1233         -    command (thanks to Greg Reynolds for his bug-fix).
  1234         -
  1235         -14. Fixed a binding-related bug in "extended" selection mode (thanks to
  1236         -    David Mattinson for his bug-fix).
  1237         -
  1238         -15. Numerous further improvements and minor bug fixes (thanks to
  1239         -    Schelte Bron, Patrick Fradin, Silas Justiniano, and Uwe Koloska for
  1240         -    their bug reports and valuable contributions).
  1241         -
  1242         -What was new in Tablelist 4.0?
  1243         -------------------------------
  1244         -
  1245         -1.  Support for the tile entry, combobox, and checkbutton widgets for
  1246         -    interactive cell editing (thanks to Miguel Bagnon, Andy Black,
  1247         -    Adrian Chan, and Mark Garvey for their proposals and to Mats
  1248         -    Bengtsson and Kevin Walzer for their support on the Macintosh).
  1249         -    See the new reference page "tablelistTile.html" for details.
  1250         -
  1251         -2.  Support for tile-compatibility:  By just specifying "package
  1252         -    require Tablelist_tile" instead of "package require Tablelist", the
  1253         -    tablelist widgets will have a modern theme-specific appearance
  1254         -    (again, thanks to the above-mentioned Tablelist users for their
  1255         -    suggestions and assistance).  See the "How to use it?" and "More on
  1256         -    Tablelist_tile" sections of the tutorial "tablelist.html" for
  1257         -    details.
  1258         -
  1259         -3.  New demo script "tileWidgets.tcl", illustrating the use of tile
  1260         -    widgets for interactive cell editing and of the Tablelist_tile
  1261         -    package.  All the other demo scripts are now provided in both a
  1262         -    traditional and a tile-based version.  See the "Tile-based demo
  1263         -    scripts" section of the tutorial "tablelist.html" for an example
  1264         -    and some screenshots.
  1265         -
  1266         -4.  The Tk checkbutton used for interactive cell editing is now a
  1267         -    platform-specific checkbutton widget on Windows and the Macintosh
  1268         -    (thanks to Mats Bengtsson for his help related to the Macintosh
  1269         -    platform).
  1270         -
  1271         -5.  The "-editwindow" option is now available at cell level, too
  1272         -    (thanks to Kenneth Green for his proposal).
  1273         -
  1274         -6.  New subcommand "togglevisibility" for hiding/unhiding several
  1275         -    columns at a time (thanks to Stefan Finzel and Kai Morich for their
  1276         -    proposals).
  1277         -
  1278         -7.  Support for the new virtual event <<TablelistSelectionLost>>,
  1279         -    generated when a tablelist widget having "-exportselection 1" loses
  1280         -    the selection (thanks to Aldo Buratti for his proposal).
  1281         -
  1282         -8.  After sorting the items, the "most important" row is automatically
  1283         -    brought into view (thanks to Kai Morich for his valuable input).
  1284         -
  1285         -9.  Worked around a peculiarity of Tk for Windows, related to mouse
  1286         -    events (thanks to Tore Morkemo and Mike Collins for their bug
  1287         -    reports).
  1288         -
  1289         -10. Worked around a problem related to the visibility of the up/down-
  1290         -    arrow on Mac OS X Aqua (thanks to Kevin Walzer for his bug report).
  1291         -
  1292         -11. Fixed a bug in the "seecell" subcommand, introduced in Tablelist
  1293         -    version 3.7 (thanks to Stefan Finzel for his bug report).
  1294         -
  1295         -12. Fixed a bug in the "rowconfigure" subcommand, introduced in the
  1296         -    previous Tablelist release (thanks to Tore Morkemo for his bug
  1297         -    report).
  1298         -
  1299         -13. Eliminated the memory leak caused by incomplete cleanup on deleting
  1300         -    rows with embedded windows (thanks to David Cockerell for his bug
  1301         -    report).
  1302         -
  1303         -14. Fixed a small timing-related bug in the "editcell" subcommand
  1304         -    (thanks to Kenneth Green for his bug report).
  1305         -
  1306         -15. Numerous further improvements and minor bug fixes (thanks to Greg
  1307         -    Reynolds for his valuable input).
  1308         -
  1309         -What was new in Tablelist 3.8?
  1310         -------------------------------
  1311         -
  1312         -1. New configuration option "-forceeditendcommand", controlling the
  1313         -   invocation of the script corresponding to the value of the
  1314         -   "-editendcommand" option (thanks to Nestor Patino for his proposal).
  1315         - 
  1316         -2. New subcommands "getcells" and "windowpath" (thanks to Jeff Godfrey
  1317         -   and Mike Collins for their proposals).
  1318         -
  1319         -3. Support for the new virtual event <<TablelistCellRestored>>,
  1320         -   generated by the "cancelediting" subcommand.
  1321         -
  1322         -4. Significantly improved the performance of the "delete",
  1323         -   "deletecolumns", and "movecolumn" subcommands for tablelist widgets
  1324         -   having color or font options set at column, row, or cell level
  1325         -   (thanks to Michael Bahr for his valuable feedback).
  1326         -
  1327         -5. Improved the autoscrolling with the left mouse button in both the
  1328         -   body and the header of a tablelist widget having title columns.
  1329         -
  1330         -6. Fixed a bug related to the "-titlecolumns" option, introduced in the
  1331         -   previous Tablelist release (thanks to Alexander Schoepe for his bug
  1332         -   report).
  1333         -
  1334         -7. Fixed a typo in the implementation of the "seecell" subcommand,
  1335         -   introduced in the previous Tablelist release (thanks to Patrick
  1336         -   Fradin for his bug report).
  1337         -
  1338         -8. Improved the demo script "embeddedWindows.tcl" (thanks to Patrick
  1339         -   Fradin for his valuable input).
  1340         -
  1341         -9. Several further improvements and minor bug fixes.
  1342         -
  1343         -What was new in Tablelist 3.7?
  1344         -------------------------------
  1345         -
  1346         -1. New configuration option "-titlecolumns", specifying the number of
  1347         -   the non-scrollable columns at the left edge of the window (thanks to
  1348         -   Goran Ivankovic, Paul Kienzle, Hemang Lavana, and Takeshi Sakamoto
  1349         -   for their proposals).  For technical reasons (the use of the
  1350         -   "-elide" option for a text widget tag), this option is not supported
  1351         -   for Tk versions earlier than 8.3.
  1352         -
  1353         -2. Extended the "separatorpath" and "separators" subcommands, to
  1354         -   support the new special separator, which is displayed to mark the
  1355         -   end of the title columns, independently of the value of the
  1356         -   "-showseparators" option.
  1357         -
  1358         -3. The "-stripebackground" and "-stripeforeground" options now have a
  1359         -   higher priority than the "-background" and "-foreground" column
  1360         -   configuration options, respectively (see the demo script
  1361         -   "styles.tcl", which has been extended to illustrate this change).
  1362         -
  1363         -4. Improved the handling of embedded images with transparent
  1364         -   background, complementing the changes made in the previous Tablelist
  1365         -   release (thanks to Kai Morich for his valuable contribution).
  1366         -
  1367         -5. Improved the implementation of the "seecell" subcommand for centered
  1368         -   and right-aligned columns.
  1369         -
  1370         -6. Fixed two bugs related to the "rowconfigure" subcommand, introduced
  1371         -   in Tablelist version 3.5 (thanks to Ted Branscomb and Roger Niva for
  1372         -   their bug reports).
  1373         -
  1374         -7. Fixed an old bug related to the "movecolumn" subcommand.
  1375         -
  1376         -8. Several further improvements and minor bug fixes.
  1377         -
  1378         -What was new in Tablelist 3.6?
  1379         -------------------------------
  1380         -
  1381         -1.  Support for embedded windows, with the aid of the new cell
  1382         -    configuration option "-window" (thanks to Wolf Grossi, Glenn
  1383         -    Herteg, Takeshi Sakamoto, and Keesang Song for proposing this
  1384         -    option).
  1385         -
  1386         -2.  New demo script "embeddedWindows.tcl" illustrating the use of
  1387         -    embedded windows in tablelist widgets; this is discussed in a new
  1388         -    section of the tutorial "tablelist.html".
  1389         -
  1390         -3.  Significantly improved and optimized the handling of embedded
  1391         -    images.
  1392         -
  1393         -4.  Simplified the support for user-defined binding scripts with the
  1394         -    aid of the new commands "tablelist::getTablelistPath" and
  1395         -    "tablelist::convEventFields", as well as of a new binding tag whose
  1396         -    name is returned by the new "bodytag" subcommand (which is now used
  1397         -    in the demo script "browse.tcl").
  1398         -
  1399         -5.  Support for the new virtual events <<TablelistRowMoved>>,
  1400         -    <<TablelistColumnMoved>>, <<TablelistColumnSorted>> and
  1401         -    <<TablelistCellUpdated>> (thanks to John Vidolich for his
  1402         -    proposal).  In addition, the new virtual event <<TablelistSelect>>
  1403         -    can now be used instead of <<ListboxSelect>> (which is supported
  1404         -    for compatibility reasons).
  1405         -
  1406         -6.  New subcommand "itemlistvar", for accessing the tablelist widget's
  1407         -    internal list (thanks to Patrick Fradin for his valuable input).
  1408         -
  1409         -7.  Fixed a bug related to the "-listvariable" option, introduced in
  1410         -    the previous Tablelist release (thanks to Torsten Reincke for his
  1411         -    bug report).
  1412         -
  1413         -8.  Fixed two bugs related to the "cellselection" subcommand (thanks to
  1414         -    John Vidolich for his bug report).
  1415         -
  1416         -9.  Fixed a few typos and minor bugs in the default binding scripts
  1417         -    (thanks to Patrick Fradin, Tore Morkemo, and Torsten Reincke for
  1418         -    their bug reports).
  1419         -
  1420         -10. Numerous further improvements and minor bug fixes.
  1421         -
  1422         -What was new in Tablelist 3.5?
  1423         -------------------------------
  1424         -
  1425         -1.  New configuration option "-selecttype" with the values "row" and
  1426         -    "cell", and new binding scripts supporting these two selection
  1427         -    types (thanks to Kevin Partin for his proposal and to Dietmar
  1428         -    Mueller for his valuable contribution).
  1429         -
  1430         -2.  New subcommands "activatecell", "cellselection", and
  1431         -    "curcellselection", used in the binding scripts mentioned above.
  1432         -
  1433         -3.  The words "active" and "anchor" are now recognized as valid column
  1434         -    and cell indices, too.
  1435         -
  1436         -4.  New configuration options "-movablerows" and "-movecursor", and new
  1437         -    mouse bindings for moving a row interactively (thanks to Dan Rogahn
  1438         -    for his valuable contribution).
  1439         -
  1440         -5.  The key sequences used for navigation between the editable cells
  1441         -    now also move the active item or element and change the
  1442         -    (cell)selection and the (cell)selection anchor in the body of the
  1443         -    tablelist widget.
  1444         -
  1445         -6.  Improved the handling and appearance of the checkbutton widget when
  1446         -    used as edit window (thanks to Kevin Partin for reporting a problem
  1447         -    experienced when the tablelist is embedded into an Iwidgets
  1448         -    dialogshell).
  1449         -
  1450         -7.  The "-listvariable" option now supports variable names returned by
  1451         -    the "itcl::scope" command, too (thanks to Nicolae Mihalache for his
  1452         -    bug report).
  1453         -
  1454         -8.  Fixed a very long-standing bug related to horizontal scrolling when
  1455         -    using a non-default font (thanks to Brand Hilton for his bug report
  1456         -    and fix).
  1457         -
  1458         -9.  Fixed another very long-standing bug, related to list variables
  1459         -    (thanks to Dr. Detlef Groth and John R. Smith for their bug
  1460         -    reports).
  1461         -
  1462         -10. Numerous further improvements and minor bug fixes (thanks to
  1463         -    Patrick Fradin for his valuable input).
  1464         -
  1465         -What was new in Tablelist 3.4?
  1466         -------------------------------
  1467         -
  1468         -1.  New column configuration option "-editwindow", specifying the
  1469         -    widget type used for interactive cell editing in the respective
  1470         -    column (thanks to Damon Courtney, Patrick Fradin, and Keesang Song
  1471         -    for their proposals and to Mats Bengtsson and Benny Riefenstein for
  1472         -    their help related to the Macintosh platform).  The edit window may
  1473         -    be a Tk core entry, spinbox, or checkbutton, or one of the 16
  1474         -    supported widgets from the packages BWidget, Iwidgets, combobox (by
  1475         -    Bryan Oakley), and Mentry.
  1476         -
  1477         -2.  New subcommand "editwinpath".
  1478         -
  1479         -3.  Three new demo scripts illustrating the use of the "-editwindow"
  1480         -    option; these are discussed in a new section of the tutorial
  1481         -    "tablelist.html".
  1482         -
  1483         -4.  New column configuration option "-maxwidth" (thanks to Tore Morkemo
  1484         -    for his proposal).
  1485         -
  1486         -5.  The <Shift-Button-3> event in a column label now restores the
  1487         -    column's last static width (thanks to Dietmar Mueller for his
  1488         -    valuable input).
  1489         -
  1490         -6.  Changing a tablelist's font now updates the column widths
  1491         -    accordingly.
  1492         -
  1493         -7.  Improved the handling of the "-setgrid" option.
  1494         -
  1495         -8.  Improved the error handling related to the option database in the
  1496         -    general mega-widget utility module "mwutil.tcl".
  1497         -
  1498         -9.  Fixed a minor bug in the "containingcolumn" subcommand (thanks to
  1499         -    David Mattinson for his bug report).
  1500         -
  1501         -10. Restored the support for Tcl/Tk versions earlier than 8.0.4, which
  1502         -    has been broken since release 3.0, due to the use of the
  1503         -    <MouseWheel> event, introduced in Tk 8.0.4.
  1504         -
  1505         -11. Further code improvements (thanks to Patrick Fradin for his
  1506         -    valuable input).
  1507         -
  1508         -12. Many improvements in the documentation, including a new Quick
  1509         -    Reference section (thanks to Dietmar Mueller for his valuable
  1510         -    contribution).
  1511         -
  1512         -What was new in Tablelist 3.3?
  1513         -------------------------------
  1514         -
  1515         -1. New column configuration option "-text" (thanks to Paul Kienzle for
  1516         -   his proposal).
  1517         -
  1518         -2. New subcommands "containing", "containingcolumn", "containingcell",
  1519         -   and "fillcolumn".
  1520         -
  1521         -3. New subcommands "deletecolumns", "insertcolumns", and
  1522         -   "insertcolumnlist" (thanks to Kevin Partin and Paul Kienzle for
  1523         -   their proposals).
  1524         -
  1525         -4. Renamed the subcommands "getcolumn" and "getkey" to "getcolumns" and
  1526         -   "getkeys", respectively.  (This won't break any existing scripts,
  1527         -   because the old command names are abbreviations of the new ones.)
  1528         -
  1529         -5. Restored the support for Tcl/Tk versions earlier than 8.4, which was
  1530         -   broken in Tablelist 3.1 and 3.2, due to the use of the improved
  1531         -   syntax of the "place configure" command, introduced in Tk 8.4
  1532         -   (thanks to David Mattinson, Kurt Braganza, and Alexander Baath for
  1533         -   reporting this problem).
  1534         -
  1535         -6. Fixed a bug in the "editcell" subcommand, introduced in Tablelist
  1536         -   3.1 (thanks to Damon Courtney for his bug report).
  1537         -
  1538         -7. Improved the demo script "config.tcl" (thanks to Mats Bengtsson for
  1539         -   his input).
  1540         -
  1541         -8. Restructured the code by moving several procedures from the
  1542         -   distribution file "tablelistWidget.tcl" into smaller, more
  1543         -   manageable modules.
  1544         -
  1545         -9. Numerous further improvements and minor bug fixes.
  1546         -
  1547         -What was new in Tablelist 3.2?
  1548         -------------------------------
  1549         -
  1550         -1. The key associated with a tablelist item can now be used as a row
  1551         -   index and as the first component of a cell index of the form
  1552         -   "row,col".
  1553         -
  1554         -2. The "delete", "get", "getcolumn", "getkey", "selection clear", and
  1555         -   "selection set" subcommands now also accept a list of indices as
  1556         -   single argument (thanks to Damon Courtney and Erik Leunissen for
  1557         -   their proposals).
  1558         -
  1559         -3. Made the interactive "movecolumn" operation more intuitive and
  1560         -   compatible with the behavior exhibited by similar actions in popular
  1561         -   applications on various platforms (thanks to Paul Kienzle for his
  1562         -   suggestion).  For example, the target position of the column being
  1563         -   moved is now indicated by a temporary gap displayed in the
  1564         -   tablelist's header.
  1565         -
  1566         -4. New configuration option "-targetcolor", used to set the color of
  1567         -   the gap mentioned above.
  1568         -
  1569         -5. Fixed a bug related to the <MouseWheel> event, caused by a missing
  1570         -   close-bracket in the last release (thanks to Patrick Fradin for his
  1571         -   bug report).
  1572         -
  1573         -6. Fixed a bug that raised an error in the "movecolumn" command for an
  1574         -   empty tablelist widget (thanks to Paul Kienzle for his bug report).
  1575         -
  1576         -7. The workaround in the "xview" and "yview" subcommands for a Tk bug
  1577         -   under Mac OS X Aqua is now only activated for that windowing system,
  1578         -   since (as reported by Patrick Fradin) it caused problems on some
  1579         -   other systems.
  1580         -
  1581         -8. Further minor code improvements.
  1582         -
  1583         -What was new in Tablelist 3.1?
  1584         -------------------------------
  1585         -
  1586         -1.  New configuration options "-movablecolumns" and
  1587         -    "-movecolumncursor".
  1588         -
  1589         -2.  New column configuration option "-name", whose value can also be
  1590         -    used as a column index and as the second component of a cell index
  1591         -    of the form "row,col".
  1592         -
  1593         -3.  New subcommands "move", "movecolumn", "getcolumn", "getkey", and
  1594         -    "finishediting" (thanks to Damon Courtney, Daniel Fehrenbach, Jeff
  1595         -    Godfrey, and Kevin Partin for their proposals).
  1596         -
  1597         -4.  Extended the scope of the "cancelediting" subcommand.
  1598         -
  1599         -5.  New mouse bindings for moving a column interactively.
  1600         -
  1601         -6.  The autoscrolling, as described in the "DEFAULT BINDINGS" section
  1602         -    of the "listbox" manual entry, is now implemented for the header of
  1603         -    a tablelist widget, too.
  1604         -
  1605         -7.  The interactive cell editing is now finished by any mouse click in
  1606         -    the tablelist's body, outside the cell just being edited (thanks to
  1607         -    Patrick Fradin and Jeff Godfrey for this suggestion).
  1608         -
  1609         -8.  The value returned by the "selection includes" command no longer
  1610         -    depends on the tablelist's state.
  1611         -
  1612         -9.  Worked around a bug in Tk 8.4.0 and 8.4.1 related to the "selection
  1613         -    handle" command, which caused crashes under KDE 3.0 (thanks to
  1614         -    Andres Garcia for reporting this and to Joe English for suggesting
  1615         -    the workaround and fixing the bug in Tk 8.4.2).
  1616         -
  1617         -10. Improved the support of Mac OS X Aqua and Mac OS Classic (thanks to
  1618         -    Mats Bengtsson, Raymond Calande, Techin Alex Kang, Bernhard
  1619         -    Spinnler, and especially to Benny Riefenstein for their valuable
  1620         -    contributions).
  1621         -
  1622         -11. Fixed a bug related to the invocation of the "cellconfigure"
  1623         -    subcommand from within a pre-edit callback (thanks to Dr. Johannes-
  1624         -    Heinrich Vogeler for his bug report).
  1625         -
  1626         -12. Several performance improvements (thanks to Patrick Fradin for his
  1627         -    valuable suggestions).
  1628         -
  1629         -13. Improved the platform-specific stuff in the demo scripts
  1630         -    "config.tcl" and "browse.tcl".
  1631         -
  1632         -14. Numerous further improvements in the code and documentation.
  1633         -
  1634         -What was new in Tablelist 3.0?
  1635         -------------------------------
  1636         -
  1637         -The main new feature provided by this release is the support for
  1638         -interactive cell editing (thanks to Juri Shimon, Dr. Johannes-Heinrich
  1639         -Vogeler, and Jeff Godfrey for their proposal).  The first three items
  1640         -below are related to this subject:
  1641         -
  1642         -1. New configuration options "-editstartcommand" and "-editendcommand".
  1643         -
  1644         -2. New column and cell configuration option "-editable".
  1645         -
  1646         -3. New subcommands "editcell", "entrypath", "cancelediting", and
  1647         -   "rejectinput".
  1648         -
  1649         -Further changes:
  1650         -
  1651         -4. New subcommands "seecolumn" and "seecell".
  1652         -
  1653         -5. Tabulator and newline characters are now retained in the internal
  1654         -   list, displayed as "\t" and "\n", and supported by interactive cell
  1655         -   editing (thanks to Jacek Jenrysik for his query concerning multi-
  1656         -   line items).
  1657         -
  1658         -6. The redisplay and sorting of tablelist items have become
  1659         -   dramatically faster (thanks to Matt Becker for his input that
  1660         -   determined me to optimize these operations, and also for his
  1661         -   testing).
  1662         -
  1663         -7. Further performance improvements (thanks to Patrick Fradin for his
  1664         -   valuable contribution).
  1665         -
  1666         -8. The option values displayed by the demo script "config.tcl" can now
  1667         -   be edited interactively.
  1668         -
  1669         -9. Minor improvements in the code and documentation.
  1670         -
  1671         -What was new in Tablelist 2.8?
  1672         -------------------------------
  1673         -
  1674         -1. The trailing or leading ellipsis ("...") used when displaying the
  1675         -   elements that don't fit into their cells can now be replaced with an
  1676         -   arbitrary string specified with the aid of the new "-snipstring"
  1677         -   configuration option (thanks to Tore Morkemo for his proposal).
  1678         -
  1679         -2. New value "none" for the "-activestyle" configuration option.
  1680         -
  1681         -3. When exporting the selection, the elements of the hidden columns are
  1682         -   now skipped and the contents of the visible cells are transformed
  1683         -   according to the value of the "-formatcommand" option for the
  1684         -   corresponding columns.
  1685         -
  1686         -4. Improved and simplified the focus control (thanks to Juri Shimon and
  1687         -   Gopal Reddy for their bug reports).
  1688         -
  1689         -5. Further minor code improvements.
  1690         -
  1691         -What was new in Tablelist 2.7?
  1692         -------------------------------
  1693         -
  1694         -1. Increased the speed of the "insert" and "insertlist" subcommands as
  1695         -   well as that of item insertions with the aid of the "-listvariable"
  1696         -   option by a factor of about 1.3.  The "insert" subcommand is now
  1697         -   about 2.3 times faster than in version 2.4.  Compared to version
  1698         -   2.4, item insertion with the aid of the "-listvariable" option has
  1699         -   become more than 10 times faster.
  1700         -
  1701         -2. The number of pixels by which a column is stretched is now
  1702         -   proportional to its width in pixels.  Based on this change,
  1703         -   significantly improved the stretching behavior after an interactive
  1704         -   column resize operation (thanks to Mats Bengtsson for his valuable
  1705         -   suggestions).
  1706         -
  1707         -3. Fixed a bug in the "-(label)font" and "-labelborderwidth"
  1708         -   configuration options, introduced in version 2.5 (thanks to Bastien
  1709         -   Chevreux for his bug report).
  1710         -
  1711         -4. Fixed a bug in the "columncget", "rowcget", and "cellcget"
  1712         -   subcommands, introduced in version 2.3 (again, thanks to Bastien
  1713         -   Chevreux for reporting this bug).
  1714         -
  1715         -5. Fixed a bug in the binding scripts for the binding tag
  1716         -   "TablelistBody" (thanks to Miguel Bagnon for his bug report).
  1717         -
  1718         -6. Applied a patch proposed by Jeff Adamczak that works around a bug in
  1719         -   the "lsort" command, present in Tcl versions 8.0 - 8.3.2.
  1720         -
  1721         -7. Applied a patch proposed (in a slightly different form) by Mats
  1722         -   Bengtsson that works around a bug in the "info script" command on
  1723         -   the Macintosh.
  1724         -
  1725         -8. Further minor code improvements.
  1726         -
  1727         -What was new in Tablelist 2.6?
  1728         -------------------------------
  1729         -
  1730         -The only change in this version is a bug-fix eliminating a rather nasty
  1731         -bug in the "insert" and "insertlist" subcommands, introduced in the
  1732         -previous release.  Thanks to Mats Bengtsson for his bug report and to
  1733         -Jeffrey Hobbs for suggesting me to bump the version number to 2.6.
  1734         -
  1735         -What was new in Tablelist 2.5?
  1736         -------------------------------
  1737         -
  1738         -1. Increased the speed of the "insert" subcommand by a factor of about
  1739         -   1.8 and that of item insertions with the aid of the "-listvariable"
  1740         -   option by a factor of about 8.  (These figures are based on speed
  1741         -   measurements made with two tablelist widgets: one having 1000 rows
  1742         -   and 10 columns and another one with 5000 rows and 20 columns.)
  1743         -
  1744         -2. The "delete", "sort", and "sortbycolumn" subcommands, as well as row
  1745         -   and cell updates with the aid of the "rowconfigure" and
  1746         -   "cellconfigure" operations have also become significantly faster.
  1747         -
  1748         -3. New "insertlist" subcommand.
  1749         -
  1750         -4. New "-stripeheight" configuration option (thanks to Gregory Samoluk
  1751         -   for his proposal).
  1752         -
  1753         -5. If no columns are to be stretched then the blank space following the
  1754         -   header labels is now filled with a dummy, insensitive label having
  1755         -   the same background, borderwidth, and relief as the "normal" header
  1756         -   labels.
  1757         -
  1758         -6. Fixed a bug concerning the placement of the arrow indicating the
  1759         -   sorting order (thanks to Robert Minichino for his bug report).
  1760         -
  1761         -7. Improved the handling of header labels with embedded images, to
  1762         -   eliminate some peculiarities experienced on Windows.
  1763         -
  1764         -8. Several further improvements and minor bug fixes.
  1765         -
  1766         -What was new in Tablelist 2.4?
  1767         -------------------------------
  1768         -
  1769         -1. New column configuration option "-formatcommand" (thanks to Jeff
  1770         -   Godfrey for his proposal).  This option is now used in the demo
  1771         -   script "browse.tcl".
  1772         -
  1773         -2. New row configuration option "-selectable" (thanks to Tore Morkemo
  1774         -   for this proposal).
  1775         -
  1776         -3. Significantly improved the performance of the row and cell updates,
  1777         -   as well as of the "delete" subcommand (thanks to Emanuele Lupi for
  1778         -   her input that determined me to optimize these operations).
  1779         -
  1780         -4. The widget implementation is now fully compatible with the recent
  1781         -   changes made in Tk 8.4a4 (thanks to Patrick Fradin for his input).
  1782         -
  1783         -5. Pop-up menus as children of a tablelist widget cause no problem any
  1784         -   longer (thanks to Andres Garcia and Bastien Chevreux for reporting
  1785         -   this bug, introduced in the previous release).
  1786         -
  1787         -6. Fixed a bug caused by the delayed redisplay after changing the
  1788         -   number of columns (thanks to Tore Morkemo for his bug report).
  1789         -
  1790         -7. Minor improvements in the code and documentation.
  1791         -
  1792         -What was new in Tablelist 2.3?
  1793         -------------------------------
  1794         -
  1795         -1. New configuration option "-activestyle", enabling to surround the
  1796         -   active item with a frame instead of underlining it.
  1797         -
  1798         -2. The columns can now be separated with borders, by making use of the
  1799         -   new configuration option "-showseparators".
  1800         -
  1801         -3. A nice distinguishing effect for the rows can now be obtained with
  1802         -   the aid of the new configuration options "-stripebackground" and
  1803         -   "-stripeforeground".
  1804         -
  1805         -4. New tablelist widget subcommands "separatorpath" and "separators".
  1806         -
  1807         -5. Fixed a bug related to the column index if the header labels are
  1808         -   hidden (thanks to Emanuele Lupi for her bug report).
  1809         -
  1810         -6. New demo script "styles.tcl", showing several ways to improve the
  1811         -   appearance of a tablelist widget.
  1812         -
  1813         -7. The demo scripts "config.tcl" and "browse.tcl" now make use of the
  1814         -   new "-stripebackground" option.
  1815         -
  1816         -8. Numerous further improvements and minor bug fixes (thanks to Patrick
  1817         -   Fradin for his valuable input).
  1818         -
  1819         -What was new in Tablelist 2.2?
  1820         -------------------------------
  1821         -
  1822         -1. The "-font" configuration option can now be specified at column,
  1823         -   row, and cell level, too (this was proposed and partly implemented
  1824         -   by Patrick Fradin).  The data will be aligned properly, no matter if
  1825         -   the fonts are of different sizes.
  1826         -
  1827         -2. Significantly improved the performance of the Tcl command associated
  1828         -   with a tablelist widget, especially that of the "delete", "sort",
  1829         -   and "sortbycolumn" subcommands for a large number (i.e., several
  1830         -   thousands) of items.
  1831         -
  1832         -3. Corrected the creation of the arrow indicating the sorting order, to
  1833         -   make sure that it works under all supported Tcl/Tk versions (thanks
  1834         -   to Juri Shimon and Andres Garcia for their bug reports).
  1835         -
  1836         -4. Several improvements in the demo scripts "config.tcl" and
  1837         -   "browse.tcl".  Among others, the GUIs generated by these scripts now
  1838         -   have a better platform-specific look & feel (many thanks to Mats
  1839         -   Bengtsson for his valuable suggestions concerning the Macintosh
  1840         -   platform).
  1841         -
  1842         -5. Further minor improvements in the code.
  1843         -
  1844         -What was new in Tablelist 2.1?
  1845         -------------------------------
  1846         -
  1847         -1. The up- or down-arrow indicating the sorting order now has a 3-D
  1848         -   border, giving the arrow a sunken relief.
  1849         -
  1850         -2. Due to the new 3-D look of the arrow, the default values of the
  1851         -   "-arrowcolor" and "-arrowdisabledcolor" configuration options have
  1852         -   been changed to an empty string, indicating that the arrow will
  1853         -   inherit the background color of the label in which it is placed.
  1854         -
  1855         -3. Several improvements in the demo script "browse.tcl".
  1856         -
  1857         -4. Minor improvements in the code and documentation.
  1858         -
  1859         -5. The distribution file "tablelist2_1.zip" for Windows now includes
  1860         -   the "tablelist2.1" directory, hence it is no longer necessary to
  1861         -   create this folder before unpacking the distribution file (thanks to
  1862         -   Kevin Partin for this suggestion).
  1863         -
  1864         -What was new in Tablelist 2.0?
  1865         -------------------------------
  1866         -
  1867         -1.  New cell configuration option "-image", used to set and retrieve
  1868         -    the image to be displayed (by itself or together with a text) in a
  1869         -    cell of a tablelist widget.
  1870         -
  1871         -2.  New column configuration option "-labelimage" specifying the image
  1872         -    to be displayed (by itself or combined with a text) in a column
  1873         -    label.
  1874         -
  1875         -3.  The alignment of a header label can now be defined to be different
  1876         -    from that of the elements contained in its column, by using the new
  1877         -    column configuration option "-labelalign".
  1878         -
  1879         -4.  Renamed the column configuration option "-justify" to "-align",
  1880         -    because (at least in the case of the header labels) this actually
  1881         -    specifies not only the justification, but also the anchor point.
  1882         -    Hopefully, this POTENTIAL INCOMPATIBILITY will not break too many
  1883         -    existing applications, because the column alignments are usually
  1884         -    specified within the "-columns" global option.
  1885         -
  1886         -5.  Fixed a bug that raised an error when some configuration options
  1887         -    were specified at widget creation time before the "-columns" option
  1888         -    (thanks to Bastien Chevreux for his bug report).
  1889         -
  1890         -6.  Reverted the implementation of the focus control to that contained
  1891         -    in the pre-1.6 Tablelist releases, because its simplified version
  1892         -    from the last release failed to work as expected if a tablelist was
  1893         -    the only widget taking the focus during keyboard traversal (thanks
  1894         -    to Juri Shimon for his bug report).
  1895         -
  1896         -7.  Fixed a bug that caused an erronous return value of the "labels"
  1897         -    subcommand if the arrow indicating the sorting order was displayed.
  1898         -
  1899         -8.  Several performance improvements, kindly contributed by Patrick
  1900         -    Fradin.
  1901         -
  1902         -9.  To improve the performance even further, the invocations of "info
  1903         -    exists" for array elements are no longer replaced with a call to a
  1904         -    helper procedure (introduced in Tablelist 1.2), because the Tcl bug
  1905         -    that made this necessary for Tcl versions 8.2, 8.3.0 - 8.3.2, and
  1906         -    8.4a1 was fixed in Tcl 8.3.3 and 8.4a2.  If for some reason you
  1907         -    cannot upgrade your Tcl/Tk version, then you should patch the file
  1908         -    "tablelistWidget.tcl" with the aid of the script "repair.tcl", as
  1909         -    described in the files "README.txt" and "tablelist.html".
  1910         -
  1911         -10. The demo script "browse.tcl" now inserts an image into the first
  1912         -    cell of each row of the tablelist widget.
  1913         -
  1914         -11. Numerous further improvements and minor bug fixes.
  1915         -
  1916         -What was new in Tablelist 1.6?
  1917         -------------------------------
  1918         -
  1919         -1. The value of the "-stretch" configuration option is now ignored if
  1920         -   the width of the tablelist widget was specified as zero or less.
  1921         -   This change was necessary in order to improve the behavior of
  1922         -   dynamic-width tablelist widgets with the "-setgrid" option set to
  1923         -   true.
  1924         -
  1925         -2. By pressing mouse button 1 over a header label, the label's relief
  1926         -   is now only changed to "sunken" if the value of the global or
  1927         -   column-specific "-labelcommand" option is nonempty.
  1928         -
  1929         -3. Several improvements concerning hidden columns (thanks to Juri
  1930         -   Shimon for his bug report).
  1931         -
  1932         -4. Made the focus control more straight-forward.
  1933         -
  1934         -5. Extended the "How to use it?" section of the tutorial
  1935         -   "tablelist.html".
  1936         -
  1937         -What was new in Tablelist 1.5?
  1938         -------------------------------
  1939         -
  1940         -This version contains mainly bug fixes and small improvements.  Many
  1941         -thanks to Andres Garcia, Bastien Chevreux, and Patrick Fradin for their
  1942         -valuable contributions.
  1943         -
  1944         -1. Fixed a bug concerning the "-label*" configuration options.
  1945         -
  1946         -2. Fixed the erronous invocation of "getSubCmd" in the selection
  1947         -   handler "fetchSelection" (this bug was introduced in version 1.1).
  1948         -
  1949         -3. Elements that don't fit into their cells are now displayed with a
  1950         -   trailing or leading ellipsis ("..."), depending on the column
  1951         -   alignment.
  1952         -
  1953         -4. Several further improvements and minor bug fixes.
  1954         -
  1955         -What was new in Tablelist 1.4?
  1956         -------------------------------
  1957         -
  1958         -1. New "-stretch" configuration option specifying the columns that are
  1959         -   to be stretched in order to eliminate the blank space that might
  1960         -   appear at the right of the table.
  1961         -
  1962         -2. Improved the error handling in the "attrib", "configure",
  1963         -   "columnconfigure", "rowconfigure", and "cellconfigure" subcommands.
  1964         -
  1965         -3. Improved the demo scripts "browse.tcl" and "config.tcl".
  1966         -
  1967         -What was new in Tablelist 1.3?
  1968         -------------------------------
  1969         -
  1970         -1. The "sortbycolumn" subcommand now per default places an up- or
  1971         -   down-arrow indicating the sorting order into the respective column's
  1972         -   label.  This can be enabled or disabled with the new "-showarrow"
  1973         -   configuration option, at both widget and column level.
  1974         -
  1975         -2. New configuration options "-arrowcolor", "-arrowdisabledcolor", and
  1976         -   "-incrarrowtype" to control the appearance of the arrow mentioned
  1977         -   above.
  1978         -
  1979         -3. New "resetsortinfo" subcommand, used to reset the information about
  1980         -   the sorting of the items.
  1981         -
  1982         -4. Improved the demo script "browse.tcl".
  1983         -
  1984         -5. Further improvements in the code and documentation.
  1985         -
  1986         -What was new in Tablelist 1.2?
  1987         -------------------------------
  1988         -
  1989         -1. Whereever possible, eliminated the invocations of "info exists" for
  1990         -   array elements.  This works around a severe bug in Tcl versions 8.2
  1991         -   and 8.3 (fixed in 8.4a2), which causes excessive memory use when
  1992         -   calling "info exists" on a non-existent array element.  Some serious
  1993         -   memory leaks in earlier Tablelist versions when run under Tcl/Tk 8.2
  1994         -   or 8.3 (reported by Henning Hanusa and Christian Burrini) could be
  1995         -   tracked down to this very annoying Tcl bug (which I was not aware of
  1996         -   until recently).
  1997         -
  1998         -2. The help variables used in the initialization of the "tablelist"
  1999         -   namespace are now declared with the "variable" keyword, in order to
  2000         -   avoid any conflicts with global variables.
  2001         -
  2002         -3. Improved the parsing of configuration and command options.
  2003         -
  2004         -What was new in Tablelist 1.1?
  2005         -------------------------------
  2006         -
  2007         -This version contains mainly bug fixes and small improvements.  Many
  2008         -thanks to Patrick Fradin, Bastien Chevreux, and Mats Bengtsson for
  2009         -their valuable contributions.
  2010         -
  2011         -1. Fixed some bugs in the implementation of the "-listvariable" option.
  2012         -   Also, the value of this option can now be an array element, not only
  2013         -   a scalar variable.
  2014         -
  2015         -2. Fixed a bug in the implementation of the "get" subcommand.
  2016         -
  2017         -3. New "sortcolumn" and "sortorder" subcommands to query the arguments
  2018         -   of the last sorting.
  2019         -
  2020         -4. Improved the look & feel of tablelist widgets on the Macintosh.
  2021         -
  2022         -5. Worked around a bug in Tk 8.3.0 (fixed in 8.3.1) concerning listbox
  2023         -   widgets with configured "-cursor" option.
  2024         -
  2025         -6. Several further improvements and minor bug fixes.
  2026         -
  2027         -What was new in Tablelist 1.0?
  2028         -------------------------------
  2029         -
  2030         -1.  New "-resizable" option for the "columnconfigure" subcommand.
  2031         -
  2032         -2.  New "labels" subcommand, returning the list of the header labels.
  2033         -
  2034         -3.  The "-disabledforeground" and "-state" configuration options no
  2035         -    longer require Tk version 8.3 or higher.
  2036         -
  2037         -4.  All "-label*" column configuration options can now have an empty
  2038         -    string as value, meaning that the corresponding global option will
  2039         -    be used instead of the column-specific one.
  2040         -
  2041         -5.  Improved the output of the "columnconfigure" subcommand.
  2042         -
  2043         -6.  The help variables used in the coordinate transformations within
  2044         -    the scripts defined for the "TablelistBody" binding tag have been
  2045         -    moved into the "tablelist" namespace, in order to avoid any
  2046         -    conflicts with global variables.
  2047         -
  2048         -7.  Improved cross-platform support with the aid of the new <<Button3>>
  2049         -    virtual event.
  2050         -
  2051         -8.  Fixed a bug in the "compareAsSet" procedure of the demo script
  2052         -    "config.tcl".
  2053         -
  2054         -9.  New demo script "browse.tcl", containing a simple widget browser
  2055         -    based on a tablelist.
  2056         -
  2057         -10. Both demo scripts now use a namespace for their procedures, to
  2058         -    avoid any conflicts when evaluating them with the "source" command.
  2059         -
  2060         -11. The tutorial "tablelist.html" is now completed and includes a
  2061         -    detailed discussion of both demo scripts mentioned above.
  2062         -
  2063         -12. Numerous further improvements in the code and documentation.
  2064         -
  2065         -What was new in Tablelist 0.9?
  2066         -------------------------------
  2067         -
  2068         -1. The documentation now includes the tutorial "tablelist.html" (part
  2069         -   of which is still work in progress), as well as reference pages for
  2070         -   the two exported commands "tablelist::tablelist" and
  2071         -   "tablelist::sortByColumn".
  2072         -
  2073         -2. The "-listvariable" configuration option is now fully implemented.
  2074         -
  2075         -3. A column of a tablelist widget can now be made invisible by using
  2076         -   the new "-hide" option of the "columnconfigure" subcommand.
  2077         -
  2078         -4. The contents of a row can now be updated with the new "-text" option
  2079         -   of the "rowconfigure" subcommand.
  2080         -
  2081         -5. For Tk versions 8.3 or higher the "tablelist::tablelist" command now
  2082         -   supports the "-disabledforeground", "-labeldisabledforeground", and
  2083         -   "-state" configuration options.
  2084         -
  2085         -6. Replaced "[focus]" with "[focus -displayof $win]", so that the code
  2086         -   will work properly in applications using multiple displays.
  2087         -   Similarly, the "font measure" command is now invoked with the
  2088         -   "-displayof $win" option.  This also works around a peculiarity of
  2089         -   the "font measure" command.
  2090         -
  2091         -7. Renamed "tablelistBindingTag" to "Tablelist".
  2092         -
  2093         -8. Fixed a bug in the private procedure "colIndex", for arguments of
  2094         -   the form "@x,y".  This procedure is invoked (directly or indirectly)
  2095         -   in the implementation of all commands that take a column or cell
  2096         -   index or an x coordinate as argument.
  2097         -
  2098         -9. Numerous further improvements and minor bug fixes.

Deleted libs/tablelist5.16/COPYRIGHT.txt.

     1         -Multi-column listbox and tree widget package Tablelist, version 5.16
     2         -Copyright (c) 2000-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     3         -
     4         -This library is free software; you can use, modify, and redistribute it
     5         -for any purpose, provided that existing copyright notices are retained
     6         -in all copies and that this notice is included verbatim in any
     7         -distributions.
     8         -
     9         -This software is distributed WITHOUT ANY WARRANTY; without even the
    10         -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Deleted libs/tablelist5.16/README.txt.

     1         -       The Multi-Column Listbox and Tree Widget Package Tablelist
     2         -
     3         -                                   by
     4         -
     5         -                             Csaba Nemethi
     6         -
     7         -                       csaba.nemethi@t-online.de 
     8         -
     9         -
    10         -What is Tablelist?
    11         -------------------
    12         -
    13         -Tablelist is a library package for Tcl/Tk versions 8.0 or higher,
    14         -written in pure Tcl/Tk code.  It contains:
    15         -
    16         -  - the implementation of the "tablelist" mega-widget, including a
    17         -    general utility module for mega-widgets;
    18         -  - a demo script containing a useful procedure that displays the
    19         -    configuration options of an arbitrary widget in a tablelist and
    20         -    enables you to edit their values interactively;
    21         -  - a demo script implementing a widget browser based on a tablelist
    22         -    used as multi-column listbox;
    23         -  - a demo script implementing a widget browser based on a tablelist
    24         -    used as multi-column tree widget;
    25         -  - a demo script implementing a directory viewer based on a tablelist
    26         -    used as multi-column tree widget;
    27         -  - a demo script showing several ways to improve the appearance of a
    28         -    tablelist widget;
    29         -  - four further demo scripts, illustrating the interactive cell
    30         -    editing with the aid of various widgets from the Tk core and from
    31         -    the packages tile, BWidget, Iwidgets, combobox (by Bryan Oakley),
    32         -    and Mentry;
    33         -  - one further demo script, with a tablelist widget containing
    34         -    embedded windows;
    35         -  - tile-based counterparts of the above-mentioned demo scripts;
    36         -  - a tutorial in HTML format;
    37         -  - reference pages in HTML format.
    38         -
    39         -A tablelist is a multi-column listbox and tree widget.  The width of
    40         -each column can be dynamic (i.e., just large enough to hold all its
    41         -elements, including the header) or static (specified in characters or
    42         -pixels).  The columns are, per default, resizable.  The alignment of
    43         -each column can be specified as "left", "right", or "center".
    44         -
    45         -The columns, rows, and cells can be configured individually.  Several
    46         -of the global and column-specific options refer to the headers,
    47         -implemented as label widgets.  For instance, the "-labelcommand" option
    48         -specifies a Tcl command to be invoked when mouse button 1 is released
    49         -over a label.  The most common value of this option sorts the items
    50         -based on the respective column.
    51         -
    52         -The Tablelist package provides a great variety of tree styles
    53         -controlling the look & feel of the column that displays the tree
    54         -hierarchy with the aid of indentations and expand/collapse controls.
    55         -
    56         -Interactive editing of the elements of a tablelist widget can be
    57         -enabled for individual cells and for entire columns.  A great variety
    58         -of widgets from the Tk core and from the packages tile, BWidget,
    59         -Iwidgets, combobox, ctext, and Mentry (or Mentry_tile) is supported for
    60         -being used as embedded edit window.  In addition, a rich set of keyboard
    61         -bindings is provided for a comfortable navigation between the editable
    62         -cells.
    63         -
    64         -The Tcl command corresponding to a tablelist widget is very similar to
    65         -the one associated with a normal listbox.  There are column-, row-, and
    66         -cell-specific counterparts of the "configure" and "cget" subcommands
    67         -("columnconfigure", "rowconfigure", "cellconfigure", ...).  They can be
    68         -used, among others, to insert images into the cells and the header
    69         -labels, or to insert embedded windows into the cells.  The "index",
    70         -"nearest", and "see" command options refer to the rows, but similar
    71         -subcommands are provided for the columns and cells ("columnindex",
    72         -"cellindex", ...).  The items can be sorted with the "sort",
    73         -"sortbycolumn", and "sortbycolumnlist" command options.
    74         -
    75         -The bindings defined for the body of a tablelist widget make it behave
    76         -just like a normal listbox.  This includes the support for the virtual
    77         -event <<ListboxSelect>> (which is equivalent to <<TablelistSelect>>).
    78         -In addition, version 2.3 or higher of the widget callback package Wcb
    79         -(written in pure Tcl/Tk code as well) can be used to define callbacks
    80         -for the "activate", "selection set", and "selection clear" commands,
    81         -and Wcb version 3.0 or higher also supports callbacks for the
    82         -"activatecell", "cellselection set", and "cellselection clear"
    83         -commands.  The download location of Wcb is
    84         -
    85         -    http://www.nemethi.de
    86         -
    87         -How to get it?
    88         ---------------
    89         -
    90         -Tablelist is available for free download from the same URL as Wcb.  The
    91         -distribution file is "tablelist5.16.tar.gz" for UNIX and
    92         -"tablelist5_16.zip" for Windows.  These files contain the same
    93         -information, except for the additional carriage return character
    94         -preceding the linefeed at the end of each line in the text files for
    95         -Windows.
    96         -
    97         -Tablelist is also included in tklib, which has the address
    98         -
    99         -    http://core.tcl.tk/tklib
   100         -
   101         -How to install it?
   102         -------------------
   103         -
   104         -Install the package as a subdirectory of one of the directories given
   105         -by the "auto_path" variable.  For example, you can install it as a
   106         -directory at the same level as the Tcl and Tk script libraries.  The
   107         -locations of these library directories are given by the "tcl_library"
   108         -and "tk_library" variables, respectively.
   109         -
   110         -To install Tablelist on UNIX, "cd" to the desired directory and unpack
   111         -the distribution file "tablelist5.16.tar.gz":
   112         -
   113         -    gunzip -c tablelist5.16.tar.gz | tar -xf -
   114         -
   115         -This command will create a directory named "tablelist5.16", with the
   116         -subdirectories "demos", "doc", and "scripts".
   117         -
   118         -On Windows, use WinZip or some other program capable of unpacking the
   119         -distribution file "tablelist5_16.zip" into the directory
   120         -"tablelist5.16", with the subdirectories "demos", "doc", and "scripts".
   121         -
   122         -The file "tablelistEdit.tcl" in the "scripts" directory is only needed
   123         -for applications making use of interactive cell editing.  Similarly, the
   124         -file "tablelistMove.tcl" in the same directory is only required for
   125         -scripts invoking the "move" or "movecolumn" tablelist command.  Finally,
   126         -the file "tablelistThemes.tcl" is only needed for applications using
   127         -the package Tablelist_tile (see next section).
   128         -
   129         -Next, you should check the exact version number of your Tcl/Tk
   130         -distribution, given by the "tcl_patchLevel" and "tk_patchLevel"
   131         -variables.  If you are using Tcl/Tk version 8.2.X, 8.3.0 - 8.3.2, or
   132         -8.4a1, then you should proceed as described in the "How to install it?"
   133         -section of the file "tablelist.html", located in the "doc" directory.
   134         -
   135         -How to use it?
   136         ---------------
   137         -
   138         -The Tablelist distribution provides two packages, called Tablelist and
   139         -Tablelist_tile.  The main difference between the two is that
   140         -Tablelist_tile enables the tile-based, theme-specific appearance of
   141         -tablelist widgets; this package requires Tcl/Tk 8.4 or higher and tile
   142         -0.6 or higher.  It is not possible to use both packages in one and the
   143         -same application, because both are implemented in the same "tablelist"
   144         -namespace and provide identical commands.
   145         -
   146         -To be able to use the commands and variables implemented in the package
   147         -Tablelist, your scripts must contain one of the lines
   148         -
   149         -    package require tablelist ?version?
   150         -    package require Tablelist ?version?
   151         -
   152         -Likewise, to be able to use the commands and variables implemented in
   153         -the package Tablelist_tile, your scripts must contain one of the lines
   154         -
   155         -    package require tablelist_tile ?version?
   156         -    package require Tablelist_tile ?version?
   157         -
   158         -Since the packages Tablelist and Tablelist_tile are implemented in the
   159         -"tablelist" namespace, you must either import the procedures you need,
   160         -or use qualified names like "tablelist::tablelist".
   161         -
   162         -For a detailed description of the commands and variables provided by
   163         -Tablelist and of the examples contained in the "demos" directory, see
   164         -the tutorial "tablelist.html" and the reference pages, all located in
   165         -the "doc" directory.

Deleted libs/tablelist5.16/demos/browse.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying information about
     3         -# the children of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2000-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require tablelist 5.16
     9         -
    10         -namespace eval demo {
    11         -    variable dir [file dirname [info script]]
    12         -
    13         -    #
    14         -    # Create two images, needed in the procedure putChildren
    15         -    #
    16         -    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
    17         -		      -background coral -foreground gray50]
    18         -    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
    19         -		      -background yellow -foreground gray50]
    20         -}
    21         -
    22         -source [file join $demo::dir config.tcl]
    23         -
    24         -#------------------------------------------------------------------------------
    25         -# demo::displayChildren
    26         -#
    27         -# Displays information on the children of the widget w in a tablelist widget
    28         -# contained in a newly created top-level widget.  Returns the name of the
    29         -# tablelist widget.
    30         -#------------------------------------------------------------------------------
    31         -proc demo::displayChildren w {
    32         -    if {![winfo exists $w]} {
    33         -	bell
    34         -	tk_messageBox -title "Error" -icon error -message \
    35         -	    "Bad window path name \"$w\""
    36         -	return ""
    37         -    }
    38         -
    39         -    #
    40         -    # Create a top-level widget of the class DemoTop
    41         -    #
    42         -    set top .browseTop
    43         -    for {set n 2} {[winfo exists $top]} {incr n} {
    44         -	set top .browseTop$n
    45         -    }
    46         -    toplevel $top -class DemoTop
    47         -
    48         -    #
    49         -    # Create a vertically scrolled tablelist widget with 9 dynamic-width
    50         -    # columns and interactive sort capability within the top-level
    51         -    #
    52         -    set tf $top.tf
    53         -    frame $tf
    54         -    set tbl $tf.tbl
    55         -    set vsb $tf.vsb
    56         -    tablelist::tablelist $tbl \
    57         -	-columns {0 "Path Name"	left
    58         -		  0 "Class"	left
    59         -		  0 "X"		right
    60         -		  0 "Y"		right
    61         -		  0 "Width"	right
    62         -		  0 "Height"	right
    63         -		  0 "Mapped"	center
    64         -		  0 "Viewable"	center
    65         -		  0 "Manager"	left} \
    66         -	-labelcommand demo::labelCmd -yscrollcommand [list $vsb set] -width 0
    67         -    if {[$tbl cget -selectborderwidth] == 0} {
    68         -	$tbl configure -spacing 1
    69         -    }
    70         -    foreach col {2 3 4 5} {
    71         -	$tbl columnconfigure $col -sortmode integer
    72         -    }
    73         -    foreach col {6 7} {
    74         -	$tbl columnconfigure $col -formatcommand demo::formatBoolean
    75         -    }
    76         -    scrollbar $vsb -orient vertical -command [list $tbl yview]
    77         -
    78         -    #
    79         -    # When displaying the information about the children of any
    80         -    # ancestor of the label widgets, the widths of some of the
    81         -    # labels and thus also the widths and x coordinates of some
    82         -    # children may change.  For this reason, make sure the items
    83         -    # will be updated after any change in the sizes of the labels
    84         -    #
    85         -    foreach l [$tbl labels] {
    86         -	bind $l <Configure> [list demo::updateItemsDelayed $tbl]
    87         -    }
    88         -    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
    89         -
    90         -    #
    91         -    # Create a pop-up menu with two command entries; bind the script
    92         -    # associated with its first entry to the <Double-1> event, too
    93         -    #
    94         -    set menu $top.menu
    95         -    menu $menu -tearoff no
    96         -    $menu add command -label "Display Children" \
    97         -		      -command [list demo::putChildrenOfSelWidget $tbl]
    98         -    $menu add command -label "Display Config" \
    99         -		      -command [list demo::dispConfigOfSelWidget $tbl]
   100         -    set bodyTag [$tbl bodytag]
   101         -    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
   102         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
   103         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
   104         -    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
   105         -
   106         -    #
   107         -    # Create three buttons within a frame child of the top-level widget
   108         -    #
   109         -    set bf $top.bf
   110         -    frame $bf
   111         -    set b1 $bf.b1
   112         -    set b2 $bf.b2
   113         -    set b3 $bf.b3
   114         -    button $b1 -text "Refresh"
   115         -    button $b2 -text "Parent"
   116         -    button $b3 -text "Close" -command [list destroy $top]
   117         -
   118         -    #
   119         -    # Manage the widgets
   120         -    #
   121         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   122         -    variable winSys
   123         -    if {[string compare $winSys "aqua"] == 0} {
   124         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   125         -	grid $vsb	       -row 1 -column 1 -sticky ns
   126         -    } else {
   127         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   128         -    }
   129         -    grid rowconfigure    $tf 1 -weight 1
   130         -    grid columnconfigure $tf 0 -weight 1
   131         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   132         -    pack $bf -side bottom -fill x
   133         -    pack $tf -side top -expand yes -fill both
   134         -
   135         -    #
   136         -    # Populate the tablelist with the data of the given widget's children
   137         -    #
   138         -    putChildren $w $tbl
   139         -    return $tbl
   140         -}
   141         -
   142         -#------------------------------------------------------------------------------
   143         -# demo::putChildren
   144         -#
   145         -# Outputs the data of the children of the widget w into the tablelist widget
   146         -# tbl.
   147         -#------------------------------------------------------------------------------
   148         -proc demo::putChildren {w tbl} {
   149         -    #
   150         -    # The following check is necessary because this procedure
   151         -    # is also invoked by the "Refresh" and "Parent" buttons
   152         -    #
   153         -    if {![winfo exists $w]} {
   154         -	bell
   155         -	set choice [tk_messageBox -title "Error" -icon warning \
   156         -		    -message "Bad window path name \"$w\" -- replacing\
   157         -			      it with nearest existent ancestor" \
   158         -		    -type okcancel -default ok -parent [winfo toplevel $tbl]]
   159         -	if {[string compare $choice "ok"] == 0} {
   160         -	    while {![winfo exists $w]} {
   161         -		set last [string last "." $w]
   162         -		if {$last != 0} {
   163         -		    incr last -1
   164         -		}
   165         -		set w [string range $w 0 $last]
   166         -	    }
   167         -	} else {
   168         -	    return ""
   169         -	}
   170         -    }
   171         -
   172         -    set top [winfo toplevel $tbl]
   173         -    wm title $top "Children of the [winfo class $w] Widget \"$w\""
   174         -
   175         -    $tbl resetsortinfo
   176         -    $tbl delete 0 end
   177         -
   178         -    #
   179         -    # Display the data of the children of the
   180         -    # widget w in the tablelist widget tbl
   181         -    #
   182         -    variable leafImg
   183         -    variable compImg
   184         -    foreach c [winfo children $w] {
   185         -	#
   186         -	# Insert the data of the current child into the tablelist widget
   187         -	#
   188         -	set item {}
   189         -	lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \
   190         -		     [winfo width $c] [winfo height $c] [winfo ismapped $c] \
   191         -		     [winfo viewable $c] [winfo manager $c]
   192         -	$tbl insert end $item
   193         -
   194         -	#
   195         -	# Insert an image into the first cell of the row
   196         -	#
   197         -	if {[llength [winfo children $c]] == 0} {
   198         -	    $tbl cellconfigure end,0 -image $leafImg
   199         -	} else {
   200         -	    $tbl cellconfigure end,0 -image $compImg
   201         -	}
   202         -    }
   203         -
   204         -    #
   205         -    # Configure the "Refresh" and "Parent" buttons
   206         -    #
   207         -    $top.bf.b1 configure -command [list demo::putChildren $w $tbl]
   208         -    set b2 $top.bf.b2
   209         -    set p [winfo parent $w]
   210         -    if {[string compare $p ""] == 0} {
   211         -	$b2 configure -state disabled
   212         -    } else {
   213         -	$b2 configure -state normal -command [list demo::putChildren $p $tbl]
   214         -    }
   215         -}
   216         -
   217         -#------------------------------------------------------------------------------
   218         -# demo::formatBoolean
   219         -#
   220         -# Returns "yes" or "no", according to the specified boolean value.
   221         -#------------------------------------------------------------------------------
   222         -proc demo::formatBoolean val {
   223         -    return [expr {$val ? "yes" : "no"}]
   224         -}
   225         -
   226         -#------------------------------------------------------------------------------
   227         -# demo::labelCmd
   228         -#
   229         -# Sorts the contents of the tablelist widget tbl by its col'th column and makes
   230         -# sure the items will be updated 500 ms later (because one of the items might
   231         -# refer to a canvas containing the arrow that displays the sort order).
   232         -#------------------------------------------------------------------------------
   233         -proc demo::labelCmd {tbl col} {
   234         -    tablelist::sortByColumn $tbl $col
   235         -    updateItemsDelayed $tbl
   236         -}
   237         -
   238         -#------------------------------------------------------------------------------
   239         -# demo::updateItemsDelayed
   240         -#
   241         -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
   242         -#------------------------------------------------------------------------------
   243         -proc demo::updateItemsDelayed tbl {
   244         -    #
   245         -    # Schedule the demo::updateItems command for execution
   246         -    # 500 ms later, but only if it is not yet pending
   247         -    #
   248         -    if {[string compare [$tbl attrib afterId] ""] == 0} {
   249         -	$tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
   250         -    }
   251         -}
   252         -
   253         -#------------------------------------------------------------------------------
   254         -# demo::updateItems
   255         -#
   256         -# Updates the items of the tablelist widget tbl.
   257         -#------------------------------------------------------------------------------
   258         -proc demo::updateItems tbl {
   259         -    #
   260         -    # Reset the tablelist's "afterId" attribute
   261         -    #
   262         -    $tbl attrib afterId ""
   263         -
   264         -    #
   265         -    # Update the items
   266         -    #
   267         -    set rowCount [$tbl size]
   268         -    for {set row 0} {$row < $rowCount} {incr row} {
   269         -	set c [$tbl cellcget $row,0 -text]
   270         -	if {![winfo exists $c]} {
   271         -	    continue
   272         -	}
   273         -
   274         -	set item {}
   275         -	lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \
   276         -		     [winfo width $c] [winfo height $c] [winfo ismapped $c] \
   277         -		     [winfo viewable $c] [winfo manager $c]
   278         -	$tbl rowconfigure $row -text $item
   279         -    }
   280         -
   281         -    #
   282         -    # Repeat the last sort operation (if any)
   283         -    #
   284         -    $tbl refreshsorting
   285         -}
   286         -
   287         -#------------------------------------------------------------------------------
   288         -# demo::putChildrenOfSelWidget
   289         -#
   290         -# Outputs the data of the children of the selected widget into the tablelist
   291         -# widget tbl.
   292         -#------------------------------------------------------------------------------
   293         -proc demo::putChildrenOfSelWidget tbl {
   294         -    set w [$tbl cellcget [$tbl curselection],0 -text]
   295         -    if {![winfo exists $w]} {
   296         -	bell
   297         -	tk_messageBox -title "Error" -icon error -message \
   298         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   299         -	return ""
   300         -    }
   301         -
   302         -    if {[llength [winfo children $w]] == 0} {
   303         -	bell
   304         -    } else {
   305         -	putChildren $w $tbl
   306         -    }
   307         -}
   308         -
   309         -#------------------------------------------------------------------------------
   310         -# demo::dispConfigOfSelWidget
   311         -#
   312         -# Displays the configuration options of the selected widget within the
   313         -# tablelist tbl in a tablelist widget contained in a newly created top-level
   314         -# widget.
   315         -#------------------------------------------------------------------------------
   316         -proc demo::dispConfigOfSelWidget tbl {
   317         -    demo::displayConfig [$tbl cellcget [$tbl curselection],0 -text]
   318         -}
   319         -
   320         -#------------------------------------------------------------------------------
   321         -# demo::postPopupMenu
   322         -#
   323         -# Posts the pop-up menu $top.menu at the given screen position.  Before posting
   324         -# the menu, the procedure enables/disables its first entry, depending upon
   325         -# whether the selected widget has children or not.
   326         -#------------------------------------------------------------------------------
   327         -proc demo::postPopupMenu {top rootX rootY} {
   328         -    set tbl $top.tf.tbl
   329         -    set w [$tbl cellcget [$tbl curselection],0 -text]
   330         -    if {![winfo exists $w]} {
   331         -	bell
   332         -	tk_messageBox -title "Error" -icon error -message \
   333         -	    "Bad window path name \"$w\"" -parent $top
   334         -	return ""
   335         -    }
   336         -
   337         -    set menu $top.menu
   338         -    if {[llength [winfo children $w]] == 0} {
   339         -	$menu entryconfigure 0 -state disabled
   340         -    } else {
   341         -	$menu entryconfigure 0 -state normal
   342         -    }
   343         -
   344         -    tk_popup $menu $rootX $rootY
   345         -}
   346         -
   347         -#------------------------------------------------------------------------------
   348         -
   349         -if {$tcl_interactive} {
   350         -    return "\nTo display information about the children of an arbitrary\
   351         -	    widget, enter\n\n\tdemo::displayChildren <widgetName>\n"
   352         -} else {
   353         -    wm withdraw .
   354         -    tk_messageBox -title $argv0 -icon warning -message \
   355         -	"Please source this script into\nan interactive wish session"
   356         -    exit 1
   357         -}

Deleted libs/tablelist5.16/demos/browseTree.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying information about
     3         -# the children of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2010-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require Tk 8.3
     9         -package require tablelist 5.16
    10         -
    11         -namespace eval demo {
    12         -    variable dir [file dirname [info script]]
    13         -
    14         -    #
    15         -    # Create two images, needed in the procedure putChildren
    16         -    #
    17         -    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
    18         -		      -background coral -foreground gray50]
    19         -    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
    20         -		      -background yellow -foreground gray50]
    21         -}
    22         -
    23         -source [file join $demo::dir config.tcl]
    24         -
    25         -#------------------------------------------------------------------------------
    26         -# demo::displayChildren
    27         -#
    28         -# Displays information on the children of the widget w in a tablelist widget
    29         -# contained in a newly created top-level widget.  Returns the name of the
    30         -# tablelist widget.
    31         -#------------------------------------------------------------------------------
    32         -proc demo::displayChildren w {
    33         -    if {![winfo exists $w]} {
    34         -	bell
    35         -	tk_messageBox -title "Error" -icon error -message \
    36         -	    "Bad window path name \"$w\""
    37         -	return ""
    38         -    }
    39         -
    40         -    #
    41         -    # Create a top-level widget of the class DemoTop
    42         -    #
    43         -    set top .browseTop
    44         -    for {set n 2} {[winfo exists $top]} {incr n} {
    45         -	set top .browseTop$n
    46         -    }
    47         -    toplevel $top -class DemoTop
    48         -
    49         -    #
    50         -    # Create a vertically scrolled tablelist widget with 9 dynamic-width
    51         -    # columns and interactive sort capability within the top-level
    52         -    #
    53         -    set tf $top.tf
    54         -    frame $tf
    55         -    set tbl $tf.tbl
    56         -    set vsb $tf.vsb
    57         -    tablelist::tablelist $tbl \
    58         -	-columns {0 "Path Name"	left
    59         -		  0 "Class"	left
    60         -		  0 "X"		right
    61         -		  0 "Y"		right
    62         -		  0 "Width"	right
    63         -		  0 "Height"	right
    64         -		  0 "Mapped"	center
    65         -		  0 "Viewable"	center
    66         -		  0 "Manager"	left} \
    67         -	-expandcommand demo::expandCmd -labelcommand demo::labelCmd \
    68         -	-yscrollcommand [list $vsb set] -setgrid no -width 0
    69         -    if {[$tbl cget -selectborderwidth] == 0} {
    70         -	$tbl configure -spacing 1
    71         -    }
    72         -    foreach col {2 3 4 5} {
    73         -	$tbl columnconfigure $col -sortmode integer
    74         -    }
    75         -    foreach col {6 7} {
    76         -	$tbl columnconfigure $col -formatcommand demo::formatBoolean
    77         -    }
    78         -    scrollbar $vsb -orient vertical -command [list $tbl yview]
    79         -
    80         -    #
    81         -    # When displaying the information about the children of any
    82         -    # ancestor of the label widgets, the widths of some of the
    83         -    # labels and thus also the widths and x coordinates of some
    84         -    # children may change.  For this reason, make sure the items
    85         -    # will be updated after any change in the sizes of the labels
    86         -    #
    87         -    foreach l [$tbl labels] {
    88         -	bind $l <Configure> [list demo::updateItemsDelayed $tbl]
    89         -    }
    90         -    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
    91         -
    92         -    #
    93         -    # Create a pop-up menu with two command entries; bind the script
    94         -    # associated with its first entry to the <Double-1> event, too
    95         -    #
    96         -    set menu $top.menu
    97         -    menu $menu -tearoff no
    98         -    $menu add command -label "Display Children" \
    99         -		      -command [list demo::putChildrenOfSelWidget $tbl]
   100         -    $menu add command -label "Display Config" \
   101         -		      -command [list demo::dispConfigOfSelWidget $tbl]
   102         -    set bodyTag [$tbl bodytag]
   103         -    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
   104         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
   105         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
   106         -    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
   107         -
   108         -    #
   109         -    # Create three buttons within a frame child of the top-level widget
   110         -    #
   111         -    set bf $top.bf
   112         -    frame $bf
   113         -    set b1 $bf.b1
   114         -    set b2 $bf.b2
   115         -    set b3 $bf.b3
   116         -    button $b1 -text "Refresh"
   117         -    button $b2 -text "Parent"
   118         -    button $b3 -text "Close" -command [list destroy $top]
   119         -
   120         -    #
   121         -    # Manage the widgets
   122         -    #
   123         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   124         -    variable winSys
   125         -    if {[string compare $winSys "aqua"] == 0} {
   126         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   127         -	grid $vsb	       -row 1 -column 1 -sticky ns
   128         -    } else {
   129         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   130         -    }
   131         -    grid rowconfigure    $tf 1 -weight 1
   132         -    grid columnconfigure $tf 0 -weight 1
   133         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   134         -    pack $bf -side bottom -fill x
   135         -    pack $tf -side top -expand yes -fill both
   136         -
   137         -    #
   138         -    # Populate the tablelist with the data of the given widget's children
   139         -    #
   140         -    putChildren $w $tbl root
   141         -    return $tbl
   142         -}
   143         -
   144         -#------------------------------------------------------------------------------
   145         -# demo::putChildren
   146         -#
   147         -# Outputs the data of the children of the widget w into the tablelist widget
   148         -# tbl, as child items of the one identified by nodeIdx.
   149         -#------------------------------------------------------------------------------
   150         -proc demo::putChildren {w tbl nodeIdx} {
   151         -    #
   152         -    # The following check is necessary because this procedure
   153         -    # is also invoked by the "Refresh" and "Parent" buttons
   154         -    #
   155         -    if {![winfo exists $w]} {
   156         -	bell
   157         -	if {[string compare $nodeIdx "root"] == 0} {
   158         -	    set choice [tk_messageBox -title "Error" -icon warning \
   159         -			-message "Bad window path name \"$w\" -- replacing\
   160         -				  it with nearest existent ancestor" \
   161         -			-type okcancel -default ok \
   162         -			-parent [winfo toplevel $tbl]]
   163         -	    if {[string compare $choice "ok"] == 0} {
   164         -		while {![winfo exists $w]} {
   165         -		    set last [string last "." $w]
   166         -		    if {$last != 0} {
   167         -			incr last -1
   168         -		    }
   169         -		    set w [string range $w 0 $last]
   170         -		}
   171         -	    } else {
   172         -		return ""
   173         -	    }
   174         -	} else {
   175         -	    return ""
   176         -	}
   177         -    }
   178         -
   179         -    if {[string compare $nodeIdx "root"] == 0} {
   180         -	set top [winfo toplevel $tbl]
   181         -	wm title $top "Children of the [winfo class $w] Widget \"$w\""
   182         -
   183         -	$tbl resetsortinfo
   184         -	$tbl delete 0 end
   185         -	set row 0
   186         -    } else {
   187         -	set row [expr {$nodeIdx + 1}]
   188         -    }
   189         -
   190         -    #
   191         -    # Display the data of the children of the
   192         -    # widget w in the tablelist widget tbl
   193         -    #
   194         -    variable leafImg
   195         -    variable compImg
   196         -    foreach c [winfo children $w] {
   197         -	#
   198         -	# Insert the data of the current child into the tablelist widget
   199         -	#
   200         -	set item {}
   201         -	lappend item \
   202         -		[winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
   203         -		[winfo width $c] [winfo height $c] [winfo ismapped $c] \
   204         -		[winfo viewable $c] [winfo manager $c]
   205         -	$tbl insertchild $nodeIdx end $item
   206         -
   207         -	#
   208         -	# Insert an image into the first cell of the row; mark the
   209         -	# row as collapsed if the child widget has children itself
   210         -	#
   211         -	if {[llength [winfo children $c]] == 0} {
   212         -	    $tbl cellconfigure $row,0 -image $leafImg
   213         -	} else {
   214         -	    $tbl cellconfigure $row,0 -image $compImg
   215         -	    $tbl collapse $row
   216         -	}
   217         -
   218         -	$tbl rowattrib $row pathName $c
   219         -	incr row
   220         -    }
   221         -
   222         -    if {[string compare $nodeIdx "root"] == 0} {
   223         -	#
   224         -	# Configure the "Refresh" and "Parent" buttons
   225         -	#
   226         -	$top.bf.b1 configure -command [list demo::refreshView $w $tbl]
   227         -	set b2 $top.bf.b2
   228         -	set p [winfo parent $w]
   229         -	if {[string compare $p ""] == 0} {
   230         -	    $b2 configure -state disabled
   231         -	} else {
   232         -	    $b2 configure -state normal -command \
   233         -		[list demo::putChildren $p $tbl root]
   234         -	}
   235         -    }
   236         -}
   237         -
   238         -#------------------------------------------------------------------------------
   239         -# demo::expandCmd
   240         -#
   241         -# Outputs the data of the children of the widget whose leaf name is displayed
   242         -# in the first cell of the specified row of the tablelist widget tbl, as child
   243         -# items of the one identified by row.
   244         -#------------------------------------------------------------------------------
   245         -proc demo::expandCmd {tbl row} {
   246         -    if {[$tbl childcount $row] == 0} {
   247         -	set w [$tbl rowattrib $row pathName]
   248         -	putChildren $w $tbl $row
   249         -
   250         -	#
   251         -	# Apply the last sorting (if any) to the new items
   252         -	#
   253         -	$tbl refreshsorting $row
   254         -    }
   255         -}
   256         -
   257         -#------------------------------------------------------------------------------
   258         -# demo::formatBoolean
   259         -#
   260         -# Returns "yes" or "no", according to the specified boolean value.
   261         -#------------------------------------------------------------------------------
   262         -proc demo::formatBoolean val {
   263         -    return [expr {$val ? "yes" : "no"}]
   264         -}
   265         -
   266         -#------------------------------------------------------------------------------
   267         -# demo::labelCmd
   268         -#
   269         -# Sorts the contents of the tablelist widget tbl by its col'th column and makes
   270         -# sure the items will be updated 500 ms later (because one of the items might
   271         -# refer to a canvas containing the arrow that displays the sort order).
   272         -#------------------------------------------------------------------------------
   273         -proc demo::labelCmd {tbl col} {
   274         -    tablelist::sortByColumn $tbl $col
   275         -    updateItemsDelayed $tbl
   276         -}
   277         -
   278         -#------------------------------------------------------------------------------
   279         -# demo::updateItemsDelayed
   280         -#
   281         -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
   282         -#------------------------------------------------------------------------------
   283         -proc demo::updateItemsDelayed tbl {
   284         -    #
   285         -    # Schedule the demo::updateItems command for execution
   286         -    # 500 ms later, but only if it is not yet pending
   287         -    #
   288         -    if {[string compare [$tbl attrib afterId] ""] == 0} {
   289         -	$tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
   290         -    }
   291         -}
   292         -
   293         -#------------------------------------------------------------------------------
   294         -# demo::updateItems
   295         -#
   296         -# Updates the items of the tablelist widget tbl.
   297         -#------------------------------------------------------------------------------
   298         -proc demo::updateItems tbl {
   299         -    #
   300         -    # Reset the tablelist's "afterId" attribute
   301         -    #
   302         -    $tbl attrib afterId ""
   303         -
   304         -    #
   305         -    # Update the items
   306         -    #
   307         -    set rowCount [$tbl size]
   308         -    for {set row 0} {$row < $rowCount} {incr row} {
   309         -	set c [$tbl rowattrib $row pathName]
   310         -	if {![winfo exists $c]} {
   311         -	    continue
   312         -	}
   313         -
   314         -	set item {}
   315         -	lappend item \
   316         -		[winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
   317         -		[winfo width $c] [winfo height $c] [winfo ismapped $c] \
   318         -		[winfo viewable $c] [winfo manager $c]
   319         -	$tbl rowconfigure $row -text $item
   320         -    }
   321         -
   322         -    #
   323         -    # Repeat the last sort operation (if any)
   324         -    #
   325         -    $tbl refreshsorting
   326         -}
   327         -
   328         -#------------------------------------------------------------------------------
   329         -# demo::putChildrenOfSelWidget
   330         -#
   331         -# Outputs the data of the children of the selected widget into the tablelist
   332         -# widget tbl.
   333         -#------------------------------------------------------------------------------
   334         -proc demo::putChildrenOfSelWidget tbl {
   335         -    set w [$tbl rowattrib [$tbl curselection] pathName]
   336         -    if {![winfo exists $w]} {
   337         -	bell
   338         -	tk_messageBox -title "Error" -icon error -message \
   339         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   340         -	return ""
   341         -    }
   342         -
   343         -    if {[llength [winfo children $w]] == 0} {
   344         -	bell
   345         -    } else {
   346         -	putChildren $w $tbl root
   347         -    }
   348         -}
   349         -
   350         -#------------------------------------------------------------------------------
   351         -# demo::dispConfigOfSelWidget
   352         -#
   353         -# Displays the configuration options of the selected widget within the
   354         -# tablelist tbl in a tablelist widget contained in a newly created top-level
   355         -# widget.
   356         -#------------------------------------------------------------------------------
   357         -proc demo::dispConfigOfSelWidget tbl {
   358         -    demo::displayConfig [$tbl rowattrib [$tbl curselection] pathName]
   359         -}
   360         -
   361         -#------------------------------------------------------------------------------
   362         -# demo::postPopupMenu
   363         -#
   364         -# Posts the pop-up menu $top.menu at the given screen position.  Before posting
   365         -# the menu, the procedure enables/disables its first entry, depending upon
   366         -# whether the selected widget has children or not.
   367         -#------------------------------------------------------------------------------
   368         -proc demo::postPopupMenu {top rootX rootY} {
   369         -    set tbl $top.tf.tbl
   370         -    set w [$tbl rowattrib [$tbl curselection] pathName]
   371         -    if {![winfo exists $w]} {
   372         -	bell
   373         -	tk_messageBox -title "Error" -icon error -message \
   374         -	    "Bad window path name \"$w\"" -parent $top
   375         -	return ""
   376         -    }
   377         -
   378         -    set menu $top.menu
   379         -    if {[llength [winfo children $w]] == 0} {
   380         -	$menu entryconfigure 0 -state disabled
   381         -    } else {
   382         -	$menu entryconfigure 0 -state normal
   383         -    }
   384         -
   385         -    tk_popup $menu $rootX $rootY
   386         -}
   387         -
   388         -#------------------------------------------------------------------------------
   389         -# demo::refreshView
   390         -#
   391         -# Redisplays the data of the children of the widget w in the tablelist widget
   392         -# tbl and restores the expanded states of the items as well as the vertical
   393         -# view.
   394         -#------------------------------------------------------------------------------
   395         -proc demo::refreshView {w tbl} {
   396         -    #
   397         -    # Save the vertical view and get the path names of
   398         -    # the child widgets displayed in the expanded rows
   399         -    #
   400         -    set yView [$tbl yview]
   401         -    foreach key [$tbl expandedkeys] {
   402         -	set pathName [$tbl rowattrib $key pathName]
   403         -	set expandedWidgets($pathName) 1
   404         -    }
   405         -
   406         -    #
   407         -    # Redisplay the data of the widget's (possibly changed) children and
   408         -    # restore the expanded states of the children, along with the vertical view
   409         -    #
   410         -    putChildren $w $tbl root
   411         -    restoreExpandedStates $tbl root expandedWidgets
   412         -    $tbl yview moveto [lindex $yView 0]
   413         -}
   414         -
   415         -#------------------------------------------------------------------------------
   416         -# demo::restoreExpandedStates
   417         -#   
   418         -# Expands those children of the parent identified by nodeIdx that display the
   419         -# data of child widgets whose path names are the names of the elements of the
   420         -# array specified by the last argument.
   421         -#------------------------------------------------------------------------------
   422         -proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} {
   423         -    upvar $expandedWidgetsName expandedWidgets
   424         -
   425         -    foreach key [$tbl childkeys $nodeIdx] {
   426         -	set pathName [$tbl rowattrib $key pathName]
   427         -	if {[info exists expandedWidgets($pathName)]} {
   428         -	    $tbl expand $key -partly
   429         -	    restoreExpandedStates $tbl $key expandedWidgets
   430         -	}
   431         -    }
   432         -}
   433         -
   434         -#------------------------------------------------------------------------------
   435         -
   436         -if {$tcl_interactive} {
   437         -    return "\nTo display information about the children of an arbitrary\
   438         -	    widget, enter\n\n\tdemo::displayChildren <widgetName>\n"
   439         -} else {
   440         -    wm withdraw .
   441         -    tk_messageBox -title $argv0 -icon warning -message \
   442         -	"Please source this script into\nan interactive wish session"
   443         -    exit 1
   444         -}

Deleted libs/tablelist5.16/demos/browseTree_tile.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying information about
     3         -# the children of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2010-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require tablelist_tile 5.16
     9         -
    10         -namespace eval demo {
    11         -    variable dir [file dirname [info script]]
    12         -
    13         -    #
    14         -    # Create two images, needed in the procedure putChildren
    15         -    #
    16         -    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
    17         -		      -background coral -foreground gray50]
    18         -    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
    19         -		      -background yellow -foreground gray50]
    20         -}
    21         -
    22         -source [file join $demo::dir config_tile.tcl]
    23         -
    24         -#
    25         -# Work around the improper appearance of the tile scrollbars in the aqua theme
    26         -#
    27         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    28         -    interp alias {} ttk::scrollbar {} ::scrollbar
    29         -}
    30         -
    31         -#------------------------------------------------------------------------------
    32         -# demo::displayChildren
    33         -#
    34         -# Displays information on the children of the widget w in a tablelist widget
    35         -# contained in a newly created top-level widget.  Returns the name of the
    36         -# tablelist widget.
    37         -#------------------------------------------------------------------------------
    38         -proc demo::displayChildren w {
    39         -    if {![winfo exists $w]} {
    40         -	bell
    41         -	tk_messageBox -title "Error" -icon error -message \
    42         -	    "Bad window path name \"$w\""
    43         -	return ""
    44         -    }
    45         -
    46         -    #
    47         -    # Create a top-level widget of the class DemoTop
    48         -    #
    49         -    set top .browseTop
    50         -    for {set n 2} {[winfo exists $top]} {incr n} {
    51         -	set top .browseTop$n
    52         -    }
    53         -    toplevel $top -class DemoTop
    54         -
    55         -    #
    56         -    # Create a vertically scrolled tablelist widget with 9 dynamic-width
    57         -    # columns and interactive sort capability within the top-level
    58         -    #
    59         -    set tf $top.tf
    60         -    ttk::frame $tf
    61         -    set tbl $tf.tbl
    62         -    set vsb $tf.vsb
    63         -    tablelist::tablelist $tbl \
    64         -	-columns {0 "Path Name"	left
    65         -		  0 "Class"	left
    66         -		  0 "X"		right
    67         -		  0 "Y"		right
    68         -		  0 "Width"	right
    69         -		  0 "Height"	right
    70         -		  0 "Mapped"	center
    71         -		  0 "Viewable"	center
    72         -		  0 "Manager"	left} \
    73         -	-expandcommand demo::expandCmd -labelcommand demo::labelCmd \
    74         -	-yscrollcommand [list $vsb set] -setgrid no -width 0
    75         -    if {[$tbl cget -selectborderwidth] == 0} {
    76         -	$tbl configure -spacing 1
    77         -    }
    78         -    foreach col {2 3 4 5} {
    79         -	$tbl columnconfigure $col -sortmode integer
    80         -    }
    81         -    foreach col {6 7} {
    82         -	$tbl columnconfigure $col -formatcommand demo::formatBoolean
    83         -    }
    84         -    ttk::scrollbar $vsb -orient vertical -command [list $tbl yview]
    85         -
    86         -    #
    87         -    # When displaying the information about the children of any
    88         -    # ancestor of the label widgets, the widths of some of the
    89         -    # labels and thus also the widths and x coordinates of some
    90         -    # children may change.  For this reason, make sure the items
    91         -    # will be updated after any change in the sizes of the labels
    92         -    #
    93         -    foreach l [$tbl labels] {
    94         -	bind $l <Configure> [list demo::updateItemsDelayed $tbl]
    95         -    }
    96         -    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
    97         -
    98         -    #
    99         -    # Create a pop-up menu with two command entries; bind the script
   100         -    # associated with its first entry to the <Double-1> event, too
   101         -    #
   102         -    set menu $top.menu
   103         -    menu $menu -tearoff no
   104         -    $menu add command -label "Display Children" \
   105         -		      -command [list demo::putChildrenOfSelWidget $tbl]
   106         -    $menu add command -label "Display Config" \
   107         -		      -command [list demo::dispConfigOfSelWidget $tbl]
   108         -    set bodyTag [$tbl bodytag]
   109         -    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
   110         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
   111         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
   112         -    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
   113         -
   114         -    #
   115         -    # Create three buttons within a tile frame child of the top-level widget
   116         -    #
   117         -    set bf $top.bf
   118         -    ttk::frame $bf
   119         -    set b1 $bf.b1
   120         -    set b2 $bf.b2
   121         -    set b3 $bf.b3
   122         -    ttk::button $b1 -text "Refresh"
   123         -    ttk::button $b2 -text "Parent"
   124         -    ttk::button $b3 -text "Close" -command [list destroy $top]
   125         -
   126         -    #
   127         -    # Manage the widgets
   128         -    #
   129         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   130         -    if {[tablelist::getCurrentTheme] eq "aqua"} {
   131         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   132         -	grid $vsb	       -row 1 -column 1 -sticky ns
   133         -    } else {
   134         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   135         -    }
   136         -    grid rowconfigure    $tf 1 -weight 1
   137         -    grid columnconfigure $tf 0 -weight 1
   138         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   139         -    pack $bf -side bottom -fill x
   140         -    pack $tf -side top -expand yes -fill both
   141         -
   142         -    #
   143         -    # Populate the tablelist with the data of the given widget's children
   144         -    #
   145         -    putChildren $w $tbl root
   146         -    return $tbl
   147         -}
   148         -
   149         -#------------------------------------------------------------------------------
   150         -# demo::putChildren
   151         -#
   152         -# Outputs the data of the children of the widget w into the tablelist widget
   153         -# tbl, as child items of the one identified by nodeIdx.
   154         -#------------------------------------------------------------------------------
   155         -proc demo::putChildren {w tbl nodeIdx} {
   156         -    #
   157         -    # The following check is necessary because this procedure
   158         -    # is also invoked by the "Refresh" and "Parent" buttons
   159         -    #
   160         -    if {![winfo exists $w]} {
   161         -	bell
   162         -	if {[string compare $nodeIdx "root"] == 0} {
   163         -	    set choice [tk_messageBox -title "Error" -icon warning \
   164         -			-message "Bad window path name \"$w\" -- replacing\
   165         -				  it with nearest existent ancestor" \
   166         -			-type okcancel -default ok \
   167         -			-parent [winfo toplevel $tbl]]
   168         -	    if {[string compare $choice "ok"] == 0} {
   169         -		while {![winfo exists $w]} {
   170         -		    set last [string last "." $w]
   171         -		    if {$last != 0} {
   172         -			incr last -1
   173         -		    }
   174         -		    set w [string range $w 0 $last]
   175         -		}
   176         -	    } else {
   177         -		return ""
   178         -	    }
   179         -	} else {
   180         -	    return ""
   181         -	}
   182         -    }
   183         -
   184         -    if {[string compare $nodeIdx "root"] == 0} {
   185         -	set top [winfo toplevel $tbl]
   186         -	wm title $top "Children of the [winfo class $w] Widget \"$w\""
   187         -
   188         -	$tbl resetsortinfo
   189         -	$tbl delete 0 end
   190         -	set row 0
   191         -    } else {
   192         -	set row [expr {$nodeIdx + 1}]
   193         -    }
   194         -
   195         -    #
   196         -    # Display the data of the children of the
   197         -    # widget w in the tablelist widget tbl
   198         -    #
   199         -    variable leafImg
   200         -    variable compImg
   201         -    foreach c [winfo children $w] {
   202         -	#
   203         -	# Insert the data of the current child into the tablelist widget
   204         -	#
   205         -	set item {}
   206         -	lappend item \
   207         -		[winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
   208         -		[winfo width $c] [winfo height $c] [winfo ismapped $c] \
   209         -		[winfo viewable $c] [winfo manager $c]
   210         -	$tbl insertchild $nodeIdx end $item
   211         -
   212         -	#
   213         -	# Insert an image into the first cell of the row; mark the
   214         -	# row as collapsed if the child widget has children itself
   215         -	#
   216         -	if {[llength [winfo children $c]] == 0} {
   217         -	    $tbl cellconfigure $row,0 -image $leafImg
   218         -	} else {
   219         -	    $tbl cellconfigure $row,0 -image $compImg
   220         -	    $tbl collapse $row
   221         -	}
   222         -
   223         -	$tbl rowattrib $row pathName $c
   224         -	incr row
   225         -    }
   226         -
   227         -    if {[string compare $nodeIdx "root"] == 0} {
   228         -	#
   229         -	# Configure the "Refresh" and "Parent" buttons
   230         -	#
   231         -	$top.bf.b1 configure -command [list demo::refreshView $w $tbl]
   232         -	set b2 $top.bf.b2
   233         -	set p [winfo parent $w]
   234         -	if {[string compare $p ""] == 0} {
   235         -	    $b2 configure -state disabled
   236         -	} else {
   237         -	    $b2 configure -state normal -command \
   238         -		[list demo::putChildren $p $tbl root]
   239         -	}
   240         -    }
   241         -}
   242         -
   243         -#------------------------------------------------------------------------------
   244         -# demo::expandCmd
   245         -#
   246         -# Outputs the data of the children of the widget whose leaf name is displayed
   247         -# in the first cell of the specified row of the tablelist widget tbl, as child
   248         -# items of the one identified by row.
   249         -#------------------------------------------------------------------------------
   250         -proc demo::expandCmd {tbl row} {
   251         -    if {[$tbl childcount $row] == 0} {
   252         -	set w [$tbl rowattrib $row pathName]
   253         -	putChildren $w $tbl $row
   254         -
   255         -	#
   256         -	# Apply the last sorting (if any) to the new items
   257         -	#
   258         -	$tbl refreshsorting $row
   259         -    }
   260         -}
   261         -
   262         -#------------------------------------------------------------------------------
   263         -# demo::formatBoolean
   264         -#
   265         -# Returns "yes" or "no", according to the specified boolean value.
   266         -#------------------------------------------------------------------------------
   267         -proc demo::formatBoolean val {
   268         -    return [expr {$val ? "yes" : "no"}]
   269         -}
   270         -
   271         -#------------------------------------------------------------------------------
   272         -# demo::labelCmd
   273         -#
   274         -# Sorts the contents of the tablelist widget tbl by its col'th column and makes
   275         -# sure the items will be updated 500 ms later (because one of the items might
   276         -# refer to a canvas containing the arrow that displays the sort order).
   277         -#------------------------------------------------------------------------------
   278         -proc demo::labelCmd {tbl col} {
   279         -    tablelist::sortByColumn $tbl $col
   280         -    updateItemsDelayed $tbl
   281         -}
   282         -
   283         -#------------------------------------------------------------------------------
   284         -# demo::updateItemsDelayed
   285         -#
   286         -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
   287         -#------------------------------------------------------------------------------
   288         -proc demo::updateItemsDelayed tbl {
   289         -    #
   290         -    # Schedule the demo::updateItems command for execution
   291         -    # 500 ms later, but only if it is not yet pending
   292         -    #
   293         -    if {[string compare [$tbl attrib afterId] ""] == 0} {
   294         -	$tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
   295         -    }
   296         -}
   297         -
   298         -#------------------------------------------------------------------------------
   299         -# demo::updateItems
   300         -#
   301         -# Updates the items of the tablelist widget tbl.
   302         -#------------------------------------------------------------------------------
   303         -proc demo::updateItems tbl {
   304         -    #
   305         -    # Reset the tablelist's "afterId" attribute
   306         -    #
   307         -    $tbl attrib afterId ""
   308         -
   309         -    #
   310         -    # Update the items
   311         -    #
   312         -    set rowCount [$tbl size]
   313         -    for {set row 0} {$row < $rowCount} {incr row} {
   314         -	set c [$tbl rowattrib $row pathName]
   315         -	if {![winfo exists $c]} {
   316         -	    continue
   317         -	}
   318         -
   319         -	set item {}
   320         -	lappend item \
   321         -		[winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
   322         -		[winfo width $c] [winfo height $c] [winfo ismapped $c] \
   323         -		[winfo viewable $c] [winfo manager $c]
   324         -	$tbl rowconfigure $row -text $item
   325         -    }
   326         -
   327         -    #
   328         -    # Repeat the last sort operation (if any)
   329         -    #
   330         -    $tbl refreshsorting
   331         -}
   332         -
   333         -#------------------------------------------------------------------------------
   334         -# demo::putChildrenOfSelWidget
   335         -#
   336         -# Outputs the data of the children of the selected widget into the tablelist
   337         -# widget tbl.
   338         -#------------------------------------------------------------------------------
   339         -proc demo::putChildrenOfSelWidget tbl {
   340         -    set w [$tbl rowattrib [$tbl curselection] pathName]
   341         -    if {![winfo exists $w]} {
   342         -	bell
   343         -	tk_messageBox -title "Error" -icon error -message \
   344         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   345         -	return ""
   346         -    }
   347         -
   348         -    if {[llength [winfo children $w]] == 0} {
   349         -	bell
   350         -    } else {
   351         -	putChildren $w $tbl root
   352         -    }
   353         -}
   354         -
   355         -#------------------------------------------------------------------------------
   356         -# demo::dispConfigOfSelWidget
   357         -#
   358         -# Displays the configuration options of the selected widget within the
   359         -# tablelist tbl in a tablelist widget contained in a newly created top-level
   360         -# widget.
   361         -#------------------------------------------------------------------------------
   362         -proc demo::dispConfigOfSelWidget tbl {
   363         -    demo::displayConfig [$tbl rowattrib [$tbl curselection] pathName]
   364         -}
   365         -
   366         -#------------------------------------------------------------------------------
   367         -# demo::postPopupMenu
   368         -#
   369         -# Posts the pop-up menu $top.menu at the given screen position.  Before posting
   370         -# the menu, the procedure enables/disables its first entry, depending upon
   371         -# whether the selected widget has children or not.
   372         -#------------------------------------------------------------------------------
   373         -proc demo::postPopupMenu {top rootX rootY} {
   374         -    set tbl $top.tf.tbl
   375         -    set w [$tbl rowattrib [$tbl curselection] pathName]
   376         -    if {![winfo exists $w]} {
   377         -	bell
   378         -	tk_messageBox -title "Error" -icon error -message \
   379         -	    "Bad window path name \"$w\"" -parent $top
   380         -	return ""
   381         -    }
   382         -
   383         -    set menu $top.menu
   384         -    if {[llength [winfo children $w]] == 0} {
   385         -	$menu entryconfigure 0 -state disabled
   386         -    } else {
   387         -	$menu entryconfigure 0 -state normal
   388         -    }
   389         -
   390         -    tk_popup $menu $rootX $rootY
   391         -}
   392         -
   393         -#------------------------------------------------------------------------------
   394         -# demo::refreshView
   395         -#
   396         -# Redisplays the data of the children of the widget w in the tablelist widget
   397         -# tbl and restores the expanded states of the items as well as the vertical
   398         -# view.
   399         -#------------------------------------------------------------------------------
   400         -proc demo::refreshView {w tbl} {
   401         -    #
   402         -    # Save the vertical view and get the path names of
   403         -    # the child widgets displayed in the expanded rows
   404         -    #
   405         -    set yView [$tbl yview]
   406         -    foreach key [$tbl expandedkeys] {
   407         -	set pathName [$tbl rowattrib $key pathName]
   408         -	set expandedWidgets($pathName) 1
   409         -    }
   410         -
   411         -    #
   412         -    # Redisplay the data of the widget's (possibly changed) children and
   413         -    # restore the expanded states of the children, along with the vertical view
   414         -    #
   415         -    putChildren $w $tbl root
   416         -    restoreExpandedStates $tbl root expandedWidgets
   417         -    $tbl yview moveto [lindex $yView 0]
   418         -}
   419         -
   420         -#------------------------------------------------------------------------------
   421         -# demo::restoreExpandedStates
   422         -#   
   423         -# Expands those children of the parent identified by nodeIdx that display the
   424         -# data of child widgets whose path names are the names of the elements of the
   425         -# array specified by the last argument.
   426         -#------------------------------------------------------------------------------
   427         -proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} {
   428         -    upvar $expandedWidgetsName expandedWidgets
   429         -
   430         -    foreach key [$tbl childkeys $nodeIdx] {
   431         -	set pathName [$tbl rowattrib $key pathName]
   432         -	if {[info exists expandedWidgets($pathName)]} {
   433         -	    $tbl expand $key -partly
   434         -	    restoreExpandedStates $tbl $key expandedWidgets
   435         -	}
   436         -    }
   437         -}
   438         -
   439         -#------------------------------------------------------------------------------
   440         -
   441         -if {$tcl_interactive} {
   442         -    return "\nTo display information about the children of an arbitrary\
   443         -	    widget, enter\n\n\tdemo::displayChildren <widgetName>\n"
   444         -} else {
   445         -    wm withdraw .
   446         -    tk_messageBox -title $argv0 -icon warning -message \
   447         -	"Please source this script into\nan interactive wish session"
   448         -    exit 1
   449         -}

Deleted libs/tablelist5.16/demos/browse_tile.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying information about
     3         -# children of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2000-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require tablelist_tile 5.16
     9         -
    10         -namespace eval demo {
    11         -    variable dir [file dirname [info script]]
    12         -
    13         -    #
    14         -    # Create two images, needed in the procedure putChildren
    15         -    #
    16         -    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
    17         -		      -background coral -foreground gray50]
    18         -    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
    19         -		      -background yellow -foreground gray50]
    20         -}
    21         -
    22         -source [file join $demo::dir config_tile.tcl]
    23         -
    24         -#
    25         -# Work around the improper appearance of the tile scrollbars in the aqua theme
    26         -#
    27         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    28         -    interp alias {} ttk::scrollbar {} ::scrollbar
    29         -}
    30         -
    31         -#------------------------------------------------------------------------------
    32         -# demo::displayChildren
    33         -#
    34         -# Displays information on the children of the widget w in a tablelist widget
    35         -# contained in a newly created top-level widget.  Returns the name of the
    36         -# tablelist widget.
    37         -#------------------------------------------------------------------------------
    38         -proc demo::displayChildren w {
    39         -    if {![winfo exists $w]} {
    40         -	bell
    41         -	tk_messageBox -title "Error" -icon error -message \
    42         -	    "Bad window path name \"$w\""
    43         -	return ""
    44         -    }
    45         -
    46         -    #
    47         -    # Create a top-level widget of the class DemoTop
    48         -    #
    49         -    set top .browseTop
    50         -    for {set n 2} {[winfo exists $top]} {incr n} {
    51         -	set top .browseTop$n
    52         -    }
    53         -    toplevel $top -class DemoTop
    54         -
    55         -    #
    56         -    # Create a vertically scrolled tablelist widget with 9 dynamic-width
    57         -    # columns and interactive sort capability within the top-level
    58         -    #
    59         -    set tf $top.tf
    60         -    ttk::frame $tf
    61         -    set tbl $tf.tbl
    62         -    set vsb $tf.vsb
    63         -    tablelist::tablelist $tbl \
    64         -	-columns {0 "Path Name"	left
    65         -		  0 "Class"	left
    66         -		  0 "X"		right
    67         -		  0 "Y"		right
    68         -		  0 "Width"	right
    69         -		  0 "Height"	right
    70         -		  0 "Mapped"	center
    71         -		  0 "Viewable"	center
    72         -		  0 "Manager"	left} \
    73         -	-labelcommand demo::labelCmd -yscrollcommand [list $vsb set] -width 0
    74         -    if {[$tbl cget -selectborderwidth] == 0} {
    75         -	$tbl configure -spacing 1
    76         -    }
    77         -    foreach col {2 3 4 5} {
    78         -	$tbl columnconfigure $col -sortmode integer
    79         -    }
    80         -    foreach col {6 7} {
    81         -	$tbl columnconfigure $col -formatcommand demo::formatBoolean
    82         -    }
    83         -    ttk::scrollbar $vsb -orient vertical -command [list $tbl yview]
    84         -
    85         -    #
    86         -    # When displaying the information about the children of any
    87         -    # ancestor of the label widgets, the widths of some of the
    88         -    # labels and thus also the widths and x coordinates of some
    89         -    # children may change.  For this reason, make sure the items
    90         -    # will be updated after any change in the sizes of the labels
    91         -    #
    92         -    foreach l [$tbl labels] {
    93         -	bind $l <Configure> [list demo::updateItemsDelayed $tbl]
    94         -    }
    95         -    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
    96         -
    97         -    #
    98         -    # Create a pop-up menu with two command entries; bind the script
    99         -    # associated with its first entry to the <Double-1> event, too
   100         -    #
   101         -    set menu $top.menu
   102         -    menu $menu -tearoff no
   103         -    $menu add command -label "Display Children" \
   104         -		      -command [list demo::putChildrenOfSelWidget $tbl]
   105         -    $menu add command -label "Display Config" \
   106         -		      -command [list demo::dispConfigOfSelWidget $tbl]
   107         -    set bodyTag [$tbl bodytag]
   108         -    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
   109         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
   110         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
   111         -    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
   112         -
   113         -    #
   114         -    # Create three buttons within a tile frame child of the top-level widget
   115         -    #
   116         -    set bf $top.bf
   117         -    ttk::frame $bf
   118         -    set b1 $bf.b1
   119         -    set b2 $bf.b2
   120         -    set b3 $bf.b3
   121         -    ttk::button $b1 -text "Refresh"
   122         -    ttk::button $b2 -text "Parent"
   123         -    ttk::button $b3 -text "Close" -command [list destroy $top]
   124         -
   125         -    #
   126         -    # Manage the widgets
   127         -    #
   128         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   129         -    if {[tablelist::getCurrentTheme] eq "aqua"} {
   130         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   131         -	grid $vsb	       -row 1 -column 1 -sticky ns
   132         -    } else {
   133         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   134         -    }
   135         -    grid rowconfigure    $tf 1 -weight 1
   136         -    grid columnconfigure $tf 0 -weight 1
   137         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   138         -    pack $bf -side bottom -fill x
   139         -    pack $tf -side top -expand yes -fill both
   140         -
   141         -    #
   142         -    # Populate the tablelist with the data of the given widget's children
   143         -    #
   144         -    putChildren $w $tbl
   145         -    return $tbl
   146         -}
   147         -
   148         -#------------------------------------------------------------------------------
   149         -# demo::putChildren
   150         -#
   151         -# Outputs the data of the children of the widget w into the tablelist widget
   152         -# tbl.
   153         -#------------------------------------------------------------------------------
   154         -proc demo::putChildren {w tbl} {
   155         -    #
   156         -    # The following check is necessary because this procedure
   157         -    # is also invoked by the "Refresh" and "Parent" buttons
   158         -    #
   159         -    if {![winfo exists $w]} {
   160         -	bell
   161         -	set choice [tk_messageBox -title "Error" -icon warning \
   162         -		    -message "Bad window path name \"$w\" -- replacing\
   163         -			      it with nearest existent ancestor" \
   164         -		    -type okcancel -default ok -parent [winfo toplevel $tbl]]
   165         -	if {[string compare $choice "ok"] == 0} {
   166         -	    while {![winfo exists $w]} {
   167         -		set last [string last "." $w]
   168         -		if {$last != 0} {
   169         -		    incr last -1
   170         -		}
   171         -		set w [string range $w 0 $last]
   172         -	    }
   173         -	} else {
   174         -	    return ""
   175         -	}
   176         -    }
   177         -
   178         -    set top [winfo toplevel $tbl]
   179         -    wm title $top "Children of the [winfo class $w] Widget \"$w\""
   180         -
   181         -    $tbl resetsortinfo
   182         -    $tbl delete 0 end
   183         -
   184         -    #
   185         -    # Display the data of the children of the
   186         -    # widget w in the tablelist widget tbl
   187         -    #
   188         -    variable leafImg
   189         -    variable compImg
   190         -    foreach c [winfo children $w] {
   191         -	#
   192         -	# Insert the data of the current child into the tablelist widget
   193         -	#
   194         -	set item {}
   195         -	lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \
   196         -		     [winfo width $c] [winfo height $c] [winfo ismapped $c] \
   197         -		     [winfo viewable $c] [winfo manager $c]
   198         -	$tbl insert end $item
   199         -
   200         -	#
   201         -	# Insert an image into the first cell of the row
   202         -	#
   203         -	if {[llength [winfo children $c]] == 0} {
   204         -	    $tbl cellconfigure end,0 -image $leafImg
   205         -	} else {
   206         -	    $tbl cellconfigure end,0 -image $compImg
   207         -	}
   208         -    }
   209         -
   210         -    #
   211         -    # Configure the "Refresh" and "Parent" buttons
   212         -    #
   213         -    $top.bf.b1 configure -command [list demo::putChildren $w $tbl]
   214         -    set b2 $top.bf.b2
   215         -    set p [winfo parent $w]
   216         -    if {[string compare $p ""] == 0} {
   217         -	$b2 configure -state disabled
   218         -    } else {
   219         -	$b2 configure -state normal -command [list demo::putChildren $p $tbl]
   220         -    }
   221         -}
   222         -
   223         -#------------------------------------------------------------------------------
   224         -# demo::formatBoolean
   225         -#
   226         -# Returns "yes" or "no", according to the specified boolean value.
   227         -#------------------------------------------------------------------------------
   228         -proc demo::formatBoolean val {
   229         -    return [expr {$val ? "yes" : "no"}]
   230         -}
   231         -
   232         -#------------------------------------------------------------------------------
   233         -# demo::labelCmd
   234         -#
   235         -# Sorts the contents of the tablelist widget tbl by its col'th column and makes
   236         -# sure the items will be updated 500 ms later (because one of the items might
   237         -# refer to a canvas containing the arrow that displays the sort order).
   238         -#------------------------------------------------------------------------------
   239         -proc demo::labelCmd {tbl col} {
   240         -    tablelist::sortByColumn $tbl $col
   241         -    updateItemsDelayed $tbl
   242         -}
   243         -
   244         -#------------------------------------------------------------------------------
   245         -# demo::updateItemsDelayed
   246         -#
   247         -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
   248         -#------------------------------------------------------------------------------
   249         -proc demo::updateItemsDelayed tbl {
   250         -    #
   251         -    # Schedule the demo::updateItems command for execution
   252         -    # 500 ms later, but only if it is not yet pending
   253         -    #
   254         -    if {[string compare [$tbl attrib afterId] ""] == 0} {
   255         -	$tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
   256         -    }
   257         -}
   258         -
   259         -#------------------------------------------------------------------------------
   260         -# demo::updateItems
   261         -#
   262         -# Updates the items of the tablelist widget tbl.
   263         -#------------------------------------------------------------------------------
   264         -proc demo::updateItems tbl {
   265         -    #
   266         -    # Reset the tablelist's "afterId" attribute
   267         -    #
   268         -    $tbl attrib afterId ""
   269         -
   270         -    #
   271         -    # Update the items
   272         -    #
   273         -    set rowCount [$tbl size]
   274         -    for {set row 0} {$row < $rowCount} {incr row} {
   275         -	set c [$tbl cellcget $row,0 -text]
   276         -	if {![winfo exists $c]} {
   277         -	    continue
   278         -	}
   279         -
   280         -	set item {}
   281         -	lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \
   282         -		     [winfo width $c] [winfo height $c] [winfo ismapped $c] \
   283         -		     [winfo viewable $c] [winfo manager $c]
   284         -	$tbl rowconfigure $row -text $item
   285         -    }
   286         -
   287         -    #
   288         -    # Repeat the last sort operation (if any)
   289         -    #
   290         -    $tbl refreshsorting
   291         -}
   292         -
   293         -#------------------------------------------------------------------------------
   294         -# demo::putChildrenOfSelWidget
   295         -#
   296         -# Outputs the data of the children of the selected widget into the tablelist
   297         -# widget tbl.
   298         -#------------------------------------------------------------------------------
   299         -proc demo::putChildrenOfSelWidget tbl {
   300         -    set w [$tbl cellcget [$tbl curselection],0 -text]
   301         -    if {![winfo exists $w]} {
   302         -	bell
   303         -	tk_messageBox -title "Error" -icon error -message \
   304         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   305         -	return ""
   306         -    }
   307         -
   308         -    if {[llength [winfo children $w]] == 0} {
   309         -	bell
   310         -    } else {
   311         -	putChildren $w $tbl
   312         -    }
   313         -}
   314         -
   315         -#------------------------------------------------------------------------------
   316         -# demo::dispConfigOfSelWidget
   317         -#
   318         -# Displays the configuration options of the selected widget within the
   319         -# tablelist tbl in a tablelist widget contained in a newly created top-level
   320         -# widget.
   321         -#------------------------------------------------------------------------------
   322         -proc demo::dispConfigOfSelWidget tbl {
   323         -    demo::displayConfig [$tbl cellcget [$tbl curselection],0 -text]
   324         -}
   325         -
   326         -#------------------------------------------------------------------------------
   327         -# demo::postPopupMenu
   328         -#
   329         -# Posts the pop-up menu $top.menu at the given screen position.  Before posting
   330         -# the menu, the procedure enables/disables its first entry, depending upon
   331         -# whether the selected widget has children or not.
   332         -#------------------------------------------------------------------------------
   333         -proc demo::postPopupMenu {top rootX rootY} {
   334         -    set tbl $top.tf.tbl
   335         -    set w [$tbl cellcget [$tbl curselection],0 -text]
   336         -    if {![winfo exists $w]} {
   337         -	bell
   338         -	tk_messageBox -title "Error" -icon error -message \
   339         -	    "Bad window path name \"$w\"" -parent $top
   340         -	return ""
   341         -    }
   342         -
   343         -    set menu $top.menu
   344         -    if {[llength [winfo children $w]] == 0} {
   345         -	$menu entryconfigure 0 -state disabled
   346         -    } else {
   347         -	$menu entryconfigure 0 -state normal
   348         -    }
   349         -
   350         -    tk_popup $menu $rootX $rootY
   351         -}
   352         -
   353         -#------------------------------------------------------------------------------
   354         -
   355         -if {$tcl_interactive} {
   356         -    return "\nTo display information about the children of an arbitrary\
   357         -	    widget, enter\n\n\tdemo::displayChildren <widgetName>\n"
   358         -} else {
   359         -    wm withdraw .
   360         -    tk_messageBox -title $argv0 -icon warning -message \
   361         -	"Please source this script into\nan interactive wish session"
   362         -    exit 1
   363         -}

Deleted libs/tablelist5.16/demos/bwidget.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of some
     5         -# widgets from the BWidget package and of the Tk core checkbutton and
     6         -# menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require Tk 8.4				;# because of "-compound"
    12         -package require tablelist 5.16
    13         -package require BWidget
    14         -
    15         -wm title . "Serial Line Configuration"
    16         -
    17         -#
    18         -# Add some entries to the Tk option database
    19         -#
    20         -set dir [file dirname [info script]]
    21         -source [file join $dir option.tcl]
    22         -option add *Tablelist*Checkbutton.background		white
    23         -option add *Tablelist*Checkbutton.activeBackground	white
    24         -option add *Tablelist*Entry.background			white
    25         -
    26         -#
    27         -# Register some widgets from the BWidget package for interactive cell editing
    28         -#
    29         -tablelist::addBWidgetEntry
    30         -tablelist::addBWidgetSpinBox
    31         -tablelist::addBWidgetComboBox
    32         -
    33         -#
    34         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    35         -# names like "img#FF0000", displaying colors identified by names like "red"
    36         -#
    37         -source [file join $dir images.tcl]
    38         -
    39         -#
    40         -# Create a tablelist widget with editable columns (except the first one)
    41         -#
    42         -set tbl .tbl
    43         -tablelist::tablelist $tbl \
    44         -    -columns {0 "No."		  right
    45         -	      0 "Available"	  center
    46         -	      0 "Name"		  left
    47         -	      0 "Baud Rate"	  right
    48         -	      0 "Data Bits"	  center
    49         -	      0 "Parity"	  left
    50         -	      0 "Stop Bits"	  center
    51         -	      0 "Handshake"	  left
    52         -	      0 "Activation Date" center
    53         -	      0 "Activation Time" center
    54         -	      0 "Cable Color"	  center} \
    55         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    56         -    -height 0 -width 0
    57         -if {[$tbl cget -selectborderwidth] == 0} {
    58         -    $tbl configure -spacing 1
    59         -}
    60         -$tbl columnconfigure 0 -sortmode integer
    61         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    62         -    -formatcommand emptyStr
    63         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow Entry \
    64         -    -sortmode dictionary
    65         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow ComboBox \
    66         -    -sortmode integer
    67         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow SpinBox
    68         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow ComboBox
    69         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow ComboBox
    70         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox
    71         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow Entry \
    72         -    -formatcommand formatDate -sortmode integer
    73         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow Entry \
    74         -    -formatcommand formatTime -sortmode integer
    75         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    76         -    -formatcommand emptyStr
    77         -
    78         -proc emptyStr   val { return "" }
    79         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    80         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    81         -
    82         -#
    83         -# Populate the tablelist widget; set the activation
    84         -# date & time to 10 minutes past the current clock value
    85         -#
    86         -set clock [expr {[clock seconds] + 600}]
    87         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    88         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
    89         -	$clock $clock [lindex $colorNames $i]]
    90         -
    91         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
    92         -    $tbl cellconfigure end,available -image $availImg
    93         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
    94         -}
    95         -
    96         -set btn [button .btn -text "Close" -command exit]
    97         -
    98         -#
    99         -# Manage the widgets
   100         -#
   101         -pack $btn -side bottom -pady 10
   102         -pack $tbl -side top -expand yes -fill both
   103         -
   104         -#------------------------------------------------------------------------------
   105         -# editStartCmd
   106         -#
   107         -# Applies some configuration options to the edit window; if the latter is a
   108         -# ComboBox, the procedure populates it.
   109         -#------------------------------------------------------------------------------
   110         -proc editStartCmd {tbl row col text} {
   111         -    set w [$tbl editwinpath]
   112         -
   113         -    switch [$tbl columncget $col -name] {
   114         -	lineName {
   115         -	    #
   116         -	    # Set an upper limit of 20 for the number of characters
   117         -	    #
   118         -	    $w configure -invalidcommand bell -validate key \
   119         -			 -validatecommand {expr {[string length %P] <= 20}}
   120         -	}
   121         -
   122         -	baudRate {
   123         -	    #
   124         -	    # Populate the ComboBox and allow no more
   125         -	    # than 6 digits in its Entry component
   126         -	    #
   127         -	    $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400
   128         -				  57600 115200 230400 460800 921600}
   129         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   130         -		{expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}}
   131         -	}
   132         -
   133         -	dataBits {
   134         -	    #
   135         -	    # Configure the SpinBox
   136         -	    #
   137         -	    $w configure -range {5 8 1} -editable no
   138         -	}
   139         -
   140         -	parity {
   141         -	    #
   142         -	    # Populate the ComboBox and make it non-editable
   143         -	    #
   144         -	    $w configure -values {None Even Odd Mark Space} -editable no
   145         -	}
   146         -
   147         -	stopBits {
   148         -	    #
   149         -	    # Populate the ComboBox and make it non-editable
   150         -	    #
   151         -	    $w configure -values {1 1.5 2} -editable no
   152         -	}
   153         -
   154         -	handshake {
   155         -	    #
   156         -	    # Populate the ComboBox and make it non-editable
   157         -	    #
   158         -	    $w configure -values {XON/XOFF RTS/CTS None} -editable no
   159         -	}
   160         -
   161         -	actDate {
   162         -	    #
   163         -	    # Set an upper limit of 10 for the number of characters
   164         -	    # and allow only digits and the "-" character in it
   165         -	    #
   166         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   167         -		{expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}}
   168         -	}
   169         -
   170         -	actTime {
   171         -	    #
   172         -	    # Set an upper limit of 8 for the number of characters
   173         -	    # and allow only digits and the ":" character in it
   174         -	    #
   175         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   176         -		{expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}}
   177         -	}
   178         -
   179         -	color {
   180         -	    #
   181         -	    # Populate the menu and make sure the menubutton will display the
   182         -	    # color name rather than $text, which is "", due to -formatcommand
   183         -	    #
   184         -	    set menu [$w cget -menu]
   185         -	    foreach name $::colorNames {
   186         -		$menu add radiobutton -compound left \
   187         -		    -image img$::colors($name) -label $name
   188         -	    }
   189         -	    $menu entryconfigure 8 -columnbreak 1
   190         -	    return [$tbl cellcget $row,$col -text]
   191         -	}
   192         -    }
   193         -
   194         -    return $text
   195         -}
   196         -
   197         -#------------------------------------------------------------------------------
   198         -# editEndCmd
   199         -#
   200         -# Performs a final validation of the text contained in the edit window and gets
   201         -# the cell's internal contents.
   202         -#------------------------------------------------------------------------------
   203         -proc editEndCmd {tbl row col text} {
   204         -    switch [$tbl columncget $col -name] {
   205         -	available {
   206         -	    #
   207         -	    # Update the image contained in the cell
   208         -	    #
   209         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   210         -	    $tbl cellconfigure $row,$col -image $img
   211         -	}
   212         -
   213         -	baudRate {
   214         -	    #
   215         -	    # Check whether the baud rate is an integer in the range 50..921600
   216         -	    #
   217         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   218         -		bell
   219         -		tk_messageBox -title "Error" -icon error -message \
   220         -		    "The baud rate must be an integer in the range 50..921600"
   221         -		$tbl rejectinput
   222         -	    }
   223         -	}
   224         -
   225         -	actDate {
   226         -	    #
   227         -	    # Get the activation date in seconds from the last argument 
   228         -	    #
   229         -	    if {[catch {clock scan $text} actDate] != 0} {
   230         -		bell
   231         -		tk_messageBox -title "Error" -icon error -message "Invalid date"
   232         -		$tbl rejectinput
   233         -		return ""
   234         -	    }
   235         -
   236         -	    #
   237         -	    # Check whether the activation clock value is later than the
   238         -	    # current one; if this is the case then make sure the cells
   239         -	    # "actDate" and "actTime" will have the same internal value
   240         -	    #
   241         -	    set actTime [$tbl cellcget $row,actTime -text]
   242         -	    set actClock [clock scan [formatTime $actTime] -base $actDate]
   243         -	    if {$actClock <= [clock seconds]} {
   244         -		bell
   245         -		tk_messageBox -title "Error" -icon error -message \
   246         -		    "The activation date & time must be in the future"
   247         -		$tbl rejectinput
   248         -	    } else {
   249         -		$tbl cellconfigure $row,actTime -text $actClock
   250         -		return $actClock
   251         -	    }
   252         -	}
   253         -
   254         -	actTime {
   255         -	    #
   256         -	    # Get the activation clock value in seconds from the last argument 
   257         -	    #
   258         -	    set actDate [$tbl cellcget $row,actDate -text]
   259         -	    if {[catch {clock scan $text -base $actDate} actClock] != 0} {
   260         -		bell
   261         -		tk_messageBox -title "Error" -icon error -message "Invalid time"
   262         -		$tbl rejectinput
   263         -		return ""
   264         -	    }
   265         -
   266         -	    #
   267         -	    # Check whether the activation clock value is later than the
   268         -	    # current one; if this is the case then make sure the cells
   269         -	    # "actDate" and "actTime" will have the same internal value
   270         -	    #
   271         -	    if {$actClock <= [clock seconds]} {
   272         -		bell
   273         -		tk_messageBox -title "Error" -icon error -message \
   274         -		    "The activation date & time must be in the future"
   275         -		$tbl rejectinput
   276         -	    } else {
   277         -		$tbl cellconfigure $row,actDate -text $actClock
   278         -		return $actClock
   279         -	    }
   280         -	}
   281         -
   282         -	color {
   283         -	    #
   284         -	    # Update the image contained in the cell
   285         -	    #
   286         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   287         -	}
   288         -    }
   289         -
   290         -    return $text
   291         -}

Deleted libs/tablelist5.16/demos/bwidget_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of some
     5         -# widgets from the BWidget package and of the Tk core checkbutton and
     6         -# menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require tablelist_tile 5.16
    12         -package require BWidget
    13         -
    14         -wm title . "Serial Line Configuration"
    15         -
    16         -#
    17         -# Add some entries to the Tk option database
    18         -#
    19         -set dir [file dirname [info script]]
    20         -source [file join $dir option_tile.tcl]
    21         -option add *Tablelist*Checkbutton.background		white
    22         -option add *Tablelist*Checkbutton.activeBackground	white
    23         -option add *Tablelist*Entry.background			white
    24         -
    25         -#
    26         -# Register some widgets from the BWidget package for interactive cell editing
    27         -#
    28         -tablelist::addBWidgetEntry
    29         -tablelist::addBWidgetSpinBox
    30         -tablelist::addBWidgetComboBox
    31         -
    32         -#
    33         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    34         -# names like "img#FF0000", displaying colors identified by names like "red"
    35         -#
    36         -source [file join $dir images.tcl]
    37         -
    38         -#
    39         -# Improve the window's appearance by using a tile
    40         -# frame as a container for the other widgets
    41         -#
    42         -set f [ttk::frame .f]
    43         -
    44         -#
    45         -# Create a tablelist widget with editable columns (except the first one)
    46         -#
    47         -set tbl $f.tbl
    48         -tablelist::tablelist $tbl \
    49         -    -columns {0 "No."		  right
    50         -	      0 "Available"	  center
    51         -	      0 "Name"		  left
    52         -	      0 "Baud Rate"	  right
    53         -	      0 "Data Bits"	  center
    54         -	      0 "Parity"	  left
    55         -	      0 "Stop Bits"	  center
    56         -	      0 "Handshake"	  left
    57         -	      0 "Activation Date" center
    58         -	      0 "Activation Time" center
    59         -	      0 "Cable Color"	  center} \
    60         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    61         -    -height 0 -width 0
    62         -if {[$tbl cget -selectborderwidth] == 0} {
    63         -    $tbl configure -spacing 1
    64         -}
    65         -$tbl columnconfigure 0 -sortmode integer
    66         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    67         -    -formatcommand emptyStr
    68         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow Entry \
    69         -    -sortmode dictionary
    70         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow ComboBox \
    71         -    -sortmode integer
    72         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow SpinBox
    73         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow ComboBox
    74         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow ComboBox
    75         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox
    76         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow Entry \
    77         -    -formatcommand formatDate -sortmode integer
    78         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow Entry \
    79         -    -formatcommand formatTime -sortmode integer
    80         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    81         -    -formatcommand emptyStr
    82         -
    83         -proc emptyStr   val { return "" }
    84         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    85         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    86         -
    87         -#
    88         -# Populate the tablelist widget; set the activation
    89         -# date & time to 10 minutes past the current clock value
    90         -#
    91         -set clock [expr {[clock seconds] + 600}]
    92         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    93         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
    94         -	$clock $clock [lindex $colorNames $i]]
    95         -
    96         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
    97         -    $tbl cellconfigure end,available -image $availImg
    98         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
    99         -}
   100         -
   101         -set btn [ttk::button $f.btn -text "Close" -command exit]
   102         -
   103         -#
   104         -# Manage the widgets
   105         -#
   106         -pack $btn -side bottom -pady 10
   107         -pack $tbl -side top -expand yes -fill both
   108         -pack $f -expand yes -fill both
   109         -
   110         -#------------------------------------------------------------------------------
   111         -# editStartCmd
   112         -#
   113         -# Applies some configuration options to the edit window; if the latter is a
   114         -# ComboBox, the procedure populates it.
   115         -#------------------------------------------------------------------------------
   116         -proc editStartCmd {tbl row col text} {
   117         -    set w [$tbl editwinpath]
   118         -
   119         -    switch [$tbl columncget $col -name] {
   120         -	lineName {
   121         -	    #
   122         -	    # Set an upper limit of 20 for the number of characters
   123         -	    #
   124         -	    $w configure -invalidcommand bell -validate key \
   125         -			 -validatecommand {expr {[string length %P] <= 20}}
   126         -	}
   127         -
   128         -	baudRate {
   129         -	    #
   130         -	    # Populate the ComboBox and allow no more
   131         -	    # than 6 digits in its Entry component
   132         -	    #
   133         -	    $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400
   134         -				  57600 115200 230400 460800 921600}
   135         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   136         -		{expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}}
   137         -	}
   138         -
   139         -	dataBits {
   140         -	    #
   141         -	    # Configure the SpinBox
   142         -	    #
   143         -	    $w configure -range {5 8 1} -editable no
   144         -	}
   145         -
   146         -	parity {
   147         -	    #
   148         -	    # Populate the ComboBox and make it non-editable
   149         -	    #
   150         -	    $w configure -values {None Even Odd Mark Space} -editable no
   151         -	}
   152         -
   153         -	stopBits {
   154         -	    #
   155         -	    # Populate the ComboBox and make it non-editable
   156         -	    #
   157         -	    $w configure -values {1 1.5 2} -editable no
   158         -	}
   159         -
   160         -	handshake {
   161         -	    #
   162         -	    # Populate the ComboBox and make it non-editable
   163         -	    #
   164         -	    $w configure -values {XON/XOFF RTS/CTS None} -editable no
   165         -	}
   166         -
   167         -	actDate {
   168         -	    #
   169         -	    # Set an upper limit of 10 for the number of characters
   170         -	    # and allow only digits and the "-" character in it
   171         -	    #
   172         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   173         -		{expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}}
   174         -	}
   175         -
   176         -	actTime {
   177         -	    #
   178         -	    # Set an upper limit of 8 for the number of characters
   179         -	    # and allow only digits and the ":" character in it
   180         -	    #
   181         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   182         -		{expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}}
   183         -	}
   184         -
   185         -	color {
   186         -	    #
   187         -	    # Populate the menu and make sure the menubutton will display the
   188         -	    # color name rather than $text, which is "", due to -formatcommand
   189         -	    #
   190         -	    set menu [$w cget -menu]
   191         -	    foreach name $::colorNames {
   192         -		$menu add radiobutton -compound left \
   193         -		    -image img$::colors($name) -label $name
   194         -	    }
   195         -	    $menu entryconfigure 8 -columnbreak 1
   196         -	    return [$tbl cellcget $row,$col -text]
   197         -	}
   198         -    }
   199         -
   200         -    return $text
   201         -}
   202         -
   203         -#------------------------------------------------------------------------------
   204         -# editEndCmd
   205         -#
   206         -# Performs a final validation of the text contained in the edit window and gets
   207         -# the cell's internal contents.
   208         -#------------------------------------------------------------------------------
   209         -proc editEndCmd {tbl row col text} {
   210         -    switch [$tbl columncget $col -name] {
   211         -	available {
   212         -	    #
   213         -	    # Update the image contained in the cell
   214         -	    #
   215         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   216         -	    $tbl cellconfigure $row,$col -image $img
   217         -	}
   218         -
   219         -	baudRate {
   220         -	    #
   221         -	    # Check whether the baud rate is an integer in the range 50..921600
   222         -	    #
   223         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   224         -		bell
   225         -		tk_messageBox -title "Error" -icon error -message \
   226         -		    "The baud rate must be an integer in the range 50..921600"
   227         -		$tbl rejectinput
   228         -	    }
   229         -	}
   230         -
   231         -	actDate {
   232         -	    #
   233         -	    # Get the activation date in seconds from the last argument 
   234         -	    #
   235         -	    if {[catch {clock scan $text} actDate] != 0} {
   236         -		bell
   237         -		tk_messageBox -title "Error" -icon error -message "Invalid date"
   238         -		$tbl rejectinput
   239         -		return ""
   240         -	    }
   241         -
   242         -	    #
   243         -	    # Check whether the activation clock value is later than the
   244         -	    # current one; if this is the case then make sure the cells
   245         -	    # "actDate" and "actTime" will have the same internal value
   246         -	    #
   247         -	    set actTime [$tbl cellcget $row,actTime -text]
   248         -	    set actClock [clock scan [formatTime $actTime] -base $actDate]
   249         -	    if {$actClock <= [clock seconds]} {
   250         -		bell
   251         -		tk_messageBox -title "Error" -icon error -message \
   252         -		    "The activation date & time must be in the future"
   253         -		$tbl rejectinput
   254         -	    } else {
   255         -		$tbl cellconfigure $row,actTime -text $actClock
   256         -		return $actClock
   257         -	    }
   258         -	}
   259         -
   260         -	actTime {
   261         -	    #
   262         -	    # Get the activation clock value in seconds from the last argument 
   263         -	    #
   264         -	    set actDate [$tbl cellcget $row,actDate -text]
   265         -	    if {[catch {clock scan $text -base $actDate} actClock] != 0} {
   266         -		bell
   267         -		tk_messageBox -title "Error" -icon error -message "Invalid time"
   268         -		$tbl rejectinput
   269         -		return ""
   270         -	    }
   271         -
   272         -	    #
   273         -	    # Check whether the activation clock value is later than the
   274         -	    # current one; if this is the case then make sure the cells
   275         -	    # "actDate" and "actTime" will have the same internal value
   276         -	    #
   277         -	    if {$actClock <= [clock seconds]} {
   278         -		bell
   279         -		tk_messageBox -title "Error" -icon error -message \
   280         -		    "The activation date & time must be in the future"
   281         -		$tbl rejectinput
   282         -	    } else {
   283         -		$tbl cellconfigure $row,actDate -text $actClock
   284         -		return $actClock
   285         -	    }
   286         -	}
   287         -
   288         -	color {
   289         -	    #
   290         -	    # Update the image contained in the cell
   291         -	    #
   292         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   293         -	}
   294         -    }
   295         -
   296         -    return $text
   297         -}

Deleted libs/tablelist5.16/demos/checked.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/demos/clsdFolder.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/demos/comp.xbm.

     1         -#define comp_width 14
     2         -#define comp_height 12
     3         -static unsigned char comp_bits[] = {
     4         -   0xff, 0x3f, 0x01, 0x20, 0xfd, 0x3f, 0x05, 0x20, 0xf5, 0x3f, 0x15, 0x20,
     5         -   0xd5, 0x3f, 0x55, 0x20, 0x55, 0x3f, 0x55, 0x21, 0x55, 0x21, 0xff, 0x3f};

Deleted libs/tablelist5.16/demos/config.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying and editing the
     3         -# configuration options of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2000-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require tablelist 5.16
     9         -
    10         -namespace eval demo {
    11         -    #
    12         -    # Get the current windowing system ("x11", "win32", "classic", or "aqua")
    13         -    # and add some entries to the Tk option database for the following
    14         -    # widget hierarchy within a top-level widget of the class DemoTop:
    15         -    #
    16         -    # Name		Class
    17         -    # -----------------------------
    18         -    # tf		Frame
    19         -    #   tbl		  Tabellist
    20         -    #   vsb, hsb	  Scrollbar
    21         -    # bf		Frame
    22         -    #   b1, b2, b3	  Button
    23         -    #
    24         -    variable winSys
    25         -    if {[catch {tk windowingsystem} winSys] != 0} {
    26         -	switch $::tcl_platform(platform) {
    27         -	    unix	{ set winSys x11 }
    28         -	    windows	{ set winSys win32 }
    29         -	    macintosh	{ set winSys classic }
    30         -	}
    31         -    }
    32         -    if {[string compare $winSys "x11"] == 0} {
    33         -	#
    34         -	# Create the font TkDefaultFont if not yet present
    35         -	#
    36         -	catch {font create TkDefaultFont -family Helvetica -size -12}
    37         -
    38         -	option add *DemoTop*Font			TkDefaultFont
    39         -	option add *DemoTop*selectBackground		#678db2
    40         -	option add *DemoTop*selectForeground		white
    41         -    } else {
    42         -	option add *DemoTop.tf.borderWidth		1
    43         -	option add *DemoTop.tf.relief			sunken
    44         -	option add *DemoTop.tf.tbl.borderWidth		0
    45         -	option add *DemoTop.tf.tbl.highlightThickness	0
    46         -    }
    47         -    option add *DemoTop.tf.tbl.background		white
    48         -    option add *DemoTop.tf.tbl.stripeBackground		#f0f0f0
    49         -    option add *DemoTop.tf.tbl.setGrid			yes
    50         -    option add *DemoTop.tf.tbl*Entry.background		white
    51         -    option add *DemoTop.bf.Button.width			10
    52         -}
    53         -
    54         -#------------------------------------------------------------------------------
    55         -# demo::displayConfig
    56         -#
    57         -# Displays the configuration options of the widget w in a tablelist widget
    58         -# contained in a newly created top-level widget.  Returns the name of the
    59         -# tablelist widget.
    60         -#------------------------------------------------------------------------------
    61         -proc demo::displayConfig w {
    62         -    if {![winfo exists $w]} {
    63         -	bell
    64         -	tk_messageBox -title "Error" -icon error -message \
    65         -	    "Bad window path name \"$w\""
    66         -	return ""
    67         -    }
    68         -
    69         -    #
    70         -    # Create a top-level widget of the class DemoTop
    71         -    #
    72         -    set top .configTop
    73         -    for {set n 2} {[winfo exists $top]} {incr n} {
    74         -	set top .configTop$n
    75         -    }
    76         -    toplevel $top -class DemoTop
    77         -    wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\""
    78         -
    79         -    #
    80         -    # Create a scrolled tablelist widget with 5 dynamic-width
    81         -    # columns and interactive sort capability within the top-level
    82         -    #
    83         -    set tf $top.tf
    84         -    frame $tf
    85         -    set tbl $tf.tbl
    86         -    set vsb $tf.vsb
    87         -    set hsb $tf.hsb
    88         -    tablelist::tablelist $tbl \
    89         -	-columns {0 "Command-Line Name"
    90         -		  0 "Database/Alias Name"
    91         -		  0 "Database Class"
    92         -		  0 "Default Value"
    93         -		  0 "Current Value"} \
    94         -	-labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \
    95         -	-editendcommand demo::applyValue -height 15 -width 100 -stretch all \
    96         -	-xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
    97         -    if {[$tbl cget -selectborderwidth] == 0} {
    98         -	$tbl configure -spacing 1
    99         -    }
   100         -    $tbl columnconfigure 3 -maxwidth 30
   101         -    $tbl columnconfigure 4 -maxwidth 30 -editable yes
   102         -    scrollbar $vsb -orient vertical   -command [list $tbl yview]
   103         -    scrollbar $hsb -orient horizontal -command [list $tbl xview]
   104         -
   105         -    #
   106         -    # Create three buttons within a frame child of the top-level widget
   107         -    #
   108         -    set bf $top.bf
   109         -    frame $bf
   110         -    set b1 $bf.b1
   111         -    set b2 $bf.b2
   112         -    set b3 $bf.b3
   113         -    button $b1 -text "Refresh"     -command [list demo::putConfig $w $tbl]
   114         -    button $b2 -text "Sort as Set" -command [list $tbl sort]
   115         -    button $b3 -text "Close"       -command [list destroy $top]
   116         -
   117         -    #
   118         -    # Manage the widgets
   119         -    #
   120         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   121         -    variable winSys
   122         -    if {[string compare $winSys "aqua"] == 0} {
   123         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   124         -	grid $vsb	       -row 1 -column 1 -sticky ns
   125         -    } else {
   126         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   127         -    }
   128         -    grid $hsb -row 2 -column 0 -sticky ew
   129         -    grid rowconfigure    $tf 1 -weight 1
   130         -    grid columnconfigure $tf 0 -weight 1
   131         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   132         -    pack $bf -side bottom -fill x
   133         -    pack $tf -side top -expand yes -fill both
   134         -
   135         -    #
   136         -    # Populate the tablelist with the configuration options of the given widget
   137         -    #
   138         -    putConfig $w $tbl
   139         -    return $tbl
   140         -}
   141         -
   142         -#------------------------------------------------------------------------------
   143         -# demo::putConfig
   144         -#
   145         -# Outputs the configuration options of the widget w into the tablelist widget
   146         -# tbl.
   147         -#------------------------------------------------------------------------------
   148         -proc demo::putConfig {w tbl} {
   149         -    if {![winfo exists $w]} {
   150         -	bell
   151         -	tk_messageBox -title "Error" -icon error -message \
   152         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   153         -	return ""
   154         -    }
   155         -
   156         -    #
   157         -    # Display the configuration options of w in the tablelist widget tbl
   158         -    #
   159         -    $tbl delete 0 end
   160         -    foreach configSet [$w configure] {
   161         -	#
   162         -	# Insert the list configSet into the tablelist widget
   163         -	#
   164         -	$tbl insert end $configSet
   165         -
   166         -	if {[llength $configSet] == 2} {
   167         -	    $tbl rowconfigure end -foreground gray50 -selectforeground gray75
   168         -	    $tbl cellconfigure end -editable no
   169         -	} else {
   170         -	    #
   171         -	    # Change the colors of the first and last cell of the row
   172         -	    # if the current value is different from the default one
   173         -	    #
   174         -	    set default [lindex $configSet 3]
   175         -	    set current [lindex $configSet 4]
   176         -	    if {[string compare $default $current] != 0} {
   177         -		foreach col {0 4} {
   178         -		    $tbl cellconfigure end,$col \
   179         -			 -foreground red -selectforeground yellow
   180         -		}
   181         -	    }
   182         -	}
   183         -    }
   184         -
   185         -    $tbl sortbycolumn 0
   186         -    $tbl activate 0
   187         -    $tbl attrib widget $w
   188         -}
   189         -
   190         -#------------------------------------------------------------------------------
   191         -# demo::compareAsSet
   192         -#
   193         -# Compares two items of a tablelist widget used to display the configuration
   194         -# options of an arbitrary widget.  The item in which the current value is
   195         -# different from the default one is considered to be less than the other; if
   196         -# both items fulfil this condition or its negation then string comparison is
   197         -# applied to the two option names.
   198         -#------------------------------------------------------------------------------
   199         -proc demo::compareAsSet {item1 item2} {
   200         -    foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \
   201         -	    {opt2 dbName2 dbClass2 default2 current2} $item2 {
   202         -	set changed1 [expr {[string compare $default1 $current1] != 0}]
   203         -	set changed2 [expr {[string compare $default2 $current2] != 0}]
   204         -	if {$changed1 == $changed2} {
   205         -	    return [string compare $opt1 $opt2]
   206         -	} elseif {$changed1} {
   207         -	    return -1
   208         -	} else {
   209         -	    return 1
   210         -	}
   211         -    }
   212         -}
   213         -
   214         -#------------------------------------------------------------------------------
   215         -# demo::applyValue
   216         -#
   217         -# Applies the new value of the configuraton option contained in the given row
   218         -# of the tablelist widget tbl to the widget whose options are displayed in it,
   219         -# and updates the colors of the first and last cell of the row.
   220         -#------------------------------------------------------------------------------
   221         -proc demo::applyValue {tbl row col text} {
   222         -    #
   223         -    # Try to apply the new value of the option contained in
   224         -    # the given row to the widget whose options are displayed
   225         -    # in the tablelist; reject the value if the attempt fails
   226         -    #
   227         -    set w [$tbl attrib widget]
   228         -    set opt [$tbl cellcget $row,0 -text]
   229         -    if {[catch {$w configure $opt $text} result] != 0} {
   230         -	bell
   231         -	tk_messageBox -title "Error" -icon error -message $result \
   232         -	    -parent [winfo toplevel $tbl]
   233         -	$tbl rejectinput
   234         -	return ""
   235         -    }
   236         -
   237         -    #
   238         -    # Replace the new option value with its canonical form and
   239         -    # update the colors of the first and last cell of the row
   240         -    #
   241         -    set text [$w cget $opt]
   242         -    set default [$tbl cellcget $row,3 -text]
   243         -    if {[string compare $default $text] == 0} {
   244         -	foreach col {0 4} {
   245         -	    $tbl cellconfigure $row,$col \
   246         -		 -foreground "" -selectforeground ""
   247         -	}
   248         -    } else {
   249         -	foreach col {0 4} {
   250         -	    $tbl cellconfigure $row,$col \
   251         -		 -foreground red -selectforeground yellow
   252         -	}
   253         -    }
   254         -
   255         -    return $text
   256         -}
   257         -
   258         -#------------------------------------------------------------------------------
   259         -
   260         -if {$tcl_interactive} {
   261         -    return "\nTo display the configuration options of an arbitrary\
   262         -	    widget, enter\n\n\tdemo::displayConfig <widgetName>\n"
   263         -} else {
   264         -    wm withdraw .
   265         -    tk_messageBox -title $argv0 -icon warning -message \
   266         -	"Please source this script into\nan interactive wish session"
   267         -    exit 1
   268         -}

Deleted libs/tablelist5.16/demos/config_tile.tcl.

     1         -#==============================================================================
     2         -# Demonstrates how to use a tablelist widget for displaying and editing the
     3         -# configuration options of an arbitrary widget.
     4         -#
     5         -# Copyright (c) 2000-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     6         -#==============================================================================
     7         -
     8         -package require tablelist_tile 5.16
     9         -
    10         -namespace eval demo {
    11         -    #
    12         -    # Get the current windowing system ("x11", "win32", or "aqua")
    13         -    # and add some entries to the Tk option database for the following
    14         -    # widget hierarchy within a top-level widget of the class DemoTop:
    15         -    #
    16         -    # Name		Class
    17         -    # -----------------------------
    18         -    # tf		TFrame
    19         -    #   tbl		  Tabellist
    20         -    #   vsb, hsb	  TScrollbar
    21         -    # bf		TFrame
    22         -    #   b1, b2, b3	  TButton
    23         -    #
    24         -    if {[tk windowingsystem] eq "x11"} {
    25         -	option add *DemoTop*Font			TkDefaultFont
    26         -    } else {
    27         -	option add *DemoTop.tf.borderWidth		1
    28         -	option add *DemoTop.tf.relief			sunken
    29         -	option add *DemoTop.tf.tbl.borderWidth		0
    30         -    }
    31         -    tablelist::setThemeDefaults
    32         -    set foreground [winfo rgb . $tablelist::themeDefaults(-foreground)]
    33         -    set selectFg   [winfo rgb . $tablelist::themeDefaults(-selectforeground)]
    34         -    set selectFgEqForeground [expr {$selectFg eq $foreground}]
    35         -    variable currentTheme [tablelist::getCurrentTheme]
    36         -    if {$currentTheme ne "aqua"} {
    37         -	option add *DemoTop*selectBackground \
    38         -		   $tablelist::themeDefaults(-selectbackground)
    39         -	option add *DemoTop*selectForeground \
    40         -		   $tablelist::themeDefaults(-selectforeground)
    41         -	option add *DemoTop*selectBorderWidth \
    42         -		   $tablelist::themeDefaults(-selectborderwidth)
    43         -    }
    44         -    option add *DemoTop.tf.tbl.background		white
    45         -    option add *DemoTop.tf.tbl.stripeBackground		#f0f0f0
    46         -    option add *DemoTop.tf.tbl.setGrid			yes
    47         -    option add *DemoTop.tf.tbl*Entry.background		white
    48         -    option add *DemoTop.bf.TButton.width		10
    49         -}
    50         -
    51         -#
    52         -# Work around the improper appearance of the tile scrollbars in the aqua theme
    53         -#
    54         -if {$demo::currentTheme eq "aqua"} {
    55         -    interp alias {} ttk::scrollbar {} ::scrollbar
    56         -}
    57         -
    58         -#------------------------------------------------------------------------------
    59         -# demo::displayConfig
    60         -#
    61         -# Displays the configuration options of the widget w in a tablelist widget
    62         -# contained in a newly created top-level widget.  Returns the name of the
    63         -# tablelist widget.
    64         -#------------------------------------------------------------------------------
    65         -proc demo::displayConfig w {
    66         -    if {![winfo exists $w]} {
    67         -	bell
    68         -	tk_messageBox -title "Error" -icon error -message \
    69         -	    "Bad window path name \"$w\""
    70         -	return ""
    71         -    }
    72         -
    73         -    #
    74         -    # Create a top-level widget of the class DemoTop
    75         -    #
    76         -    set top .configTop
    77         -    for {set n 2} {[winfo exists $top]} {incr n} {
    78         -	set top .configTop$n
    79         -    }
    80         -    toplevel $top -class DemoTop
    81         -    wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\""
    82         -
    83         -    #
    84         -    # Create a scrolled tablelist widget with 5 dynamic-width
    85         -    # columns and interactive sort capability within the top-level
    86         -    #
    87         -    set tf $top.tf
    88         -    ttk::frame $tf
    89         -    set tbl $tf.tbl
    90         -    set vsb $tf.vsb
    91         -    set hsb $tf.hsb
    92         -    tablelist::tablelist $tbl \
    93         -	-columns {0 "Command-Line Name"
    94         -		  0 "Database/Alias Name"
    95         -		  0 "Database Class"
    96         -		  0 "Default Value"
    97         -		  0 "Current Value"} \
    98         -	-labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \
    99         -	-editendcommand demo::applyValue -height 15 -width 100 -stretch all \
   100         -	-xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
   101         -    if {[$tbl cget -selectborderwidth] == 0} {
   102         -	$tbl configure -spacing 1
   103         -    }
   104         -    $tbl columnconfigure 3 -maxwidth 30
   105         -    $tbl columnconfigure 4 -maxwidth 30 -editable yes
   106         -    ttk::scrollbar $vsb -orient vertical   -command [list $tbl yview]
   107         -    ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview]
   108         -
   109         -    #
   110         -    # Create three buttons within a tile frame child of the top-level widget
   111         -    #
   112         -    set bf $top.bf
   113         -    ttk::frame $bf
   114         -    set b1 $bf.b1
   115         -    set b2 $bf.b2
   116         -    set b3 $bf.b3
   117         -    ttk::button $b1 -text "Refresh"     -command [list demo::putConfig $w $tbl]
   118         -    ttk::button $b2 -text "Sort as Set" -command [list $tbl sort]
   119         -    ttk::button $b3 -text "Close"       -command [list destroy $top]
   120         -
   121         -    #
   122         -    # Manage the widgets
   123         -    #
   124         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   125         -    if {[tablelist::getCurrentTheme] eq "aqua"} {
   126         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   127         -	grid $vsb	       -row 1 -column 1 -sticky ns
   128         -    } else {
   129         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   130         -    }
   131         -    grid $hsb -row 2 -column 0 -sticky ew
   132         -    grid rowconfigure    $tf 1 -weight 1
   133         -    grid columnconfigure $tf 0 -weight 1
   134         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   135         -    pack $bf -side bottom -fill x
   136         -    pack $tf -side top -expand yes -fill both
   137         -
   138         -    #
   139         -    # Populate the tablelist with the configuration options of the given widget
   140         -    #
   141         -    putConfig $w $tbl
   142         -    return $tbl
   143         -}
   144         -
   145         -#------------------------------------------------------------------------------
   146         -# demo::putConfig
   147         -#
   148         -# Outputs the configuration options of the widget w into the tablelist widget
   149         -# tbl.
   150         -#------------------------------------------------------------------------------
   151         -proc demo::putConfig {w tbl} {
   152         -    if {![winfo exists $w]} {
   153         -	bell
   154         -	tk_messageBox -title "Error" -icon error -message \
   155         -	    "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   156         -	return ""
   157         -    }
   158         -
   159         -    #
   160         -    # Display the configuration options of w in the tablelist widget tbl
   161         -    #
   162         -    $tbl delete 0 end
   163         -    foreach configSet [$w configure] {
   164         -	#
   165         -	# Insert the list configSet into the tablelist widget
   166         -	#
   167         -	$tbl insert end $configSet
   168         -
   169         -	if {[llength $configSet] == 2} {
   170         -	    $tbl rowconfigure end -foreground gray50 -selectforeground gray75
   171         -	    $tbl cellconfigure end -editable no
   172         -	} else {
   173         -	    #
   174         -	    # Change the colors of the first and last cell of the row
   175         -	    # if the current value is different from the default one
   176         -	    #
   177         -	    set default [lindex $configSet 3]
   178         -	    set current [lindex $configSet 4]
   179         -	    if {[string compare $default $current] != 0} {
   180         -		foreach col {0 4} {
   181         -		    $tbl cellconfigure end,$col -foreground red
   182         -		    if {$demo::selectFgEqForeground} {
   183         -			$tbl cellconfigure end,$col -selectforeground red
   184         -		    } else {
   185         -			$tbl cellconfigure end,$col -selectforeground yellow
   186         -		    }
   187         -		}
   188         -	    }
   189         -	}
   190         -    }
   191         -
   192         -    $tbl sortbycolumn 0
   193         -    $tbl activate 0
   194         -    $tbl attrib widget $w
   195         -}
   196         -
   197         -#------------------------------------------------------------------------------
   198         -# demo::compareAsSet
   199         -#
   200         -# Compares two items of a tablelist widget used to display the configuration
   201         -# options of an arbitrary widget.  The item in which the current value is
   202         -# different from the default one is considered to be less than the other; if
   203         -# both items fulfil this condition or its negation then string comparison is
   204         -# applied to the two option names.
   205         -#------------------------------------------------------------------------------
   206         -proc demo::compareAsSet {item1 item2} {
   207         -    foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \
   208         -	    {opt2 dbName2 dbClass2 default2 current2} $item2 {
   209         -	set changed1 [expr {[string compare $default1 $current1] != 0}]
   210         -	set changed2 [expr {[string compare $default2 $current2] != 0}]
   211         -	if {$changed1 == $changed2} {
   212         -	    return [string compare $opt1 $opt2]
   213         -	} elseif {$changed1} {
   214         -	    return -1
   215         -	} else {
   216         -	    return 1
   217         -	}
   218         -    }
   219         -}
   220         -
   221         -#------------------------------------------------------------------------------
   222         -# demo::applyValue
   223         -#
   224         -# Applies the new value of the configuraton option contained in the given row
   225         -# of the tablelist widget tbl to the widget whose options are displayed in it,
   226         -# and updates the colors of the first and last cell of the row.
   227         -#------------------------------------------------------------------------------
   228         -proc demo::applyValue {tbl row col text} {
   229         -    #
   230         -    # Try to apply the new value of the option contained in
   231         -    # the given row to the widget whose options are displayed
   232         -    # in the tablelist; reject the value if the attempt fails
   233         -    #
   234         -    set w [$tbl attrib widget]
   235         -    set opt [$tbl cellcget $row,0 -text]
   236         -    if {[catch {$w configure $opt $text} result] != 0} {
   237         -	bell
   238         -	tk_messageBox -title "Error" -icon error -message $result \
   239         -	    -parent [winfo toplevel $tbl]
   240         -	$tbl rejectinput
   241         -	return ""
   242         -    }
   243         -
   244         -    #
   245         -    # Replace the new option value with its canonical form and
   246         -    # update the colors of the first and last cell of the row
   247         -    #
   248         -    set text [$w cget $opt]
   249         -    set default [$tbl cellcget $row,3 -text]
   250         -    if {[string compare $default $text] == 0} {
   251         -	foreach col {0 4} {
   252         -	    $tbl cellconfigure $row,$col \
   253         -		 -foreground "" -selectforeground ""
   254         -	}
   255         -    } else {
   256         -	foreach col {0 4} {
   257         -	    $tbl cellconfigure $row,$col -foreground red
   258         -	    if {$demo::selectFgEqForeground} {
   259         -		$tbl cellconfigure $row,$col -selectforeground red
   260         -	    } else {
   261         -		$tbl cellconfigure $row,$col -selectforeground yellow
   262         -	    }
   263         -	}
   264         -    }
   265         -
   266         -    return $text
   267         -}
   268         -
   269         -#------------------------------------------------------------------------------
   270         -
   271         -if {$tcl_interactive} {
   272         -    return "\nTo display the configuration options of an arbitrary\
   273         -	    widget, enter\n\n\tdemo::displayConfig <widgetName>\n"
   274         -} else {
   275         -    wm withdraw .
   276         -    tk_messageBox -title $argv0 -icon warning -message \
   277         -	"Please source this script into\nan interactive wish session"
   278         -    exit 1
   279         -}

Deleted libs/tablelist5.16/demos/dirViewer.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates how to use a tablelist widget for displaying the contents of a
     5         -# directory.
     6         -#
     7         -# Copyright (c) 2010-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     8         -#==============================================================================
     9         -
    10         -package require Tk 8.3
    11         -package require tablelist 5.16
    12         -
    13         -#
    14         -# Add some entries to the Tk option database
    15         -#
    16         -set dir [file dirname [info script]]
    17         -source [file join $dir option.tcl]
    18         -
    19         -#
    20         -# Create three images
    21         -#
    22         -image create photo clsdFolderImg -file [file join $dir clsdFolder.gif]
    23         -image create photo openFolderImg -file [file join $dir openFolder.gif]
    24         -image create photo fileImg       -file [file join $dir file.gif]
    25         -
    26         -#------------------------------------------------------------------------------
    27         -# displayContents
    28         -#
    29         -# Displays the contents of the directory dir in a tablelist widget.
    30         -#------------------------------------------------------------------------------
    31         -proc displayContents dir {
    32         -    #
    33         -    # Create a scrolled tablelist widget with 3 dynamic-
    34         -    # width columns and interactive sort capability
    35         -    #
    36         -    set tf .tf
    37         -    frame $tf -class ScrollArea
    38         -    set tbl $tf.tbl
    39         -    set vsb $tf.vsb
    40         -    set hsb $tf.hsb
    41         -    tablelist::tablelist $tbl \
    42         -	-columns {0 "Name"	    left
    43         -		  0 "Size"	    right
    44         -		  0 "Date Modified" left} \
    45         -	-expandcommand expandCmd -collapsecommand collapseCmd \
    46         -	-xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \
    47         -	-movablecolumns no -setgrid no -showseparators yes -height 18 -width 80
    48         -    if {[$tbl cget -selectborderwidth] == 0} {
    49         -	$tbl configure -spacing 1
    50         -    }
    51         -    $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary
    52         -    $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer
    53         -    $tbl columnconfigure 2 -formatcommand formatString
    54         -    scrollbar $vsb -orient vertical   -command [list $tbl yview]
    55         -    scrollbar $hsb -orient horizontal -command [list $tbl xview]
    56         -
    57         -    #
    58         -    # Create a pop-up menu with one command entry; bind the script
    59         -    # associated with its entry to the <Double-1> event, too
    60         -    #
    61         -    set menu .menu
    62         -    menu $menu -tearoff no
    63         -    $menu add command -label "Display Contents" \
    64         -		      -command [list putContentsOfSelFolder $tbl]
    65         -    set bodyTag [$tbl bodytag]
    66         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
    67         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
    68         -    bind $bodyTag <<Button3>> +[list postPopupMenu %X %Y]
    69         -    bind $bodyTag <Double-1>   [list putContentsOfSelFolder $tbl]
    70         -
    71         -    #
    72         -    # Create three buttons within a frame child of the main widget
    73         -    #
    74         -    set bf .bf
    75         -    frame $bf
    76         -    set b1 $bf.b1
    77         -    set b2 $bf.b2
    78         -    set b3 $bf.b3
    79         -    button $b1 -width 10 -text "Refresh"
    80         -    button $b2 -width 10 -text "Parent"
    81         -    button $b3 -width 10 -text "Close" -command exit
    82         -
    83         -    #
    84         -    # Manage the widgets
    85         -    #
    86         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
    87         -    global winSys
    88         -    if {[string compare $winSys "aqua"] == 0} {
    89         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
    90         -	grid $vsb	       -row 1 -column 1 -sticky ns
    91         -    } else {
    92         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
    93         -    }
    94         -    grid $hsb -row 2 -column 0 -sticky ew
    95         -    grid rowconfigure    $tf 1 -weight 1
    96         -    grid columnconfigure $tf 0 -weight 1
    97         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
    98         -    pack $bf -side bottom -fill x
    99         -    pack $tf -side top -expand yes -fill both
   100         -
   101         -    #
   102         -    # Populate the tablelist with the contents of the given directory
   103         -    #
   104         -    $tbl sortbycolumn 0
   105         -    putContents $dir $tbl root
   106         -}
   107         -
   108         -#------------------------------------------------------------------------------
   109         -# putContents
   110         -#
   111         -# Outputs the contents of the directory dir into the tablelist widget tbl, as
   112         -# child items of the one identified by nodeIdx.
   113         -#------------------------------------------------------------------------------
   114         -proc putContents {dir tbl nodeIdx} {
   115         -    #
   116         -    # The following check is necessary because this procedure
   117         -    # is also invoked by the "Refresh" and "Parent" buttons
   118         -    #
   119         -    if {[string compare $dir ""] != 0 &&
   120         -	(![file isdirectory $dir] || ![file readable $dir])} {
   121         -	bell
   122         -	if {[string compare $nodeIdx "root"] == 0} {
   123         -	    set choice [tk_messageBox -title "Error" -icon warning -message \
   124         -			"Cannot read directory \"[file nativename $dir]\"\
   125         -			-- replacing it with nearest existent ancestor" \
   126         -			-type okcancel -default ok]
   127         -	    if {[string compare $choice "ok"] == 0} {
   128         -		while {![file isdirectory $dir] || ![file readable $dir]} {
   129         -		    set dir [file dirname $dir]
   130         -		}
   131         -	    } else {
   132         -		return ""
   133         -	    }
   134         -	} else {
   135         -	    return ""
   136         -	}
   137         -    }
   138         -
   139         -    if {[string compare $nodeIdx "root"] == 0} {
   140         -	if {[string compare $dir ""] == 0} {
   141         -	    if {[llength [file volumes]] == 1} {
   142         -		wm title . "Contents of the File System"
   143         -	    } else {
   144         -		wm title . "Contents of the File Systems"
   145         -	    }
   146         -	} else {
   147         -	    wm title . "Contents of the Directory \"[file nativename $dir]\""
   148         -	}
   149         -
   150         -	$tbl delete 0 end
   151         -	set row 0
   152         -    } else {
   153         -	set row [expr {$nodeIdx + 1}]
   154         -    }
   155         -
   156         -    #
   157         -    # Build a list from the data of the subdirectories and
   158         -    # files of the directory dir.  Prepend a "D" or "F" to
   159         -    # each entry's name and modification date & time, for
   160         -    # sorting purposes (it will be removed by formatString).
   161         -    #
   162         -    set itemList {}
   163         -    if {[string compare $dir ""] == 0} {
   164         -	foreach volume [file volumes] {
   165         -	    lappend itemList [list D[file nativename $volume] -1 D $volume]
   166         -	}
   167         -    } else {
   168         -	foreach entry [glob -nocomplain -types {d f} -directory $dir *] {
   169         -	    if {[catch {file mtime $entry} modTime] != 0} {
   170         -		continue
   171         -	    }
   172         -
   173         -	    if {[file isdirectory $entry]} {
   174         -		lappend itemList [list D[file tail $entry] -1 \
   175         -		    D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry]
   176         -	    } else {
   177         -		lappend itemList [list F[file tail $entry] [file size $entry] \
   178         -		    F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""]
   179         -	    }
   180         -	}
   181         -    }
   182         -
   183         -    #
   184         -    # Sort the above list and insert it into the tablelist widget
   185         -    # tbl as list of children of the row identified by nodeIdx
   186         -    #
   187         -    set itemList [$tbl applysorting $itemList]
   188         -    $tbl insertchildlist $nodeIdx end $itemList
   189         -
   190         -    #
   191         -    # Insert an image into the first cell of each newly inserted row
   192         -    #
   193         -    foreach item $itemList {
   194         -	set name [lindex $item end]
   195         -	if {[string compare $name ""] == 0} {			;# file
   196         -	    $tbl cellconfigure $row,0 -image fileImg
   197         -	} else {						;# directory
   198         -	    $tbl cellconfigure $row,0 -image clsdFolderImg
   199         -	    $tbl rowattrib $row pathName $name
   200         -
   201         -	    #
   202         -	    # Mark the row as collapsed if the directory is non-empty
   203         -	    #
   204         -	    if {[file readable $name] && [llength \
   205         -		[glob -nocomplain -types {d f} -directory $name *]] != 0} {
   206         -		$tbl collapse $row
   207         -	    }
   208         -	}
   209         -
   210         -	incr row
   211         -    }
   212         -
   213         -    if {[string compare $nodeIdx "root"] == 0} {
   214         -	#
   215         -	# Configure the "Refresh" and "Parent" buttons
   216         -	#
   217         -	.bf.b1 configure -command [list refreshView $dir $tbl]
   218         -	set b2 .bf.b2
   219         -	if {[string compare $dir ""] == 0} {
   220         -	    $b2 configure -state disabled
   221         -	} else {
   222         -	    $b2 configure -state normal
   223         -	    set p [file dirname $dir]
   224         -	    if {[string compare $p $dir] == 0} {
   225         -		$b2 configure -command [list putContents "" $tbl root]
   226         -	    } else {
   227         -		$b2 configure -command [list putContents $p $tbl root]
   228         -	    }
   229         -	}
   230         -    }
   231         -}
   232         -
   233         -#------------------------------------------------------------------------------
   234         -# formatString
   235         -#
   236         -# Returns the substring obtained from the specified value by removing its first
   237         -# character.
   238         -#------------------------------------------------------------------------------
   239         -proc formatString val {
   240         -    return [string range $val 1 end]
   241         -}
   242         -
   243         -#------------------------------------------------------------------------------
   244         -# formatSize
   245         -#
   246         -# Returns an empty string if the specified value is negative and the value
   247         -# itself in user-friendly format otherwise.
   248         -#------------------------------------------------------------------------------
   249         -proc formatSize val {
   250         -    if {$val < 0} {
   251         -	return ""
   252         -    } elseif {$val < 1024} {
   253         -	return "$val bytes"
   254         -    } elseif {$val < 1048576} {
   255         -	return [format "%.1f KB" [expr {$val / 1024.0}]]
   256         -    } elseif {$val < 1073741824} {
   257         -	return [format "%.1f MB" [expr {$val / 1048576.0}]]
   258         -    } else {
   259         -	return [format "%.1f GB" [expr {$val / 1073741824.0}]]
   260         -    }
   261         -}
   262         -
   263         -#------------------------------------------------------------------------------
   264         -# expandCmd
   265         -#
   266         -# Outputs the contents of the directory whose leaf name is displayed in the
   267         -# first cell of the specified row of the tablelist widget tbl, as child items
   268         -# of the one identified by row, and updates the image displayed in that cell.
   269         -#------------------------------------------------------------------------------
   270         -proc expandCmd {tbl row} {
   271         -    if {[$tbl childcount $row] == 0} {
   272         -	set dir [$tbl rowattrib $row pathName]
   273         -	putContents $dir $tbl $row
   274         -    }
   275         -
   276         -    if {[$tbl childcount $row] != 0} {
   277         -	$tbl cellconfigure $row,0 -image openFolderImg
   278         -    }
   279         -}
   280         -
   281         -#------------------------------------------------------------------------------
   282         -# collapseCmd
   283         -#
   284         -# Updates the image displayed in the first cell of the specified row of the
   285         -# tablelist widget tbl.
   286         -#------------------------------------------------------------------------------
   287         -proc collapseCmd {tbl row} {
   288         -    $tbl cellconfigure $row,0 -image clsdFolderImg
   289         -}
   290         -
   291         -#------------------------------------------------------------------------------
   292         -# putContentsOfSelFolder
   293         -#
   294         -# Outputs the contents of the selected folder into the tablelist widget tbl.
   295         -#------------------------------------------------------------------------------
   296         -proc putContentsOfSelFolder tbl {
   297         -    set row [$tbl curselection]
   298         -    if {[$tbl hasrowattrib $row pathName]} {		;# directory item
   299         -	set dir [$tbl rowattrib $row pathName]
   300         -	if {[file isdirectory $dir] && [file readable $dir]} {
   301         -	    if {[llength [glob -nocomplain -types {d f} -directory $dir *]]
   302         -		== 0} {
   303         -		bell
   304         -	    } else {
   305         -		putContents $dir $tbl root
   306         -	    }
   307         -	} else {
   308         -	    bell
   309         -	    tk_messageBox -title "Error" -icon error -message \
   310         -		"Cannot read directory \"[file nativename $dir]\""
   311         -	    return ""
   312         -	}
   313         -    } else {						;# file item
   314         -	bell
   315         -    }
   316         -}
   317         -
   318         -#------------------------------------------------------------------------------
   319         -# postPopupMenu
   320         -#
   321         -# Posts the pop-up menu .menu at the given screen position.  Before posting
   322         -# the menu, the procedure enables/disables its only entry, depending upon
   323         -# whether the selected item represents a readable directory or not.
   324         -#------------------------------------------------------------------------------
   325         -proc postPopupMenu {rootX rootY} {
   326         -    set tbl .tf.tbl
   327         -    set row [$tbl curselection]
   328         -    set menu .menu
   329         -    if {[$tbl hasrowattrib $row pathName]} {		;# directory item
   330         -	set dir [$tbl rowattrib $row pathName]
   331         -	if {[file isdirectory $dir] && [file readable $dir]} {
   332         -	    if {[llength [glob -nocomplain -types {d f} -directory $dir *]]
   333         -		== 0} {
   334         -		$menu entryconfigure 0 -state disabled
   335         -	    } else {
   336         -		$menu entryconfigure 0 -state normal
   337         -	    }
   338         -	} else {
   339         -	    bell
   340         -	    tk_messageBox -title "Error" -icon error -message \
   341         -		"Cannot read directory \"[file nativename $dir]\""
   342         -	    return ""
   343         -	}
   344         -    } else {						;# file item
   345         -	$menu entryconfigure 0 -state disabled
   346         -    }
   347         -
   348         -    tk_popup $menu $rootX $rootY
   349         -}
   350         -
   351         -#------------------------------------------------------------------------------
   352         -# refreshView
   353         -#
   354         -# Redisplays the contents of the directory dir in the tablelist widget tbl and
   355         -# restores the expanded states of the folders as well as the vertical view.
   356         -#------------------------------------------------------------------------------
   357         -proc refreshView {dir tbl} {
   358         -    #
   359         -    # Save the vertical view and get the path names
   360         -    # of the folders displayed in the expanded rows
   361         -    #
   362         -    set yView [$tbl yview]
   363         -    foreach key [$tbl expandedkeys] {
   364         -	set pathName [$tbl rowattrib $key pathName]
   365         -	set expandedFolders($pathName) 1
   366         -    }
   367         -
   368         -    #
   369         -    # Redisplay the directory's (possibly changed) contents and restore
   370         -    # the expanded states of the folders, along with the vertical view
   371         -    #
   372         -    putContents $dir $tbl root
   373         -    restoreExpandedStates $tbl root expandedFolders
   374         -    $tbl yview moveto [lindex $yView 0]
   375         -}
   376         -
   377         -#------------------------------------------------------------------------------
   378         -# restoreExpandedStates
   379         -#
   380         -# Expands those children of the parent identified by nodeIdx that display
   381         -# folders whose path names are the names of the elements of the array specified
   382         -# by the last argument.
   383         -#------------------------------------------------------------------------------
   384         -proc restoreExpandedStates {tbl nodeIdx expandedFoldersName} {
   385         -    upvar $expandedFoldersName expandedFolders
   386         -
   387         -    foreach key [$tbl childkeys $nodeIdx] {
   388         -	set pathName [$tbl rowattrib $key pathName]
   389         -	if {[string compare $pathName ""] != 0 &&
   390         -	    [info exists expandedFolders($pathName)]} {
   391         -	    $tbl expand $key -partly
   392         -	    restoreExpandedStates $tbl $key expandedFolders
   393         -	}
   394         -    }
   395         -}
   396         -
   397         -displayContents ""

Deleted libs/tablelist5.16/demos/dirViewer_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates how to use a tablelist widget for displaying the contents of a
     5         -# directory.
     6         -#
     7         -# Copyright (c) 2010-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     8         -#==============================================================================
     9         -
    10         -package require tablelist_tile 5.16
    11         -
    12         -#
    13         -# Add some entries to the Tk option database
    14         -#
    15         -set dir [file dirname [info script]]
    16         -source [file join $dir option_tile.tcl]
    17         -
    18         -#
    19         -# Create three images
    20         -#
    21         -image create photo clsdFolderImg -file [file join $dir clsdFolder.gif]
    22         -image create photo openFolderImg -file [file join $dir openFolder.gif]
    23         -image create photo fileImg       -file [file join $dir file.gif]
    24         -
    25         -#
    26         -# Work around the improper appearance of the tile scrollbars in the aqua theme
    27         -#
    28         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    29         -    interp alias {} ttk::scrollbar {} ::scrollbar
    30         -}
    31         -
    32         -#------------------------------------------------------------------------------
    33         -# displayContents
    34         -#
    35         -# Displays the contents of the directory dir in a tablelist widget.
    36         -#------------------------------------------------------------------------------
    37         -proc displayContents dir {
    38         -    #
    39         -    # Create a scrolled tablelist widget with 3 dynamic-
    40         -    # width columns and interactive sort capability
    41         -    #
    42         -    set tf .tf
    43         -    ttk::frame $tf -class ScrollArea
    44         -    set tbl $tf.tbl
    45         -    set vsb $tf.vsb
    46         -    set hsb $tf.hsb
    47         -    tablelist::tablelist $tbl \
    48         -	-columns {0 "Name"	    left
    49         -		  0 "Size"	    right
    50         -		  0 "Date Modified" left} \
    51         -	-expandcommand expandCmd -collapsecommand collapseCmd \
    52         -	-xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \
    53         -	-movablecolumns no -setgrid no -showseparators yes -height 18 -width 80
    54         -    if {[$tbl cget -selectborderwidth] == 0} {
    55         -	$tbl configure -spacing 1
    56         -    }
    57         -    $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary
    58         -    $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer
    59         -    $tbl columnconfigure 2 -formatcommand formatString
    60         -    ttk::scrollbar $vsb -orient vertical   -command [list $tbl yview]
    61         -    ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview]
    62         -
    63         -    #
    64         -    # Create a pop-up menu with one command entry; bind the script
    65         -    # associated with its entry to the <Double-1> event, too
    66         -    #
    67         -    set menu .menu
    68         -    menu $menu -tearoff no
    69         -    $menu add command -label "Display Contents" \
    70         -		      -command [list putContentsOfSelFolder $tbl]
    71         -    set bodyTag [$tbl bodytag]
    72         -    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
    73         -    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
    74         -    bind $bodyTag <<Button3>> +[list postPopupMenu %X %Y]
    75         -    bind $bodyTag <Double-1>   [list putContentsOfSelFolder $tbl]
    76         -
    77         -    #
    78         -    # Create three buttons within a frame child of the main widget
    79         -    #
    80         -    set bf .bf
    81         -    ttk::frame $bf
    82         -    set b1 $bf.b1
    83         -    set b2 $bf.b2
    84         -    set b3 $bf.b3
    85         -    ttk::button $b1 -width 10 -text "Refresh"
    86         -    ttk::button $b2 -width 10 -text "Parent"
    87         -    ttk::button $b3 -width 10 -text "Close" -command exit
    88         -
    89         -    #
    90         -    # Manage the widgets
    91         -    #
    92         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
    93         -    if {[tablelist::getCurrentTheme] eq "aqua"} {
    94         -	grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
    95         -	grid $vsb	       -row 1 -column 1 -sticky ns
    96         -    } else {
    97         -	grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
    98         -    }
    99         -    grid $hsb -row 2 -column 0 -sticky ew
   100         -    grid rowconfigure    $tf 1 -weight 1
   101         -    grid columnconfigure $tf 0 -weight 1
   102         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   103         -    pack $bf -side bottom -fill x
   104         -    pack $tf -side top -expand yes -fill both
   105         -
   106         -    #
   107         -    # Populate the tablelist with the contents of the given directory
   108         -    #
   109         -    $tbl sortbycolumn 0
   110         -    putContents $dir $tbl root
   111         -}
   112         -
   113         -#------------------------------------------------------------------------------
   114         -# putContents
   115         -#
   116         -# Outputs the contents of the directory dir into the tablelist widget tbl, as
   117         -# child items of the one identified by nodeIdx.
   118         -#------------------------------------------------------------------------------
   119         -proc putContents {dir tbl nodeIdx} {
   120         -    #
   121         -    # The following check is necessary because this procedure
   122         -    # is also invoked by the "Refresh" and "Parent" buttons
   123         -    #
   124         -    if {[string compare $dir ""] != 0 &&
   125         -	(![file isdirectory $dir] || ![file readable $dir])} {
   126         -	bell
   127         -	if {[string compare $nodeIdx "root"] == 0} {
   128         -	    set choice [tk_messageBox -title "Error" -icon warning -message \
   129         -			"Cannot read directory \"[file nativename $dir]\"\
   130         -			-- replacing it with nearest existent ancestor" \
   131         -			-type okcancel -default ok]
   132         -	    if {[string compare $choice "ok"] == 0} {
   133         -		while {![file isdirectory $dir] || ![file readable $dir]} {
   134         -		    set dir [file dirname $dir]
   135         -		}
   136         -	    } else {
   137         -		return ""
   138         -	    }
   139         -	} else {
   140         -	    return ""
   141         -	}
   142         -    }
   143         -
   144         -    if {[string compare $nodeIdx "root"] == 0} {
   145         -	if {[string compare $dir ""] == 0} {
   146         -	    if {[llength [file volumes]] == 1} {
   147         -		wm title . "Contents of the File System"
   148         -	    } else {
   149         -		wm title . "Contents of the File Systems"
   150         -	    }
   151         -	} else {
   152         -	    wm title . "Contents of the Directory \"[file nativename $dir]\""
   153         -	}
   154         -
   155         -	$tbl delete 0 end
   156         -	set row 0
   157         -    } else {
   158         -	set row [expr {$nodeIdx + 1}]
   159         -    }
   160         -
   161         -    #
   162         -    # Build a list from the data of the subdirectories and
   163         -    # files of the directory dir.  Prepend a "D" or "F" to
   164         -    # each entry's name and modification date & time, for
   165         -    # sorting purposes (it will be removed by formatString).
   166         -    #
   167         -    set itemList {}
   168         -    if {[string compare $dir ""] == 0} {
   169         -	foreach volume [file volumes] {
   170         -	    lappend itemList [list D[file nativename $volume] -1 D $volume]
   171         -	}
   172         -    } else {
   173         -	foreach entry [glob -nocomplain -types {d f} -directory $dir *] {
   174         -	    if {[catch {file mtime $entry} modTime] != 0} {
   175         -		continue
   176         -	    }
   177         -
   178         -	    if {[file isdirectory $entry]} {
   179         -		lappend itemList [list D[file tail $entry] -1 \
   180         -		    D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry]
   181         -	    } else {
   182         -		lappend itemList [list F[file tail $entry] [file size $entry] \
   183         -		    F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""]
   184         -	    }
   185         -	}
   186         -    }
   187         -
   188         -    #
   189         -    # Sort the above list and insert it into the tablelist widget
   190         -    # tbl as list of children of the row identified by nodeIdx
   191         -    #
   192         -    set itemList [$tbl applysorting $itemList]
   193         -    $tbl insertchildlist $nodeIdx end $itemList
   194         -
   195         -    #
   196         -    # Insert an image into the first cell of each newly inserted row
   197         -    #
   198         -    foreach item $itemList {
   199         -	set name [lindex $item end]
   200         -	if {[string compare $name ""] == 0} {			;# file
   201         -	    $tbl cellconfigure $row,0 -image fileImg
   202         -	} else {						;# directory
   203         -	    $tbl cellconfigure $row,0 -image clsdFolderImg
   204         -	    $tbl rowattrib $row pathName $name
   205         -
   206         -	    #
   207         -	    # Mark the row as collapsed if the directory is non-empty
   208         -	    #
   209         -	    if {[file readable $name] && [llength \
   210         -		[glob -nocomplain -types {d f} -directory $name *]] != 0} {
   211         -		$tbl collapse $row
   212         -	    }
   213         -	}
   214         -
   215         -	incr row
   216         -    }
   217         -
   218         -    if {[string compare $nodeIdx "root"] == 0} {
   219         -	#
   220         -	# Configure the "Refresh" and "Parent" buttons
   221         -	#
   222         -	.bf.b1 configure -command [list refreshView $dir $tbl]
   223         -	set b2 .bf.b2
   224         -	if {[string compare $dir ""] == 0} {
   225         -	    $b2 configure -state disabled
   226         -	} else {
   227         -	    $b2 configure -state normal
   228         -	    set p [file dirname $dir]
   229         -	    if {[string compare $p $dir] == 0} {
   230         -		$b2 configure -command [list putContents "" $tbl root]
   231         -	    } else {
   232         -		$b2 configure -command [list putContents $p $tbl root]
   233         -	    }
   234         -	}
   235         -    }
   236         -}
   237         -
   238         -#------------------------------------------------------------------------------
   239         -# formatString
   240         -#
   241         -# Returns the substring obtained from the specified value by removing its first
   242         -# character.
   243         -#------------------------------------------------------------------------------
   244         -proc formatString val {
   245         -    return [string range $val 1 end]
   246         -}
   247         -
   248         -#------------------------------------------------------------------------------
   249         -# formatSize
   250         -#
   251         -# Returns an empty string if the specified value is negative and the value
   252         -# itself in user-friendly format otherwise.
   253         -#------------------------------------------------------------------------------
   254         -proc formatSize val {
   255         -    if {$val < 0} {
   256         -	return ""
   257         -    } elseif {$val < 1024} {
   258         -	return "$val bytes"
   259         -    } elseif {$val < 1048576} {
   260         -	return [format "%.1f KB" [expr {$val / 1024.0}]]
   261         -    } elseif {$val < 1073741824} {
   262         -	return [format "%.1f MB" [expr {$val / 1048576.0}]]
   263         -    } else {
   264         -	return [format "%.1f GB" [expr {$val / 1073741824.0}]]
   265         -    }
   266         -}
   267         -
   268         -#------------------------------------------------------------------------------
   269         -# expandCmd
   270         -#
   271         -# Outputs the contents of the directory whose leaf name is displayed in the
   272         -# first cell of the specified row of the tablelist widget tbl, as child items
   273         -# of the one identified by row, and updates the image displayed in that cell.
   274         -#------------------------------------------------------------------------------
   275         -proc expandCmd {tbl row} {
   276         -    if {[$tbl childcount $row] == 0} {
   277         -	set dir [$tbl rowattrib $row pathName]
   278         -	putContents $dir $tbl $row
   279         -    }
   280         -
   281         -    if {[$tbl childcount $row] != 0} {
   282         -	$tbl cellconfigure $row,0 -image openFolderImg
   283         -    }
   284         -}
   285         -
   286         -#------------------------------------------------------------------------------
   287         -# collapseCmd
   288         -#
   289         -# Updates the image displayed in the first cell of the specified row of the
   290         -# tablelist widget tbl.
   291         -#------------------------------------------------------------------------------
   292         -proc collapseCmd {tbl row} {
   293         -    $tbl cellconfigure $row,0 -image clsdFolderImg
   294         -}
   295         -
   296         -#------------------------------------------------------------------------------
   297         -# putContentsOfSelFolder
   298         -#
   299         -# Outputs the contents of the selected folder into the tablelist widget tbl.
   300         -#------------------------------------------------------------------------------
   301         -proc putContentsOfSelFolder tbl {
   302         -    set row [$tbl curselection]
   303         -    if {[$tbl hasrowattrib $row pathName]} {		;# directory item
   304         -	set dir [$tbl rowattrib $row pathName]
   305         -	if {[file isdirectory $dir] && [file readable $dir]} {
   306         -	    if {[llength [glob -nocomplain -types {d f} -directory $dir *]]
   307         -		== 0} {
   308         -		bell
   309         -	    } else {
   310         -		putContents $dir $tbl root
   311         -	    }
   312         -	} else {
   313         -	    bell
   314         -	    tk_messageBox -title "Error" -icon error -message \
   315         -		"Cannot read directory \"[file nativename $dir]\""
   316         -	    return ""
   317         -	}
   318         -    } else {						;# file item
   319         -	bell
   320         -    }
   321         -}
   322         -
   323         -#------------------------------------------------------------------------------
   324         -# postPopupMenu
   325         -#
   326         -# Posts the pop-up menu .menu at the given screen position.  Before posting
   327         -# the menu, the procedure enables/disables its only entry, depending upon
   328         -# whether the selected item represents a readable directory or not.
   329         -#------------------------------------------------------------------------------
   330         -proc postPopupMenu {rootX rootY} {
   331         -    set tbl .tf.tbl
   332         -    set row [$tbl curselection]
   333         -    set menu .menu
   334         -    if {[$tbl hasrowattrib $row pathName]} {		;# directory item
   335         -	set dir [$tbl rowattrib $row pathName]
   336         -	if {[file isdirectory $dir] && [file readable $dir]} {
   337         -	    if {[llength [glob -nocomplain -types {d f} -directory $dir *]]
   338         -		== 0} {
   339         -		$menu entryconfigure 0 -state disabled
   340         -	    } else {
   341         -		$menu entryconfigure 0 -state normal
   342         -	    }
   343         -	} else {
   344         -	    bell
   345         -	    tk_messageBox -title "Error" -icon error -message \
   346         -		"Cannot read directory \"[file nativename $dir]\""
   347         -	    return ""
   348         -	}
   349         -    } else {						;# file item
   350         -	$menu entryconfigure 0 -state disabled
   351         -    }
   352         -
   353         -    tk_popup $menu $rootX $rootY
   354         -}
   355         -
   356         -#------------------------------------------------------------------------------
   357         -# refreshView
   358         -#
   359         -# Redisplays the contents of the directory dir in the tablelist widget tbl and
   360         -# restores the expanded states of the folders as well as the vertical view.
   361         -#------------------------------------------------------------------------------
   362         -proc refreshView {dir tbl} {
   363         -    #
   364         -    # Save the vertical view and get the path names
   365         -    # of the folders displayed in the expanded rows
   366         -    #
   367         -    set yView [$tbl yview]
   368         -    foreach key [$tbl expandedkeys] {
   369         -	set pathName [$tbl rowattrib $key pathName]
   370         -	set expandedFolders($pathName) 1
   371         -    }
   372         -
   373         -    #
   374         -    # Redisplay the directory's (possibly changed) contents and restore
   375         -    # the expanded states of the folders, along with the vertical view
   376         -    #
   377         -    putContents $dir $tbl root
   378         -    restoreExpandedStates $tbl root expandedFolders
   379         -    $tbl yview moveto [lindex $yView 0]
   380         -}
   381         -
   382         -#------------------------------------------------------------------------------
   383         -# restoreExpandedStates
   384         -#
   385         -# Expands those children of the parent identified by nodeIdx that display
   386         -# folders whose path names are the names of the elements of the array specified
   387         -# by the last argument.
   388         -#------------------------------------------------------------------------------
   389         -proc restoreExpandedStates {tbl nodeIdx expandedFoldersName} {
   390         -    upvar $expandedFoldersName expandedFolders
   391         -
   392         -    foreach key [$tbl childkeys $nodeIdx] {
   393         -	set pathName [$tbl rowattrib $key pathName]
   394         -	if {[string compare $pathName ""] != 0 &&
   395         -	    [info exists expandedFolders($pathName)]} {
   396         -	    $tbl expand $key -partly
   397         -	    restoreExpandedStates $tbl $key expandedFolders
   398         -	}
   399         -    }
   400         -}
   401         -
   402         -displayContents ""

Deleted libs/tablelist5.16/demos/embeddedWindows.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the use of embedded windows in tablelist widgets.
     5         -#
     6         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     7         -#==============================================================================
     8         -
     9         -package require tablelist 5.16
    10         -
    11         -wm title . "Tk Library Scripts"
    12         -
    13         -#
    14         -# Add some entries to the Tk option database
    15         -#
    16         -set dir [file dirname [info script]]
    17         -source [file join $dir option.tcl]
    18         -
    19         -#
    20         -# Create the font TkFixedFont if not yet present
    21         -#
    22         -catch {font create TkFixedFont -family Courier -size -12}
    23         -
    24         -#
    25         -# Create an image to be displayed in buttons embedded in a tablelist widget
    26         -#
    27         -image create photo openImg -file [file join $dir open.gif]
    28         -
    29         -#
    30         -# Create a vertically scrolled tablelist widget with 5
    31         -# dynamic-width columns and interactive sort capability
    32         -#
    33         -set tf .tf
    34         -frame $tf -class ScrollArea 
    35         -set tbl $tf.tbl
    36         -set vsb $tf.vsb
    37         -tablelist::tablelist $tbl \
    38         -    -columns {0 "File Name" left
    39         -	      0 "Bar Chart" center
    40         -	      0 "File Size" right
    41         -	      0 "View"      center
    42         -	      0 "Seen"      center} \
    43         -    -setgrid no -yscrollcommand [list $vsb set] -width 0
    44         -if {[$tbl cget -selectborderwidth] == 0} {
    45         -    $tbl configure -spacing 1
    46         -}
    47         -$tbl columnconfigure 0 -name fileName
    48         -$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer
    49         -$tbl columnconfigure 2 -name fileSize -sortmode integer
    50         -$tbl columnconfigure 4 -name seen
    51         -scrollbar $vsb -orient vertical -command [list $tbl yview]
    52         -
    53         -proc emptyStr val { return "" }
    54         -
    55         -eval font create BoldFont [font actual [$tbl cget -font]] -weight bold
    56         -
    57         -#
    58         -# Populate the tablelist widget
    59         -#
    60         -cd $tk_library
    61         -set maxFileSize 0
    62         -foreach fileName [lsort [glob *.tcl]] {
    63         -    set fileSize [file size $fileName]
    64         -    $tbl insert end [list $fileName $fileSize $fileSize "" no]
    65         -
    66         -    if {$fileSize > $maxFileSize} {
    67         -	set maxFileSize $fileSize
    68         -    }
    69         -}
    70         -
    71         -#------------------------------------------------------------------------------
    72         -# createFrame
    73         -#
    74         -# Creates a frame widget w to be embedded into the specified cell of the
    75         -# tablelist widget tbl, as well as a child frame representing the size of the
    76         -# file whose name is diplayed in the first column of the cell's row.
    77         -#------------------------------------------------------------------------------
    78         -proc createFrame {tbl row col w} {
    79         -    #
    80         -    # Create the frame and replace the binding tag "Frame"
    81         -    # with "TablelistBody" in the list of its binding tags
    82         -    #
    83         -    frame $w -width 102 -height 14 -background ivory -borderwidth 1 \
    84         -	     -relief solid
    85         -    bindtags $w [lreplace [bindtags $w] 1 1 TablelistBody]
    86         -
    87         -    #
    88         -    # Create the child frame and replace the binding tag "Frame"
    89         -    # with "TablelistBody" in the list of its binding tags
    90         -    #
    91         -    frame $w.f -height 12 -background red -borderwidth 1 -relief raised
    92         -    bindtags $w.f [lreplace [bindtags $w] 1 1 TablelistBody]
    93         -
    94         -    #
    95         -    # Manage the child frame
    96         -    #
    97         -    set fileSize [$tbl cellcget $row,fileSize -text]
    98         -    place $w.f -relwidth [expr {double($fileSize) / $::maxFileSize}]
    99         -}
   100         -
   101         -#------------------------------------------------------------------------------
   102         -# createButton
   103         -#
   104         -# Creates a button widget w to be embedded into the specified cell of the
   105         -# tablelist widget tbl.
   106         -#------------------------------------------------------------------------------
   107         -proc createButton {tbl row col w} {
   108         -    set key [$tbl getkeys $row]
   109         -    button $w -image openImg -highlightthickness 0 -takefocus 0 \
   110         -	      -command [list viewFile $tbl $key]
   111         -}
   112         -
   113         -#------------------------------------------------------------------------------
   114         -# viewFile
   115         -#
   116         -# Displays the contents of the file whose name is contained in the row with the
   117         -# given key of the tablelist widget tbl.
   118         -#------------------------------------------------------------------------------
   119         -proc viewFile {tbl key} {
   120         -    set top .top$key
   121         -    if {[winfo exists $top]} {
   122         -	raise $top
   123         -	return ""
   124         -    }
   125         -
   126         -    toplevel $top
   127         -    set fileName [$tbl cellcget k$key,fileName -text]
   128         -    wm title $top "File \"$fileName\""
   129         -
   130         -    #
   131         -    # Create a vertically scrolled text widget as a grandchild of the toplevel
   132         -    #
   133         -    set tf $top.tf
   134         -    frame $tf -class ScrollArea 
   135         -    set txt $tf.txt
   136         -    set vsb $tf.vsb
   137         -    text $txt -background white -font TkFixedFont -setgrid yes \
   138         -	      -yscrollcommand [list $vsb set]
   139         -    catch {$txt configure -tabstyle wordprocessor}	;# for Tk 8.5 and above
   140         -    scrollbar $vsb -orient vertical -command [list $txt yview]
   141         -
   142         -    #
   143         -    # Insert the file's contents into the text widget
   144         -    #
   145         -    set chan [open $fileName]
   146         -    $txt insert end [read $chan]
   147         -    close $chan
   148         -
   149         -    set btn [button $top.btn -text "Close" -command [list destroy $top]]
   150         -
   151         -    #
   152         -    # Manage the widgets
   153         -    #
   154         -    grid $txt -row 0 -column 0 -sticky news
   155         -    grid $vsb -row 0 -column 1 -sticky ns
   156         -    grid rowconfigure    $tf 0 -weight 1
   157         -    grid columnconfigure $tf 0 -weight 1
   158         -    pack $btn -side bottom -pady 10
   159         -    pack $tf  -side top -expand yes -fill both
   160         -
   161         -    #
   162         -    # Mark the file as seen
   163         -    #
   164         -    $tbl rowconfigure k$key -font BoldFont
   165         -    $tbl cellconfigure k$key,seen -text yes
   166         -}
   167         -
   168         -#------------------------------------------------------------------------------
   169         -
   170         -#
   171         -# Create embedded windows in the columns no. 1 and 3
   172         -#
   173         -set rowCount [$tbl size]
   174         -for {set row 0} {$row < $rowCount} {incr row} {
   175         -    $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes
   176         -    $tbl cellconfigure $row,3 -window createButton
   177         -}
   178         -
   179         -set btn [button .btn -text "Close" -command exit]
   180         -
   181         -#
   182         -# Manage the widgets
   183         -#
   184         -grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   185         -if {[string compare $winSys "aqua"] == 0} {
   186         -    grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   187         -    grid $vsb		   -row 1 -column 1 -sticky ns
   188         -} else {
   189         -    grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   190         -}
   191         -grid rowconfigure    $tf 1 -weight 1
   192         -grid columnconfigure $tf 0 -weight 1
   193         -pack $btn -side bottom -pady 10
   194         -pack $tf  -side top -expand yes -fill both

Deleted libs/tablelist5.16/demos/embeddedWindows_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the use of embedded windows in tablelist widgets.
     5         -#
     6         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     7         -#==============================================================================
     8         -
     9         -package require tablelist_tile 5.16
    10         -
    11         -wm title . "Tile Library Scripts"
    12         -
    13         -#
    14         -# Add some entries to the Tk option database
    15         -#
    16         -set dir [file dirname [info script]]
    17         -source [file join $dir option_tile.tcl]
    18         -
    19         -#
    20         -# Create the font TkFixedFont if not yet present
    21         -#
    22         -catch {font create TkFixedFont -family Courier -size -12}
    23         -
    24         -#
    25         -# Create an image to be displayed in buttons embedded in a tablelist widget
    26         -#
    27         -image create photo openImg -file [file join $dir open.gif]
    28         -
    29         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    30         -    #
    31         -    # Work around the improper appearance of the tile scrollbars
    32         -    #
    33         -    interp alias {} ttk::scrollbar {} ::scrollbar
    34         -} else {
    35         -    #
    36         -    # Make the embedded buttons as small as possible.  Recall that in most
    37         -    # themes, the tile buttons consist of the following element hierarchy:
    38         -    #
    39         -    # Button.border
    40         -    #     Button.focus	      (one of its options is -focusthickness)
    41         -    #         Button.padding  (two of its options are -padding and -shiftrelief)
    42         -    #             Button.label
    43         -    #
    44         -    if {[info commands "::ttk::style"] ne ""} {
    45         -	interp alias {} styleConfig {} ttk::style configure
    46         -    } elseif {[string compare $tile::version "0.7"] >= 0} {
    47         -	interp alias {} styleConfig {} style configure
    48         -    } else {
    49         -	interp alias {} styleConfig {} style default
    50         -    }
    51         -    styleConfig Embedded.TButton -focusthickness 0 -padding 0 -shiftrelief 0
    52         -}
    53         -
    54         -#
    55         -# Create a vertically scrolled tablelist widget with 5
    56         -# dynamic-width columns and interactive sort capability
    57         -#
    58         -set tf .tf
    59         -ttk::frame $tf -class ScrollArea
    60         -set tbl $tf.tbl
    61         -set vsb $tf.vsb
    62         -tablelist::tablelist $tbl \
    63         -    -columns {0 "File Name" left
    64         -	      0 "Bar Chart" center
    65         -	      0 "File Size" right
    66         -	      0 "View"      center
    67         -	      0 "Seen"      center} \
    68         -    -setgrid no -yscrollcommand [list $vsb set] -width 0
    69         -if {[$tbl cget -selectborderwidth] == 0} {
    70         -    $tbl configure -spacing 1
    71         -}
    72         -$tbl columnconfigure 0 -name fileName
    73         -$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer
    74         -$tbl columnconfigure 2 -name fileSize -sortmode integer
    75         -$tbl columnconfigure 4 -name seen
    76         -ttk::scrollbar $vsb -orient vertical -command [list $tbl yview]
    77         -
    78         -proc emptyStr val { return "" }
    79         -
    80         -eval font create BoldFont [font actual [$tbl cget -font]] -weight bold
    81         -
    82         -#
    83         -# Populate the tablelist widget
    84         -#
    85         -if {[info exists ttk::library]} {
    86         -    cd $ttk::library
    87         -} else {
    88         -    cd $tile::library
    89         -}
    90         -set maxFileSize 0
    91         -foreach fileName [lsort [glob *.tcl]] {
    92         -    set fileSize [file size $fileName]
    93         -    $tbl insert end [list $fileName $fileSize $fileSize "" no]
    94         -
    95         -    if {$fileSize > $maxFileSize} {
    96         -	set maxFileSize $fileSize
    97         -    }
    98         -}
    99         -
   100         -#------------------------------------------------------------------------------
   101         -# createFrame
   102         -#
   103         -# Creates a frame widget w to be embedded into the specified cell of the
   104         -# tablelist widget tbl, as well as a child frame representing the size of the
   105         -# file whose name is diplayed in the first column of the cell's row.
   106         -#------------------------------------------------------------------------------
   107         -proc createFrame {tbl row col w} {
   108         -    #
   109         -    # Create the frame and replace the binding tag "Frame"
   110         -    # with "TablelistBody" in the list of its binding tags
   111         -    #
   112         -    frame $w -width 102 -height 14 -background ivory -borderwidth 1 \
   113         -	     -relief solid
   114         -    bindtags $w [lreplace [bindtags $w] 1 1 TablelistBody]
   115         -
   116         -    #
   117         -    # Create the child frame and replace the binding tag "Frame"
   118         -    # with "TablelistBody" in the list of its binding tags
   119         -    #
   120         -    frame $w.f -height 12 -background red -borderwidth 1 -relief raised
   121         -    bindtags $w.f [lreplace [bindtags $w] 1 1 TablelistBody]
   122         -
   123         -    #
   124         -    # Manage the child frame
   125         -    #
   126         -    set fileSize [$tbl cellcget $row,fileSize -text]
   127         -    place $w.f -relwidth [expr {double($fileSize) / $::maxFileSize}]
   128         -}
   129         -
   130         -#------------------------------------------------------------------------------
   131         -# createButton
   132         -#
   133         -# Creates a button widget w to be embedded into the specified cell of the
   134         -# tablelist widget tbl.
   135         -#------------------------------------------------------------------------------
   136         -proc createButton {tbl row col w} {
   137         -    set key [$tbl getkeys $row]
   138         -    ttk::button $w -style Embedded.TButton -image openImg -takefocus 0 \
   139         -		   -command [list viewFile $tbl $key]
   140         -}
   141         -
   142         -#------------------------------------------------------------------------------
   143         -# viewFile
   144         -#
   145         -# Displays the contents of the file whose name is contained in the row with the
   146         -# given key of the tablelist widget tbl.
   147         -#------------------------------------------------------------------------------
   148         -proc viewFile {tbl key} {
   149         -    set top .top$key
   150         -    if {[winfo exists $top]} {
   151         -	raise $top
   152         -	return ""
   153         -    }
   154         -
   155         -    toplevel $top
   156         -    set fileName [$tbl cellcget k$key,fileName -text]
   157         -    wm title $top "File \"$fileName\""
   158         -
   159         -    #
   160         -    # Create a vertically scrolled text widget as a grandchild of the toplevel
   161         -    #
   162         -    set tf $top.tf
   163         -    ttk::frame $tf -class ScrollArea
   164         -    set txt $tf.txt
   165         -    set vsb $tf.vsb
   166         -    text $txt -background white -font TkFixedFont -highlightthickness 0 \
   167         -	      -setgrid yes -yscrollcommand [list $vsb set]
   168         -    catch {$txt configure -tabstyle wordprocessor}	;# for Tk 8.5 and above
   169         -    ttk::scrollbar $vsb -orient vertical -command [list $txt yview]
   170         -
   171         -    #
   172         -    # Insert the file's contents into the text widget
   173         -    #
   174         -    set chan [open $fileName]
   175         -    $txt insert end [read $chan]
   176         -    close $chan
   177         -
   178         -    set bf $top.bf
   179         -    ttk::frame $bf
   180         -    set btn [ttk::button $bf.btn -text "Close" -command [list destroy $top]]
   181         -
   182         -    #
   183         -    # Manage the widgets
   184         -    #
   185         -    grid $txt -row 0 -column 0 -sticky news
   186         -    grid $vsb -row 0 -column 1 -sticky ns
   187         -    grid rowconfigure    $tf 0 -weight 1
   188         -    grid columnconfigure $tf 0 -weight 1
   189         -    pack $btn -pady 10
   190         -    pack $bf -side bottom -fill x
   191         -    pack $tf -side top -expand yes -fill both
   192         -
   193         -    #
   194         -    # Mark the file as seen
   195         -    #
   196         -    $tbl rowconfigure k$key -font BoldFont
   197         -    $tbl cellconfigure k$key,seen -text yes
   198         -}
   199         -
   200         -#------------------------------------------------------------------------------
   201         -
   202         -#
   203         -# Create embedded windows in the columns no. 1 and 3
   204         -#
   205         -set rowCount [$tbl size]
   206         -for {set row 0} {$row < $rowCount} {incr row} {
   207         -    $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes
   208         -    $tbl cellconfigure $row,3 -window createButton
   209         -}
   210         -
   211         -set bf .bf
   212         -ttk::frame $bf
   213         -set btn [ttk::button $bf.btn -text "Close" -command exit]
   214         -
   215         -#
   216         -# Manage the widgets
   217         -#
   218         -grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   219         -if {[tablelist::getCurrentTheme] eq "aqua"} {
   220         -    grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   221         -    grid $vsb		   -row 1 -column 1 -sticky ns
   222         -} else {
   223         -    grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   224         -}
   225         -grid rowconfigure    $tf 1 -weight 1
   226         -grid columnconfigure $tf 0 -weight 1
   227         -pack $btn -pady 10
   228         -pack $bf -side bottom -fill x
   229         -pack $tf -side top -expand yes -fill both

Deleted libs/tablelist5.16/demos/file.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/demos/images.tcl.

     1         -#==============================================================================
     2         -# Creates some images.
     3         -#
     4         -# Copyright (c) 2011-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     5         -#==============================================================================
     6         -
     7         -#
     8         -# Create two images, to be displayed in tablelist cells with boolean values
     9         -#
    10         -image create photo checkedImg   -file [file join $dir checked.gif]
    11         -image create photo uncheckedImg -file [file join $dir unchecked.gif]
    12         -
    13         -#
    14         -# Create 16 images representing different colors
    15         -#
    16         -set colorNames {
    17         -    "red" "green" "blue" "magenta"
    18         -    "yellow" "cyan" "white" "light gray"
    19         -    "dark red" "dark green" "dark blue" "dark magenta"
    20         -    "dark yellow" "dark cyan" "dark gray" "black"
    21         -}
    22         -set colorValues {
    23         -    #FF0000 #00FF00 #0000FF #FF00FF
    24         -    #FFFF00 #00FFFF #FFFFFF #C0C0C0
    25         -    #800000 #008000 #000080 #800080
    26         -    #808000 #008080 #808080 #000000
    27         -}
    28         -foreach name $colorNames value $colorValues {
    29         -    set colors($name) $value
    30         -}
    31         -foreach value $colorValues {
    32         -    image create photo img$value -height 13 -width 13
    33         -    img$value put gray50 -to 0 0 13 1				;# top edge
    34         -    img$value put gray50 -to 0 1 1 12				;# left edge
    35         -    img$value put gray75 -to 0 12 13 13				;# bottom edge
    36         -    img$value put gray75 -to 12 1 13 12				;# right edge
    37         -    img$value put $value -to 1 1 12 12
    38         -}

Deleted libs/tablelist5.16/demos/iwidgets.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of some
     5         -# widgets from the Iwidgets package and of the Tk core checkbutton and
     6         -# menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require Tk 8.4				;# because of "-compound"
    12         -package require tablelist 5.16
    13         -package require Iwidgets
    14         -
    15         -wm title . "Serial Line Configuration"
    16         -
    17         -#
    18         -# Add some entries to the Tk option database
    19         -#
    20         -set dir [file dirname [info script]]
    21         -source [file join $dir option.tcl]
    22         -option add *Tablelist*Checkbutton.background		white
    23         -option add *Tablelist*Checkbutton.activeBackground	white
    24         -option add *Tablelist*textBackground			white
    25         -option add *Tablelist*Entry.disabledBackground		white
    26         -option add *Tablelist*Entry.disabledForeground		black
    27         -option add *Tablelist*Dateentry*Label.background	white
    28         -option add *Tablelist*Timeentry*Label.background	white
    29         -
    30         -#
    31         -# Register some widgets from the Iwidgets package for interactive cell editing
    32         -#
    33         -tablelist::addIncrEntryfield
    34         -tablelist::addIncrSpinint
    35         -tablelist::addIncrCombobox
    36         -tablelist::addIncrDateTimeWidget dateentry -seconds
    37         -tablelist::addIncrDateTimeWidget timeentry -seconds
    38         -
    39         -#
    40         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    41         -# names like "img#FF0000", displaying colors identified by names like "red"
    42         -#
    43         -source [file join $dir images.tcl]
    44         -
    45         -#
    46         -# Create a tablelist widget with editable columns (except the first one)
    47         -#
    48         -set tbl .tbl
    49         -tablelist::tablelist $tbl \
    50         -    -columns {0 "No."		  right
    51         -	      0 "Available"	  center
    52         -	      0 "Name"		  left
    53         -	      0 "Baud Rate"	  right
    54         -	      0 "Data Bits"	  center
    55         -	      0 "Parity"	  left
    56         -	      0 "Stop Bits"	  center
    57         -	      0 "Handshake"	  left
    58         -	      0 "Activation Date" center
    59         -	      0 "Activation Time" center
    60         -	      0 "Cable Color"	  center} \
    61         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    62         -    -height 0 -width 0
    63         -if {[$tbl cget -selectborderwidth] == 0} {
    64         -    $tbl configure -spacing 1
    65         -}
    66         -$tbl columnconfigure 0 -sortmode integer
    67         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    68         -    -formatcommand emptyStr
    69         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow entryfield \
    70         -    -sortmode dictionary
    71         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow combobox \
    72         -    -sortmode integer
    73         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow spinint
    74         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow combobox
    75         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow combobox
    76         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox
    77         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow dateentry \
    78         -    -formatcommand formatDate -sortmode integer
    79         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow timeentry \
    80         -    -formatcommand formatTime -sortmode integer
    81         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    82         -    -formatcommand emptyStr
    83         -
    84         -proc emptyStr   val { return "" }
    85         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    86         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    87         -
    88         -#
    89         -# Populate the tablelist widget; set the activation
    90         -# date & time to 10 minutes past the current clock value
    91         -#
    92         -set clock [expr {[clock seconds] + 600}]
    93         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    94         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
    95         -	$clock $clock [lindex $colorNames $i]]
    96         -
    97         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
    98         -    $tbl cellconfigure end,available -image $availImg
    99         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
   100         -}
   101         -
   102         -set btn [button .btn -text "Close" -command exit]
   103         -
   104         -#
   105         -# Manage the widgets
   106         -#
   107         -pack $btn -side bottom -pady 10
   108         -pack $tbl -side top -expand yes -fill both
   109         -
   110         -#------------------------------------------------------------------------------
   111         -# editStartCmd
   112         -#
   113         -# Applies some configuration options to the edit window; if the latter is a
   114         -# combobox, the procedure populates it.
   115         -#------------------------------------------------------------------------------
   116         -proc editStartCmd {tbl row col text} {
   117         -    set w [$tbl editwinpath]
   118         -
   119         -    switch [$tbl columncget $col -name] {
   120         -	lineName {
   121         -	    #
   122         -	    # Set an upper limit of 20 for the number of characters
   123         -	    #
   124         -	    $w configure -pasting no -fixed 20
   125         -	}
   126         -
   127         -	baudRate {
   128         -	    #
   129         -	    # Populate the combobox and allow no more
   130         -	    # than 6 digits in its entry component
   131         -	    #
   132         -	    $w insert list end 50 75 110 300 1200 2400 4800 9600 19200 38400 \
   133         -			       57600 115200 230400 460800 921600
   134         -	    $w configure -pasting no -fixed 6 -validate numeric
   135         -	}
   136         -
   137         -	dataBits {
   138         -	    #
   139         -	    # Configure the spinint widget
   140         -	    #
   141         -	    $w configure -range {5 8} -wrap no -pasting no -fixed 1 \
   142         -			 -validate {regexp {^[5-8]$} %c}
   143         -	}
   144         -
   145         -	parity {
   146         -	    #
   147         -	    # Populate the combobox and make it non-editable
   148         -	    #
   149         -	    $w insert list end None Even Odd Mark Space
   150         -	    $w configure -editable no -listheight 120
   151         -	}
   152         -
   153         -	stopBits {
   154         -	    #
   155         -	    # Populate the combobox and make it non-editable
   156         -	    #
   157         -	    $w insert list end 1 1.5 2
   158         -	    $w configure -editable no -listheight 90
   159         -	}
   160         -
   161         -	handshake {
   162         -	    #
   163         -	    # Populate the combobox and make it non-editable
   164         -	    #
   165         -	    $w insert list end XON/XOFF RTS/CTS None
   166         -	    $w configure -editable no -listheight 90
   167         -	}
   168         -
   169         -	actDate {
   170         -	    #
   171         -	    # Set the date format "%Y-%m-%d"
   172         -	    #
   173         -	    $w configure -int yes
   174         -	}
   175         -
   176         -	actTime {
   177         -	    #
   178         -	    # Set the time format "%H:%M:%S"
   179         -	    #
   180         -	    $w configure -format military
   181         -	}
   182         -
   183         -	color {
   184         -	    #
   185         -	    # Populate the menu and make sure the menubutton will display the
   186         -	    # color name rather than $text, which is "", due to -formatcommand
   187         -	    #
   188         -	    set menu [$w cget -menu]
   189         -	    foreach name $::colorNames {
   190         -		$menu add radiobutton -compound left \
   191         -		    -image img$::colors($name) -label $name
   192         -	    }
   193         -	    $menu entryconfigure 8 -columnbreak 1
   194         -	    return [$tbl cellcget $row,$col -text]
   195         -	}
   196         -    }
   197         -
   198         -    return $text
   199         -}
   200         -
   201         -#------------------------------------------------------------------------------
   202         -# editEndCmd
   203         -#
   204         -# Performs a final validation of the text contained in the edit window and gets
   205         -# the cell's internal contents.
   206         -#------------------------------------------------------------------------------
   207         -proc editEndCmd {tbl row col text} {
   208         -    switch [$tbl columncget $col -name] {
   209         -	available {
   210         -	    #
   211         -	    # Update the image contained in the cell
   212         -	    #
   213         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   214         -	    $tbl cellconfigure $row,$col -image $img
   215         -	}
   216         -
   217         -	baudRate {
   218         -	    #
   219         -	    # Check whether the baud rate is an integer in the range 50..921600
   220         -	    #
   221         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   222         -		bell
   223         -		tk_messageBox -title "Error" -icon error -message \
   224         -		    "The baud rate must be an integer in the range 50..921600"
   225         -		$tbl rejectinput
   226         -	    }
   227         -	}
   228         -
   229         -	dataBits {
   230         -	    #
   231         -	    # Check whether the # of data bits is an integer in the range 5..8
   232         -	    #
   233         -	    if {![regexp {^[5-8]$} $text]} {
   234         -		bell
   235         -		tk_messageBox -title "Error" -icon error -message \
   236         -		    "The # of data bits must be an integer in the range 5..8"
   237         -		$tbl rejectinput
   238         -	    }
   239         -	}
   240         -
   241         -	actDate {
   242         -	    #
   243         -	    # Check whether the activation clock value is later than the
   244         -	    # current one; if this is the case then make sure the cells
   245         -	    # "actDate" and "actTime" will have the same internal value
   246         -	    #
   247         -	    set actTime [$tbl cellcget $row,actTime -text]
   248         -	    set actClock [clock scan [formatTime $actTime] -base $text]
   249         -	    if {$actClock <= [clock seconds]} {
   250         -		bell
   251         -		tk_messageBox -title "Error" -icon error -message \
   252         -		    "The activation date & time must be in the future"
   253         -		$tbl rejectinput
   254         -	    } else {
   255         -		$tbl cellconfigure $row,actTime -text $actClock
   256         -		return $actClock
   257         -	    }
   258         -	}
   259         -
   260         -	actTime {
   261         -	    #
   262         -	    # Check whether the activation clock value is later than the
   263         -	    # current one; if this is the case then make sure the cells
   264         -	    # "actDate" and "actTime" will have the same internal value
   265         -	    #
   266         -	    set actDate [$tbl cellcget $row,actDate -text]
   267         -	    set actClock [clock scan [formatTime $text] -base $actDate]
   268         -	    if {$actClock <= [clock seconds]} {
   269         -		bell
   270         -		tk_messageBox -title "Error" -icon error -message \
   271         -		    "The activation date & time must be in the future"
   272         -		$tbl rejectinput
   273         -	    } else {
   274         -		$tbl cellconfigure $row,actDate -text $actClock
   275         -		return $actClock
   276         -	    }
   277         -	}
   278         -
   279         -	color {
   280         -	    #
   281         -	    # Update the image contained in the cell
   282         -	    #
   283         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   284         -	}
   285         -    }
   286         -
   287         -    return $text
   288         -}

Deleted libs/tablelist5.16/demos/iwidgets_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of some
     5         -# widgets from the Iwidgets package and of the Tk core checkbutton and
     6         -# menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require tablelist_tile 5.16
    12         -package require Iwidgets
    13         -
    14         -wm title . "Serial Line Configuration"
    15         -
    16         -#
    17         -# Add some entries to the Tk option database
    18         -#
    19         -set dir [file dirname [info script]]
    20         -source [file join $dir option_tile.tcl]
    21         -option add *Tablelist*Checkbutton.background		white
    22         -option add *Tablelist*Checkbutton.activeBackground	white
    23         -option add *Tablelist*textBackground			white
    24         -option add *Tablelist*Entry.disabledBackground		white
    25         -option add *Tablelist*Entry.disabledForeground		black
    26         -option add *Tablelist*Dateentry*Label.background	white
    27         -option add *Tablelist*Timeentry*Label.background	white
    28         -
    29         -#
    30         -# Register some widgets from the Iwidgets package for interactive cell editing
    31         -#
    32         -tablelist::addIncrEntryfield
    33         -tablelist::addIncrSpinint
    34         -tablelist::addIncrCombobox
    35         -tablelist::addIncrDateTimeWidget dateentry -seconds
    36         -tablelist::addIncrDateTimeWidget timeentry -seconds
    37         -
    38         -#
    39         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    40         -# names like "img#FF0000", displaying colors identified by names like "red"
    41         -#
    42         -source [file join $dir images.tcl]
    43         -
    44         -#
    45         -# Improve the window's appearance by using a tile
    46         -# frame as a container for the other widgets
    47         -#
    48         -set f [ttk::frame .f]
    49         -
    50         -#
    51         -# Create a tablelist widget with editable columns (except the first one)
    52         -#
    53         -set tbl $f.tbl
    54         -tablelist::tablelist $tbl \
    55         -    -columns {0 "No."		  right
    56         -	      0 "Available"	  center
    57         -	      0 "Name"		  left
    58         -	      0 "Baud Rate"	  right
    59         -	      0 "Data Bits"	  center
    60         -	      0 "Parity"	  left
    61         -	      0 "Stop Bits"	  center
    62         -	      0 "Handshake"	  left
    63         -	      0 "Activation Date" center
    64         -	      0 "Activation Time" center
    65         -	      0 "Cable Color"	  center} \
    66         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    67         -    -height 0 -width 0
    68         -if {[$tbl cget -selectborderwidth] == 0} {
    69         -    $tbl configure -spacing 1
    70         -}
    71         -$tbl columnconfigure 0 -sortmode integer
    72         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    73         -    -formatcommand emptyStr
    74         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow entryfield \
    75         -    -sortmode dictionary
    76         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow combobox \
    77         -    -sortmode integer
    78         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow spinint
    79         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow combobox
    80         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow combobox
    81         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox
    82         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow dateentry \
    83         -    -formatcommand formatDate -sortmode integer
    84         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow timeentry \
    85         -    -formatcommand formatTime -sortmode integer
    86         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    87         -    -formatcommand emptyStr
    88         -
    89         -proc emptyStr   val { return "" }
    90         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    91         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    92         -
    93         -#
    94         -# Populate the tablelist widget; set the activation
    95         -# date & time to 10 minutes past the current clock value
    96         -#
    97         -set clock [expr {[clock seconds] + 600}]
    98         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    99         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
   100         -	$clock $clock [lindex $colorNames $i]]
   101         -
   102         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
   103         -    $tbl cellconfigure end,available -image $availImg
   104         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
   105         -}
   106         -
   107         -set btn [ttk::button $f.btn -text "Close" -command exit]
   108         -
   109         -#
   110         -# Manage the widgets
   111         -#
   112         -pack $btn -side bottom -pady 10
   113         -pack $tbl -side top -expand yes -fill both
   114         -pack $f -expand yes -fill both
   115         -
   116         -#------------------------------------------------------------------------------
   117         -# editStartCmd
   118         -#
   119         -# Applies some configuration options to the edit window; if the latter is a
   120         -# combobox, the procedure populates it.
   121         -#------------------------------------------------------------------------------
   122         -proc editStartCmd {tbl row col text} {
   123         -    set w [$tbl editwinpath]
   124         -
   125         -    switch [$tbl columncget $col -name] {
   126         -	lineName {
   127         -	    #
   128         -	    # Set an upper limit of 20 for the number of characters
   129         -	    #
   130         -	    $w configure -pasting no -fixed 20
   131         -	}
   132         -
   133         -	baudRate {
   134         -	    #
   135         -	    # Populate the combobox and allow no more
   136         -	    # than 6 digits in its entry component
   137         -	    #
   138         -	    $w insert list end 50 75 110 300 1200 2400 4800 9600 19200 38400 \
   139         -			       57600 115200 230400 460800 921600
   140         -	    $w configure -pasting no -fixed 6 -validate numeric
   141         -	}
   142         -
   143         -	dataBits {
   144         -	    #
   145         -	    # Configure the spinint widget
   146         -	    #
   147         -	    $w configure -range {5 8} -wrap no -pasting no -fixed 1 \
   148         -			 -validate {regexp {^[5-8]$} %c}
   149         -	}
   150         -
   151         -	parity {
   152         -	    #
   153         -	    # Populate the combobox and make it non-editable
   154         -	    #
   155         -	    $w insert list end None Even Odd Mark Space
   156         -	    $w configure -editable no -listheight 120
   157         -	}
   158         -
   159         -	stopBits {
   160         -	    #
   161         -	    # Populate the combobox and make it non-editable
   162         -	    #
   163         -	    $w insert list end 1 1.5 2
   164         -	    $w configure -editable no -listheight 90
   165         -	}
   166         -
   167         -	handshake {
   168         -	    #
   169         -	    # Populate the combobox and make it non-editable
   170         -	    #
   171         -	    $w insert list end XON/XOFF RTS/CTS None
   172         -	    $w configure -editable no -listheight 90
   173         -	}
   174         -
   175         -	actDate {
   176         -	    #
   177         -	    # Set the date format "%Y-%m-%d"
   178         -	    #
   179         -	    $w configure -int yes
   180         -	}
   181         -
   182         -	actTime {
   183         -	    #
   184         -	    # Set the time format "%H:%M:%S"
   185         -	    #
   186         -	    $w configure -format military
   187         -	}
   188         -
   189         -	color {
   190         -	    #
   191         -	    # Populate the menu and make sure the menubutton will display the
   192         -	    # color name rather than $text, which is "", due to -formatcommand
   193         -	    #
   194         -	    set menu [$w cget -menu]
   195         -	    foreach name $::colorNames {
   196         -		$menu add radiobutton -compound left \
   197         -		    -image img$::colors($name) -label $name
   198         -	    }
   199         -	    $menu entryconfigure 8 -columnbreak 1
   200         -	    return [$tbl cellcget $row,$col -text]
   201         -	}
   202         -    }
   203         -
   204         -    return $text
   205         -}
   206         -
   207         -#------------------------------------------------------------------------------
   208         -# editEndCmd
   209         -#
   210         -# Performs a final validation of the text contained in the edit window and gets
   211         -# the cell's internal contents.
   212         -#------------------------------------------------------------------------------
   213         -proc editEndCmd {tbl row col text} {
   214         -    switch [$tbl columncget $col -name] {
   215         -	available {
   216         -	    #
   217         -	    # Update the image contained in the cell
   218         -	    #
   219         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   220         -	    $tbl cellconfigure $row,$col -image $img
   221         -	}
   222         -
   223         -	baudRate {
   224         -	    #
   225         -	    # Check whether the baud rate is an integer in the range 50..921600
   226         -	    #
   227         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   228         -		bell
   229         -		tk_messageBox -title "Error" -icon error -message \
   230         -		    "The baud rate must be an integer in the range 50..921600"
   231         -		$tbl rejectinput
   232         -	    }
   233         -	}
   234         -
   235         -	dataBits {
   236         -	    #
   237         -	    # Check whether the # of data bits is an integer in the range 5..8
   238         -	    #
   239         -	    if {![regexp {^[5-8]$} $text]} {
   240         -		bell
   241         -		tk_messageBox -title "Error" -icon error -message \
   242         -		    "The # of data bits must be an integer in the range 5..8"
   243         -		$tbl rejectinput
   244         -	    }
   245         -	}
   246         -
   247         -	actDate {
   248         -	    #
   249         -	    # Check whether the activation clock value is later than the
   250         -	    # current one; if this is the case then make sure the cells
   251         -	    # "actDate" and "actTime" will have the same internal value
   252         -	    #
   253         -	    set actTime [$tbl cellcget $row,actTime -text]
   254         -	    set actClock [clock scan [formatTime $actTime] -base $text]
   255         -	    if {$actClock <= [clock seconds]} {
   256         -		bell
   257         -		tk_messageBox -title "Error" -icon error -message \
   258         -		    "The activation date & time must be in the future"
   259         -		$tbl rejectinput
   260         -	    } else {
   261         -		$tbl cellconfigure $row,actTime -text $actClock
   262         -		return $actClock
   263         -	    }
   264         -	}
   265         -
   266         -	actTime {
   267         -	    #
   268         -	    # Check whether the activation clock value is later than the
   269         -	    # current one; if this is the case then make sure the cells
   270         -	    # "actDate" and "actTime" will have the same internal value
   271         -	    #
   272         -	    set actDate [$tbl cellcget $row,actDate -text]
   273         -	    set actClock [clock scan [formatTime $text] -base $actDate]
   274         -	    if {$actClock <= [clock seconds]} {
   275         -		bell
   276         -		tk_messageBox -title "Error" -icon error -message \
   277         -		    "The activation date & time must be in the future"
   278         -		$tbl rejectinput
   279         -	    } else {
   280         -		$tbl cellconfigure $row,actDate -text $actClock
   281         -		return $actClock
   282         -	    }
   283         -	}
   284         -
   285         -	color {
   286         -	    #
   287         -	    # Update the image contained in the cell
   288         -	    #
   289         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   290         -	}
   291         -    }
   292         -
   293         -    return $text
   294         -}

Deleted libs/tablelist5.16/demos/leaf.xbm.

     1         -#define leaf_width 14
     2         -#define leaf_height 12
     3         -static unsigned char leaf_bits[] = {
     4         -   0xff, 0x3f, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20,
     5         -   0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0xff, 0x3f};

Deleted libs/tablelist5.16/demos/miscWidgets.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of Bryan
     5         -# Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the
     6         -# Tk core entry, spinbox, checkbutton, and menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require Tk 8.4		;# because of "-compound" and the spinbox widget
    12         -package require tablelist 5.16
    13         -package require combobox
    14         -package require mentry
    15         -
    16         -wm title . "Serial Line Configuration"
    17         -
    18         -#
    19         -# Add some entries to the Tk option database
    20         -#
    21         -set dir [file dirname [info script]]
    22         -source [file join $dir option.tcl]
    23         -option add *Tablelist*Checkbutton.background		white
    24         -option add *Tablelist*Checkbutton.activeBackground	white
    25         -option add *Tablelist*Entry.background			white
    26         -option add *Tablelist*Spinbox.background		white
    27         -option add *Tablelist*Spinbox.readonlyBackground	white
    28         -option add *Tablelist*Combobox.background		white
    29         -option add *Tablelist*Combobox.elementBorderWidth	2
    30         -option add *Tablelist*Mentry.background			white
    31         -
    32         -#
    33         -# Register Bryan Oakley's combobox widget as well as the mentry
    34         -# widgets of type "Date" and "Time" for interactive cell editing
    35         -#
    36         -tablelist::addOakleyCombobox
    37         -tablelist::addDateMentry Ymd -
    38         -tablelist::addTimeMentry HMS :
    39         -
    40         -#
    41         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    42         -# names like "img#FF0000", displaying colors identified by names like "red"
    43         -#
    44         -source [file join $dir images.tcl]
    45         -
    46         -#
    47         -# Create a tablelist widget with editable columns (except the first one)
    48         -#
    49         -set tbl .tbl
    50         -tablelist::tablelist $tbl \
    51         -    -columns {0 "No."		  right
    52         -	      0 "Available"	  center
    53         -	      0 "Name"		  left
    54         -	      0 "Baud Rate"	  right
    55         -	      0 "Data Bits"	  center
    56         -	      0 "Parity"	  left
    57         -	      0 "Stop Bits"	  center
    58         -	      0 "Handshake"	  left
    59         -	      0 "Activation Date" center
    60         -	      0 "Activation Time" center
    61         -	      0 "Cable Color"	  center} \
    62         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    63         -    -height 0 -width 0
    64         -if {[$tbl cget -selectborderwidth] == 0} {
    65         -    $tbl configure -spacing 1
    66         -}
    67         -$tbl columnconfigure 0 -sortmode integer
    68         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    69         -    -formatcommand emptyStr
    70         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow entry \
    71         -    -sortmode dictionary
    72         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow combobox \
    73         -    -sortmode integer
    74         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow spinbox
    75         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow combobox
    76         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow combobox
    77         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox
    78         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow dateMentry \
    79         -    -formatcommand formatDate -sortmode integer
    80         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow timeMentry \
    81         -    -formatcommand formatTime -sortmode integer
    82         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    83         -    -formatcommand emptyStr
    84         -
    85         -proc emptyStr   val { return "" }
    86         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    87         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    88         -
    89         -#
    90         -# Populate the tablelist widget; set the activation
    91         -# date & time to 10 minutes past the current clock value
    92         -#
    93         -set clock [expr {[clock seconds] + 600}]
    94         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    95         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
    96         -	$clock $clock [lindex $colorNames $i]]
    97         -
    98         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
    99         -    $tbl cellconfigure end,available -image $availImg
   100         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
   101         -}
   102         -
   103         -set btn [button .btn -text "Close" -command exit]
   104         -
   105         -#
   106         -# Manage the widgets
   107         -#
   108         -pack $btn -side bottom -pady 10
   109         -pack $tbl -side top -expand yes -fill both
   110         -
   111         -#------------------------------------------------------------------------------
   112         -# editStartCmd
   113         -#
   114         -# Applies some configuration options to the edit window; if the latter is a
   115         -# combobox, the procedure populates it.
   116         -#------------------------------------------------------------------------------
   117         -proc editStartCmd {tbl row col text} {
   118         -    set w [$tbl editwinpath]
   119         -
   120         -    switch [$tbl columncget $col -name] {
   121         -	lineName {
   122         -	    #
   123         -	    # Set an upper limit of 20 for the number of characters
   124         -	    #
   125         -	    wcb::callback $w before insert {wcb::checkEntryLen 20}
   126         -	}
   127         -
   128         -	baudRate {
   129         -	    #
   130         -	    # Populate the combobox and allow no more
   131         -	    # than 6 digits in its entry component
   132         -	    #
   133         -	    $w list insert end 50 75 110 300 1200 2400 4800 9600 19200 38400 \
   134         -			       57600 115200 230400 460800 921600
   135         -	    wcb::callback [$tbl entrypath] before insert \
   136         -		{wcb::checkEntryLen 6} {wcb::checkStrForRegExp {^[0-9]*$}}
   137         -	}
   138         -
   139         -	dataBits {
   140         -	    #
   141         -	    # Configure the spinbox
   142         -	    #
   143         -	    $w configure -from 5 -to 8 -state readonly
   144         -	}
   145         -
   146         -	parity {
   147         -	    #
   148         -	    # Populate the combobox and make it non-editable
   149         -	    #
   150         -	    $w list insert end None Even Odd Mark Space
   151         -	    $w configure -editable no
   152         -	}
   153         -
   154         -	stopBits {
   155         -	    #
   156         -	    # Populate the combobox and make it non-editable
   157         -	    #
   158         -	    $w list insert end 1 1.5 2
   159         -	    $w configure -editable no
   160         -	}
   161         -
   162         -	handshake {
   163         -	    #
   164         -	    # Populate the combobox and make it non-editable
   165         -	    #
   166         -	    $w list insert end XON/XOFF RTS/CTS None
   167         -	    $w configure -editable no
   168         -	}
   169         -
   170         -	actDate -
   171         -	actTime {
   172         -	    #
   173         -	    # Configure the mentry widget
   174         -	    #
   175         -	    $w configure -justify center
   176         -	}
   177         -
   178         -	color {
   179         -	    #
   180         -	    # Populate the menu and make sure the menubutton will display the
   181         -	    # color name rather than $text, which is "", due to -formatcommand
   182         -	    #
   183         -	    set menu [$w cget -menu]
   184         -	    foreach name $::colorNames {
   185         -		$menu add radiobutton -compound left \
   186         -		    -image img$::colors($name) -label $name
   187         -	    }
   188         -	    $menu entryconfigure 8 -columnbreak 1
   189         -	    return [$tbl cellcget $row,$col -text]
   190         -	}
   191         -    }
   192         -
   193         -    return $text
   194         -}
   195         -
   196         -#
   197         -# Message strings corresponding to the values
   198         -# returned by mentry::getClockVal on failure
   199         -#
   200         -array set msgs {
   201         -    EMPTY	"Field value missing"
   202         -    BAD		"Invalid field value"
   203         -    BAD_DATE	"Invalid date"
   204         -    BAD_YEAR	"Unsupported year"
   205         -}
   206         -
   207         -#------------------------------------------------------------------------------
   208         -# editEndCmd
   209         -#
   210         -# Performs a final validation of the text contained in the edit window and gets
   211         -# the cell's internal contents.
   212         -#------------------------------------------------------------------------------
   213         -proc editEndCmd {tbl row col text} {
   214         -    switch [$tbl columncget $col -name] {
   215         -	available {
   216         -	    #
   217         -	    # Update the image contained in the cell
   218         -	    #
   219         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   220         -	    $tbl cellconfigure $row,$col -image $img
   221         -	}
   222         -
   223         -	baudRate {
   224         -	    #
   225         -	    # Check whether the baud rate is an integer in the range 50..921600
   226         -	    #
   227         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   228         -		bell
   229         -		tk_messageBox -title "Error" -icon error -message \
   230         -		    "The baud rate must be an integer in the range 50..921600"
   231         -		$tbl rejectinput
   232         -	    }
   233         -	}
   234         -
   235         -	actDate {
   236         -	    #
   237         -	    # Check whether the last argument is a clock value in seconds
   238         -	    #
   239         -	    if {![string is digit $text]} {
   240         -		bell
   241         -		tk_messageBox -title "Error" -icon error -message $::msgs($text)
   242         -		$tbl rejectinput
   243         -		return ""
   244         -	    }
   245         -
   246         -	    #
   247         -	    # Check whether the activation clock value is later than the
   248         -	    # current one; if this is the case then make sure the cells
   249         -	    # "actDate" and "actTime" will have the same internal value
   250         -	    #
   251         -	    set actTime [$tbl cellcget $row,actTime -text]
   252         -	    set actClock [clock scan [formatTime $actTime] -base $text]
   253         -	    if {$actClock <= [clock seconds]} {
   254         -		bell
   255         -		tk_messageBox -title "Error" -icon error -message \
   256         -		    "The activation date & time must be in the future"
   257         -		$tbl rejectinput
   258         -	    } else {
   259         -		$tbl cellconfigure $row,actTime -text $actClock
   260         -		return $actClock
   261         -	    }
   262         -	}
   263         -
   264         -	actTime {
   265         -	    #
   266         -	    # Check whether the last argument is a clock value in seconds
   267         -	    #
   268         -	    if {![string is digit $text]} {
   269         -		bell
   270         -		tk_messageBox -title "Error" -icon error -message $::msgs($text)
   271         -		$tbl rejectinput
   272         -		return ""
   273         -	    }
   274         -
   275         -	    #
   276         -	    # Check whether the activation clock value is later than the
   277         -	    # current one; if this is the case then make sure the cells
   278         -	    # "actDate" and "actTime" will have the same internal value
   279         -	    #
   280         -	    set actDate [$tbl cellcget $row,actDate -text]
   281         -	    set actClock [clock scan [formatTime $text] -base $actDate]
   282         -	    if {$actClock <= [clock seconds]} {
   283         -		bell
   284         -		tk_messageBox -title "Error" -icon error -message \
   285         -		    "The activation date & time must be in the future"
   286         -		$tbl rejectinput
   287         -	    } else {
   288         -		$tbl cellconfigure $row,actDate -text $actClock
   289         -		return $actClock
   290         -	    }
   291         -	}
   292         -
   293         -	color {
   294         -	    #
   295         -	    # Update the image contained in the cell
   296         -	    #
   297         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   298         -	}
   299         -    }
   300         -
   301         -    return $text
   302         -}

Deleted libs/tablelist5.16/demos/miscWidgets_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of Bryan
     5         -# Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the
     6         -# Tk core entry, spinbox, checkbutton, and menubutton widgets.
     7         -#
     8         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     9         -#==============================================================================
    10         -
    11         -package require tablelist_tile 5.16
    12         -package require combobox
    13         -package require mentry
    14         -
    15         -wm title . "Serial Line Configuration"
    16         -
    17         -#
    18         -# Add some entries to the Tk option database
    19         -#
    20         -set dir [file dirname [info script]]
    21         -source [file join $dir option_tile.tcl]
    22         -option add *Tablelist*Checkbutton.background		white
    23         -option add *Tablelist*Checkbutton.activeBackground	white
    24         -option add *Tablelist*Entry.background			white
    25         -option add *Tablelist*Spinbox.background		white
    26         -option add *Tablelist*Spinbox.readonlyBackground	white
    27         -option add *Tablelist*Combobox.background		white
    28         -option add *Tablelist*Combobox.elementBorderWidth	2
    29         -option add *Tablelist*Mentry.background			white
    30         -
    31         -#
    32         -# Register Bryan Oakley's combobox widget as well as the mentry
    33         -# widgets of type "Date" and "Time" for interactive cell editing
    34         -#
    35         -tablelist::addOakleyCombobox
    36         -tablelist::addDateMentry Ymd -
    37         -tablelist::addTimeMentry HMS :
    38         -
    39         -#
    40         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    41         -# names like "img#FF0000", displaying colors identified by names like "red"
    42         -#
    43         -source [file join $dir images.tcl]
    44         -
    45         -#
    46         -# Improve the window's appearance by using a tile
    47         -# frame as a container for the other widgets
    48         -#
    49         -set f [ttk::frame .f]
    50         -
    51         -#
    52         -# Create a tablelist widget with editable columns (except the first one)
    53         -#
    54         -set tbl $f.tbl
    55         -tablelist::tablelist $tbl \
    56         -    -columns {0 "No."		  right
    57         -	      0 "Available"	  center
    58         -	      0 "Name"		  left
    59         -	      0 "Baud Rate"	  right
    60         -	      0 "Data Bits"	  center
    61         -	      0 "Parity"	  left
    62         -	      0 "Stop Bits"	  center
    63         -	      0 "Handshake"	  left
    64         -	      0 "Activation Date" center
    65         -	      0 "Activation Time" center
    66         -	      0 "Cable Color"	  center} \
    67         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    68         -    -height 0 -width 0
    69         -if {[$tbl cget -selectborderwidth] == 0} {
    70         -    $tbl configure -spacing 1
    71         -}
    72         -$tbl columnconfigure 0 -sortmode integer
    73         -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
    74         -    -formatcommand emptyStr
    75         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow entry \
    76         -    -sortmode dictionary
    77         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow combobox \
    78         -    -sortmode integer
    79         -$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow spinbox
    80         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow combobox
    81         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow combobox
    82         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox
    83         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow dateMentry \
    84         -    -formatcommand formatDate -sortmode integer
    85         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow timeMentry \
    86         -    -formatcommand formatTime -sortmode integer
    87         -$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
    88         -    -formatcommand emptyStr
    89         -
    90         -proc emptyStr   val { return "" }
    91         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    92         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    93         -
    94         -#
    95         -# Populate the tablelist widget; set the activation
    96         -# date & time to 10 minutes past the current clock value
    97         -#
    98         -set clock [expr {[clock seconds] + 600}]
    99         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
   100         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
   101         -	$clock $clock [lindex $colorNames $i]]
   102         -
   103         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
   104         -    $tbl cellconfigure end,available -image $availImg
   105         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
   106         -}
   107         -
   108         -set btn [ttk::button $f.btn -text "Close" -command exit]
   109         -
   110         -#
   111         -# Manage the widgets
   112         -#
   113         -pack $btn -side bottom -pady 10
   114         -pack $tbl -side top -expand yes -fill both
   115         -pack $f -expand yes -fill both
   116         -
   117         -#------------------------------------------------------------------------------
   118         -# editStartCmd
   119         -#
   120         -# Applies some configuration options to the edit window; if the latter is a
   121         -# combobox, the procedure populates it.
   122         -#------------------------------------------------------------------------------
   123         -proc editStartCmd {tbl row col text} {
   124         -    set w [$tbl editwinpath]
   125         -
   126         -    switch [$tbl columncget $col -name] {
   127         -	lineName {
   128         -	    #
   129         -	    # Set an upper limit of 20 for the number of characters
   130         -	    #
   131         -	    wcb::callback $w before insert {wcb::checkEntryLen 20}
   132         -	}
   133         -
   134         -	baudRate {
   135         -	    #
   136         -	    # Populate the combobox and allow no more
   137         -	    # than 6 digits in its entry component
   138         -	    #
   139         -	    $w list insert end 50 75 110 300 1200 2400 4800 9600 19200 38400 \
   140         -			       57600 115200 230400 460800 921600
   141         -	    wcb::callback [$tbl entrypath] before insert \
   142         -		{wcb::checkEntryLen 6} {wcb::checkStrForRegExp {^[0-9]*$}}
   143         -	}
   144         -
   145         -	dataBits {
   146         -	    #
   147         -	    # Configure the spinbox
   148         -	    #
   149         -	    $w configure -from 5 -to 8 -state readonly
   150         -	}
   151         -
   152         -	parity {
   153         -	    #
   154         -	    # Populate the combobox and make it non-editable
   155         -	    #
   156         -	    $w list insert end None Even Odd Mark Space
   157         -	    $w configure -editable no
   158         -	}
   159         -
   160         -	stopBits {
   161         -	    #
   162         -	    # Populate the combobox and make it non-editable
   163         -	    #
   164         -	    $w list insert end 1 1.5 2
   165         -	    $w configure -editable no
   166         -	}
   167         -
   168         -	handshake {
   169         -	    #
   170         -	    # Populate the combobox and make it non-editable
   171         -	    #
   172         -	    $w list insert end XON/XOFF RTS/CTS None
   173         -	    $w configure -editable no
   174         -	}
   175         -
   176         -	actDate -
   177         -	actTime {
   178         -	    #
   179         -	    # Configure the mentry widget
   180         -	    #
   181         -	    $w configure -justify center
   182         -	}
   183         -
   184         -	color {
   185         -	    #
   186         -	    # Populate the menu and make sure the menubutton will display the
   187         -	    # color name rather than $text, which is "", due to -formatcommand
   188         -	    #
   189         -	    set menu [$w cget -menu]
   190         -	    foreach name $::colorNames {
   191         -		$menu add radiobutton -compound left \
   192         -		    -image img$::colors($name) -label $name
   193         -	    }
   194         -	    $menu entryconfigure 8 -columnbreak 1
   195         -	    return [$tbl cellcget $row,$col -text]
   196         -	}
   197         -    }
   198         -
   199         -    return $text
   200         -}
   201         -
   202         -#
   203         -# Message strings corresponding to the values
   204         -# returned by mentry::getClockVal on failure
   205         -#
   206         -array set msgs {
   207         -    EMPTY	"Field value missing"
   208         -    BAD		"Invalid field value"
   209         -    BAD_DATE	"Invalid date"
   210         -    BAD_YEAR	"Unsupported year"
   211         -}
   212         -
   213         -#------------------------------------------------------------------------------
   214         -# editEndCmd
   215         -#
   216         -# Performs a final validation of the text contained in the edit window and gets
   217         -# the cell's internal contents.
   218         -#------------------------------------------------------------------------------
   219         -proc editEndCmd {tbl row col text} {
   220         -    switch [$tbl columncget $col -name] {
   221         -	available {
   222         -	    #
   223         -	    # Update the image contained in the cell
   224         -	    #
   225         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   226         -	    $tbl cellconfigure $row,$col -image $img
   227         -	}
   228         -
   229         -	baudRate {
   230         -	    #
   231         -	    # Check whether the baud rate is an integer in the range 50..921600
   232         -	    #
   233         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   234         -		bell
   235         -		tk_messageBox -title "Error" -icon error -message \
   236         -		    "The baud rate must be an integer in the range 50..921600"
   237         -		$tbl rejectinput
   238         -	    }
   239         -	}
   240         -
   241         -	actDate {
   242         -	    #
   243         -	    # Check whether the last argument is a clock value in seconds
   244         -	    #
   245         -	    if {![string is digit $text]} {
   246         -		bell
   247         -		tk_messageBox -title "Error" -icon error -message $::msgs($text)
   248         -		$tbl rejectinput
   249         -		return ""
   250         -	    }
   251         -
   252         -	    #
   253         -	    # Check whether the activation clock value is later than the
   254         -	    # current one; if this is the case then make sure the cells
   255         -	    # "actDate" and "actTime" will have the same internal value
   256         -	    #
   257         -	    set actTime [$tbl cellcget $row,actTime -text]
   258         -	    set actClock [clock scan [formatTime $actTime] -base $text]
   259         -	    if {$actClock <= [clock seconds]} {
   260         -		bell
   261         -		tk_messageBox -title "Error" -icon error -message \
   262         -		    "The activation date & time must be in the future"
   263         -		$tbl rejectinput
   264         -	    } else {
   265         -		$tbl cellconfigure $row,actTime -text $actClock
   266         -		return $actClock
   267         -	    }
   268         -	}
   269         -
   270         -	actTime {
   271         -	    #
   272         -	    # Check whether the last argument is a clock value in seconds
   273         -	    #
   274         -	    if {![string is digit $text]} {
   275         -		bell
   276         -		tk_messageBox -title "Error" -icon error -message $::msgs($text)
   277         -		$tbl rejectinput
   278         -		return ""
   279         -	    }
   280         -
   281         -	    #
   282         -	    # Check whether the activation clock value is later than the
   283         -	    # current one; if this is the case then make sure the cells
   284         -	    # "actDate" and "actTime" will have the same internal value
   285         -	    #
   286         -	    set actDate [$tbl cellcget $row,actDate -text]
   287         -	    set actClock [clock scan [formatTime $text] -base $actDate]
   288         -	    if {$actClock <= [clock seconds]} {
   289         -		bell
   290         -		tk_messageBox -title "Error" -icon error -message \
   291         -		    "The activation date & time must be in the future"
   292         -		$tbl rejectinput
   293         -	    } else {
   294         -		$tbl cellconfigure $row,actDate -text $actClock
   295         -		return $actClock
   296         -	    }
   297         -	}
   298         -
   299         -	color {
   300         -	    #
   301         -	    # Update the image contained in the cell
   302         -	    #
   303         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   304         -	}
   305         -    }
   306         -
   307         -    return $text
   308         -}

Deleted libs/tablelist5.16/demos/open.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/demos/openFolder.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/demos/option.tcl.

     1         -#==============================================================================
     2         -# Contains some Tk option database settings.
     3         -#
     4         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     5         -#==============================================================================
     6         -
     7         -#
     8         -# Get the current windowing system ("x11", "win32", "classic", or "aqua")
     9         -#
    10         -if {[catch {tk windowingsystem} winSys] != 0} {
    11         -    switch $::tcl_platform(platform) {
    12         -	unix      { set winSys x11 }
    13         -	windows   { set winSys win32 }
    14         -	macintosh { set winSys classic }
    15         -    }
    16         -}
    17         -
    18         -#
    19         -# Add some entries to the Tk option database
    20         -#
    21         -if {[string compare $winSys "x11"] == 0} {
    22         -    #
    23         -    # Create the font TkDefaultFont if not yet present
    24         -    #
    25         -    catch {font create TkDefaultFont -family Helvetica -size -12}
    26         -
    27         -    option add *Font			TkDefaultFont
    28         -    option add *selectBackground	#678db2
    29         -    option add *selectForeground	white
    30         -} else {
    31         -    option add *ScrollArea.borderWidth			1
    32         -    option add *ScrollArea.relief			sunken
    33         -    option add *ScrollArea.Tablelist.borderWidth	0
    34         -    option add *ScrollArea.Tablelist.highlightThickness	0
    35         -    option add *ScrollArea.Text.borderWidth		0
    36         -    option add *ScrollArea.Text.highlightThickness	0
    37         -}
    38         -option add *Tablelist.background	white
    39         -option add *Tablelist.stripeBackground	#f0f0f0
    40         -option add *Tablelist.setGrid		yes
    41         -option add *Tablelist.movableColumns	yes
    42         -option add *Tablelist.labelCommand	tablelist::sortByColumn
    43         -option add *Tablelist.labelCommand2	tablelist::addToSortColumns

Deleted libs/tablelist5.16/demos/option_tile.tcl.

     1         -#==============================================================================
     2         -# Contains some Tk option database settings.
     3         -#
     4         -# Copyright (c) 2004-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     5         -#==============================================================================
     6         -
     7         -#
     8         -# Get the current windowing system ("x11", "win32", or
     9         -# "aqua") and add some entries to the Tk option database
    10         -#
    11         -if {[tk windowingsystem] eq "x11"} {
    12         -    option add *Font			TkDefaultFont
    13         -} else {
    14         -    option add *ScrollArea.borderWidth			1
    15         -    option add *ScrollArea.relief			sunken
    16         -    option add *ScrollArea.Tablelist.borderWidth	0
    17         -    option add *ScrollArea.Text.borderWidth		0
    18         -    option add *ScrollArea.Text.highlightThickness	0
    19         -}
    20         -tablelist::setThemeDefaults
    21         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    22         -    option add *Listbox.selectBackground \
    23         -	       $tablelist::themeDefaults(-selectbackground)
    24         -    option add *Listbox.selectForeground \
    25         -	       $tablelist::themeDefaults(-selectforeground)
    26         -} else {
    27         -    option add *selectBackground  $tablelist::themeDefaults(-selectbackground)
    28         -    option add *selectForeground  $tablelist::themeDefaults(-selectforeground)
    29         -}
    30         -option add *selectBorderWidth     $tablelist::themeDefaults(-selectborderwidth)
    31         -option add *Tablelist.background	white
    32         -option add *Tablelist.stripeBackground	#f0f0f0
    33         -option add *Tablelist.setGrid		yes
    34         -option add *Tablelist.movableColumns	yes
    35         -option add *Tablelist.labelCommand	tablelist::sortByColumn
    36         -option add *Tablelist.labelCommand2	tablelist::addToSortColumns

Deleted libs/tablelist5.16/demos/styles.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates some ways of improving the look & feel of a tablelist widget.
     5         -#
     6         -# Copyright (c) 2002-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     7         -#==============================================================================
     8         -
     9         -package require tablelist 5.16
    10         -
    11         -wm title . "Tablelist Styles"
    12         -
    13         -#
    14         -# Get the current windowing system ("x11", "win32", "classic",
    15         -# or "aqua") and add some entries to the Tk option database
    16         -#
    17         -if {[catch {tk windowingsystem} winSys] != 0} {
    18         -    switch $::tcl_platform(platform) {
    19         -	unix      { set winSys x11 }
    20         -	windows   { set winSys win32 }
    21         -	macintosh { set winSys classic }
    22         -    }
    23         -}
    24         -if {[string compare $winSys "x11"] == 0} {
    25         -    #
    26         -    # Create the font TkDefaultFont if not yet present
    27         -    #
    28         -    catch {font create TkDefaultFont -family Helvetica -size -12}
    29         -
    30         -    option add *Font			TkDefaultFont
    31         -    option add *selectBackground	#678db2
    32         -    option add *selectForeground	white
    33         -}
    34         -
    35         -#
    36         -# Create, configure, and populate 8 tablelist widgets
    37         -#
    38         -frame .f
    39         -for {set n 0} { $n < 8} {incr n} {
    40         -    set tbl .f.tbl$n
    41         -    tablelist::tablelist $tbl \
    42         -	-columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \
    43         -	-background white -height 4 -width 40 -stretch all
    44         -    if {[$tbl cget -selectborderwidth] == 0} {
    45         -	$tbl configure -spacing 1
    46         -    }
    47         -
    48         -    switch $n {
    49         -	1 {
    50         -	    $tbl configure -showseparators yes
    51         -	}
    52         -	2 {
    53         -	    $tbl configure -stripebackground #f0f0f0
    54         -	}
    55         -	3 {
    56         -	    $tbl configure -stripebackground #f0f0f0 -showseparators yes
    57         -	}
    58         -	4 {
    59         -	    $tbl columnconfigure 1 -background LightYellow
    60         -	    $tbl columnconfigure 3 -background LightCyan
    61         -	}
    62         -	5 {
    63         -	    $tbl configure -showseparators yes
    64         -	    $tbl columnconfigure 1 -background LightYellow
    65         -	    $tbl columnconfigure 3 -background LightCyan
    66         -	}
    67         -	6 {
    68         -	    $tbl configure -stripebackground #f0f0f0
    69         -	    $tbl columnconfigure 1 -background LightYellow \
    70         -		-stripebackground #f0f0d2
    71         -	    $tbl columnconfigure 3 -background LightCyan \
    72         -		-stripebackground #d2f0f0
    73         -	}
    74         -	7 {
    75         -	    $tbl configure -stripebackground #f0f0f0 -showseparators yes
    76         -	    $tbl columnconfigure 1 -background LightYellow \
    77         -		-stripebackground #f0f0d2
    78         -	    $tbl columnconfigure 3 -background LightCyan \
    79         -		-stripebackground #d2f0f0
    80         -	}
    81         -    }
    82         -
    83         -    foreach row {0 1 2 3} {
    84         -	$tbl insert end \
    85         -	     [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"]
    86         -    }
    87         -}
    88         -
    89         -button .close -text "Close" -command exit
    90         -frame .bottom -height 10
    91         -
    92         -#
    93         -# Manage the widgets
    94         -#
    95         -grid .f.tbl0 .f.tbl1 -sticky news -padx 5 -pady 5
    96         -grid .f.tbl2 .f.tbl3 -sticky news -padx 5 -pady 5
    97         -grid .f.tbl4 .f.tbl5 -sticky news -padx 5 -pady 5
    98         -grid .f.tbl6 .f.tbl7 -sticky news -padx 5 -pady 5
    99         -grid rowconfigure    .f {0 1 2 3} -weight 1
   100         -grid columnconfigure .f {0 1}     -weight 1
   101         -pack .bottom .close -side bottom
   102         -pack .f -side top -expand yes -fill both -padx 5 -pady 5

Deleted libs/tablelist5.16/demos/styles_tile.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates some ways of improving the look & feel of a tablelist widget.
     5         -#
     6         -# Copyright (c) 2002-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     7         -#==============================================================================
     8         -
     9         -package require tablelist_tile 5.16
    10         -
    11         -wm title . "Tablelist Styles"
    12         -
    13         -#
    14         -# Improve the window's appearance by using a tile
    15         -# frame as a container for the other widgets
    16         -#
    17         -set f [ttk::frame .f]
    18         -
    19         -#
    20         -# Create, configure, and populate 8 tablelist widgets
    21         -#
    22         -ttk::frame $f.f
    23         -for {set n 0} { $n < 8} {incr n} {
    24         -    set tbl $f.f.tbl$n
    25         -    tablelist::tablelist $tbl \
    26         -	-columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \
    27         -	-background white -stripebackground "" -height 4 -width 40 -stretch all
    28         -    if {[$tbl cget -selectborderwidth] == 0} {
    29         -	$tbl configure -spacing 1
    30         -    }
    31         -
    32         -    switch $n {
    33         -	1 {
    34         -	    $tbl configure -showseparators yes
    35         -	}
    36         -	2 {
    37         -	    $tbl configure -stripebackground #f0f0f0
    38         -	}
    39         -	3 {
    40         -	    $tbl configure -stripebackground #f0f0f0 -showseparators yes
    41         -	}
    42         -	4 {
    43         -	    $tbl columnconfigure 1 -background LightYellow
    44         -	    $tbl columnconfigure 3 -background LightCyan
    45         -	}
    46         -	5 {
    47         -	    $tbl configure -showseparators yes
    48         -	    $tbl columnconfigure 1 -background LightYellow
    49         -	    $tbl columnconfigure 3 -background LightCyan
    50         -	}
    51         -	6 {
    52         -	    $tbl configure -stripebackground #f0f0f0
    53         -	    $tbl columnconfigure 1 -background LightYellow \
    54         -		-stripebackground #f0f0d2
    55         -	    $tbl columnconfigure 3 -background LightCyan \
    56         -		-stripebackground #d2f0f0
    57         -	}
    58         -	7 {
    59         -	    $tbl configure -stripebackground #f0f0f0 -showseparators yes
    60         -	    $tbl columnconfigure 1 -background LightYellow \
    61         -		-stripebackground #f0f0d2
    62         -	    $tbl columnconfigure 3 -background LightCyan \
    63         -		-stripebackground #d2f0f0
    64         -	}
    65         -    }
    66         -
    67         -    foreach row {0 1 2 3} {
    68         -	$tbl insert end \
    69         -	     [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"]
    70         -    }
    71         -}
    72         -
    73         -ttk::button $f.close -text "Close" -command exit
    74         -ttk::frame $f.bottom -height 10
    75         -
    76         -#
    77         -# Manage the widgets
    78         -#
    79         -grid $f.f.tbl0 $f.f.tbl1 -sticky news -padx 5 -pady 5
    80         -grid $f.f.tbl2 $f.f.tbl3 -sticky news -padx 5 -pady 5
    81         -grid $f.f.tbl4 $f.f.tbl5 -sticky news -padx 5 -pady 5
    82         -grid $f.f.tbl6 $f.f.tbl7 -sticky news -padx 5 -pady 5
    83         -grid rowconfigure    $f.f {0 1 2 3} -weight 1
    84         -grid columnconfigure $f.f {0 1}     -weight 1
    85         -pack $f.bottom $f.close -side bottom
    86         -pack $f.f -side top -expand yes -fill both -padx 5 -pady 5
    87         -pack $f -expand yes -fill both

Deleted libs/tablelist5.16/demos/tileWidgets.tcl.

     1         -#!/usr/bin/env wish
     2         -
     3         -#==============================================================================
     4         -# Demonstrates the interactive tablelist cell editing with the aid of some
     5         -# widgets from the tile package and of the Tk core spinbox widget.
     6         -#
     7         -# Copyright (c) 2005-2016  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
     8         -#==============================================================================
     9         -
    10         -package require tablelist_tile 5.16
    11         -
    12         -wm title . "Serial Line Configuration"
    13         -
    14         -#
    15         -# Add some entries to the Tk option database
    16         -#
    17         -set dir [file dirname [info script]]
    18         -source [file join $dir option_tile.tcl]
    19         -option add *Tablelist*Spinbox.background		white
    20         -option add *Tablelist*Spinbox.readonlyBackground	white
    21         -
    22         -#
    23         -# Create the images "checkedImg" and "uncheckedImg", as well as 16 images of
    24         -# names like "img#FF0000", displaying colors identified by names like "red"
    25         -#
    26         -source [file join $dir images.tcl]
    27         -
    28         -#
    29         -# Improve the window's appearance by using a tile
    30         -# frame as a container for the other widgets
    31         -#
    32         -set f [ttk::frame .f]
    33         -
    34         -#
    35         -# Work around the improper appearance of the tile scrollbars in the aqua theme
    36         -#
    37         -if {[tablelist::getCurrentTheme] eq "aqua"} {
    38         -    interp alias {} ttk::scrollbar {} ::scrollbar
    39         -}
    40         -
    41         -#
    42         -# Create a tablelist widget with editable columns (except the first one)
    43         -#
    44         -set tbl $f.tbl
    45         -tablelist::tablelist $tbl \
    46         -    -columns {0 "No."		  right
    47         -	      0 "Available"	  center
    48         -	      0 "Name"		  left
    49         -	      0 "Baud Rate"	  right
    50         -	      0 "Data Bits"	  center
    51         -	      0 "Parity"	  left
    52         -	      0 "Stop Bits"	  center
    53         -	      0 "Handshake"	  left
    54         -	      0 "Activation Date" center
    55         -	      0 "Activation Time" center
    56         -	      0 "Cable Color"	  center} \
    57         -    -editstartcommand editStartCmd -editendcommand editEndCmd \
    58         -    -height 0 -width 0
    59         -if {[$tbl cget -selectborderwidth] == 0} {
    60         -    $tbl configure -spacing 1
    61         -}
    62         -$tbl columnconfigure 0 -sortmode integer
    63         -$tbl columnconfigure 1 -name available -editable yes \
    64         -    -editwindow ttk::checkbutton -formatcommand emptyStr
    65         -$tbl columnconfigure 2 -name lineName  -editable yes -editwindow ttk::entry \
    66         -    -sortmode dictionary
    67         -$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow ttk::combobox \
    68         -    -sortmode integer
    69         -if {[info commands ttk::spinbox] eq ""} {
    70         -    $tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinbox
    71         -} else {
    72         -    $tbl columnconfigure 4 -name dataBits -editable yes -editwindow ttk::spinbox
    73         -}
    74         -$tbl columnconfigure 5 -name parity    -editable yes -editwindow ttk::combobox
    75         -$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow ttk::combobox
    76         -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ttk::combobox
    77         -$tbl columnconfigure 8 -name actDate   -editable yes -editwindow ttk::entry \
    78         -    -formatcommand formatDate -sortmode integer
    79         -$tbl columnconfigure 9 -name actTime   -editable yes -editwindow ttk::entry \
    80         -    -formatcommand formatTime -sortmode integer
    81         -$tbl columnconfigure 10 -name color    -editable yes \
    82         -    -editwindow ttk::menubutton -formatcommand emptyStr
    83         -
    84         -proc emptyStr   val { return "" }
    85         -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
    86         -proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
    87         -
    88         -#
    89         -# Populate the tablelist widget; set the activation
    90         -# date & time to 10 minutes past the current clock value
    91         -#
    92         -set clock [expr {[clock seconds] + 600}]
    93         -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
    94         -    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
    95         -	$clock $clock [lindex $colorNames $i]]
    96         -
    97         -    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
    98         -    $tbl cellconfigure end,available -image $availImg
    99         -    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
   100         -}
   101         -
   102         -set btn [ttk::button $f.btn -text "Close" -command exit]
   103         -
   104         -#
   105         -# Manage the widgets
   106         -#
   107         -pack $btn -side bottom -pady 10
   108         -pack $tbl -side top -expand yes -fill both
   109         -pack $f -expand yes -fill both
   110         -
   111         -#------------------------------------------------------------------------------
   112         -# editStartCmd
   113         -#
   114         -# Applies some configuration options to the edit window; if the latter is a
   115         -# combobox, the procedure populates it.
   116         -#------------------------------------------------------------------------------
   117         -proc editStartCmd {tbl row col text} {
   118         -    set w [$tbl editwinpath]
   119         -
   120         -    switch [$tbl columncget $col -name] {
   121         -	lineName {
   122         -	    #
   123         -	    # Set an upper limit of 20 for the number of characters
   124         -	    #
   125         -	    $w configure -invalidcommand bell -validate key \
   126         -			 -validatecommand {expr {[string length %P] <= 20}}
   127         -	}
   128         -
   129         -	baudRate {
   130         -	    #
   131         -	    # Populate the combobox and allow no more
   132         -	    # than 6 digits in its entry component
   133         -	    #
   134         -	    $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400
   135         -				  57600 115200 230400 460800 921600}
   136         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   137         -		{expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}}
   138         -	}
   139         -
   140         -	dataBits {
   141         -	    #
   142         -	    # Configure the spinbox
   143         -	    #
   144         -	    $w configure -from 5 -to 8 -state readonly
   145         -	}
   146         -
   147         -	parity {
   148         -	    #
   149         -	    # Populate the combobox and make it non-editable
   150         -	    #
   151         -	    $w configure -values {None Even Odd Mark Space} -state readonly
   152         -	}
   153         -
   154         -	stopBits {
   155         -	    #
   156         -	    # Populate the combobox and make it non-editable
   157         -	    #
   158         -	    $w configure -values {1 1.5 2} -state readonly
   159         -	}
   160         -
   161         -	handshake {
   162         -	    #
   163         -	    # Populate the combobox and make it non-editable
   164         -	    #
   165         -	    $w configure -values {XON/XOFF RTS/CTS None} -state readonly
   166         -	}
   167         -
   168         -	actDate {
   169         -	    #
   170         -	    # Set an upper limit of 10 for the number of characters
   171         -	    # and allow only digits and the "-" character in it
   172         -	    #
   173         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   174         -		{expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}}
   175         -	}
   176         -
   177         -	actTime {
   178         -	    #
   179         -	    # Set an upper limit of 8 for the number of characters
   180         -	    # and allow only digits and the ":" character in it
   181         -	    #
   182         -	    $w configure -invalidcommand bell -validate key -validatecommand \
   183         -		{expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}}
   184         -	}
   185         -
   186         -	color {
   187         -	    #
   188         -	    # Populate the menu and make sure the menubutton will display the
   189         -	    # color name rather than $text, which is "", due to -formatcommand
   190         -	    #
   191         -	    set menu [$w cget -menu]
   192         -	    foreach name $::colorNames {
   193         -		$menu add radiobutton -compound left \
   194         -		    -image img$::colors($name) -label $name
   195         -	    }
   196         -	    $menu entryconfigure 8 -columnbreak 1
   197         -	    return [$tbl cellcget $row,$col -text]
   198         -	}
   199         -    }
   200         -
   201         -    return $text
   202         -}
   203         -
   204         -#------------------------------------------------------------------------------
   205         -# editEndCmd
   206         -#
   207         -# Performs a final validation of the text contained in the edit window and gets
   208         -# the cell's internal contents.
   209         -#------------------------------------------------------------------------------
   210         -proc editEndCmd {tbl row col text} {
   211         -    switch [$tbl columncget $col -name] {
   212         -	available {
   213         -	    #
   214         -	    # Update the image contained in the cell
   215         -	    #
   216         -	    set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
   217         -	    $tbl cellconfigure $row,$col -image $img
   218         -	}
   219         -
   220         -	baudRate {
   221         -	    #
   222         -	    # Check whether the baud rate is an integer in the range 50..921600
   223         -	    #
   224         -	    if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
   225         -		bell
   226         -		tk_messageBox -title "Error" -icon error -message \
   227         -		    "The baud rate must be an integer in the range 50..921600"
   228         -		$tbl rejectinput
   229         -	    }
   230         -	}
   231         -
   232         -	actDate {
   233         -	    #
   234         -	    # Get the activation date in seconds from the last argument 
   235         -	    #
   236         -	    if {[catch {clock scan $text} actDate] != 0} {
   237         -		bell
   238         -		tk_messageBox -title "Error" -icon error -message "Invalid date"
   239         -		$tbl rejectinput
   240         -		return ""
   241         -	    }
   242         -
   243         -	    #
   244         -	    # Check whether the activation clock value is later than the
   245         -	    # current one; if this is the case then make sure the cells
   246         -	    # "actDate" and "actTime" will have the same internal value
   247         -	    #
   248         -	    set actTime [$tbl cellcget $row,actTime -text]
   249         -	    set actClock [clock scan [formatTime $actTime] -base $actDate]
   250         -	    if {$actClock <= [clock seconds]} {
   251         -		bell
   252         -		tk_messageBox -title "Error" -icon error -message \
   253         -		    "The activation date & time must be in the future"
   254         -		$tbl rejectinput
   255         -	    } else {
   256         -		$tbl cellconfigure $row,actTime -text $actClock
   257         -		return $actClock
   258         -	    }
   259         -	}
   260         -
   261         -	actTime {
   262         -	    #
   263         -	    # Get the activation clock value in seconds from the last argument 
   264         -	    #
   265         -	    set actDate [$tbl cellcget $row,actDate -text]
   266         -	    if {[catch {clock scan $text -base $actDate} actClock] != 0} {
   267         -		bell
   268         -		tk_messageBox -title "Error" -icon error -message "Invalid time"
   269         -		$tbl rejectinput
   270         -		return ""
   271         -	    }
   272         -
   273         -	    #
   274         -	    # Check whether the activation clock value is later than the
   275         -	    # current one; if this is the case then make sure the cells
   276         -	    # "actDate" and "actTime" will have the same internal value
   277         -	    #
   278         -	    if {$actClock <= [clock seconds]} {
   279         -		bell
   280         -		tk_messageBox -title "Error" -icon error -message \
   281         -		    "The activation date & time must be in the future"
   282         -		$tbl rejectinput
   283         -	    } else {
   284         -		$tbl cellconfigure $row,actDate -text $actClock
   285         -		return $actClock
   286         -	    }
   287         -	}
   288         -
   289         -	color {
   290         -	    #
   291         -	    # Update the image contained in the cell
   292         -	    #
   293         -	    $tbl cellconfigure $row,$col -image img$::colors($text)
   294         -	}
   295         -    }
   296         -
   297         -    return $text
   298         -}

Deleted libs/tablelist5.16/demos/unchecked.gif.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/adwaita.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/ambiance.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/aqua.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/arrowStyles.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/arrowStyles_vista.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/baghira.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/bicolor1.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/bicolor2.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/bicolor3.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/bicolor4.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/browse.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/browseTree.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/bwidget.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/classic1.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/classic2.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/classic3.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/classic4.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/config.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/dirViewer.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/dust.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/dustSand.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/embeddedWindows.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/embeddedWindows_tile.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/gtk.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/index.html.

     1         -<html>
     2         -<head>
     3         -  <title>The Multi-Column Listbox and Tree Widget Package Tablelist
     4         -  5.16</title>
     5         -
     6         -  <meta name="Author" content="Csaba Nemethi">
     7         -  <meta name="Keywords" content=
     8         -  "tablelist, multi-column, listbox, tree, widget, tile">
     9         -</head>
    10         -
    11         -<body bgcolor="#FFFFFF">
    12         -  <div align="center">
    13         -    <h1>The Multi-Column Listbox and Tree Widget Package Tablelist 5.16</h1>
    14         -
    15         -    <h3>by</h3>
    16         -
    17         -    <h2>Csaba Nemethi</h2>
    18         -
    19         -    <address>
    20         -      <a href="mailto:csaba.nemethi@t-online.de">csaba.nemethi@t-online.de</a>
    21         -    </address>
    22         -  </div>
    23         -
    24         -  <hr>
    25         -
    26         -  <h2>Contents</h2>
    27         -
    28         -  <p><a href="tablelist.html">Tablelist Programmer's Guide</a></p>
    29         -
    30         -  <p><a href="tablelistWidget.html">The <code>tablelist::tablelist</code>
    31         -  Command</a></p>
    32         -
    33         -  <p><a href="tablelistColSort.html">Commands for Interactive Sorting by One or
    34         -  More Columns</a></p>
    35         -
    36         -  <p><a href="tablelistBinding.html">Helper Commands Used in Tablelist Binding
    37         -  Scripts</a></p>
    38         -
    39         -  <p><a href="tablelistTkCore.html">Interactive Tablelist Cell Editing Using Tk
    40         -  Core Widgets</a></p>
    41         -
    42         -  <p><a href="tablelistTile.html">Interactive Tablelist Cell Editing Using Tile
    43         -  Widgets</a></p>
    44         -
    45         -  <p><a href="tablelistBWidget.html">Interactive Tablelist Cell Editing Using
    46         -  the BWidget Package</a></p>
    47         -
    48         -  <p><a href="tablelistIwidgets.html">Interactive Tablelist Cell Editing Using
    49         -  the Iwidgets Package</a></p>
    50         -
    51         -  <p><a href="tablelistCombobox.html">Interactive Tablelist Cell Editing Using
    52         -  the combobox Package</a></p>
    53         -
    54         -  <p><a href="tablelistCtext.html">Interactive Tablelist Cell Editing Using
    55         -  the ctext Package</a></p>
    56         -
    57         -  <p><a href="tablelistMentry.html">Interactive Tablelist Cell Editing Using
    58         -  the Mentry Package</a></p>
    59         -
    60         -  <p><a href="tablelistThemes.html">Commands Related to Tile Themes</a></p>
    61         -</body>
    62         -</html>

Deleted libs/tablelist5.16/doc/klearlooks.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/mate.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/mint.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/mint2.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/newWave.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/oxygen1.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/oxygen2.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/phase.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plain1.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plain2.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plain3.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plain4.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plastik.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/plastique.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/radiance.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/styles.png.

cannot compute difference between binary files

Deleted libs/tablelist5.16/doc/stylesheet.css.

     1         -/* generic class defining a top margin whose height equals the font size */
     2         -.tm {margin-top: 1em}
     3         -
     4         -/* background and border for the <pre> tag */
     5         -pre {background: #F7F7F7; border: silver solid 1px}
     6         -
     7         -/* color for the <span> tag */
     8         -span {color: #E00000}

Deleted libs/tablelist5.16/doc/tablelist.html.

     1         -<html>
     2         -<head>
     3         -  <title>Tablelist Programmer's Guide</title>
     4         -
     5         -  <meta name="Author" content="Csaba Nemethi">
     6         -  <meta name="Keywords" content=
     7         -  "tablelist, multi-column, listbox, tree, widget, tile">
     8         -
     9         -  <link rel="stylesheet" type="text/css" href="stylesheet.css">
    10         -</head>
    11         -
    12         -<body bgcolor="#FFFFFF">
    13         -  <div align="center">
    14         -    <h1>Tablelist Programmer's Guide</h1>
    15         -
    16         -    <h2>For Tablelist Version 5.16</h2>
    17         -
    18         -    <h3>by</h3>
    19         -
    20         -    <h2>Csaba Nemethi</h2>
    21         -
    22         -    <address>
    23         -      <a href="mailto:csaba.nemethi@t-online.de">csaba.nemethi@t-online.de</a>
    24         -    </address>
    25         -  </div>
    26         -  <hr>
    27         -
    28         -  <h2 id="contents">Contents</h2>
    29         -
    30         -  <h4><a href="#overview">Overview</a></h4>
    31         -
    32         -  <ul>
    33         -    <li><a href="#ov_what">What is Tablelist?</a></li>
    34         -
    35         -    <li><a href="#ov_get">How to Get It?</a></li>
    36         -
    37         -    <li><a href="#ov_install">How to Install It?</a></li>
    38         -
    39         -    <li><a href="#ov_use">How to Use It?</a></li>
    40         -
    41         -    <li><a href="#ov_tile">More on Tablelist_tile</a></li>
    42         -  </ul>
    43         -
    44         -  <h4><a href="#examples">Examples</a></h4>
    45         -
    46         -  <ul>
    47         -    <li><a href="#ex_config">A tablelist Widget for Displaying and Editing
    48         -    Configuration Options</a></li>
    49         -
    50         -    <li><a href="#ex_browse">Two Widget Browsers Based on a tablelist</a></li>
    51         -
    52         -    <li><a href="#ex_dirViewer">A Directory Viewer Based on a
    53         -    tablelist</a></li>
    54         -
    55         -    <li><a href="#ex_styles">Improving the Look &amp; Feel of a tablelist
    56         -    Widget</a></li>
    57         -
    58         -    <li><a href="#ex_editing">Advanced Interactive tablelist Cell
    59         -    Editing</a></li>
    60         -
    61         -    <li><a href="#ex_windows">A tablelist Widget Containing Embedded
    62         -    Windows</a></li>
    63         -
    64         -    <li><a href="#ex_tile">Tile-Based Demo Scripts</a></li>
    65         -  </ul>
    66         -
    67         -  <div align="center">
    68         -    <p><a href="index.html">Start page</a></p>
    69         -  </div>
    70         -  <hr>
    71         -
    72         -  <h2 id="overview">Overview</h2>
    73         -
    74         -  <h3 id="ov_what">What is Tablelist?</h3>
    75         -
    76         -  <p>Tablelist is a library package for Tcl/Tk versions 8.0 or higher, written
    77         -  in pure Tcl/Tk code.&nbsp; It contains:</p>
    78         -
    79         -  <ul>
    80         -    <li>the implementation of the <a href=
    81         -    "tablelistWidget.html"><b>tablelist</b> mega-widget</a>, including a
    82         -    general utility module for mega-widgets;</li>
    83         -
    84         -    <li>a demo script containing a useful procedure that displays the
    85         -    configuration options of an arbitrary widget in a tablelist and enables you
    86         -    to edit their values interactively;</li>
    87         -
    88         -    <li>a demo script implementing a widget browser based on a tablelist used
    89         -    as multi-column listbox;</li>
    90         -
    91         -    <li>a demo script implementing a widget browser based on a tablelist used
    92         -    as multi-column tree widget;</li>
    93         -
    94         -    <li>a demo script implementing a directory viewer based on a tablelist used
    95         -    as multi-column tree widget;</li>
    96         -
    97         -    <li>a demo script showing several ways to improve the appearance of a
    98         -    tablelist widget;</li>
    99         -
   100         -    <li>four further demo scripts, illustrating the interactive cell editing
   101         -    with the aid of various widgets from the Tk core and from the packages
   102         -    tile, BWidget, Iwidgets, combobox (by Bryan Oakley), and Mentry;</li>
   103         -
   104         -    <li>one further demo script, with a tablelist widget containing embedded
   105         -    windows;</li>
   106         -
   107         -    <li>tile-based counterparts of the above-mentioned demo scripts;</li>
   108         -
   109         -    <li>this tutorial;</li>
   110         -
   111         -    <li>reference pages in HTML format.</li>
   112         -  </ul>
   113         -
   114         -  <p>A tablelist is a multi-column listbox and tree widget.&nbsp; The width of
   115         -  each column can be dynamic (i.e., just large enough to hold all its elements,
   116         -  including the header) or static (specified in characters or pixels).&nbsp;
   117         -  The columns are, per default, resizable.&nbsp; The alignment of each column
   118         -  can be specified as <code>left</code>, <code>right</code>, or
   119         -  <code>center</code>.</p>
   120         -
   121         -  <p>The columns, rows, and cells can be configured individually.&nbsp; Several
   122         -  of the global and column-specific options refer to the headers, implemented
   123         -  as label widgets.&nbsp; For instance, the <code>-labelcommand</code> option
   124         -  specifies a Tcl command to be invoked when mouse button 1 is released over a
   125         -  label.&nbsp; The most common value of this option sorts the items based on
   126         -  the respective column.</p>
   127         -
   128         -  <p>The Tablelist package provides a great variety of tree styles controlling
   129         -  the look &amp; feel of the column that displays the tree hierarchy with the
   130         -  aid of indentations and expand/collapse controls.</p>
   131         -
   132         -  <p>Interactive editing of the elements of a tablelist widget can be enabled
   133         -  for individual cells and for entire columns.&nbsp; A great variety of widgets
   134         -  from the Tk core and from the packages tile, BWidget, Iwidgets, combobox,
   135         -  ctext, and Mentry (or Mentry_tile) is supported for being used as embedded
   136         -  edit window.&nbsp; In addition, a rich set of keyboard bindings is provided
   137         -  for a comfortable navigation between the editable cells.</p>
   138         -
   139         -  <p>The Tcl command corresponding to a tablelist widget is very similar to the
   140         -  one associated with a normal listbox.&nbsp; There are column-, row-, and
   141         -  cell-specific counterparts of the <code>configure</code> and
   142         -  <code>cget</code> subcommands (<code>columnconfigure</code>,
   143         -  <code>rowconfigure</code>, <code>cellconfigure</code>, ...).&nbsp; They can
   144         -  be used, among others, to insert images into the cells and the header labels,
   145         -  or to insert embedded windows into the cells.&nbsp; The <code>index</code>,
   146         -  <code>nearest</code>, and <code>see</code> command options refer to the rows,
   147         -  but similar subcommands are provided for the columns and cells
   148         -  (<code>columnindex</code>, <code>cellindex</code>, ...).&nbsp; The items can
   149         -  be sorted with the <code>sort</code>, <code>sortbycolumn</code>, and
   150         -  <code>sortbycolumnlist</code> command options.</p>
   151         -
   152         -  <p>The bindings defined for the body of a tablelist widget make it behave
   153         -  just like a normal listbox.&nbsp; This includes the support for the virtual
   154         -  event <code>&lt;&lt;ListboxSelect&gt;&gt;</code> (which is equivalent to
   155         -  <code>&lt;&lt;TablelistSelect&gt;&gt;</code>).&nbsp; In addition, versions
   156         -  2.3 or higher of the widget callback package Wcb (written in pure Tcl/Tk code
   157         -  as well) can be used to define callbacks for the <code>activate</code>,&nbsp;
   158         -  <code>selection set</code>,&nbsp; and&nbsp; <code>selection
   159         -  clear</code>&nbsp; commands, and Wcb versions 3.0 or higher also support
   160         -  callbacks for the <code>activatecell</code>,&nbsp; <code>cellselection
   161         -  set</code>,&nbsp; and&nbsp; <code>cellselection clear</code>&nbsp;
   162         -  commands.&nbsp; The download location of Wcb is</p>
   163         -
   164         -  <blockquote>
   165         -    <address>
   166         -      <a href="http://www.nemethi.de">http://www.nemethi.de</a>
   167         -    </address>
   168         -  </blockquote>
   169         -
   170         -  <h3 id="ov_get">How to Get It?</h3>
   171         -
   172         -  <p>Tablelist is available for free download from the same URL as Wcb.&nbsp;
   173         -  The distribution file is <code>tablelist5.16.tar.gz</code> for UNIX and
   174         -  <code>tablelist5_16.zip</code> for Windows.&nbsp; These files contain the
   175         -  same information, except for the additional carriage return character
   176         -  preceding the linefeed at the end of each line in the text files for
   177         -  Windows.</p>
   178         -
   179         -  <p>Tablelist is also included in tklib, which has the address</p>
   180         -
   181         -  <blockquote>
   182         -    <address>
   183         -      <a href="http://core.tcl.tk/tklib">http://core.tcl.tk/tklib</a>
   184         -    </address>
   185         -  </blockquote>
   186         -
   187         -  <h3 id="ov_install">How to Install It?</h3>
   188         -
   189         -  <p>Install the package as a subdirectory of one of the directories given by
   190         -  the <code>auto_path</code> variable.&nbsp; For example, you can install it as
   191         -  a directory at the same level as the Tcl and Tk script libraries.&nbsp; The
   192         -  locations of these library directories are given by the
   193         -  <code>tcl_library</code> and <code>tk_library</code> variables,
   194         -  respectively.</p>
   195         -
   196         -  <p>To install Tablelist <i>on UNIX</i>, <code>cd</code> to the desired
   197         -  directory and unpack the distribution file
   198         -  <code>tablelist5.16.tar.gz</code>:</p>
   199         -
   200         -  <blockquote>
   201         -    <pre>
   202         -gunzip -c tablelist5.16.tar.gz | tar -xf -
   203         -</pre>
   204         -  </blockquote>
   205         -
   206         -  <p>This command will create a directory named <code>tablelist5.16</code>,
   207         -  with the subdirectories <code>demos</code>, <code>doc</code>, and
   208         -  <code>scripts</code>.</p>
   209         -
   210         -  <p><i>On Windows</i>, use WinZip or some other program capable of unpacking
   211         -  the distribution file <code>tablelist5_16.zip</code> into the directory
   212         -  <code>tablelist5.16</code>, with the subdirectories <code>demos</code>,
   213         -  <code>doc</code>, and <code>scripts</code>.</p>
   214         -
   215         -  <p>The file <code>tablelistEdit.tcl</code> in the <code>scripts</code>
   216         -  directory is only needed for applications making use of interactive cell
   217         -  editing.&nbsp; Similarly, the file <code>tablelistMove.tcl</code> in the same
   218         -  directory is only required for scripts invoking the <code>move</code> or
   219         -  <code>movecolumn</code> command.&nbsp; Finally, the file
   220         -  <code>tablelistThemes.tcl</code> is only needed for applications using the
   221         -  package Tablelist_tile (see next section).</p>
   222         -
   223         -  <p>Next, you should check the exact version number of your Tcl/Tk
   224         -  distribution, given by the <code>tcl_patchLevel</code> and
   225         -  <code>tk_patchLevel</code> variables.&nbsp; If you are using Tcl/Tk version
   226         -  8.2.X, 8.3.0 - 8.3.2, or 8.4a1, then you should upgrade your Tcl/Tk
   227         -  distribution to a higher release.&nbsp; This is because a bug in these Tcl
   228         -  versions (fixed in Tcl 8.3.3 and 8.4a2) causes excessive memory use when
   229         -  calling&nbsp; <code>info exists</code>&nbsp; on non-existent array elements,
   230         -  and Tablelist makes a lot of invocations of this command.</p>
   231         -
   232         -  <p>If for some reason you cannot upgrade your Tcl/Tk version, then you should
   233         -  execute the Tcl script <code>repair.tcl</code> in the directory
   234         -  <code>scripts</code>.&nbsp; This script makes backup copies of several files
   235         -  contained in this directory, and then creates new versions of them by
   236         -  replacing all invocations of&nbsp; <code>info exists</code>&nbsp; for array
   237         -  elements with a call to the helper procedure
   238         -  <code>arrElemExists</code>.&nbsp; The patched files work with all Tcl/Tk
   239         -  releases starting with 8.0, but the original ones have a much better
   240         -  performance.</p>
   241         -
   242         -  <p>Notice that in tklib the Tablelist <code>demos</code> directory is
   243         -  replaced with the subdirectory <code>tablelist</code> of the
   244         -  <code>examples</code> directory.&nbsp; Please take this into account when
   245         -  reading the <a href="#examples">examples</a> below.</p>
   246         -
   247         -  <h3 id="ov_use">How to Use It?</h3>
   248         -
   249         -  <p>The Tablelist distribution provides two packages, called <b>Tablelist</b>
   250         -  and <b>Tablelist_tile</b>.&nbsp; The main difference between the two is that
   251         -  Tablelist_tile enables the tile-based, theme-specific appearance of tablelist
   252         -  widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or
   253         -  higher.&nbsp; It is not possible to use both packages in one and the same
   254         -  application, because both are implemented in the same <code>tablelist</code>
   255         -  namespace and provide identical commands.</p>
   256         -
   257         -  <p>To be able to access the commands and variables defined in the package
   258         -  Tablelist, your scripts must contain one of the lines</p>
   259         -
   260         -  <blockquote>
   261         -    <pre>
   262         -package require tablelist ?<i>version</i>?
   263         -package require Tablelist ?<i>version</i>?
   264         -</pre>
   265         -  </blockquote>
   266         -
   267         -  <p>You can use either one of the two statements above because the file
   268         -  <code>tablelist.tcl</code> contains both lines</p>
   269         -
   270         -  <blockquote>
   271         -    <pre>
   272         -package provide tablelist ...
   273         -package provide Tablelist ...
   274         -</pre>
   275         -  </blockquote>
   276         -
   277         -  <p>Likewise, to be able to access the commands and variables defined in the
   278         -  package Tablelist_tile, your scripts must contain one of the lines</p>
   279         -
   280         -  <blockquote>
   281         -    <pre>
   282         -package require tablelist_tile ?<i>version</i>?
   283         -package require Tablelist_tile ?<i>version</i>?
   284         -</pre>
   285         -  </blockquote>
   286         -
   287         -  <p>Again, you can use either one of the two statements above because the file
   288         -  <code>tablelist_tile.tcl</code> contains both lines</p>
   289         -
   290         -  <blockquote>
   291         -    <pre>
   292         -package provide tablelist_tile ...
   293         -package provide Tablelist_tile ...
   294         -</pre>
   295         -  </blockquote>
   296         -
   297         -  <p>You are free to remove one of the above lines from
   298         -  <code>tablelist.tcl</code> and <code>tablelist_tile.tcl</code>, respectively,
   299         -  if you want to prevent the corresponding packages from making themselves
   300         -  known under two different names each.&nbsp; Of course, by doing so you
   301         -  restrict the argument of&nbsp; <code>package require</code>&nbsp; to a single
   302         -  name per package.</p>
   303         -
   304         -  <p>Please note that <b>ActiveTcl versions 8.5 and later use a modified
   305         -  package mechanism, which only exports the all-lowercase names
   306         -  <code>tablelist</code> and <code>tablelist_tile</code></b>.</p>
   307         -
   308         -  <p><b>REMARK:</b>&nbsp; If you have an earlier Tablelist version as part of
   309         -  ActiveTcl 8.5 or above and the new Tablelist release 5.16, then it is highly
   310         -  recommended to specify the version number <code>5.16</code> in the&nbsp;
   311         -  <code>package require</code>&nbsp; command, because otherwise the interpreter
   312         -  will load the old Tablelist version included in ActiveTcl as Tcl
   313         -  Module.&nbsp; The <a href="#examples">examples</a> below use the
   314         -  statement&nbsp; <code>package require tablelist 5.16</code>,&nbsp; and their
   315         -  tile-based counterparts invoke the command&nbsp; <code>package require
   316         -  tablelist_tile 5.16</code>.</p>
   317         -
   318         -  <p>Since the packages Tablelist and Tablelist_tile are implemented in the
   319         -  <code>tablelist</code> namespace, you must either invoke the</p>
   320         -
   321         -  <blockquote>
   322         -    <pre>
   323         -namespace import tablelist::<i>pattern</i> ?tablelist::<i>pattern ...</i>?
   324         -</pre>
   325         -  </blockquote>
   326         -
   327         -  <p>command to import the <i>procedures</i> you need, or use qualified names
   328         -  like <code>tablelist::tablelist</code>.&nbsp; In the examples below we have
   329         -  chosen the latter approach.</p>
   330         -
   331         -  <p>To access Tablelist <i>variables</i>, you <i>must</i> use qualified
   332         -  names.&nbsp; There are only 4 Tablelist variables (and one more when using
   333         -  Tablelist_tile) that are designed to be accessed outside the namespace
   334         -  <code>tablelist</code>:</p>
   335         -
   336         -  <ul>
   337         -    <li>The variable <code>tablelist::version</code> holds the current version
   338         -    number of the Tablelist and Tablelist_tile packages.</li>
   339         -
   340         -    <li>The variable <code>tablelist::library</code> holds the location of the
   341         -    Tablelist installation directory.</li>
   342         -
   343         -    <li>The variable <code>tablelist::scalingpct</code> holds the scaling
   344         -    percentage used by Tablelist when adapting the sizes of the tree styles
   345         -    <code>vistaAero</code>, <code> vistaClassic</code>, <code>win7Aero</code>,
   346         -    <code>win7Classic</code>, and <code>win10</code> to the display's DPI
   347         -    scaling level.&nbsp; The currently supported values are <code>100</code>,
   348         -    <code>125</code>, <code>150</code>, and <code>200</code>.&nbsp; You can use
   349         -    the value of this variable, e.g., if you want to create images of different
   350         -    sizes, depending on the DPI scaling factor.&nbsp; For example, if your
   351         -    application uses images of size 16 x 16 on an unscaled display and
   352         -    <code>tablelist::scalingpct</code> has the value <code>150</code>, then the
   353         -    image size for this display should be 24 x 24.</li>
   354         -
   355         -    <li>The read-only variable <code>tablelist::usingTile</code> has the value
   356         -    <code>0</code> in the package Tablelist and the value <code>1</code> in
   357         -    Tablelist_tile.</li>
   358         -
   359         -    <li>In Tablelist_tile the array <code>tablelist::themeDefaults</code> holds
   360         -    the theme-specific default values of a series of Tablelist configuration
   361         -    options.</li>
   362         -  </ul>
   363         -
   364         -  <h3 id="ov_tile">More on Tablelist_tile</h3>
   365         -
   366         -  <p>A tablelist widget consists of a body (containing the items) and a header
   367         -  (displaying the column titles).&nbsp; Both components are contained in a
   368         -  hull, implemented as a frame.&nbsp; The header has a rather complex
   369         -  structure, consisting mainly of frame and label widgets.&nbsp; While in the
   370         -  Tablelist package all of these components are Tk widgets, the Tablelist_tile
   371         -  package uses both Tk and tile frame and label widgets.&nbsp; Due to several
   372         -  incompatibilities between Tk and tile, it is currently not possible to
   373         -  replace all Tk widgets making up a tablelist with their tile
   374         -  counterparts.</p>
   375         -
   376         -  <p>From the above it follows that <b>the package Tablelist_tile will only
   377         -  work as expected if the Tk <code>frame</code> and <code>label</code> commands
   378         -  haven't been overridden by using&nbsp; <code>namespace import -force
   379         -  ttk::*</code>&nbsp; at global scope</b>.&nbsp; While earlier tile releases
   380         -  suggested using this command at global scope for the really adventurous, in
   381         -  newer tile versions this is considered a Really Bad Idea, causing many things
   382         -  to break.&nbsp; Instead, <b>you should explicitly invoke
   383         -  <code>ttk::frame</code>, <code>ttk::label</code>, etc. whenever you want to
   384         -  use a tile widget</b>.</p>
   385         -
   386         -  <p><b>Overriding some other Tk widgets at global scope may be equally
   387         -  dangerous when using various widgets from the Tk core and from the packages
   388         -  BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry for
   389         -  interactive cell editing</b>, because these packages expect Tk widgets, which
   390         -  may not always be replaced by their tile counterparts.</p>
   391         -
   392         -  <p>Another restriction to be taken into account is due to the fact that in
   393         -  earlier tile versions the&nbsp; <code>(ttk::)style theme use</code>&nbsp;
   394         -  command could only be used to set the current theme, but not to retrieve
   395         -  it.&nbsp; For this reason, the package Tablelist_tile makes use of the
   396         -  variable <code>ttk::currentTheme</code> or <code>tile::currentTheme</code>
   397         -  (depending on the tile version), which is set by the
   398         -  <code>ttk::setTheme</code> or <code>tile::setTheme</code> procedure.&nbsp;
   399         -  From this it follows that <b>the tile-based tablelist widgets will only have
   400         -  the expected appearance if the platform-specific default theme is either left
   401         -  unchanged or replaced with another theme by invoking the procedure
   402         -  <code>ttk::setTheme</code> or <code>tile::setTheme</code>, depending on the
   403         -  current tile version</b>.&nbsp; (See also the <code><a href=
   404         -  "tablelistThemes.html#setTheme">tablelist::setTheme</a></code> command.)</p>
   405         -
   406         -  <p>After these cautions concerning the use of tile, the rest of this section
   407         -  describes the differences between the packages Tablelist and
   408         -  Tablelist_tile.</p>
   409         -
   410         -  <p>The Tablelist_tile package checks whether the required Tcl, Tk, and tile
   411         -  versions are present, by executing the commands</p>
   412         -
   413         -  <blockquote>
   414         -    <pre>
   415         -package require Tcl 8.4
   416         -package require Tk  8.4
   417         -if {$::tk_version &lt; 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
   418         -    package require tile 0.6
   419         -}
   420         -</pre>
   421         -  </blockquote>
   422         -
   423         -  <p>The last command above reflects the fact that, beginning with Tk 8.5a6,
   424         -  tile is integrated into the Tk core and therefore it should only be loaded
   425         -  explicitly when using an earlier Tk version.</p>
   426         -
   427         -  <p>Apart from this and the <code>_tile</code> suffix in the&nbsp;
   428         -  <code>package require</code>&nbsp; command, the only difference (from the
   429         -  programmer's point of view) between the packages Tablelist and Tablelist_tile
   430         -  is related to the supported configuration options:&nbsp; The
   431         -  <code>-highlightbackground</code>, <code>-highlightcolor</code>,
   432         -  <code>-highlightthickness</code>, <code>-labelbackground</code>,
   433         -  <code>-labelactivebackground</code>, <code>-labelactiveforeground</code>,
   434         -  <code>-labeldisabledforeground</code>, and <code>-labelheight</code> options
   435         -  (the latter at both widget and column levels), present in the Tablelist
   436         -  package, are not supported by Tablelist_tile.&nbsp; The first three are
   437         -  standard Tk widget options that are not available for tile widgets.&nbsp; The
   438         -  <code>-labelbackground</code> option stands for the <code>-background</code>
   439         -  option of the column labels, and current versions of the tile engine don't
   440         -  support setting the background color for these widgets with a special header
   441         -  layout.&nbsp; The remaining options stand for the
   442         -  <code>-activebackground</code>, <code>-activeforeground</code>,
   443         -  <code>-disabledforeground</code>, and <code>-height</code> options of the
   444         -  column labels, and these configuration options are not supported for tile
   445         -  label widgets.</p>
   446         -
   447         -  <p>Also, take into account that in some themes, setting the
   448         -  <code>-labelborderwidth</code> option (at widget or column level) to a value
   449         -  other than the default might be ignored by tile and thus could cause
   450         -  alignment problems.&nbsp; This is because the border of tile widgets is drawn
   451         -  with theme-specific methods, which will not always produce the results known
   452         -  from Tk widgets.</p>
   453         -
   454         -  <p>Finally, notice that, when using the <code>tileqt</code> theme, the
   455         -  version number of the <code>tile::theme::tileqt</code> package must be 0.4 or
   456         -  higher, and <code>tileqt</code> itself won't work with tile versions earlier
   457         -  than 0.7.</p>
   458         -
   459         -  <div align="center">
   460         -    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
   461         -    "index.html">Start page</a></p>
   462         -  </div>
   463         -  <hr>
   464         -
   465         -  <h2 id="examples">Examples</h2>
   466         -
   467         -  <h3 id="ex_config">A tablelist Widget for Displaying and Editing
   468         -  Configuration Options</h3>
   469         -
   470         -  <p>The file <code>config.tcl</code> in the <code>demos</code> directory
   471         -  contains a procedure <code>demo::displayConfig</code> that displays the
   472         -  configuration options of an arbitrary widget in a tablelist contained in a
   473         -  newly created top-level widget and allows you to edit these options.&nbsp;
   474         -  This procedure can prove to be quite useful during interactive GUI
   475         -  development.&nbsp; To test it, start <code>wish</code> and evaluate the file
   476         -  by using the <code>source</code> command as follows:</p>
   477         -
   478         -  <ul>
   479         -    <li>If <code>wish</code> was started in the <code>demos</code> directory
   480         -    then it is sufficient to enter
   481         -
   482         -      <blockquote>
   483         -        <pre>
   484         -source config.tcl
   485         -</pre>
   486         -      </blockquote>
   487         -    </li>
   488         -
   489         -    <li>If <code>wish</code> was started in some other directory then you can
   490         -    use the <code>tablelist::library</code> variable to find the location of
   491         -    the file.&nbsp; For example, assuming that your Tablelist installation has
   492         -    the directory structure described in the <a href="#ov_install">How to
   493         -    install it?</a> section, the required commands are:
   494         -
   495         -      <blockquote>
   496         -        <pre>
   497         -package require tablelist 5.16
   498         -source [file join $tablelist::library demos config.tcl]
   499         -</pre>
   500         -      </blockquote>
   501         -    </li>
   502         -  </ul>
   503         -
   504         -  <p>In both cases, the script will print the following message to
   505         -  <code>stdout</code>:</p>
   506         -
   507         -  <blockquote>
   508         -    <pre>
   509         -To display the configuration options of an arbitrary widget, enter
   510         -
   511         -        demo::displayConfig &lt;widgetName&gt;
   512         -</pre>
   513         -  </blockquote>
   514         -
   515         -  <p>The result looks like in the following figure:</p>
   516         -
   517         -  <blockquote>
   518         -    <img src="config.png" alt="Configuration Options" width="839" height=
   519         -    "387">
   520         -  </blockquote>
   521         -
   522         -  <p>It is assumed that the Tcl command associated with the widget specified by
   523         -  <code>&lt;widgetName&gt;</code> has a <code>configure</code> subcommand
   524         -  which, when invoked without any argument, returns a list describing all of
   525         -  the available configuration options for the widget, in the common format
   526         -  known from the standard Tk widgets.&nbsp; The
   527         -  <code>demo::displayConfig</code> procedure inserts the items of this list
   528         -  into a scrolled tablelist with 5 dynamic-width columns and interactive sort
   529         -  capability, and returns the name of the newly created tablelist widget:</p>
   530         -
   531         -  <blockquote>
   532         -    <pre>
   533         -package require tablelist 5.16
   534         -
   535         -namespace eval demo {
   536         -    #
   537         -    # Get the current windowing system ("x11", "win32", "classic", or "aqua")
   538         -    # and add some entries to the Tk option database for the following
   539         -    # widget hierarchy within a top-level widget of the class DemoTop:
   540         -    #
   541         -    # Name              Class
   542         -    # -----------------------------
   543         -    # tf                Frame
   544         -    #   tbl               Tabellist
   545         -    #   vsb, hsb          Scrollbar
   546         -    # bf                Frame
   547         -    #   b1, b2, b3        Button
   548         -    #
   549         -    variable winSys
   550         -    if {[catch {tk windowingsystem} winSys] != 0} {
   551         -        switch $::tcl_platform(platform) {
   552         -            unix        { set winSys x11 }
   553         -            windows     { set winSys win32 }
   554         -            macintosh   { set winSys classic }
   555         -        }
   556         -    }
   557         -    if {[string compare $winSys "x11"] == 0} {
   558         -        #
   559         -        # Create the font TkDefaultFont if not yet present
   560         -        #
   561         -        catch {font create TkDefaultFont -family Helvetica -size -12}
   562         -
   563         -        option add *DemoTop*Font                        TkDefaultFont
   564         -        option add *DemoTop*selectBackground            #678db2
   565         -        option add *DemoTop*selectForeground            white
   566         -    } else {
   567         -        option add *DemoTop.tf.borderWidth              1
   568         -        option add *DemoTop.tf.relief                   sunken
   569         -        option add *DemoTop.tf.tbl.borderWidth          0
   570         -        option add *DemoTop.tf.tbl.highlightThickness   0
   571         -    }
   572         -    option add *DemoTop.tf.tbl.background               white
   573         -    option add *DemoTop.tf.tbl.stripeBackground         #f0f0f0
   574         -    option add *DemoTop.tf.tbl.setGrid                  yes
   575         -    option add *DemoTop.tf.tbl*Entry.background         white
   576         -    option add *DemoTop.bf.Button.width                 10
   577         -}
   578         -
   579         -#------------------------------------------------------------------------------
   580         -# demo::displayConfig
   581         -#
   582         -# Displays the configuration options of the widget w in a tablelist widget
   583         -# contained in a newly created top-level widget.  Returns the name of the
   584         -# tablelist widget.
   585         -#------------------------------------------------------------------------------
   586         -proc demo::displayConfig w {
   587         -    if {![winfo exists $w]} {
   588         -        bell
   589         -        tk_messageBox -title "Error" -icon error -message \
   590         -            "Bad window path name \"$w\""
   591         -        return ""
   592         -    }
   593         -
   594         -    #
   595         -    # Create a top-level widget of the class DemoTop
   596         -    #
   597         -    set top .configTop
   598         -    for {set n 2} {[winfo exists $top]} {incr n} {
   599         -        set top .configTop$n
   600         -    }
   601         -    toplevel $top -class DemoTop
   602         -    wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\""
   603         -
   604         -    #
   605         -    # Create a scrolled tablelist widget with 5 dynamic-width
   606         -    # columns and interactive sort capability within the top-level
   607         -    #
   608         -    set tf $top.tf
   609         -    frame $tf
   610         -    set tbl $tf.tbl
   611         -    set vsb $tf.vsb
   612         -    set hsb $tf.hsb
   613         -    tablelist::tablelist $tbl \
   614         -        -columns {0 "Command-Line Name"
   615         -                  0 "Database/Alias Name"
   616         -                  0 "Database Class"
   617         -                  0 "Default Value"
   618         -                  0 "Current Value"} \
   619         -        -labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \
   620         -        -editendcommand demo::applyValue -height 15 -width 100 -stretch all \
   621         -        -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
   622         -    if {[$tbl cget -selectborderwidth] == 0} {
   623         -        $tbl configure -spacing 1
   624         -    }
   625         -    $tbl columnconfigure 3 -maxwidth 30
   626         -    $tbl columnconfigure 4 -maxwidth 30 -editable yes
   627         -    scrollbar $vsb -orient vertical   -command [list $tbl yview]
   628         -    scrollbar $hsb -orient horizontal -command [list $tbl xview]
   629         -
   630         -    #
   631         -    # Create three buttons within a frame child of the top-level widget
   632         -    #
   633         -    set bf $top.bf
   634         -    frame $bf
   635         -    set b1 $bf.b1
   636         -    set b2 $bf.b2
   637         -    set b3 $bf.b3
   638         -    button $b1 -text "Refresh"     -command [list demo::putConfig $w $tbl]
   639         -    button $b2 -text "Sort as Set" -command [list $tbl sort]
   640         -    button $b3 -text "Close"       -command [list destroy $top]
   641         -
   642         -    #
   643         -    # Manage the widgets
   644         -    #
   645         -    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
   646         -    variable winSys
   647         -    if {[string compare $winSys "aqua"] == 0} {
   648         -        grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
   649         -        grid $vsb              -row 1 -column 1 -sticky ns
   650         -    } else {
   651         -        grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
   652         -    }
   653         -    grid $hsb -row 2 -column 0 -sticky ew
   654         -    grid rowconfigure    $tf 1 -weight 1
   655         -    grid columnconfigure $tf 0 -weight 1
   656         -    pack $b1 $b2 $b3 -side left -expand yes -pady 10
   657         -    pack $bf -side bottom -fill x
   658         -    pack $tf -side top -expand yes -fill both
   659         -
   660         -    #
   661         -    # Populate the tablelist with the configuration options of the given widget
   662         -    #
   663         -    putConfig $w $tbl
   664         -    return $tbl
   665         -}
   666         -</pre>
   667         -  </blockquote>
   668         -
   669         -  <p>The procedure invokes the <code><a href=
   670         -  "tablelistWidget.html">tablelist::tablelist</a></code> command to create a
   671         -  tablelist widget.&nbsp; The value of the <code><a href=
   672         -  "tablelistWidget.html#columns">-columns</a></code> option passed to this
   673         -  command specifies the widths, titles, and alignments of the 5 columns.&nbsp;
   674         -  The width of each column is given as <code>0</code>, specifying that the
   675         -  column's width is to be made just large enough to hold all the elements in
   676         -  the column, including its title, which is the string following the
   677         -  width.&nbsp; We have omitted the alignment specifications (which can
   678         -  optionally follow the titles), because the columns shall all be
   679         -  left-justified.</p>
   680         -
   681         -  <p>Since all columns are of dynamic width and left-aligned, instead of
   682         -  <code>-columns</code> we could have used the <code><a href=
   683         -  "tablelistWidget.html#columntitles">-columntitles</a></code> option as
   684         -  follows:</p>
   685         -
   686         -  <blockquote>
   687         -    <pre>
   688         -    tablelist::tablelist $tbl \
   689         -        -columntitles {"Command-Line Name"
   690         -                       "Database/Alias Name"
   691         -                       "Database Class"
   692         -                       "Default Value"
   693         -                       "Current Value"} \
   694         -        . . .
   695         -</pre>
   696         -  </blockquote>
   697         -
   698         -  <p>The command <code><a href=
   699         -  "tablelistColSort.html#sortByColumn">tablelist::sortByColumn</a></code>,
   700         -  specified as the value of the <code><a href=
   701         -  "tablelistWidget.html#labelcommand">-labelcommand</a></code> option, will be
   702         -  invoked whenever mouse button 1 is released over one of the labels.&nbsp;
   703         -  This command sorts the items based on the column corresponding to that label,
   704         -  in the right order, by invoking the <code><a href=
   705         -  "tablelistWidget.html#sortbycolumn">sortbycolumn</a></code> subcommand of the
   706         -  Tcl command associated with the tablelist widget.</p>
   707         -
   708         -  <p>As seen from the creation of the button displaying the text&nbsp;
   709         -  <code>"Sort as Set"</code>,&nbsp; the items will also be sorted by invoking
   710         -  the <code><a href="tablelistWidget.html#sort">sort</a></code>
   711         -  subcommand.&nbsp; This makes it necessary to specify a command to be used for
   712         -  the comparison of the items, as the value of the <code><a href=
   713         -  "tablelistWidget.html#sortcommand">-sortcommand</a></code> option.&nbsp; In
   714         -  our example this is the <code>demo::compareAsSet</code> procedure shown
   715         -  below.</p>
   716         -
   717         -  <p>The <code><a href=
   718         -  "tablelistWidget.html#editendcommand">-editendcommand</a></code> option
   719         -  specifies the command to be invoked automatically whenever the interactive
   720         -  editing of a cell's contents is finished and the final contents of the
   721         -  temporary embedded entry widget used for the editing are different from its
   722         -  original one.&nbsp; Per default, the elements of a tablelist widget can only
   723         -  be edited programmatically, but we enable the interactive editing for the
   724         -  cells of the last column with the aid of the <code><a href=
   725         -  "tablelistWidget.html#col_editable">-editable</a></code> column configuration
   726         -  option.</p>
   727         -
   728         -  <p>By specifying the value <code>all</code> for the <code><a href=
   729         -  "tablelistWidget.html#stretch">-stretch</a></code> configuration option we
   730         -  make sure that all of the columns will be stretched to eliminate the blank
   731         -  space that might appear at the right of the table.</p>
   732         -
   733         -  <p>If the default value of the <code>-selectborderwidth</code> option is
   734         -  <code>0</code> (this is the case on the Windows and Macintosh platforms, and
   735         -  also in an X11 envronment with Tk 8.5 or above) then we use the
   736         -  <code><a href="tablelistWidget.html#spacing">-spacing</a></code> option to
   737         -  provide some additional space above and below the rows.</p>
   738         -
   739         -  <p>For the last two columns of the tablelist we use the <code><a href=
   740         -  "tablelistWidget.html#col_maxwidth">-maxwidth</a></code> column configuration
   741         -  option, to make sure that the dynamic widths of these columns won't exceed 30
   742         -  average-width characters.</p>
   743         -
   744         -  <p>Besides the options given on the command line, our tablelist widget will
   745         -  automatically inherit the ones contained in the Tk option database entries
   746         -  specified in the namespace initialization preceding the
   747         -  <code>demo::displayConfig</code> procedure.&nbsp; The database name
   748         -  <code>stripeBackground</code> corresponds to the <code><a href=
   749         -  "tablelistWidget.html#stripebackground">-stripebackground</a></code>
   750         -  configuration option.&nbsp; According to this entry, every other row of the
   751         -  tablelist widget will be displayed in the background color
   752         -  <code>#f0f0f0</code>, which improves the readability of the items and gives
   753         -  the widget a nice appearance.</p>
   754         -
   755         -  <p>The option database entries given for the windowing systems other than
   756         -  <code>x11</code> are implicitly used when managing the tablelist widget and
   757         -  the two scrollbars with the aid of <code>grid</code>.&nbsp; Notice how the
   758         -  <code><a href="tablelistWidget.html#cornerpath">cornerpath</a></code>
   759         -  subcommand enables us to achieve a native look &amp; feel with respect to the
   760         -  vertical scrollbar on the windowing system <code>aqua</code>.</p>
   761         -
   762         -  <p>We populate the tablelist by invoking the <code>demo::putConfig</code>
   763         -  procedure discussed below.&nbsp; The same script is associated with the
   764         -  <b>Refresh</b> button, as the value of its <code>-command</code>
   765         -  configuration option.&nbsp; This procedure is implemented as follows:</p>
   766         -
   767         -  <blockquote>
   768         -    <pre>
   769         -#------------------------------------------------------------------------------
   770         -# demo::putConfig
   771         -#
   772         -# Outputs the configuration options of the widget w into the tablelist widget
   773         -# tbl.
   774         -#------------------------------------------------------------------------------
   775         -proc demo::putConfig {w tbl} {
   776         -    if {![winfo exists $w]} {
   777         -        bell
   778         -        tk_messageBox -title "Error" -icon error -message \
   779         -            "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
   780         -        return ""
   781         -    }
   782         -
   783         -    #
   784         -    # Display the configuration options of w in the tablelist widget tbl
   785         -    #
   786         -    $tbl delete 0 end
   787         -    foreach configSet [$w configure] {
   788         -        #
   789         -        # Insert the list configSet into the tablelist widget
   790         -        #
   791         -        $tbl insert end $configSet
   792         -
   793         -        if {[llength $configSet] == 2} {
   794         -            $tbl rowconfigure end -foreground gray50 -selectforeground gray75
   795         -            $tbl cellconfigure end -editable no
   796         -        } else {
   797         -            #
   798         -            # Change the colors of the first and last cell of the row
   799         -            # if the current value is different from the default one
   800         -            #
   801         -            set default [lindex $configSet 3]
   802         -            set current [lindex $configSet 4]
   803         -            if {[string compare $default $current] != 0} {
   804         -                foreach col {0 4} {
   805         -                    $tbl cellconfigure end,$col \
   806         -                         -foreground red -selectforeground yellow
   807         -                }
   808         -            }
   809         -        }
   810         -    }
   811         -
   812         -    $tbl sortbycolumn 0
   813         -    $tbl activate 0
   814         -    $tbl attrib widget $w
   815         -}
   816         -</pre>
   817         -  </blockquote>
   818         -
   819         -  <p>After deleting the current items of the tablelist widget <code>tbl</code>,
   820         -  the procedure inserts the items of the list returned by the
   821         -  <code>configure</code> subcommand of the Tcl command associated with the
   822         -  widget <code>w</code>.&nbsp; For each option that is merely an abbreviated
   823         -  form of some other one, we use the <code><a href=
   824         -  "tablelistWidget.html#rowconfigure">rowconfigure</a></code> tablelist
   825         -  subcommand to change the normal and selection foreground colors of the item
   826         -  just appended, and we disable the interactive editing in the last inserted
   827         -  cell by using the <code><a href=
   828         -  "tablelistWidget.html#cell_editable">-editable</a></code> cell configuration
   829         -  option.&nbsp; The <code><a href=
   830         -  "tablelistWidget.html#cellconfigure">cellconfigure</a></code> tablelist
   831         -  operation is also invoked for each real option whose current value is
   832         -  different from the default one, to change the values of the
   833         -  <code>-foreground</code> and <code>-selectforeground</code> options of the
   834         -  cells no. 0 and 4, containing the command-line name of the option and its
   835         -  current value.</p>
   836         -
   837         -  <p>Each tablelist widget may have any number of private <b>attributes</b>,
   838         -  which can be set and retrieved with the aid of the <code><a href=
   839         -  "tablelistWidget.html#attrib">attrib</a></code> subcommand of the Tcl command
   840         -  corresponding to the widget.&nbsp; The <code>demo::putConfig</code> procedure
   841         -  sets the <code>widget</code> attribute to the name of the widget whose
   842         -  options are displayed in the tablelist.</p>
   843         -
   844         -  <p>The implementation of the comparison command
   845         -  <code>demo::compareAsSet</code> mentioned above is quite simple:</p>
   846         -
   847         -  <blockquote>
   848         -    <pre>
   849         -#------------------------------------------------------------------------------
   850         -# demo::compareAsSet
   851         -#
   852         -# Compares two items of a tablelist widget used to display the configuration
   853         -# options of an arbitrary widget.  The item in which the current value is
   854         -# different from the default one is considered to be less than the other; if
   855         -# both items fulfil this condition or its negation then string comparison is
   856         -# applied to the two option names.
   857         -#------------------------------------------------------------------------------
   858         -proc demo::compareAsSet {item1 item2} {
   859         -    foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \
   860         -            {opt2 dbName2 dbClass2 default2 current2} $item2 {
   861         -        set changed1 [expr {[string compare $default1 $current1] != 0}]
   862         -        set changed2 [expr {[string compare $default2 $current2] != 0}]
   863         -        if {$changed1 == $changed2} {
   864         -            return [string compare $opt1 $opt2]
   865         -        } elseif {$changed1} {
   866         -            return -1
   867         -        } else {
   868         -            return 1
   869         -        }
   870         -    }
   871         -}
   872         -</pre>
   873         -  </blockquote>
   874         -
   875         -  <p>Finally, here is the implementation of the <code>demo::applyValue</code>
   876         -  procedure, specified as the value of the <code>-editendcommand</code>
   877         -  option:</p>
   878         -
   879         -  <blockquote>
   880         -    <pre>
   881         -#------------------------------------------------------------------------------
   882         -# demo::applyValue
   883         -#
   884         -# Applies the new value of the configuraton option contained in the given row
   885         -# of the tablelist widget tbl to the widget whose options are displayed in it,
   886         -# and updates the colors of the first and last cell of the row.
   887         -#------------------------------------------------------------------------------
   888         -proc demo::applyValue {tbl row col text} {
   889         -    #
   890         -    # Try to apply the new value of the option contained in
   891         -    # the given row to the widget whose options are displayed
   892         -    # in the tablelist; reject the value if the attempt fails
   893         -    #
   894         -    set w [$tbl attrib widget]
   895         -    set opt [$tbl cellcget $row,0 -text]
   896         -    if {[catch {$w configure $opt $text} result] != 0} {
   897         -        bell
   898         -        tk_messageBox -title "Error" -icon error -message $result \
   899         -            -parent [winfo toplevel $tbl]
   900         -        $tbl rejectinput
   901         -        return ""
   902         -    }
   903         -
   904         -    #
   905         -    # Replace the new option value with its canonical form and
   906         -    # update the colors of the first and last cell of the row
   907         -    #
   908         -    set text [$w cget $opt]
   909         -    set default [$tbl cellcget $row,3 -text]
   910         -    if {[string compare $default $text] == 0} {
   911         -        foreach col {0 4} {
   912         -            $tbl cellconfigure $row,$col \
   913         -                 -foreground "" -selectforeground ""
   914         -        }
   915         -    } else {
   916         -        foreach col {0 4} {
   917         -            $tbl cellconfigure $row,$col \
   918         -                 -foreground red -selectforeground yellow
   919         -        }
   920         -    }
   921         -
   922         -    return $text
   923         -}
   924         -</pre>
   925         -  </blockquote>
   926         -
   927         -  <p>The procedure retrieves the name of the widget whose options are displayed
   928         -  in the tablelist, as the value of its <code>widget</code> attribute, and
   929         -  invokes the <code><a href="tablelistWidget.html#cellcget">cellcget</a></code>
   930         -  tablelist subcommand to get the name of the option specified in the first
   931         -  cell of the row whose last element was just edited.&nbsp; Next, it tries to
   932         -  apply the new value of the option to the widget, and invokes the
   933         -  <code><a href="tablelistWidget.html#rejectinput">rejectinput</a></code>
   934         -  subcommand if the attempt fails.&nbsp; Otherwise it replaces the new option
   935         -  value with its canonical form and updates the normal and selection foreground
   936         -  colors of the cells no. 0 and 4.&nbsp; The canonical form of the option value
   937         -  is given by the <code>cget</code> subcommand of the Tcl command associated
   938         -  with that widget.&nbsp; For example, a boolean value will always be replaced
   939         -  with <code>1</code> or <code>0</code>, even if the entry contains the string
   940         -  <code>yes</code> or <code>no</code>.&nbsp; The procedure returns this
   941         -  canonical option value, thus making sure that the latter will become the new
   942         -  contents of the cell that was just edited.</p>
   943         -
   944         -  <h3 id="ex_browse">Two Widget Browsers Based on a tablelist</h3>
   945         -
   946         -  <p>The files <code>browse.tcl</code> and <code>browseTree.tcl</code> in the
   947         -  <code>demos</code> directory contain a procedure
   948         -  <code>demo::displayChildren</code> that displays information about the
   949         -  children of an arbitrary widget in a tablelist contained in a newly created
   950         -  top-level widget.&nbsp; To test it, start <code>wish</code> and evaluate the
   951         -  chosen file by using the <code>source</code> command, in a similar way as in
   952         -  the case of the <a href="#ex_config">previous example</a>.</p>
   953         -
   954         -  <p>Both scripts will print the following message to <code>stdout</code>:</p>
   955         -
   956         -  <blockquote>
   957         -    <pre>
   958         -To display information about the children of an arbitrary widget, enter
   959         -
   960         -        demo::displayChildren &lt;widgetName&gt;
   961         -</pre>
   962         -  </blockquote>
   963         -
   964         -  <p>The tablelist created by the procedure <code>demo::displayChildren</code>
   965         -  in the file <code>browse.tcl</code> is a multi-column listbox:</p>
   966         -
   967         -  <blockquote>
   968         -    <img src="browse.png" alt="Widget Browser" width="609" height="289">
   969         -  </blockquote>
   970         -
   971         -  <p>The tablelist created by the procedure of the same name in the file
   972         -  <code>browseTree.tcl</code> is a multi-column tree widget:</p>
   973         -
   974         -  <blockquote>
   975         -    <img src="browseTree.png" alt="Widget Browser" width="627" height="289">
   976         -  </blockquote>
   977         -
   978         -  <p>The <code>demo::displayChildren</code> command inserts some data of the
   979         -  children of the widget specified by <code>&lt;widgetName&gt;</code> into a
   980         -  vertically scrolled tablelist with 9 dynamic-width columns and interactive
   981         -  sort capability, and returns the name of the newly created tablelist
   982         -  widget.&nbsp; By double-clicking an item or invoking the first entry of a
   983         -  pop-up menu within the body of the tablelist, you can display the data of the
   984         -  children of the widget corresponding to the selected item, and with the
   985         -  second menu entry you can display its configuration options (see the <a href=
   986         -  "#ex_config">previous example</a> for details).&nbsp; To go one level up,
   987         -  click on the <b>Parent</b> button.</p>
   988         -
   989         -  <p>There is a lot of code common to the scripts <code>browse.tcl</code> and
   990         -  <code>browseTree.tcl</code>.&nbsp; We will restrict the description below to
   991         -  the second one, which requires Tk 8.3 or later, due to the use of several
   992         -  tree-related tablelist options and subcommands.</p>
   993         -
   994         -  <blockquote>
   995         -    <pre>
   996         -package require Tk 8.3
   997         -package require tablelist 5.16
   998         -
   999         -namespace eval demo {
  1000         -    variable dir [file dirname [info script]]
  1001         -
  1002         -    #
  1003         -    # Create two images, needed in the procedure putChildren
  1004         -    #
  1005         -    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
  1006         -                      -background coral -foreground gray50]
  1007         -    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
  1008         -                      -background yellow -foreground gray50]
  1009         -}
  1010         -
  1011         -source [file join $demo::dir config.tcl]
  1012         -
  1013         -#------------------------------------------------------------------------------
  1014         -# demo::displayChildren
  1015         -#
  1016         -# Displays information on the children of the widget w in a tablelist widget
  1017         -# contained in a newly created top-level widget.  Returns the name of the
  1018         -# tablelist widget.
  1019         -#------------------------------------------------------------------------------
  1020         -proc demo::displayChildren w {
  1021         -    if {![winfo exists $w]} {
  1022         -        bell
  1023         -        tk_messageBox -title "Error" -icon error -message \
  1024         -            "Bad window path name \"$w\""
  1025         -        return ""
  1026         -    }
  1027         -
  1028         -    #
  1029         -    # Create a top-level widget of the class DemoTop
  1030         -    #
  1031         -    set top .browseTop
  1032         -    for {set n 2} {[winfo exists $top]} {incr n} {
  1033         -        set top .browseTop$n
  1034         -    }
  1035         -    toplevel $top -class DemoTop
  1036         -
  1037         -    #
  1038         -    # Create a vertically scrolled tablelist widget with 9 dynamic-width
  1039         -    # columns and interactive sort capability within the top-level
  1040         -    #
  1041         -    set tf $top.tf
  1042         -    frame $tf
  1043         -    set tbl $tf.tbl
  1044         -    set vsb $tf.vsb
  1045         -    tablelist::tablelist $tbl \
  1046         -        -columns {0 "Path Name" left
  1047         -                  0 "Class"     left
  1048         -                  0 "X"         right
  1049         -                  0 "Y"         right
  1050         -                  0 "Width"     right
  1051         -                  0 "Height"    right
  1052         -                  0 "Mapped"    center
  1053         -                  0 "Viewable"  center
  1054         -                  0 "Manager"   left} \
  1055         -        -expandcommand demo::expandCmd -labelcommand demo::labelCmd \
  1056         -        -yscrollcommand [list $vsb set] -setgrid no -width 0
  1057         -    if {[$tbl cget -selectborderwidth] == 0} {
  1058         -        $tbl configure -spacing 1
  1059         -    }
  1060         -    foreach col {2 3 4 5} {
  1061         -        $tbl columnconfigure $col -sortmode integer
  1062         -    }
  1063         -    foreach col {6 7} {
  1064         -        $tbl columnconfigure $col -formatcommand demo::formatBoolean
  1065         -    }
  1066         -    scrollbar $vsb -orient vertical -command [list $tbl yview]
  1067         -
  1068         -    #
  1069         -    # When displaying the information about the children of any
  1070         -    # ancestor of the label widgets, the widths of some of the
  1071         -    # labels and thus also the widths and x coordinates of some
  1072         -    # children may change.  For this reason, make sure the items
  1073         -    # will be updated after any change in the sizes of the labels
  1074         -    #
  1075         -    foreach l [$tbl labels] {
  1076         -        bind $l &lt;Configure&gt; [list demo::updateItemsDelayed $tbl]
  1077         -    }
  1078         -    bind $tbl &lt;Configure&gt; [list demo::updateItemsDelayed $tbl]
  1079         -
  1080         -    #
  1081         -    # Create a pop-up menu with two command entries; bind the script
  1082         -    # associated with its first entry to the &lt;Double-1&gt; event, too
  1083         -    #
  1084         -    set menu $top.menu
  1085         -    menu $menu -tearoff no
  1086         -    $menu add command -label "Display Children" \
  1087         -                      -command [list demo::putChildrenOfSelWidget $tbl]
  1088         -    $menu add command -label "Display Config" \
  1089         -                      -command [list demo::dispConfigOfSelWidget $tbl]
  1090         -    set bodyTag [$tbl bodytag]
  1091         -    bind $bodyTag &lt;Double-1&gt;   [list demo::putChildrenOfSelWidget $tbl]
  1092         -    bind $bodyTag &lt;&lt;Button3&gt;&gt;  [bind TablelistBody &lt;Button-1&gt;]
  1093         -    bind $bodyTag &lt;&lt;Button3&gt;&gt; +[bind TablelistBody &lt;ButtonRelease-1&gt;]
  1094         -    bind $bodyTag &lt;&lt;Button3&gt;&gt; +[list demo::postPopupMenu $top %X %Y]
  1095         -
  1096         -    #
  1097         -    # Create three buttons within a frame child of the top-level widget
  1098         -    #
  1099         -    set bf $top.bf
  1100         -    frame $bf
  1101         -    set b1 $bf.b1
  1102         -    set b2 $bf.b2
  1103         -    set b3 $bf.b3
  1104         -    button $b1 -text "Refresh"
  1105         -    button $b2 -text "Parent"
  1106         -    button $b3 -text "Close" -command [list destroy $top]
  1107         -
  1108         -    #
  1109         -    # Manage the widgets
  1110         -    #
  1111         -    . . .
  1112         -
  1113         -    #
  1114         -    # Populate the tablelist with the data of the given widget's children
  1115         -    #
  1116         -    putChildren $w $tbl root
  1117         -    return $tbl
  1118         -}
  1119         -</pre>
  1120         -  </blockquote>
  1121         -
  1122         -  <p>The procedure invokes the <code><a href=
  1123         -  "tablelistWidget.html">tablelist::tablelist</a></code> command to create a
  1124         -  tablelist widget.&nbsp; The value of the <code><a href=
  1125         -  "tablelistWidget.html#columns">-columns</a></code> option passed to this
  1126         -  command specifies the widths, titles, and alignments of the 9 columns.&nbsp;
  1127         -  The width of each column is given as <code>0</code>, specifying that the
  1128         -  column's width is to be made just large enough to hold all the elements in
  1129         -  the column, including its title, which is the string following the
  1130         -  width.&nbsp; Each of the titles is followed by an alignment, which indicates
  1131         -  how to justify both the elements and the title of the respective column.</p>
  1132         -
  1133         -  <p>We want to display not only the data of the given widget's children, but
  1134         -  also those of its further descendants.&nbsp; To this end, we need a command
  1135         -  to be invoked whenever an item corresponding to a widget with children gets
  1136         -  expanded.&nbsp; This command is specified as the value of the <code><a href=
  1137         -  "tablelistWidget.html#expandcommand">-expandcommand</a></code> option.&nbsp;
  1138         -  As discussed later, the <code>demo::expandCmd</code> procedure will insert
  1139         -  the children of the row that is about to be expanded, if it has no children
  1140         -  yet.</p>
  1141         -
  1142         -  <p>The command <code>demo::labelCmd</code>, specified as the value of the
  1143         -  <code><a href="tablelistWidget.html#labelcommand">-labelcommand</a></code>
  1144         -  option, will be invoked whenever mouse button 1 is released over one of the
  1145         -  labels.&nbsp; We will discuss this procedure later.</p>
  1146         -
  1147         -  <p>We specify the value <code>0</code> for the widget's <code><a href=
  1148         -  "tablelistWidget.html#width">-width</a></code> option, meaning that the
  1149         -  tablelist's width shall be made just large enough to hold all its
  1150         -  columns.</p>
  1151         -
  1152         -  <p>After creating the tablelist widget, we make sure that the elements of its
  1153         -  columns 2, 3, 4, and 5 (displaying the x and y coordinates as well as the
  1154         -  widths and heights of the children) will be compared as integers when sorting
  1155         -  the items based on one of these columns.&nbsp; We do this with the aid of the
  1156         -  <code><a href=
  1157         -  "tablelistWidget.html#columnconfigure">columnconfigure</a></code> tablelist
  1158         -  operation.</p>
  1159         -
  1160         -  <p>The same <code>columnconfigure</code> subcommand enables us to specify
  1161         -