Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | update tklib/tablelist and add scrollutil |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
592d20919d34bdff2d1a3a115fe5c2be |
User & Date: | chw 2019-07-17 10:35:14.421 |
Context
2019-07-17
| ||
10:48 | add scrollutil in build scripts check-in: a4fe2f2aeb user: chw tags: trunk | |
10:35 | update tklib/tablelist and add scrollutil check-in: 592d20919d user: chw tags: trunk | |
2019-07-16
| ||
20:36 | add tk upstream changes check-in: 6f4939db8c user: chw tags: trunk | |
Changes
Changes to assets/INVENTORY.
︙ | ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | {opt assets/parse_args* {libs/$arch/libparse_args.so jni/parse_args}} {opt assets/parser[0-9]* {libs/$arch/libparser.so jni/tclparser}} {opt assets/pdf4tcl[0-9]*} {opt assets/pdf4tcl_graph*} {opt assets/promise*} {opt assets/ral* {libs/$arch/libtclral*.so jni/tclral}} {opt assets/rl_json* {libs/$arch/librl_json*.so jni/rl_json}} {req assets/sdl2tk* {libs/$arch/libSDL2.so libs/$arch/libfreetype.so libs/$arch/libtk.so jni/SDL2 jni/freetype jni/sdl2tk src/org/libsdl/app}} {opt assets/snap7*} {opt assets/snack* {libs/$arch/libsnack.so jni/snack}} {opt assets/sqlite3* {libs/$arch/libtclsqlite3.so jni/tcl/pkgs/sqlite3*}} {opt assets/stardom*} {opt assets/tbcload* {libs/$arch/libtbcload.so jni/tbcload}} {req assets/tcl8* {libs/$arch/libtcl.so jni/tcl}} | > | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | {opt assets/parse_args* {libs/$arch/libparse_args.so jni/parse_args}} {opt assets/parser[0-9]* {libs/$arch/libparser.so jni/tclparser}} {opt assets/pdf4tcl[0-9]*} {opt assets/pdf4tcl_graph*} {opt assets/promise*} {opt assets/ral* {libs/$arch/libtclral*.so jni/tclral}} {opt assets/rl_json* {libs/$arch/librl_json*.so jni/rl_json}} {opt assets/scrollutil*} {req assets/sdl2tk* {libs/$arch/libSDL2.so libs/$arch/libfreetype.so libs/$arch/libtk.so jni/SDL2 jni/freetype jni/sdl2tk src/org/libsdl/app}} {opt assets/snap7*} {opt assets/snack* {libs/$arch/libsnack.so jni/snack}} {opt assets/sqlite3* {libs/$arch/libtclsqlite3.so jni/tcl/pkgs/sqlite3*}} {opt assets/stardom*} {opt assets/tbcload* {libs/$arch/libtbcload.so jni/tbcload}} {req assets/tcl8* {libs/$arch/libtcl.so jni/tcl}} |
︙ | ︙ |
Added assets/scrollutil1.0/CHANGES.txt.
> > > > > > > | 1 2 3 4 5 6 7 | What is new in Scrollutil 1.0? ------------------------------ This is the first release. Thanks to Michael Niehren for discussions on mouse wheel event handling in scrollable widget containers, as well as to Paul Obermeier and Thomas Grausgruber for testing the scrollarea widget. |
Added assets/scrollutil1.0/COPYRIGHT.txt.
> > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 | Scrolling utilities package Scrollutil 1.0 Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) This library is free software; you can use, modify, and redistribute it for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Added assets/scrollutil1.0/README.txt.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | The Scrolling Utilities Package Scrollutil by Csaba Nemethi csaba.nemethi@t-online.de What Is Scrollutil? ------------------- Scrollutil is a library package for Tcl/Tk versions 8.0 or higher, written in pure Tcl/Tk code. It contains: - the implementation of the "scrollarea" mega-widget, including a general utility module for mega-widgets; - commands for user-friendly mouse wheel event handling in scrollable widget containers like BWidget ScrollableFrame and iwidgets::scrolledframe. These commands require Tcl/Tk versions 8.4 or higher on X11 and Mac OS X and Tk 8.6b2 or later on Windows; - demo scripts illustrating the use of the Scrollutil package in connection with various scrollable widgets and the above-mentioned scrollable widget containers; - a tutorial in HTML format; - reference pages in HTML format. The reason for requiring at least Tk version 8.6b2 on Windows for the above-mentioned commands for mouse wheel event handling is that in earlier Tk versions on this platform the mouse wheel events were sent to the widget having the focus rather than to the one under the pointer. How to Get It? -------------- Scrollutil is available for free download from the Web page http://www.nemethi.de The distribution file is "scrollutil1.0.tar.gz" for UNIX and "scrollutil1_0.zip" for Windows. These files contain the same information, except for the additional carriage return character preceding the linefeed at the end of each line in the text files for Windows. How to Install It? ------------------ Install the package as a subdirectory of one of the directories given by the "auto_path" variable. For example, you can install it as a directory at the same level as the Tcl and Tk script libraries. The locations of these library directories are given by the "tcl_library" and "tk_library" variables, respectively. To install Scrollutil on UNIX, "cd" to the desired directory and unpack the distribution file "scrollutil1.0.tar.gz": gunzip -c scrollutil1.0.tar.gz | tar -xf - On most UNIX systems this can be replaced with tar -zxf scrollutil1.0.tar.gz Both commands will create a directory named "scrollutil1.0", with the subdirectories "demos", "doc", and "scripts". On Windows, use WinZip or some other program capable of unpacking the distribution file "scrollutil1_0.zip" into the directory "scrollutil1.0", with the subdirectories "demos", "doc", and "scripts". How to Use It? -------------- The Scrollutil distribution provides two packages, called Scrollutil and Scrollutil_tile. The main difference between the two is that Scrollutil_tile enables the tile-based, theme-specific appearance of scrollarea widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or higher. It is not possible to use both packages in one and the same application, because both are implemented in the same "scrollutil" namespace and provide identical commands. To be able to use the commands and variables implemented in the package Scrollutil, your scripts must contain one of the lines package require scrollutil ?version? package require Scrollutil ?version? Likewise, to be able to use the commands and variables implemented in the package Scrollutil_tile, your scripts must contain one of the lines package require scrollutil_tile ?version? package require Scrollutil_tile ?version? Since the packages Scrollutil and Scrollutil_tile are implemented in the "scrollutil" namespace, you must either import the procedures you need, or use qualified names like "scrollutil::scrollarea". For a detailed description of the commands and variables provided by Scrollutil and of the examples contained in the "demos" directory, see the tutorial "scrollutil.html" and the reference pages, all located in the "doc" directory. |
Added assets/scrollutil1.0/pkgIndex.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #============================================================================== # Scrollutil and Scrollutil_tile package index file. # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Regular packages: # package ifneeded scrollutil 1.0 \ [list source [file join $dir scrollutil.tcl]] package ifneeded scrollutil_tile 1.0 \ [list source [file join $dir scrollutil_tile.tcl]] # # Aliases: # package ifneeded Scrollutil 1.0 \ [list package require -exact scrollutil 1.0] package ifneeded Scrollutil_tile 1.0 \ [list package require -exact scrollutil_tile 1.0] # # Code common to all packages: # package ifneeded scrollutil::common 1.0 \ [list source [file join $dir scrollutilCommon.tcl]] |
Added assets/scrollutil1.0/scripts/mwutil.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | #============================================================================== # Contains utility procedures for mega-widgets. # # Structure of the module: # - Namespace initialization # - Public utility procedures # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8 # # Namespace initialization # ======================== # namespace eval mwutil { # # Public variables: # variable version 2.13 variable library if {$::tcl_version >= 8.4} { set library [file dirname [file normalize [info script]]] } else { set library [file dirname [info script]] ;# no "file normalize" yet } # # Public procedures: # namespace export wrongNumArgs getAncestorByClass convEventFields \ defineKeyNav processTraversal focusNext focusPrev \ configureWidget fullConfigOpt fullOpt enumOpts \ configureSubCmd attribSubCmd hasattribSubCmd \ unsetattribSubCmd getScrollInfo hasFocus \ genMouseWheelEvent windowingSystem currentTheme # # Make modified versions of the procedures tk_focusNext and # tk_focusPrev, to be invoked in the processTraversal command # proc makeFocusProcs {} { # # Enforce the evaluation of the Tk library file "focus.tcl" # tk_focusNext . # # Build the procedures focusNext and focusPrev # foreach dir {Next Prev} { set procBody [info body tk_focus$dir] regsub -all {winfo children} $procBody {getChildren $class} procBody proc focus$dir {w class} $procBody } } makeFocusProcs # # Invoked in the procedures focusNext and focusPrev defined above: # proc getChildren {class w} { if {[string compare [winfo class $w] $class] == 0} { return {} } else { return [winfo children $w] } } } # # Public utility procedures # ========================= # #------------------------------------------------------------------------------ # mwutil::wrongNumArgs # # Generates a "wrong # args" error message. #------------------------------------------------------------------------------ proc mwutil::wrongNumArgs args { set optList {} foreach arg $args { lappend optList \"$arg\" } return -code error "wrong # args: should be [enumOpts $optList]" } #------------------------------------------------------------------------------ # mwutil::getAncestorByClass # # Gets the path name of the widget of the specified class from the path name w # of one of its descendants. It is assumed that all of the ancestors of w # exist (but w itself needn't exist). #------------------------------------------------------------------------------ proc mwutil::getAncestorByClass {w class} { regexp {^(\..+)\..+$} $w dummy win while {[string compare [winfo class $win] $class] != 0} { set win [winfo parent $win] } return $win } #------------------------------------------------------------------------------ # mwutil::convEventFields # # Gets the path name of the widget of the specified class and the x and y # coordinates relative to the latter from the path name w of one of its # descendants and from the x and y coordinates relative to the latter. #------------------------------------------------------------------------------ proc mwutil::convEventFields {w x y class} { set win [getAncestorByClass $w $class] set _x [expr {$x + [winfo rootx $w] - [winfo rootx $win]}] set _y [expr {$y + [winfo rooty $w] - [winfo rooty $win]}] return [list $win $_x $_y] } #------------------------------------------------------------------------------ # mwutil::defineKeyNav # # For a given mega-widget class, the procedure defines the binding tag # ${class}KeyNav as a partial replacement for "all", by substituting the # scripts bound to the events <Tab>, <Shift-Tab>, and <<PrevWindow>> with new # ones which propagate these events to the mega-widget of the given class # containing the widget to which the event was reported. (The event # <Shift-Tab> was replaced with <<PrevWindow>> in Tk 8.3.0.) This tag is # designed to be inserted before "all" in the list of binding tags of a # descendant of a mega-widget of the specified class. #------------------------------------------------------------------------------ proc mwutil::defineKeyNav class { foreach event {<Tab> <Shift-Tab> <<PrevWindow>>} { bind ${class}KeyNav $event \ [list mwutil::processTraversal %W $class $event] } bind Entry <<TraverseIn>> { %W selection range 0 end; %W icursor end } bind Spinbox <<TraverseIn>> { %W selection range 0 end; %W icursor end } } #------------------------------------------------------------------------------ # mwutil::processTraversal # # Processes the given traversal event for the mega-widget of the specified # class containing the widget w if that mega-widget is not the only widget # receiving the focus during keyboard traversal within its toplevel widget. #------------------------------------------------------------------------------ proc mwutil::processTraversal {w class event} { set win [getAncestorByClass $w $class] if {[string compare $event "<Tab>"] == 0} { set target [focusNext $win $class] } else { set target [focusPrev $win $class] } if {[string compare $target $win] != 0} { set focusWin [focus -displayof $win] if {[string length $focusWin] != 0} { event generate $focusWin <<TraverseOut>> } focus $target event generate $target <<TraverseIn>> } return -code break "" } #------------------------------------------------------------------------------ # mwutil::configureWidget # # Configures the widget win by processing the command-line arguments specified # in optValPairs and, if the value of initialize is true, also those database # options that don't match any command-line arguments. #------------------------------------------------------------------------------ proc mwutil::configureWidget {win configSpecsName configCmd cgetCmd \ optValPairs initialize} { upvar $configSpecsName configSpecs # # Process the command-line arguments # set cmdLineOpts {} set savedOptValPairs {} set failed 0 set count [llength $optValPairs] foreach {opt val} $optValPairs { if {[catch {fullConfigOpt $opt configSpecs} result] != 0} { set failed 1 break } if {$count == 1} { set result "value for \"$opt\" missing" set failed 1 break } set opt $result lappend cmdLineOpts $opt lappend savedOptValPairs $opt [eval $cgetCmd [list $win $opt]] if {[catch {eval $configCmd [list $win $opt $val]} result] != 0} { set failed 1 break } incr count -2 } if {$failed} { # # Restore the saved values # foreach {opt val} $savedOptValPairs { eval $configCmd [list $win $opt $val] } return -code error $result } if {$initialize} { # # Process those configuration options that were not # given as command-line arguments; use the corresponding # values from the option database if available # foreach opt [lsort [array names configSpecs]] { if {[llength $configSpecs($opt)] == 1 || [lsearch -exact $cmdLineOpts $opt] >= 0} { continue } set dbName [lindex $configSpecs($opt) 0] set dbClass [lindex $configSpecs($opt) 1] set dbValue [option get $win $dbName $dbClass] if {[string length $dbValue] == 0} { set default [lindex $configSpecs($opt) 3] eval $configCmd [list $win $opt $default] } else { if {[catch { eval $configCmd [list $win $opt $dbValue] } result] != 0} { return -code error $result } } } } return "" } #------------------------------------------------------------------------------ # mwutil::fullConfigOpt # # Returns the full configuration option corresponding to the possibly # abbreviated option opt. #------------------------------------------------------------------------------ proc mwutil::fullConfigOpt {opt configSpecsName} { upvar $configSpecsName configSpecs if {[info exists configSpecs($opt)]} { if {[llength $configSpecs($opt)] == 1} { return $configSpecs($opt) } else { return $opt } } set optList [lsort [array names configSpecs]] set count 0 foreach elem $optList { if {[string first $opt $elem] == 0} { incr count if {$count == 1} { set option $elem } else { break } } } if {$count == 1} { if {[llength $configSpecs($option)] == 1} { return $configSpecs($option) } else { return $option } } elseif {$count == 0} { ### return -code error "unknown option \"$opt\"" return -code error \ "bad option \"$opt\": must be [enumOpts $optList]" } else { ### return -code error "unknown option \"$opt\"" return -code error \ "ambiguous option \"$opt\": must be [enumOpts $optList]" } } #------------------------------------------------------------------------------ # mwutil::fullOpt # # Returns the full option corresponding to the possibly abbreviated option opt. #------------------------------------------------------------------------------ proc mwutil::fullOpt {kind opt optList} { if {[lsearch -exact $optList $opt] >= 0} { return $opt } set count 0 foreach elem $optList { if {[string first $opt $elem] == 0} { incr count if {$count == 1} { set option $elem } else { break } } } if {$count == 1} { return $option } elseif {$count == 0} { return -code error \ "bad $kind \"$opt\": must be [enumOpts $optList]" } else { return -code error \ "ambiguous $kind \"$opt\": must be [enumOpts $optList]" } } #------------------------------------------------------------------------------ # mwutil::enumOpts # # Returns a string consisting of the elements of the given list, separated by # commas and spaces. #------------------------------------------------------------------------------ proc mwutil::enumOpts optList { set optCount [llength $optList] set n 1 foreach opt $optList { if {$n == 1} { set str $opt } elseif {$n < $optCount} { append str ", $opt" } else { if {$optCount > 2} { append str "," } append str " or $opt" } incr n } return $str } #------------------------------------------------------------------------------ # mwutil::configureSubCmd # # This procedure is invoked to process configuration subcommands. #------------------------------------------------------------------------------ proc mwutil::configureSubCmd {win configSpecsName configCmd cgetCmd argList} { upvar $configSpecsName configSpecs set argCount [llength $argList] if {$argCount > 1} { # # Set the specified configuration options to the given values # return [configureWidget $win configSpecs $configCmd $cgetCmd $argList 0] } elseif {$argCount == 1} { # # Return the description of the specified configuration option # set opt [fullConfigOpt [lindex $argList 0] configSpecs] set dbName [lindex $configSpecs($opt) 0] set dbClass [lindex $configSpecs($opt) 1] set default [lindex $configSpecs($opt) 3] return [list $opt $dbName $dbClass $default \ [eval $cgetCmd [list $win $opt]]] } else { # # Return a list describing all available configuration options # foreach opt [lsort [array names configSpecs]] { if {[llength $configSpecs($opt)] == 1} { set alias $configSpecs($opt) if {$::tk_version >= 8.1} { lappend result [list $opt $alias] } else { set dbName [lindex $configSpecs($alias) 0] lappend result [list $opt $dbName] } } else { set dbName [lindex $configSpecs($opt) 0] set dbClass [lindex $configSpecs($opt) 1] set default [lindex $configSpecs($opt) 3] lappend result [list $opt $dbName $dbClass $default \ [eval $cgetCmd [list $win $opt]]] } } return $result } } #------------------------------------------------------------------------------ # mwutil::attribSubCmd # # This procedure is invoked to process *attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::attribSubCmd {win prefix argList} { set classNs [string tolower [winfo class $win]] upvar ::${classNs}::ns${win}::attribs attribs set argCount [llength $argList] if {$argCount > 1} { # # Set the specified attributes to the given values # if {$argCount % 2 != 0} { return -code error "value for \"[lindex $argList end]\" missing" } foreach {attr val} $argList { set attribs($prefix-$attr) $val } return "" } elseif {$argCount == 1} { # # Return the value of the specified attribute # set attr [lindex $argList 0] set name $prefix-$attr if {[info exists attribs($name)]} { return $attribs($name) } else { return "" } } else { # # Return the current list of attribute names and values # set len [string length "$prefix-"] set result {} foreach name [lsort [array names attribs "$prefix-*"]] { set attr [string range $name $len end] lappend result [list $attr $attribs($name)] } return $result } } #------------------------------------------------------------------------------ # mwutil::hasattribSubCmd # # This procedure is invoked to process has*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::hasattribSubCmd {win prefix attr} { set classNs [string tolower [winfo class $win]] upvar ::${classNs}::ns${win}::attribs attribs return [info exists attribs($prefix-$attr)] } #------------------------------------------------------------------------------ # mwutil::unsetattribSubCmd # # This procedure is invoked to process unset*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::unsetattribSubCmd {win prefix attr} { set classNs [string tolower [winfo class $win]] upvar ::${classNs}::ns${win}::attribs attribs set name $prefix-$attr if {[info exists attribs($name)]} { unset attribs($name) } return "" } #------------------------------------------------------------------------------ # mwutil::getScrollInfo # # Parses a list of arguments of the form "moveto <fraction>" or "scroll # <number> units|pages" and returns the corresponding list consisting of two or # three properly formatted elements. #------------------------------------------------------------------------------ proc mwutil::getScrollInfo argList { set argCount [llength $argList] set opt [lindex $argList 0] if {[string first $opt "moveto"] == 0} { if {$argCount != 2} { wrongNumArgs "moveto fraction" } set fraction [lindex $argList 1] format "%f" $fraction ;# floating-point number check with error message return [list moveto $fraction] } elseif {[string first $opt "scroll"] == 0} { if {$argCount != 3} { wrongNumArgs "scroll number units|pages" } set number [format "%d" [lindex $argList 1]] set what [lindex $argList 2] if {[string first $what "units"] == 0} { return [list scroll $number units] } elseif {[string first $what "pages"] == 0} { return [list scroll $number pages] } else { return -code error "bad argument \"$what\": must be units or pages" } } else { return -code error "unknown option \"$opt\": must be moveto or scroll" } } #------------------------------------------------------------------------------ # mwutil::hasFocus # # Returns a boolean value indicating whether the focus window is (a descendant # of) the widget w. #------------------------------------------------------------------------------ proc mwutil::hasFocus w { return [expr {[string first $w. [focus -displayof $w].] == 0}] } #------------------------------------------------------------------------------ # mwutil::genMouseWheelEvent # # Generates a mouse wheel event with the given root coordinates and delta on # the widget w. #------------------------------------------------------------------------------ proc mwutil::genMouseWheelEvent {w event rootX rootY delta} { set needsFocus [expr {[package vcompare $::tk_patchLevel "8.6b2"] < 0 && [string compare $::tcl_platform(platform) "windows"] == 0}] if {$needsFocus} { set focusWin [focus -displayof $w] focus $w } event generate $w $event -rootx $rootX -rooty $rootY -delta $delta if {$needsFocus} { focus $focusWin } } #------------------------------------------------------------------------------ # mwutil::windowingSystem # # Returns the current windowing system ("x11", "win32", "classic", or "aqua"). #------------------------------------------------------------------------------ proc mwutil::windowingSystem {} { if {[catch {tk windowingsystem} winSys] != 0} { switch $::tcl_platform(platform) { unix { set winSys x11 } windows { set winSys win32 } macintosh { set winSys classic } } } return $winSys } #------------------------------------------------------------------------------ # mwutil::currentTheme # # Returns the current tile theme. #------------------------------------------------------------------------------ proc mwutil::currentTheme {} { if {[info exists ::ttk::currentTheme]} { return $::ttk::currentTheme } elseif {[info exists ::tile::currentTheme]} { return $::tile::currentTheme } else { return "" } } |
Added assets/scrollutil1.0/scripts/scrollarea.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | #============================================================================== # Contains the implementation of the scrollarea widget. # # Structure of the module: # - Namespace initialization # - Public procedure creating a new scrollarea widget # - Private configuration procedures # - Private procedures implementing the scrollarea widget command # - Private callback procedures # - Private procedures used in bindings # - Private utility procedures # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Namespace initialization # ======================== # namespace eval scrollutil { # # Get the current windowing system ("x11", "win32", "classic", or "aqua") # variable winSys [mwutil::windowingSystem] # # The array configSpecs is used to handle configuration options. The names # of its elements are the configuration options for the Scrollarea class. # The value of an array element is either an alias name or a list # containing the database name and class as well as an indicator specifying # the widget to which the option applies: f stands for the frame and w for # the scrollarea widget itself. # # Command-Line Name {Database Name Database Class W} # ------------------------------------------------------------------------ # variable configSpecs array set configSpecs { -background {background Background f} -bg -background -borderwidth {borderWidth BorderWidth f} -bd -borderwidth -cursor {cursor Cursor f} -highlightbackground {highlightBackground HighlightBackground f} -highlightcolor {highlightColor HighlightColor f} -highlightthickness {highlightThickness HighlightThickness f} -lockinterval {lockInterval LockInterval w} -relief {relief Relief f} -respectheader {respectHeader RespectHeader w} -respecttitlecolumns {respectTitleColumns RespectTitleColumns w} -xscrollbarmode {xScrollbarMode ScrollbarMode w} -yscrollbarmode {yScrollbarMode ScrollbarMode w} } # # Extend the elements of the array configSpecs # proc extendConfigSpecs {} { variable usingTile variable configSpecs variable winSys if {$usingTile} { foreach opt {-background -bg -highlightbackground -highlightcolor -highlightthickness} { unset configSpecs($opt) } } else { set helpFrm .__helpFrm for {set n 2} {[winfo exists $helpFrm]} {incr n} { set helpFrm .__helpFrm$n } tk::frame $helpFrm foreach opt {-background -highlightbackground -highlightcolor -highlightthickness} { set configSet [$helpFrm configure $opt] lappend configSpecs($opt) [lindex $configSet 3] } destroy $helpFrm } lappend configSpecs(-borderwidth) 1 lappend configSpecs(-cursor) "" lappend configSpecs(-lockinterval) 1 lappend configSpecs(-relief) sunken lappend configSpecs(-respectheader) \ [expr {[string compare $winSys "win32"] != 0}] lappend configSpecs(-respecttitlecolumns) 1 lappend configSpecs(-xscrollbarmode) dynamic lappend configSpecs(-yscrollbarmode) dynamic } extendConfigSpecs variable configOpts [lsort [array names configSpecs]] # # Use a list to facilitate the handling of the command options # variable cmdOpts [list cget configure setwidget widget] # # Use a list to facilitate the handling of the # -xscrollbarmode and -yscrollbarmode options # variable scrollbarModes [list static dynamic none] # # Default bindings # bind Scrollarea <Configure> { scrollutil::onScrollareaConfigure %W } bind Scrollarea <Destroy> { scrollutil::onScrollareaDestroy %W } bind WidgetOfScrollarea <Destroy> { scrollutil::onWidgetOfScrollareaDestroy %W } } # # Public procedure creating a new scrollarea widget # ================================================= # #------------------------------------------------------------------------------ # scrollutil::scrollarea # # Creates a new scrollarea widget whose name is specified as the first command- # line argument, and configures it according to the options and their values # given on the command line. Returns the name of the newly created widget. #------------------------------------------------------------------------------ proc scrollutil::scrollarea args { variable usingTile variable configSpecs variable configOpts variable winSys if {[llength $args] == 0} { mwutil::wrongNumArgs "scrollarea pathName ?options?" } # # Create a frame of the class Scrollarea # set sa [lindex $args 0] if {[catch { if {$usingTile} { ttk::frame $sa -class Scrollarea -padding 0 } else { tk::frame $sa -class Scrollarea -container 0 catch {$sa configure -padx 0 -pady 0} } $sa configure -height 0 -width 0 -takefocus 0 } result] != 0} { return -code error $result } # # Create a namespace within the current one to hold the data of the widget # namespace eval ns$sa { # # The folowing array holds various data for this widget # variable data array set data { hsbManaged 0 vsbManaged 0 hsbLocked 0 vsbLocked 0 widget "" cf-ne "" cf-sw "" cf-ne_height 1 cf-sw_width 1 } } # # Initialize some further components of data # upvar ::scrollutil::ns${sa}::data data foreach opt $configOpts { set data($opt) [lindex $configSpecs($opt) 3] } # # Create two scrollbars as children of the frame # set hsb $sa.hsb set vsb $sa.vsb if {$usingTile && [string compare $winSys "aqua"] != 0} { ttk::scrollbar $hsb -orient horizontal ttk::scrollbar $vsb -orient vertical } else { tk::scrollbar $hsb -orient horizontal -highlightthickness 0 tk::scrollbar $vsb -orient vertical -highlightthickness 0 } $hsb configure -takefocus 0 $vsb configure -takefocus 0 # # Make sure that the scrollbars won't use the old command syntax # $hsb set 0 1 $vsb set 0 1 grid rowconfigure $sa 1 -weight 1 grid columnconfigure $sa 1 -weight 1 # # Configure the widget according to the command-line # arguments and to the available database options # if {[catch { mwutil::configureWidget $sa configSpecs scrollutil::doConfig \ scrollutil::doCget [lrange $args 1 end] 1 } result] != 0} { destroy $sa return -code error $result } # # Move the original widget command into the current namespace and # create an alias of the original name for a new widget procedure # rename ::$sa $sa interp alias {} ::$sa {} scrollutil::scrollareaWidgetCmd $sa return $sa } # # Private configuration procedures # ================================ # #------------------------------------------------------------------------------ # scrollutil::doConfig # # Applies the value val of the configuration option opt to the scrollarea # widget sa. #------------------------------------------------------------------------------ proc scrollutil::doConfig {sa opt val} { variable configSpecs upvar ::scrollutil::ns${sa}::data data # # Apply the value to the widget corresponding to the given option # switch [lindex $configSpecs($opt) 2] { f { # # Apply the value to the frame and save the # properly formatted value of val in data($opt) # $sa configure $opt $val set data($opt) [$sa cget $opt] switch -- $opt { -borderwidth - -relief { if {[winfo exists $data(widget)] && [winfo pixels $sa $data(-borderwidth)] > 0 && [string compare $data(-relief) "flat"] != 0} { catch {::$data(widget) configure -borderwidth 0} } } } } w { switch -- $opt { -lockinterval { set val [format "%d" $val] ;# integer check with error msg if {$val < 0} { set val 0 } set data($opt) $val } -respectheader { set data($opt) [expr {$val ? 1 : 0}] if {$data(vsbManaged)} { showVScrollbar $sa 1 } } -respecttitlecolumns { set data($opt) [expr {$val ? 1 : 0}] if {$data(hsbManaged)} { showHScrollbar $sa 1 } } -xscrollbarmode { variable scrollbarModes set val [mwutil::fullOpt "scroll mode" $val $scrollbarModes] if {[string compare $val "none"] != 0 && [winfo exists $data(widget)]} { set w $data(widget) if {[catch {::$w cget -xscrollcommand}] != 0 || [catch {::$w xview} xv] != 0 || [catch {::$w xview moveto [lindex $xv 0]}] != 0 || [catch {::$w xview scroll 0 units}] != 0 || [catch {::$w xview scroll 0 pages}] != 0} { return -code error "\"$w\" fails to support\ horizontal scrolling" } } set data($opt) $val set hsb $sa.hsb switch $val { static { showHScrollbar $sa } dynamic { eval setHScrollbar [list $sa] [$hsb get] } none { hideHScrollbar $sa } } } -yscrollbarmode { variable scrollbarModes set val [mwutil::fullOpt "scroll mode" $val $scrollbarModes] if {[string compare $val "none"] != 0 && [winfo exists $data(widget)]} { set w $data(widget) if {[catch {::$w cget -yscrollcommand}] != 0 || [catch {::$w yview} yv] != 0 || [catch {::$w yview moveto [lindex $yv 0]}] != 0 || [catch {::$w yview scroll 0 units}] != 0 || [catch {::$w yview scroll 0 pages}] != 0} { return -code error "\"$w\" fails to support\ vertical scrolling" } } set data($opt) $val set vsb $sa.vsb switch $val { static { showVScrollbar $sa } dynamic { eval setVScrollbar [list $sa] [$vsb get] } none { hideVScrollbar $sa } } } } } } } #------------------------------------------------------------------------------ # scrollutil::doCget # # Returns the value of the configuration option opt for the scrollarea widget # sa. #------------------------------------------------------------------------------ proc scrollutil::doCget {sa opt} { upvar ::scrollutil::ns${sa}::data data return $data($opt) } # # Private procedures implementing the scrollarea widget command # ============================================================= # #------------------------------------------------------------------------------ # scrollutil::scrollareaWidgetCmd # # Processes the Tcl command corresponding to a scrollarea widget. #------------------------------------------------------------------------------ proc scrollutil::scrollareaWidgetCmd {sa args} { set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$sa option ?arg arg ...?" } upvar ::scrollutil::ns${sa}::data data variable cmdOpts set cmd [mwutil::fullOpt "option" [lindex $args 0] $cmdOpts] switch $cmd { cget { if {$argCount != 2} { mwutil::wrongNumArgs "$sa $cmd option" } # # Return the value of the specified configuration option # variable configSpecs set opt [mwutil::fullConfigOpt [lindex $args 1] configSpecs] return $data($opt) } configure { variable configSpecs return [mwutil::configureSubCmd $sa configSpecs \ scrollutil::doConfig scrollutil::doCget \ [lrange $args 1 end]] } setwidget { if {$argCount != 2} { mwutil::wrongNumArgs "$sa $cmd widget" } return [setwidgetSubCmd $sa [lindex $args 1]] } widget { if {$argCount != 1} { mwutil::wrongNumArgs "$sa $cmd" } return $data(widget) } } } #------------------------------------------------------------------------------ # scrollutil::setwidgetSubCmd # # Processes the scrollarea setwidget subcommmand. #------------------------------------------------------------------------------ proc scrollutil::setwidgetSubCmd {sa widget} { upvar ::scrollutil::ns${sa}::data data if {[winfo exists $widget]} { if {[string compare $data(-xscrollbarmode) "none"] != 0} { if {[catch {::$widget cget -xscrollcommand}] != 0 || [catch {::$widget xview} xv] != 0 || [catch {::$widget xview moveto [lindex $xv 0]}] != 0 || [catch {::$widget xview scroll 0 units}] != 0 || [catch {::$widget xview scroll 0 pages}] != 0} { return -code error "\"$widget\" fails to support horizontal\ scrolling" } } if {[string compare $data(-yscrollbarmode) "none"] != 0} { if {[catch {::$widget cget -yscrollcommand}] != 0 || [catch {::$widget yview} yv] != 0 || [catch {::$widget yview moveto [lindex $yv 0]}] != 0 || [catch {::$widget yview scroll 0 units}] != 0 || [catch {::$widget yview scroll 0 pages}] != 0} { return -code error "\"$widget\" fails to support vertical\ scrolling" } } } elseif {[string length $widget] != 0} { return -code error "bad window path name \"$widget\"" } if {[string compare $widget $data(widget)] == 0} { return $widget } if {[winfo exists $data(widget)]} { grid forget $data(widget) if {[string compare [winfo class $data(widget)] "Tablelist"] == 0 && [package vcompare $::tablelist::version "6.5"] >= 0} { grid forget $data(cf-ne) $data(cf-sw) bind $data(widget) <<TablelistHeaderHeightChanged>> "" bind $data(widget) <<TablelistTitleColsWidthChanged>> "" } catch {::$data(widget) configure -xscrollcommand ""} catch {::$data(widget) configure -yscrollcommand ""} set tagList [bindtags $data(widget)] set idx [lsearch -exact $tagList "WidgetOfScrollarea"] bindtags $data(widget) [lreplace $tagList $idx $idx] } setHScrollbar $sa 0 1 setVScrollbar $sa 0 1 $sa.hsb configure -command "" $sa.vsb configure -command "" array set data { cf-ne "" cf-sw "" cf-ne_height 1 cf-sw_width 1 } if {[string length $widget] == 0} { set data(widget) "" return $widget } grid $widget -in $sa -row 0 -rowspan 2 -column 0 -columnspan 2 -sticky news raise $widget catch {::$widget configure -highlightthickness 0} if {[winfo pixels $sa $data(-borderwidth)] > 0 && [string compare $data(-relief) "flat"] != 0} { catch {::$widget configure -borderwidth 0} } if {[string compare $data(-xscrollbarmode) "none"] != 0} { ::$widget configure -xscrollcommand [list scrollutil::setHScrollbar $sa] $sa.hsb configure -command [list $widget xview] } if {[string compare $data(-yscrollbarmode) "none"] != 0} { ::$widget configure -yscrollcommand [list scrollutil::setVScrollbar $sa] $sa.vsb configure -command [list $widget yview] } if {[string compare [winfo class $widget] "Tablelist"] == 0 && [package vcompare $::tablelist::version "6.5"] >= 0} { set data(cf-ne) [::$widget cornerpath -ne] set data(cf-sw) [::$widget cornerpath -sw] bind $widget <<TablelistHeaderHeightChanged>> { scrollutil::onHeaderHeightChanged %W } bind $widget <<TablelistTitleColsWidthChanged>> { scrollutil::onTitleColsWidthChanged %W } onHeaderHeightChanged $widget onTitleColsWidthChanged $widget } set data(widget) $widget set tagList [bindtags $widget] set idx [lsearch -exact $tagList "WidgetOfScrollarea"] if {$idx < 0} { bindtags $widget [linsert $tagList 1 WidgetOfScrollarea] } variable scrollareaArr set scrollareaArr($widget) $sa return $widget } # # Private callback procedures # =========================== # #------------------------------------------------------------------------------ # scrollutil::setHScrollbar # # Wrapper for the set subcommand of the Tcl command associated with the # horizontal scrollbar of the scrollarea widget sa. #------------------------------------------------------------------------------ proc scrollutil::setHScrollbar {sa first last} { upvar ::scrollutil::ns${sa}::data data $sa.hsb set $first $last if {[string compare $data(-xscrollbarmode) "dynamic"] == 0} { if {$first == 0 && $last == 1} { hideHScrollbar $sa } elseif {[winfo width $data(widget)] > 1} { showHScrollbar $sa } } } #------------------------------------------------------------------------------ # scrollutil::setVScrollbar # # Wrapper for the set subcommand of the Tcl command associated with the # vertical scrollbar of the scrollarea widget sa. #------------------------------------------------------------------------------ proc scrollutil::setVScrollbar {sa first last} { upvar ::scrollutil::ns${sa}::data data $sa.vsb set $first $last if {[string compare $data(-yscrollbarmode) "dynamic"] == 0} { if {$first == 0 && $last == 1} { hideVScrollbar $sa } elseif {[winfo height $data(widget)] > 1} { showVScrollbar $sa } } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::onScrollareaConfigure #------------------------------------------------------------------------------ proc scrollutil::onScrollareaConfigure sa { upvar ::scrollutil::ns${sa}::data data set delay $data(-lockinterval) if {$delay > 1} { incr delay 50 } after $delay [list scrollutil::updateScrollbars $sa] } #------------------------------------------------------------------------------ # scrollutil::updateScrollbars #------------------------------------------------------------------------------ proc scrollutil::updateScrollbars sa { if {[winfo exists $sa] && [string compare [winfo class $sa] "Scrollarea"] == 0} { # # Handle the case that the last hideHScrollbar or hideVScrollbar # invocation returned prematurely because of the scrollbar lock # eval setHScrollbar [list $sa] [$sa.hsb get] eval setVScrollbar [list $sa] [$sa.vsb get] } } #------------------------------------------------------------------------------ # scrollutil::onScrollareaDestroy #------------------------------------------------------------------------------ proc scrollutil::onScrollareaDestroy sa { namespace delete ::scrollutil::ns$sa catch {rename ::$sa ""} } #------------------------------------------------------------------------------ # scrollutil::onWidgetOfScrollareaDestroy #------------------------------------------------------------------------------ proc scrollutil::onWidgetOfScrollareaDestroy widget { variable scrollareaArr set sa $scrollareaArr($widget) unset scrollareaArr($widget) if {[winfo exists $sa] && [string compare [winfo class $sa] "Scrollarea"] == 0} { ::$sa setwidget "" } } #------------------------------------------------------------------------------ # scrollutil::onHeaderHeightChanged #------------------------------------------------------------------------------ proc scrollutil::onHeaderHeightChanged tbl { set sa [lindex [grid info $tbl] 1] upvar ::scrollutil::ns${sa}::data data set newHeight [winfo reqheight $data(cf-ne)] set oldHeight $data(cf-ne_height) set data(cf-ne_height) $newHeight if {($oldHeight == 1 && $newHeight > 1 || $oldHeight > 1 && $newHeight == 1) && $data(vsbManaged)} { showVScrollbar $sa 1 } } #------------------------------------------------------------------------------ # scrollutil::onTitleColsWidthChanged #------------------------------------------------------------------------------ proc scrollutil::onTitleColsWidthChanged tbl { set sa [lindex [grid info $tbl] 1] upvar ::scrollutil::ns${sa}::data data set newWidth [winfo reqwidth $data(cf-sw)] set oldWidth $data(cf-sw_width) set data(cf-sw_width) $newWidth if {($oldWidth == 1 && $newWidth > 1 || $oldWidth > 1 && $newWidth == 1) && $data(hsbManaged)} { showHScrollbar $sa 1 } } # # Private utility procedures # ========================== # #------------------------------------------------------------------------------ # scrollutil::showHScrollbar #------------------------------------------------------------------------------ proc scrollutil::showHScrollbar {sa {redisplay 0}} { upvar ::scrollutil::ns${sa}::data data if {$data(hsbManaged) && !$redisplay} { return "" } if {$data(-respecttitlecolumns) && $data(cf-sw_width) > 1} { grid $data(cf-sw) -in $sa -row 2 -column 0 -sticky ns grid $sa.hsb -row 2 -column 1 -columnspan 1 -sticky ew } else { if {[winfo exists $data(cf-sw)]} { grid forget $data(cf-sw) } grid $sa.hsb -row 2 -column 0 -columnspan 2 -sticky ew } set data(hsbManaged) 1 if {[winfo ismapped $sa]} { set data(hsbLocked) 1 after $data(-lockinterval) [list scrollutil::unlockScrollbar $sa hsb] } } #------------------------------------------------------------------------------ # scrollutil::hideHScrollbar #------------------------------------------------------------------------------ proc scrollutil::hideHScrollbar sa { upvar ::scrollutil::ns${sa}::data data if {!$data(hsbManaged) || $data(hsbLocked)} { return "" } if {[winfo exists $data(cf-sw)]} { grid forget $data(cf-sw) } grid forget $sa.hsb set data(hsbManaged) 0 } #------------------------------------------------------------------------------ # scrollutil::showVScrollbar #------------------------------------------------------------------------------ proc scrollutil::showVScrollbar {sa {redisplay 0}} { upvar ::scrollutil::ns${sa}::data data if {$data(vsbManaged) && !$redisplay} { return "" } if {$data(-respectheader) && $data(cf-ne_height) > 1} { grid $data(cf-ne) -in $sa -row 0 -column 2 -sticky ew grid $sa.vsb -row 1 -rowspan 1 -column 2 -sticky ns } else { if {[winfo exists $data(cf-ne)]} { grid forget $data(cf-ne) } grid $sa.vsb -row 0 -rowspan 2 -column 2 -sticky ns } set data(vsbManaged) 1 if {[winfo ismapped $sa]} { set data(vsbLocked) 1 after $data(-lockinterval) [list scrollutil::unlockScrollbar $sa vsb] } } #------------------------------------------------------------------------------ # scrollutil::hideVScrollbar #------------------------------------------------------------------------------ proc scrollutil::hideVScrollbar sa { upvar ::scrollutil::ns${sa}::data data if {!$data(vsbManaged) || $data(vsbLocked)} { return "" } if {[winfo exists $data(cf-ne)]} { grid forget $data(cf-ne) } grid forget $sa.vsb set data(vsbManaged) 0 } #------------------------------------------------------------------------------ # scrollutil::unlockScrollbar #------------------------------------------------------------------------------ proc scrollutil::unlockScrollbar {sa sb} { if {[winfo exists $sa] && [string compare [winfo class $sa] "Scrollarea"] == 0} { upvar ::scrollutil::ns${sa}::data data set data(${sb}Locked) 0 } } |
Added assets/scrollutil1.0/scripts/tclIndex.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # Tcl autoload index file, version 2.0 # This file is generated by the "auto_mkindex" command # and sourced to set up indexing information for one or # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. set auto_index(::mwutil::makeFocusProcs) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::getChildren) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::wrongNumArgs) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::getAncestorByClass) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::convEventFields) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::defineKeyNav) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::processTraversal) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::configureWidget) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::fullConfigOpt) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::fullOpt) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::enumOpts) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::configureSubCmd) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::attribSubCmd) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::hasattribSubCmd) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::unsetattribSubCmd) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::getScrollInfo) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::hasFocus) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::genMouseWheelEvent) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::windowingSystem) [list source [file join $dir mwutil.tcl]] set auto_index(::mwutil::currentTheme) [list source [file join $dir mwutil.tcl]] set auto_index(::scrollutil::extendConfigSpecs) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::scrollarea) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::doConfig) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::doCget) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::scrollareaWidgetCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::setwidgetSubCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::setHScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::setVScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::onScrollareaConfigure) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::updateScrollbars) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::onScrollareaDestroy) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::onWidgetOfScrollareaDestroy) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::onHeaderHeightChanged) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::onTitleColsWidthChanged) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::showHScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::hideHScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::showVScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::hideVScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::unlockScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::createWheelEventBindings) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::enableScrollingByWheel) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::adaptWheelEventHandling) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::setFocusCheckWindow) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::focusCheckWindow) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::hasFocus) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::isCompatible) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::scrollByUnits) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::mayScroll) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::onScrlWidgetContDestroy) [list source [file join $dir wheelEvent.tcl]] |
Added assets/scrollutil1.0/scripts/wheelEvent.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | #============================================================================== # Contains procedures for mouse wheel event handling in scrollable widget # containers like BWidget ScrollableFrame and iwidgets::scrolledframe. Tested # also with the scrolledframe::scrolledframe command of the Scrolledframe # package by Maurice Bredelet (ulis) and its optimized and enhanced version # contributed by Keith Nash, as well as with the sframe command implemented by # Paul Walton (see https://wiki.tcl-lang.org/page/A+scrolled+frame). # # Structure of the module: # - Namespace initialization # - Public procedures # - Private procedures # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== if {[string compare $tcl_platform(platform) "windows"] == 0} { package require Tk 8.6b2 } else { package require Tk 8.4 } # # Namespace initialization # ======================== # namespace eval scrollutil { # # Mouse wheel event bindings for the binding # tags "WheeleventRedir" and "WheeleventBreak": # set eventList [list <MouseWheel> <Shift-MouseWheel>] switch [tk windowingsystem] { aqua { lappend eventList <Option-MouseWheel> <Shift-Option-MouseWheel> } x11 { lappend eventList <Button-4> <Button-5> \ <Shift-Button-4> <Shift-Button-5> } } foreach event $eventList { if {[string match <*Button-?> $event]} { bind WheeleventRedir $event [format { if {![scrollutil::hasFocus %%W] || ![scrollutil::isCompatible %s %%W]} { event generate [winfo toplevel %%W] %s \ -rootx %%X -rooty %%Y break } } $event $event] } else { bind WheeleventRedir $event [format { if {![scrollutil::hasFocus %%W] || ![scrollutil::isCompatible %s %%W]} { event generate [winfo toplevel %%W] %s \ -rootx %%X -rooty %%Y -delta %%D break } } $event $event] } bind WheeleventBreak $event { break } } # # The list of scrollable widget containers that are # registered for scrolling by the mouse wheel event # bindings created by the createWheelEventBindings command: # variable scrlWidgetContList {} # # <Destroy> event binding for the binding tag "ScrlWidgetCont": # bind ScrlWidgetCont <Destroy> { scrollutil::onScrlWidgetContDestroy %W } # # <Destroy> event binding for the binding tag "WheeleventWidget": # bind WheeleventWidget <Destroy> { unset -nocomplain scrollutil::focusCheckWinArr(%W) } } # # Public procedures # ================= # #------------------------------------------------------------------------------ # scrollutil::createWheelEventBindings # # Usage: scrollutil::createWheelEventBindings ?tag tag ...? # # Creates mouse wheel event bindings for the specified binding tags such that # if the widget under the pointer is (a descendant of) one of the registered # scrollable widget containers then these events will trigger a scrolling of # that widget container. Each tag argument must be "all" or the path name of # an existing toplevel widget. #------------------------------------------------------------------------------ proc scrollutil::createWheelEventBindings args { set winSys [tk windowingsystem] foreach tag $args { if {[string match .* $tag]} { if {![winfo exists $tag]} { return -code error "bad window path name \"$tag\"" } if {[winfo toplevel $tag] ne $tag} { return -code error "\"$tag\" is not a toplevel widget" } } elseif {$tag ne "all"} { return -code error "unsupported tag \"$tag\": must be \"all\" or\ the path name of an existing toplevel widget" } if {$winSys eq "aqua"} { bind $tag <MouseWheel> { scrollutil::scrollByUnits %W %X %Y y [expr {-%D}] } bind $tag <Option-MouseWheel> { scrollutil::scrollByUnits %W %X %Y y [expr {-10 * %D}] } bind $tag <Shift-MouseWheel> { scrollutil::scrollByUnits %W %X %Y x [expr {-%D}] } bind $tag <Shift-Option-MouseWheel> { scrollutil::scrollByUnits %W %X %Y x [expr {-10 * %D}] } } else { bind $tag <MouseWheel> { scrollutil::scrollByUnits %W %X %Y y [expr {-(%D/120) * 4}] } bind $tag <Shift-MouseWheel> { scrollutil::scrollByUnits %W %X %Y x [expr {-(%D/120) * 4}] } if {$winSys eq "x11"} { bind $tag <Button-4> { scrollutil::scrollByUnits %W %X %Y y -5 } bind $tag <Button-5> { scrollutil::scrollByUnits %W %X %Y y 5 } bind $tag <Shift-Button-4> { scrollutil::scrollByUnits %W %X %Y x -5 } bind $tag <Shift-Button-5> { scrollutil::scrollByUnits %W %X %Y x 5 } } } } } #------------------------------------------------------------------------------ # scrollutil::enableScrollingByWheel # # Usage: scrollutil::enableScrollingByWheel ?scrlWidgetCont scrlWidgetCont ...? # # Adds the specified scrollable widget containers to the internal list of # widget containers that are registered for scrolling by the mouse wheel event # bindings created by the createWheelEventBindings command. #------------------------------------------------------------------------------ proc scrollutil::enableScrollingByWheel args { variable scrlWidgetContList foreach swc $args { if {![winfo exists $swc]} { return -code error "bad window path name \"$swc\"" } if {[catch {$swc xview scroll 0 units}] != 0} { return -code error "\"$swc\" fails to support horizontal scrolling\ by units" } if {[catch {$swc yview scroll 0 units}] != 0} { return -code error "\"$swc\" fails to support vertical scrolling\ by units" } if {[lsearch -exact $scrlWidgetContList $swc] >= 0} { continue } lappend scrlWidgetContList $swc set tagList [bindtags $swc] if {[lsearch -exact $tagList "ScrlWidgetCont"] < 0} { bindtags $swc [linsert $tagList 1 ScrlWidgetCont] } } } #------------------------------------------------------------------------------ # scrollutil::adaptWheelEventHandling # # Usage: scrollutil::adaptWheelEventHandling ?widget widget ...? # # For each widget argument, the command performs the following actions: # # * If $widget is a tablelist then it sets the latter's -xmousewheelwindow # and -ymousewheelwindow options to the path name of the containing # toplevel window (for Tablelist versions 6.4 and later). # # * Otherwise it locates the (first) binding tag that has mouse wheel event # bindings and is different from both the path name of the containing # toplevel window and "all". If the search for this tag was successful # then the command modifies the widget's list of binding tags by prepending # the tag "WheeleventRedir" and appending the tag "WheeleventBreak" to this # binding tag. As a result, a mouse wheel event sent to this widget will # be handled as follows: # # - If the focus is on or inside the window [focusCheckWindow $widget] # then the event will be handled by the binding script associated with # this tag and no further processing of the event will take place. # # - If the focus is outside the window [focusCheckWindow $widget] then # the event will be redirected to the containing toplevel window via # event generate rather than being handled by the binding script # associated with the above-mentioned tag. #------------------------------------------------------------------------------ proc scrollutil::adaptWheelEventHandling args { set winSys [tk windowingsystem] foreach w $args { if {![winfo exists $w]} { return -code error "bad window path name \"$w\"" } set wTop [winfo toplevel $w] if {[winfo class $w] eq "Tablelist"} { if {[package vcompare $::tablelist::version "6.4"] >= 0} { $w configure -xmousewheelwindow $wTop -ymousewheelwindow $wTop } } else { set tagList [bindtags $w] if {[lsearch -exact $tagList "WheeleventRedir"] >= 0} { continue } foreach tag $tagList { if {$tag eq $wTop || $tag eq "all" || ($winSys eq "x11" && [bind $tag <Button-4>] eq "") || ($winSys ne "x11" && [bind $tag <MouseWheel>] eq "")} { continue } set tagIdx [lsearch -exact $tagList $tag] bindtags $w [lreplace $tagList $tagIdx $tagIdx \ WheeleventRedir $tag WheeleventBreak] break } } } } #------------------------------------------------------------------------------ # scrollutil::setFocusCheckWindow # # Usage: scrollutil::setFocusCheckWindow widget ?widget ...? otherWidget # # For each widget argument, the command sets the associated "focus check # window" to otherWidget. This is the window to be used instead of the widget # when checking whether the focus is on/inside or outside that window. It must # be an ancestor of or identical to widget. #------------------------------------------------------------------------------ proc scrollutil::setFocusCheckWindow args { set argCount [llength $args] if {$argCount < 2} { return -code error "wrong # args: should be\ \"scrollutil::setFocusCheckWindow widget ?widget ...? otherWidget\"" } foreach w $args { if {![winfo exists $w]} { return -code error "bad window path name \"$w\"" } } set w2 [lindex $args end] variable focusCheckWinArr set n 0 foreach w $args { if {$n == $argCount - 1} { return "" } if {[string first $w2. $w.] != 0} { return -code error \ "\"$w2\" is neither an ancestor of nor is identical to \"$w\"" } set focusCheckWinArr($w) $w2 set tagList [bindtags $w] if {[lsearch -exact $tagList "WheeleventWidget"] < 0} { bindtags $w [linsert $tagList 1 WheeleventWidget] } incr n } } #------------------------------------------------------------------------------ # scrollutil::focusCheckWindow # # Usage: scrollutil::focusCheckWindow widget # # Returns the "focus check window" associated with widget. This is the window # that is used instead of the widget when checking whether the focus is # on/inside or outside that window. If the command setFocusCheckWindow was not # invoked for widget then the return value is widget itself. #------------------------------------------------------------------------------ proc scrollutil::focusCheckWindow w { if {![winfo exists $w]} { return -code error "bad window path name \"$w\"" } variable focusCheckWinArr return [expr {[info exists focusCheckWinArr($w)] ? $focusCheckWinArr($w) : $w}] } # # Private procedures # ================== # #------------------------------------------------------------------------------ # scrollutil::hasFocus #------------------------------------------------------------------------------ proc scrollutil::hasFocus w { set focusWin [focus -displayof $w] if {[string first [focusCheckWindow $w]. $focusWin.] == 0} { return 1 } elseif {[string match "*Scrollbar" [winfo class $w]]} { set w2 [lindex [$w cget -command] 0] ;# the associated widget return [expr {[winfo exists $w2] && [string first [focusCheckWindow $w2]. $focusWin.] == 0}] } else { return 0 } } #------------------------------------------------------------------------------ # scrollutil::isCompatible #------------------------------------------------------------------------------ proc scrollutil::isCompatible {event w} { set tagList [bindtags $w] set idx [lsearch -exact $tagList "WheeleventRedir"] set tag [lindex $tagList [incr idx]] if {[bind $tag $event] eq ""} { return 0 } elseif {[string match "*Scrollbar" [winfo class $w]]} { set orient [$w cget -orient] return [expr { ($orient eq "horizontal" && [string match "<Shift-*>" $event]) || ($orient eq "vertical" && ![string match "<Shift-*>" $event]) }] } else { return 1 } } #------------------------------------------------------------------------------ # scrollutil::scrollByUnits #------------------------------------------------------------------------------ proc scrollutil::scrollByUnits {w rootX rootY axis units} { set w [winfo containing -displayof $w $rootX $rootY] variable scrlWidgetContList foreach swc $scrlWidgetContList { if {[mayScroll $swc $w]} { $swc ${axis}view scroll $units units return "" } } } #------------------------------------------------------------------------------ # scrollutil::mayScroll #------------------------------------------------------------------------------ proc scrollutil::mayScroll {swc w} { if {[string first $swc. $w.] == 0} { ;# $w is (a descendant of) $swc if {[winfo class $swc] eq "Scrolledframe" && [llength [info commands ::iwidgets::scrolledframe]] != 0 && ($w eq [$swc component horizsb] || $w eq [$swc component vertsb])} { return 0 } else { # # Don't scroll the window $swc if the toplevel window of any # combobox widget contained in it is currently popped down # set swcTop [winfo toplevel $swc] set toplevelList [wm stackorder $swcTop] if {[llength $toplevelList] == 1} { return 1 } else { foreach top $toplevelList { if {$top eq $swcTop} { continue } # # Check whether the toplevel $top is a child of a # ttk::combobox, BWidget ComboBox or Oakley combobox # widget, or is a descendant of an iwidgets::combobox # set topName [winfo name $top] set parent [winfo parent $top] set parClass [winfo class $parent] set parName [winfo name $parent] if {($parClass eq "TCombobox" && $topName eq "popdown") || ($parClass eq "ComboBox" && $topName eq "shell") || ($parClass eq "Combobox" && $topName eq "top") || ($parName eq "efchildsite" && $topName eq "popup")} { return 0 } } return 1 } } } else { return 0 } } #------------------------------------------------------------------------------ # scrollutil::onScrlWidgetContDestroy #------------------------------------------------------------------------------ proc scrollutil::onScrlWidgetContDestroy swc { variable scrlWidgetContList set idx [lsearch -exact $scrlWidgetContList $swc] set scrlWidgetContList [lreplace $scrlWidgetContList $idx $idx] } |
Added assets/scrollutil1.0/scrollutil.tcl.
> > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 | #============================================================================== # Main Scrollutil package module. # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require -exact scrollutil::common 1.0 package provide scrollutil $::scrollutil::version package provide Scrollutil $::scrollutil::version ::scrollutil::useTile 0 |
Added assets/scrollutil1.0/scrollutilCommon.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #============================================================================== # Main Scrollutil and Scrollutil_tile package module. # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8 namespace eval ::scrollutil { # # Public variables: # variable version 1.0 variable library if {$::tcl_version >= 8.4} { set library [file dirname [file normalize [info script]]] } else { set library [file dirname [info script]] ;# no "file normalize" yet } # # Creates a new scrollarea widget: # namespace export scrollarea # # Public procedures for mouse wheel event # handling in scrollable widget containers: # namespace export createWheelEventBindings enableScrollingByWheel \ adaptWheelEventHandling setFocusCheckWindow \ focusCheckWindow } package provide scrollutil::common $::scrollutil::version # # The following procedure, invoked in "scrollutil.tcl" and # "scrollutil_tile.tcl", sets the variable ::scrollutil::usingTile to the given # value and sets a trace on this variable. # proc ::scrollutil::useTile {bool} { variable usingTile $bool trace variable usingTile wu [list ::scrollutil::restoreUsingTile $bool] } # # The following trace procedure is executed whenever the variable # ::scrollutil::usingTile is written or unset. It restores the variable to its # original value, given by the first argument. # proc ::scrollutil::restoreUsingTile {origVal varName index op} { variable usingTile $origVal switch $op { w { return -code error "it is not allowed to use both Scrollutil and\ Scrollutil_tile in the same application" } u { trace variable usingTile wu \ [list ::scrollutil::restoreUsingTile $origVal] } } } interp alias {} ::tk::frame {} ::frame interp alias {} ::tk::scrollbar {} ::scrollbar # # Everything else needed is lazily loaded on demand, via the dispatcher # set up in the subdirectory "scripts" (see the file "tclIndex"). # lappend auto_path [file join $::scrollutil::library scripts] |
Added assets/scrollutil1.0/scrollutil_tile.tcl.
> > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #============================================================================== # Main Scrollutil_tile package module. # # Copyright (c) 2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} { package require tile 0.6 } package require -exact scrollutil::common 1.0 package provide scrollutil_tile $::scrollutil::version package provide Scrollutil_tile $::scrollutil::version ::scrollutil::useTile 1 |
Changes to assets/tklib0.6/tablelist/CHANGES.txt.
|
| | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | What is new in Tablelist 6.6? ----------------------------- 1. Added mouse bindings for setting, extending, and toggling the column- wise cell selection with the aid of the header labels if the selection type is "cell" (thanks to Nicolas Bats for his proposal, testing, and discussions on this subject). 2. New "-selectfiltercommand" widget and column configuration option, which can be used for filtering the cells that are to be selected by the column-wise cell selection operation (again, thanks to Nicolas Bats for his proposal, testing, and discussions on this subject). 3. Improvements related to the interactive editing of multi-line cells (thanks to Johann Oberdorfer for his proposal). 4. Adapted the look & feel of the tree style "adwaita" to current versions of the GTK+ 3 theme Adwaita. 5. Improved the description of the "-height" option in the reference manual and extended it by a hint concerning the desired height in rows (thanks to Jakob Gager for discussions on this subject). 6. The reference manual now contains several links to the new Scrollutil package, along with an example showing how the scrollutil::scrollarea widget can be used to make the creation of a scrolled tablelist quite simple. 7. Eliminated the flickering in the presence of header items, introduced in Tablelist 6.5 (thanks to Johann Oberdorfer for reporting this regression). 8. Fixed a long-standing bug related to the "move" subcommand (thanks to John J. Seal for his bug report). 9. Several further improvements and minor bug fixes. What was new in Tablelist 6.5? ------------------------------ 1. Support for the new virtual events <<TablelistHeaderHeightChanged>> and <<TablelistTitleColsWidthChanged>>, generated when the header's height or the total width of the viewable title columns, respectively, has changed. 2. Optimized the vertical scrolling by units (thanks to Nicolas Bats for his input). 3. Minor improvement related to the appearance of embedded checkbuttons on X11. 4. Fixed a bug introduced in Tablelist 6.4, related to the "-showlabels" option (thanks to Jakob Gager for his bug report). 5. Fixed a few bugs specific to Mac OS X Aqua, introduced in Tablelist 6.4 (thanks to Paul Obermeier and Nicolas Bats for their bug reports). 6. Fixed a bug related to the handling of mouse wheel events during interactive cell editing, introduced in Tablelist 6.4 (thanks to Alexandru Dadalau for his bug report). 7. Fixed a bug related to the "move" subcommand, introduced in Tablelist |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/COPYRIGHT.txt.
|
| | | 1 2 3 4 5 6 7 8 | Multi-column listbox and tree widget package Tablelist, version 6.6 Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) This library is free software; you can use, modify, and redistribute it for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/ChangeLog.
1 2 3 4 5 6 7 | 2019-04-18 Csaba Nemethi <csaba.nemethi@t-online.de> * CHANGES.txt: Slightly extended. 2019-04-14 Csaba Nemethi <csaba.nemethi@t-online.de> * *.tcl: Bumped the version number to 6.5. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 2019-07-13 Csaba Nemethi <csaba.nemethi@t-online.de> * scripts/tablelistMove.tcl: Fixed a bug related to the "move" subcommand. * CHANGES.txt: Updated. 2019-07-13 Csaba Nemethi <csaba.nemethi@t-online.de> * scripts/tablelistConfig.tcl: Removed the restrictions related to the * scripts/tablelistWidget.tcl: scrollutil::scrollarea widget. 2019-07-08 Csaba Nemethi <csaba.nemethi@t-online.de> * scripts/tablelistWidget.tcl: Reverted the change in the procedure tablelist::vertMoveTo. 2019-07-06 Csaba Nemethi <csaba.nemethi@t-online.de> * *.tcl: Bumped the version number to 6.6. * COPYRIGHT.txt: * README.txt: * ../../examples/tablelist/*.tcl: * CHANGES.txt: Updated to reflect the changes. * scripts/*.tcl: Added mouse bindings for column-wise cell selection; new "-selectfiltercommand" widget and column configuration option; improved the interactive editing of multi-line cells; updated the tree style "adwaita"; eliminated the flickering in the presence of header items; fixed a bug related to the error handling in the tablelist configuration at widget creation time in the presence of the "-columntitles" option; several further improvements and minor bug fixes. * scripts/tclIndex: Newly generated. * doc/*.html: Updated to reflect the changes; improved and extended the description of the "-height" option in the reference manual; added references to the new Scrollutil package and an example showing how the scrollutil::scrollarea widget can be used to make the creation of a scrolled tablelist quite simple. * doc/adwaita.png: Updated screenshots. * doc/arrowStyles_vista.png: 2019-04-18 Csaba Nemethi <csaba.nemethi@t-online.de> * CHANGES.txt: Slightly extended. 2019-04-14 Csaba Nemethi <csaba.nemethi@t-online.de> * *.tcl: Bumped the version number to 6.5. |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/README.txt.
︙ | ︙ | |||
84 85 86 87 88 89 90 | http://www.nemethi.de How to Get It? -------------- Tablelist is available for free download from the same URL as Wcb. The | | | | | | | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | http://www.nemethi.de How to Get It? -------------- Tablelist is available for free download from the same URL as Wcb. The distribution file is "tablelist6.6.tar.gz" for UNIX and "tablelist6_6.zip" for Windows. These files contain the same information, except for the additional carriage return character preceding the linefeed at the end of each line in the text files for Windows. Tablelist is also included in tklib, which has the address http://core.tcl.tk/tklib How to Install It? ------------------ Install the package as a subdirectory of one of the directories given by the "auto_path" variable. For example, you can install it as a directory at the same level as the Tcl and Tk script libraries. The locations of these library directories are given by the "tcl_library" and "tk_library" variables, respectively. To install Tablelist on UNIX, "cd" to the desired directory and unpack the distribution file "tablelist6.6.tar.gz": gunzip -c tablelist6.6.tar.gz | tar -xf - On most UNIX systems this can be replaced with tar -zxf tablelist6.6.tar.gz Both commands will create a directory named "tablelist6.6 with the subdirectories "demos", "doc", and "scripts". On Windows, use WinZip or some other program capable of unpacking the distribution file "tablelist6_6.zip" into the directory "tablelist6.6", with the subdirectories "demos", "doc", and "scripts". The file "tablelistEdit.tcl" in the "scripts" directory is only needed for applications making use of interactive cell editing. Similarly, the file "tablelistMove.tcl" in the same directory is only required for scripts invoking the "move" or "movecolumn" tablelist command. Finally, the file "tablelistThemes.tcl" is only needed for applications using |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/pkgIndex.tcl.
1 2 3 4 5 6 7 8 9 | #============================================================================== # Tablelist and Tablelist_tile package index file. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Regular packages: # | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #============================================================================== # Tablelist and Tablelist_tile package index file. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Regular packages: # package ifneeded tablelist 6.6 \ [list source [file join $dir tablelist.tcl]] package ifneeded tablelist_tile 6.6 \ [list source [file join $dir tablelist_tile.tcl]] # # Aliases: # package ifneeded Tablelist 6.6 \ [list package require -exact tablelist 6.6] package ifneeded Tablelist_tile 6.6 \ [list package require -exact tablelist_tile 6.6] # # Code common to all packages: # package ifneeded tablelist::common 6.6 \ "namespace eval ::tablelist { proc DIR {} {return [list $dir]} } ;\ source [list [file join $dir tablelistPublic.tcl]]" |
Changes to assets/tklib0.6/tablelist/scripts/mwutil.tcl.
︙ | ︙ | |||
15 16 17 18 19 20 21 | # ======================== # namespace eval mwutil { # # Public variables: # | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # ======================== # namespace eval mwutil { # # Public variables: # variable version 2.13 variable library if {$::tcl_version >= 8.4} { set library [file dirname [file normalize [info script]]] } else { set library [file dirname [info script]] ;# no "file normalize" yet } |
︙ | ︙ | |||
181 182 183 184 185 186 187 | optValPairs initialize} { upvar $configSpecsName configSpecs # # Process the command-line arguments # set cmdLineOpts {} | | | | | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | optValPairs initialize} { upvar $configSpecsName configSpecs # # Process the command-line arguments # set cmdLineOpts {} set savedOptValPairs {} set failed 0 set count [llength $optValPairs] foreach {opt val} $optValPairs { if {[catch {fullConfigOpt $opt configSpecs} result] != 0} { set failed 1 break } if {$count == 1} { set result "value for \"$opt\" missing" set failed 1 break } set opt $result lappend cmdLineOpts $opt lappend savedOptValPairs $opt [eval $cgetCmd [list $win $opt]] if {[catch {eval $configCmd [list $win $opt $val]} result] != 0} { set failed 1 break } incr count -2 } if {$failed} { # # Restore the saved values # foreach {opt val} $savedOptValPairs { eval $configCmd [list $win $opt $val] } return -code error $result } if {$initialize} { |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tablelistBind.tcl.
︙ | ︙ | |||
549 550 551 552 553 554 555 | set tablelist::priv(clickedExpCollCtrl) 1 if {[string length [$tablelist::W editwinpath]] != 0} { tablelist::doFinishEditing $tablelist::W } } else { tablelist::condEditContainingCell $tablelist::W \ $tablelist::x $tablelist::y | < < < < | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | set tablelist::priv(clickedExpCollCtrl) 1 if {[string length [$tablelist::W editwinpath]] != 0} { tablelist::doFinishEditing $tablelist::W } } else { tablelist::condEditContainingCell $tablelist::W \ $tablelist::x $tablelist::y tablelist::condBeginMove $tablelist::W $tablelist::priv(row) tablelist::beginSelect $tablelist::W \ $tablelist::priv(row) $tablelist::priv(col) 1 } } } bind TablelistBody <Double-Button-1> { |
︙ | ︙ | |||
788 789 790 791 792 793 794 | bind TablelistBody $eventArr(SelectAll) { tablelist::selectAll [tablelist::getTablelistPath %W] } bind TablelistBody $eventArr(SelectNone) { set tablelist::W [tablelist::getTablelistPath %W] if {[string compare [$tablelist::W cget -selectmode] "browse"] != 0} { $tablelist::W selection clear 0 end | | | 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 | bind TablelistBody $eventArr(SelectAll) { tablelist::selectAll [tablelist::getTablelistPath %W] } bind TablelistBody $eventArr(SelectNone) { set tablelist::W [tablelist::getTablelistPath %W] if {[string compare [$tablelist::W cget -selectmode] "browse"] != 0} { $tablelist::W selection clear 0 end tablelist::genTablelistSelectEvent $tablelist::W } } foreach pattern {Tab Shift-Tab ISO_Left_Tab hpBackTab} { catch { foreach modifier {Control Meta} { bind TablelistBody <$modifier-$pattern> [format { mwutil::processTraversal %%W Tablelist <%s> |
︙ | ︙ | |||
908 909 910 911 912 913 914 | } foreach event {<Shift-Control-Key-A> <Shift-Control-Lock-Key-a>} { bind TablelistBody $event { set tablelist::W [tablelist::getTablelistPath %W] if {[string compare [$tablelist::W cget -selectmode] \ "browse"] != 0} { $tablelist::W selection clear 0 end | | | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 | } foreach event {<Shift-Control-Key-A> <Shift-Control-Lock-Key-a>} { bind TablelistBody $event { set tablelist::W [tablelist::getTablelistPath %W] if {[string compare [$tablelist::W cget -selectmode] \ "browse"] != 0} { $tablelist::W selection clear 0 end tablelist::genTablelistSelectEvent $tablelist::W } } } } } if {[string compare $winSys "x11"] == 0} { |
︙ | ︙ | |||
1532 1533 1534 1535 1536 1537 1538 | } set priv(prevRow) $row set priv(prevCol) $col } } | | | 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 | } set priv(prevRow) $row set priv(prevCol) $col } } genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::condAutoScan # # This procedure is invoked when the mouse leaves or enters the scrollable part # of a tablelist widget's body text child while button 1 is down. It either |
︙ | ︙ | |||
1677 1678 1679 1680 1681 1682 1683 | } switch -- $data(-selectmode) { browse { ::$win selection clear 0 end ::$win selection set $row set priv(prevRow) $row | | | 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 | } switch -- $data(-selectmode) { browse { ::$win selection clear 0 end ::$win selection set $row set priv(prevRow) $row genTablelistSelectEvent $win } extended { if {[string length $prRow] == 0} { set prRow $row ::$win selection set $row } |
︙ | ︙ | |||
1705 1706 1707 1708 1709 1710 1711 | ($r <= $prRow && $r > $row && $r > $ancRow)} { ::$win selection set $r } } ::$win restorecursor set priv(prevRow) $row | | | | 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 | ($r <= $prRow && $r > $row && $r > $ancRow)} { ::$win selection set $r } } ::$win restorecursor set priv(prevRow) $row genTablelistSelectEvent $win } } } cell { set prRow $priv(prevRow) set prCol $priv(prevCol) if {$row == $prRow && $col == $prCol} { return "" } switch -- $data(-selectmode) { browse { ::$win cellselection clear 0,0 end ::$win cellselection set $row,$col set priv(prevRow) $row set priv(prevCol) $col genTablelistSelectEvent $win } extended { if {[string length $prRow] == 0 || [string length $prCol] == 0} { set prRow $row set prcol $col ::$win cellselection set $row,$col |
︙ | ︙ | |||
1765 1766 1767 1768 1769 1770 1771 | ::$win cellselection set $r,$c } } ::$win restorecursor set priv(prevRow) $row set priv(prevCol) $col | | | 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 | ::$win cellselection set $r,$c } } ::$win restorecursor set priv(prevRow) $row set priv(prevCol) $col genTablelistSelectEvent $win } } } } } #------------------------------------------------------------------------------ |
︙ | ︙ | |||
1918 1919 1920 1921 1922 1923 1924 | cell { if {$row == $priv(prevRow) && $col == $priv(prevCol)} { ::$win cellselection clear $priv(prevRow),$priv(prevCol) } } } | | | | 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 | cell { if {$row == $priv(prevRow) && $col == $priv(prevCol)} { ::$win cellselection clear $priv(prevRow),$priv(prevCol) } } } genTablelistSelectEvent $win set priv(selClearPending) 0 } elseif {$priv(selChangePending) && $inside} { switch $data(-selecttype) { row { if {$row == $priv(prevRow)} { ::$win selection clear 0 end ::$win selection set $priv(prevRow) } } cell { if {$row == $priv(prevRow) && $col == $priv(prevCol)} { ::$win cellselection clear 0,0 end ::$win cellselection set $priv(prevRow),$priv(prevCol) } } } genTablelistSelectEvent $win set priv(selChangePending) 0 } # # Return if both <Button-1> and <ButtonRelease-1> occurred in the # temporary embedded widget used for interactive cell editing # |
︙ | ︙ | |||
2206 2207 2208 2209 2210 2211 2212 | beginSelect $win $row $col return "" } } } } | | | 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 | beginSelect $win $row $col return "" } } } } genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::condEditActiveCell # # This procedure is invoked whenever Return or KP_Enter is pressed in the body # of a tablelist widget. If the selection type is cell and the active cell is |
︙ | ︙ | |||
2688 2689 2690 2691 2692 2693 2694 | ::$win selection clear 0 end if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win selection set $priv(selection) ;# can take long ::$win restorecursor | | | | 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 | ::$win selection clear 0 end if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win selection set $priv(selection) ;# can take long ::$win restorecursor genTablelistSelectEvent $win } cell { if {[string length $priv(prevRow)] == 0 || [string length $priv(prevCol)] == 0} { return "" } ::$win selection clear 0 end if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win cellselection set $priv(selection) ;# can take long ::$win restorecursor genTablelistSelectEvent $win } } } #------------------------------------------------------------------------------ # tablelist::selectAll # |
︙ | ︙ | |||
2739 2740 2741 2742 2743 2744 2745 | ::$win cellselection set active } else { ::$win cellselection set 0,0 end } } } | | | 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 | ::$win cellselection set active } else { ::$win cellselection set 0,0 end } } } genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::isDragSrc # # Checks whether the body component of the tablelist widget win is a drag # source for mouse button 1. |
︙ | ︙ | |||
2874 2875 2876 2877 2878 2879 2880 | ::$win activate $row ::$win see active switch -- $data(-selectmode) { browse { ::$win selection clear 0 end ::$win selection set active | | | | | | 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 | ::$win activate $row ::$win see active switch -- $data(-selectmode) { browse { ::$win selection clear 0 end ::$win selection set active genTablelistSelectEvent $win } extended { ::$win selection clear 0 end ::$win selection set active ::$win selection anchor active variable priv set priv(selection) {} set priv(prevRow) $data(activeRow) genTablelistSelectEvent $win } } } cell { ::$win activatecell $row,$col ::$win seecell active switch -- $data(-selectmode) { browse { ::$win cellselection clear 0,0 end ::$win cellselection set active genTablelistSelectEvent $win } extended { ::$win cellselection clear 0,0 end ::$win cellselection set active ::$win cellselection anchor active variable priv set priv(selection) {} set priv(prevRow) $data(activeRow) set priv(prevCol) $data(activeCol) genTablelistSelectEvent $win } } } } update idletasks } |
︙ | ︙ | |||
2940 2941 2942 2943 2944 2945 2946 | ::$win seecell active ::$win cellselection clear 0,0 end ::$win cellselection set active } } | > > > > > > > > > > > | > | 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 | ::$win seecell active ::$win cellselection clear 0,0 end ::$win cellselection set active } } genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::genTablelistSelectEvent # # Generates a <<TablelistSelect>> virtual event on the tablelist widget win if # the latter is in normal state. #------------------------------------------------------------------------------ proc tablelist::genTablelistSelectEvent win { if {[string compare [::$win cget -state] "normal"] == 0} { event generate $win <<TablelistSelect>> } } # # Binding tag TablelistHeader # =========================== # |
︙ | ︙ | |||
3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 | } bind TablelistLabel <Double-Button-1> { tablelist::labelDblB1 %W %x 0 } bind TablelistLabel <Shift-Double-Button-1> { tablelist::labelDblB1 %W %x 1 } } #------------------------------------------------------------------------------ # tablelist::defineTablelistSubLabel # # Defines the binding tag TablelistSubLabel (for sublabels of tablelist labels) # to have the same events as TablelistLabel and the binding scripts obtained | > > > > > > > > > > > > > > > > > > > | 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 | } bind TablelistLabel <Double-Button-1> { tablelist::labelDblB1 %W %x 0 } bind TablelistLabel <Shift-Double-Button-1> { tablelist::labelDblB1 %W %x 1 } variable winSys switch $winSys { x11 { set modList {Alt Meta} } win32 { set modList {Alt} } classic - aqua { set modList {Command} } } foreach modifier $modList { bind TablelistLabel <$modifier-Button-1> { tablelist::labelModifB1Down %W %X } bind TablelistLabel <$modifier-Shift-Button-1> { tablelist::labelModifShiftB1Down %W %X } bind TablelistLabel <$modifier-Control-Button-1> { tablelist::labelModifCtrlB1Down %W %X } } } #------------------------------------------------------------------------------ # tablelist::defineTablelistSubLabel # # Defines the binding tag TablelistSubLabel (for sublabels of tablelist labels) # to have the same events as TablelistLabel and the binding scripts obtained |
︙ | ︙ | |||
3158 3159 3160 3161 3162 3163 3164 | } $script] } } #------------------------------------------------------------------------------ # tablelist::labelEnter # | | | | 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 | } $script] } } #------------------------------------------------------------------------------ # tablelist::labelEnter # # This procedure is invoked when the mouse pointer enters a header label w of a # tablelist widget, or is moving within that label. It updates the cursor, # displays the tooltip, and activates or deactivates the label, depending on # whether the pointer is on its right border or not. #------------------------------------------------------------------------------ proc tablelist::labelEnter {w X Y x} { if {![parseLabelPath $w win col]} { return "" } |
︙ | ︙ | |||
3212 3213 3214 3215 3216 3217 3218 | configLabel $w -active 1 } } #------------------------------------------------------------------------------ # tablelist::labelLeave # | | | | 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 | configLabel $w -active 1 } } #------------------------------------------------------------------------------ # tablelist::labelLeave # # This procedure is invoked when the mouse pointer leaves a header label w of a # tablelist widget. It removes the tooltip and deactivates the label. #------------------------------------------------------------------------------ proc tablelist::labelLeave {w X x y} { if {![parseLabelPath $w win col]} { return "" } # |
︙ | ︙ | |||
3256 3257 3258 3259 3260 3261 3262 | configLabel $w -active 0 } #------------------------------------------------------------------------------ # tablelist::labelB1Down # | | | | 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 | configLabel $w -active 0 } #------------------------------------------------------------------------------ # tablelist::labelB1Down # # This procedure is invoked when mouse button 1 is pressed in a header label w # of a tablelist widget. If the pointer is on the right border of the label # then the procedure records its x-coordinate relative to the label, the width # of the column, and some other data needed later. Otherwise it saves the # label's relief so it can be restored later, and changes the relief to sunken. #------------------------------------------------------------------------------ proc tablelist::labelB1Down {w x shiftPressed} { if {![parseLabelPath $w win col]} { return "" |
︙ | ︙ | |||
3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 | set data(X) [expr {[winfo rootx $w] + $x}] set data(shiftPressed) $shiftPressed if {[inResizeArea $w $x col] && $data(-resizablecolumns) && $data($col-resizable)} { set data(colBeingResized) $col set data(colResized) 0 set w $data(body) set topTextIdx [$w index @0,0] set btmTextIdx [$w index @0,[expr {[winfo height $w] - 1}]] $w tag add visibleLines "$topTextIdx linestart" "$btmTextIdx lineend" set data(topRow) [expr {int($topTextIdx) - 1}] set data(btmRow) [expr {int($btmTextIdx) - 1}] | > | 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 | set data(X) [expr {[winfo rootx $w] + $x}] set data(shiftPressed) $shiftPressed if {[inResizeArea $w $x col] && $data(-resizablecolumns) && $data($col-resizable)} { set data(colBeingResized) $col set data(colResized) 0 set data(inClickedLabel) 0 set w $data(body) set topTextIdx [$w index @0,0] set btmTextIdx [$w index @0,[expr {[winfo height $w] - 1}]] $w tag add visibleLines "$topTextIdx linestart" "$btmTextIdx lineend" set data(topRow) [expr {int($topTextIdx) - 1}] set data(btmRow) [expr {int($btmTextIdx) - 1}] |
︙ | ︙ | |||
3340 3341 3342 3343 3344 3345 3346 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Motion # | | | | | | 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Motion # # This procedure is invoked to process mouse motion events in a header label w # of a tablelist widget while button 1 is down. If this event occured during a # column resize operation then the procedure computes the difference between # the pointer's new x-coordinate relative to that label and the one recorded by # the last invocation of labelB1Down, and adjusts the width of the # corresponding column accordingly. Otherwise a horizontal scrolling is # performed if needed, and the would-be target position of the clicked label is # visualized if the columns are movable. #------------------------------------------------------------------------------ proc tablelist::labelB1Motion {w X x y} { if {![parseLabelPath $w win col]} { return "" } upvar ::tablelist::ns${win}::data data if {!$data(labelClicked) && !$data(labelModifClicked)} { return "" } if {[info exists data(colBeingResized)]} { ;# resize operation in progress set width [expr {$data(oldStretchedColWidth) + $X - $data(X)}] if {$width >= $data(minColWidth)} { set col $data(colBeingResized) |
︙ | ︙ | |||
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 | after cancel $data(afterId) set data(afterId) "" } set data(X) $X if {$scroll} { horizAutoScan $win } if {$x >= 1 && $x < [winfo width $w] - 1 && $y >= 0 && $y < [winfo height $w]} { # # The following code is needed because the event # can also occur in a widget placed into the label # | > > > > > | 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 | after cancel $data(afterId) set data(afterId) "" } set data(X) $X if {$scroll} { horizAutoScan $win } if {$data(labelModifClicked)} { labelModifB1Motion $win $w $X return "" } if {$x >= 1 && $x < [winfo width $w] - 1 && $y >= 0 && $y < [winfo height $w]} { # # The following code is needed because the event # can also occur in a widget placed into the label # |
︙ | ︙ | |||
3537 3538 3539 3540 3541 3542 3543 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Enter # | | | | 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Enter # # This procedure is invoked when the mouse pointer enters a header label w of a # tablelist widget while mouse button 1 is down. If the label was not # previously clicked then nothing happens. Otherwise, if this event occured # during a column resize operation then the procedure updates the mouse cursor # accordingly. Otherwise it changes the label's relief to sunken. #------------------------------------------------------------------------------ proc tablelist::labelB1Enter w { if {![parseLabelPath $w win col]} { return "" |
︙ | ︙ | |||
3568 3569 3570 3571 3572 3573 3574 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Leave # | | | | 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 | } } } #------------------------------------------------------------------------------ # tablelist::labelB1Leave # # This procedure is invoked when the mouse pointer leaves a header label w of a # tablelist widget while mouse button 1 is down. If the label was not # previously clicked then nothing happens. Otherwise, if no column resize # operation is in progress then the procedure restores the label's relief, and, # if the columns are movable, then it changes the mouse cursor, too. #------------------------------------------------------------------------------ proc tablelist::labelB1Leave {w x y} { if {![parseLabelPath $w win col]} { return "" |
︙ | ︙ | |||
3602 3603 3604 3605 3606 3607 3608 | configLabel $w -relief $data(relief) -pressed 0 } #------------------------------------------------------------------------------ # tablelist::labelB1Up # # This procedure is invoked when mouse button 1 is released, if it was | | | | 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 | configLabel $w -relief $data(relief) -pressed 0 } #------------------------------------------------------------------------------ # tablelist::labelB1Up # # This procedure is invoked when mouse button 1 is released, if it was # previously clicked in a header label of a tablelist widget. If this event # occured during a column resize operation then the procedure redisplays the # column and stretches the stretchable columns. Otherwise, if the mouse button # was released in the previously clicked label then the procedure restores the # label's relief and invokes the command specified by the -labelcommand or # -labelcommand2 configuration option, passing to it the widget name and the # column number as arguments. Otherwise the column of the previously clicked # label is moved before the column containing the mouse cursor or to its right, # if the columns are movable. #------------------------------------------------------------------------------ proc tablelist::labelB1Up {w X} { if {![parseLabelPath $w win col]} { return "" } upvar ::tablelist::ns${win}::data data if {!$data(labelClicked) && !$data(labelModifClicked)} { return "" } if {[info exists data(colBeingResized)]} { ;# resize operation in progress configLabel $w -cursor $data(-cursor) if {[winfo exists $data(focus)]} { focus $data(focus) |
︙ | ︙ | |||
3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 | $data(body) tag configure visibleLines -tabs {} } else { if {[info exists data(X)]} { unset data(X) after cancel $data(afterId) set data(afterId) "" } if {$data(-movablecolumns)} { if {[winfo exists $data(focus)]} { focus $data(focus) } bind [winfo toplevel $win] <Escape> $data(topEscBinding) place forget $data(colGap) } | > > > > > > | 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 | $data(body) tag configure visibleLines -tabs {} } else { if {[info exists data(X)]} { unset data(X) after cancel $data(afterId) set data(afterId) "" } if {$data(labelModifClicked)} { labelModifB1Up $win $w $X return "" } if {$data(-movablecolumns)} { if {[winfo exists $data(focus)]} { focus $data(focus) } bind [winfo toplevel $win] <Escape> $data(topEscBinding) place forget $data(colGap) } |
︙ | ︙ | |||
3750 3751 3752 3753 3754 3755 3756 | set data(labelClicked) 0 } #------------------------------------------------------------------------------ # tablelist::labelB3Down # | | | | 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 | set data(labelClicked) 0 } #------------------------------------------------------------------------------ # tablelist::labelB3Down # # This procedure is invoked when mouse button 3 is pressed in a header label w # of a tablelist widget. If the Shift key was down when this event occured # then the procedure restores the last static width of the given column; # otherwise it configures the width of the given column to be just large enough # to hold all the elements (including the label). #------------------------------------------------------------------------------ proc tablelist::labelB3Down {w shiftPressed} { if {![parseLabelPath $w win col]} { return "" |
︙ | ︙ | |||
3782 3783 3784 3785 3786 3787 3788 | genVirtualEvent $win <<TablelistColumnResized>> $col } } #------------------------------------------------------------------------------ # tablelist::labelDblB1 # | | | 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 | genVirtualEvent $win <<TablelistColumnResized>> $col } } #------------------------------------------------------------------------------ # tablelist::labelDblB1 # # This procedure is invoked when a header label w of a tablelist widget is # double-clicked. If the pointer is on the right border of the label then the # procedure performs the same action as labelB3Down. #------------------------------------------------------------------------------ proc tablelist::labelDblB1 {w x shiftPressed} { if {![parseLabelPath $w win col]} { return "" } |
︙ | ︙ | |||
3905 3906 3907 3908 3909 3910 3911 | set data(afterId) [after $ms [list tablelist::horizAutoScan $win]] } #------------------------------------------------------------------------------ # tablelist::inResizeArea # | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 | set data(afterId) [after $ms [list tablelist::horizAutoScan $win]] } #------------------------------------------------------------------------------ # tablelist::inResizeArea # # Checks whether the given x coordinate relative to a header label w of a # tablelist widget is in the resize area of that label or of the one to its # left. #------------------------------------------------------------------------------ proc tablelist::inResizeArea {w x colName} { if {![parseLabelPath $w dummy _col]} { return 0 } upvar $colName col if {$x >= [winfo width $w] - 5} { set col $_col return 1 } elseif {$x < 5} { set X [expr {[winfo rootx $w] - 3}] set contW [winfo containing -displayof $w $X [winfo rooty $w]] return [parseLabelPath $contW dummy col] } else { return 0 } } #------------------------------------------------------------------------------ # tablelist::labelModifB1Down # # This procedure is invoked when mouse button 1 is pressed in a header label w # of a tablelist widget, with the Alt/Meta/Command key down. It begins the # process of making a column-wise selection in the widget. #------------------------------------------------------------------------------ proc tablelist::labelModifB1Down {w X} { if {![parseLabelPath $w win col]} { return "" } upvar ::tablelist::ns${win}::data data if {$data(isDisabled) || [string compare $data(-selecttype) "cell"] != 0} { return "" } set data(labelModifClicked) 1 set data(X) $X ::$win cellselection clear 0,0 end selectColRange $win $col $col ::$win cellselection anchor [firstSelCellOfCol $win $col] variable priv set priv(selection) {} set priv(prevRow) $data(lastRow) set priv(prevCol) $col genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::labelModifB1Motion # # This procedure is invoked to process mouse motion events in a header label w # of the tablelist widget win if mouse button 1 was previously clicked in some # header label, with the Alt/Meta/Command key down. It extends the column-wise # selection in the widget. Invoked from within labelB1Motion and # labelModifShiftB1Down. #------------------------------------------------------------------------------ proc tablelist::labelModifB1Motion {win w X} { upvar ::tablelist::ns${win}::data data if {[string compare $data(-selecttype) "cell"] != 0} { return "" } set row $data(lastRow) set x [expr {$X - [winfo rootx $win]}] set col [::$win columnindex @$x,0] variable priv set prRow $priv(prevRow) set prCol $priv(prevCol) if {$row == $prRow && $col == $prCol} { return "" } if {[string length $prRow] == 0 || [string length $prCol] == 0} { set prRow $row set prcol $col selectColRange $win $col $col } set ancCol $data(anchorCol) if {[isColSelected $win $ancCol]} { deselectColRange $win $prCol $col selectColRange $win $ancCol $col } else { deselectColRange $win $prCol $col deselectColRange $win $ancCol $col } if {[::$win cget -showbusycursor]} { ::$win setbusycursor } for {set c 0} {$c < $data(colCount)} {incr c} { ;# can take long if {(($c >= $prCol && $c < $col && $c < $ancCol) || ($c <= $prCol && $c > $col && $c > $ancCol)) && [wasColSelected $win $c]} { selectColRange $win $c $c } } ::$win restorecursor set priv(prevRow) $row set priv(prevCol) $col genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::labelModifB1Up # # This procedure is invoked when mouse button 1 is released, if it was # previously clicked in a header label w of a tablelist widget win, with the # Alt/Meta/Command key down. It activates the last cell of the nearest column. # Invoked from within labelB1Up. #------------------------------------------------------------------------------ proc tablelist::labelModifB1Up {win w X} { upvar ::tablelist::ns${win}::data data if {[string compare $data(-selecttype) "cell"] != 0} { return "" } set x [expr {$X - [winfo rootx $win]}] set col [::$win columnindex @$x,0] ::$win activatecell last,$col set data(labelModifClicked) 0 } #------------------------------------------------------------------------------ # tablelist::labelModifShiftB1Down # # This procedure is invoked when mouse button 1 is pressed in a header label w # of a tablelist widget, with the Alt/Meta/Command and Shift keys down. It # begins the process of extending the column-wise selection in the widget. #------------------------------------------------------------------------------ proc tablelist::labelModifShiftB1Down {w X} { if {![parseLabelPath $w win col]} { return "" } upvar ::tablelist::ns${win}::data data if {$data(isDisabled) || [string compare $data(-selecttype) "cell"] != 0} { return "" } set data(labelModifClicked) 1 set data(X) $X if {[isColSelected $win $data(anchorCol)]} { labelModifB1Motion $win $w $X } else { labelModifB1Down $w $X } } #------------------------------------------------------------------------------ # tablelist::labelModifCtrlB1Down # # This procedure is invoked when mouse button 1 is pressed in a header label w # of a tablelist widget, with the Alt/Meta/Command and Control keys down. It # begins the process of toggling the column-wise selection in the widget. #------------------------------------------------------------------------------ proc tablelist::labelModifCtrlB1Down {w X} { if {![parseLabelPath $w win col]} { return "" } upvar ::tablelist::ns${win}::data data if {$data(isDisabled) || [string compare $data(-selecttype) "cell"] != 0} { return "" } set data(labelModifClicked) 1 set data(X) $X if {[::$win cget -showbusycursor]} { ::$win setbusycursor } variable priv set priv(selection) [::$win curcellselection] ;# can take long ::$win restorecursor set priv(prevRow) $data(lastRow) set priv(prevCol) $col if {[isColSelected $win $col]} { deselectColRange $win $col $col ::$win cellselection anchor 0,$col } else { selectColRange $win $col $col ::$win cellselection anchor [firstSelCellOfCol $win $col] } genTablelistSelectEvent $win } #------------------------------------------------------------------------------ # tablelist::selectColRange # # Selects the cells of the specified tablelist column range. #------------------------------------------------------------------------------ proc tablelist::selectColRange {win col1 col2} { # # Swap the column numbers if necessary # if {$col2 < $col1} { set tmp $col1 set col1 $col2 set col2 $tmp } upvar ::tablelist::ns${win}::data data for {set col $col1} {$col <= $col2} {incr col} { set cmd "" if {[info exists data($col-selectfiltercommand)]} { set cmd $data($col-selectfiltercommand) } elseif {[string length $data(-selectfiltercommand)] != 0} { set cmd $data(-selectfiltercommand) } if {[string length $cmd] == 0} { ::$win cellselection set 0,$col last,$col } else { set rowList [uplevel #0 $cmd [list $win $col]] set cellIdxList {} foreach row $rowList { lappend cellIdxList $row,$col } ::$win cellselection set $cellIdxList } } } #------------------------------------------------------------------------------ # tablelist::deselectColRange # # Deselects the cells of the specified tablelist column range. #------------------------------------------------------------------------------ proc tablelist::deselectColRange {win col1 col2} { ::$win cellselection clear 0,$col1 last,$col2 } #------------------------------------------------------------------------------ # tablelist::firstSelCellOfCol # # Returns the index of the first selected cell of the specified tablelist # column. #------------------------------------------------------------------------------ proc tablelist::firstSelCellOfCol {win col} { set itemCount [::$win size] for {set row 0} {$row < $itemCount} {incr row} { if {[::$win cellselection includes $row,$col]} { return $row,$col } } return -1,$col } #------------------------------------------------------------------------------ # tablelist::isColSelected # # Checks whether any cell of the specified tablelist column is selected. #------------------------------------------------------------------------------ proc tablelist::isColSelected {win col} { set itemCount [::$win size] for {set row 0} {$row < $itemCount} {incr row} { if {[::$win cellselection includes $row,$col]} { return 1 } } return 0 } #------------------------------------------------------------------------------ # tablelist::wasColSelected # # Checks whether any cell of the specified tablelist column was selected before # the current selection operation (such as a mouse drag) started. #------------------------------------------------------------------------------ proc tablelist::wasColSelected {win col} { variable priv set itemCount [::$win size] for {set row 0} {$row < $itemCount} {incr row} { if {[lsearch $priv(selection) $row,$col] >= 0} { return 1 } } return 0 } |
Changes to assets/tklib0.6/tablelist/scripts/tablelistConfig.tcl.
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | lappend configSpecs(-labelrelief) raised lappend configSpecs(-listvariable) {} lappend configSpecs(-movablecolumns) 0 lappend configSpecs(-movablerows) 0 lappend configSpecs(-populatecommand) {} lappend configSpecs(-protecttitlecolumns) 0 lappend configSpecs(-resizablecolumns) 1 lappend configSpecs(-selecttype) row lappend configSpecs(-setfocus) 1 lappend configSpecs(-showarrow) 1 lappend configSpecs(-showbusycursor) 1 lappend configSpecs(-showeditcursor) 1 lappend configSpecs(-showhorizseparator) 1 lappend configSpecs(-showlabels) 1 | > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | lappend configSpecs(-labelrelief) raised lappend configSpecs(-listvariable) {} lappend configSpecs(-movablecolumns) 0 lappend configSpecs(-movablerows) 0 lappend configSpecs(-populatecommand) {} lappend configSpecs(-protecttitlecolumns) 0 lappend configSpecs(-resizablecolumns) 1 lappend configSpecs(-selectfiltercommand) {} lappend configSpecs(-selecttype) row lappend configSpecs(-setfocus) 1 lappend configSpecs(-showarrow) 1 lappend configSpecs(-showbusycursor) 1 lappend configSpecs(-showeditcursor) 1 lappend configSpecs(-showhorizseparator) 1 lappend configSpecs(-showlabels) 1 |
︙ | ︙ | |||
414 415 416 417 418 419 420 | #------------------------------------------------------------------------------ proc tablelist::doConfig {win opt val} { variable usingTile variable helpLabel variable configSpecs upvar ::tablelist::ns${win}::data data | < < < < < < < < < < < < < < < < | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | #------------------------------------------------------------------------------ proc tablelist::doConfig {win opt val} { variable usingTile variable helpLabel variable configSpecs upvar ::tablelist::ns${win}::data data # # Apply the value to the widget(s) corresponding to the given option # switch [lindex $configSpecs($opt) 2] { c { # # Apply the value to all children and save the |
︙ | ︙ | |||
633 634 635 636 637 638 639 640 641 642 643 644 645 646 | -colorizecommand - -editendcommand - -editstartcommand - -expandcommand - -labelcommand - -labelcommand2 - -populatecommand - -selectmode - -sortcommand - -tooltipaddcommand - -tooltipdelcommand - -yscrollcommand { set data($opt) $val } | > | 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | -colorizecommand - -editendcommand - -editstartcommand - -expandcommand - -labelcommand - -labelcommand2 - -populatecommand - -selectfiltercommand - -selectmode - -sortcommand - -tooltipaddcommand - -tooltipdelcommand - -yscrollcommand { set data($opt) $val } |
︙ | ︙ | |||
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | adjustColumns $win l$col 1 updateViewWhenIdle $win } -labelcommand - -labelcommand2 - -name - -sortcommand { if {[string length $val] == 0} { arrayUnset data $col$opt } else { set data($col$opt) $val } } | > | 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | adjustColumns $win l$col 1 updateViewWhenIdle $win } -labelcommand - -labelcommand2 - -name - -selectfiltercommand - -sortcommand { if {[string length $val] == 0} { arrayUnset data $col$opt } else { set data($col$opt) $val } } |
︙ | ︙ | |||
2672 2673 2674 2675 2676 2677 2678 | if {$val} { arrayUnset data $key$opt } else { # # Set data($key$opt) to 0 and deselect the row # set data($key$opt) 0 | | | 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 | if {$val} { arrayUnset data $key$opt } else { # # Set data($key$opt) to 0 and deselect the row # set data($key$opt) 0 selectionSubCmd $win [list clear $row $row] } } -selectbackground - -selectforeground { set key [lindex $data(keyList) $row] set name $key$opt |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tablelistEdit.tcl.
︙ | ︙ | |||
1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 | } focus $data(body) set userData [list $row $col] genVirtualEvent $win <<TablelistCellRestored>> $userData updateViewWhenIdle $win return "" } #------------------------------------------------------------------------------ # tablelist::doFinishEditing # | > | 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 | } focus $data(body) set userData [list $row $col] genVirtualEvent $win <<TablelistCellRestored>> $userData seeRow $win $row updateViewWhenIdle $win return "" } #------------------------------------------------------------------------------ # tablelist::doFinishEditing # |
︙ | ︙ | |||
1942 1943 1944 1945 1946 1947 1948 | # # Check whether the input was rejected (by the above "set data(rejected) 1" # statement or within the command specified by the -editendcommand option) # if {$data(rejected)} { if {[winfo exists $data(bodyFrm)]} { | < | 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 | # # Check whether the input was rejected (by the above "set data(rejected) 1" # statement or within the command specified by the -editendcommand option) # if {$data(rejected)} { if {[winfo exists $data(bodyFrm)]} { if {[string compare [winfo class $w] "Mentry"] != 0} { focus $data(editFocus) } } else { focus $data(body) } |
︙ | ︙ | |||
1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 | focus $data(body) set userData [list $row $col] genVirtualEvent $win <<TablelistCellUpdated>> $userData } updateViewWhenIdle $win return $result } #------------------------------------------------------------------------------ # tablelist::clearTakefocusOpt # | > | 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 | focus $data(body) set userData [list $row $col] genVirtualEvent $win <<TablelistCellUpdated>> $userData } seeRow $win $row updateViewWhenIdle $win return $result } #------------------------------------------------------------------------------ # tablelist::clearTakefocusOpt # |
︙ | ︙ | |||
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 | $w configure -height $numLines update idletasks ;# needed for ctext set path [wcb::pathname $w] if {[winfo exists $path]} { [winfo parent $path] configure -height [winfo reqheight $path] } } #------------------------------------------------------------------------------ # tablelist::setMentryCursor # # Sets the focus to the entry child of the mentry widget w that contains the # global character position specified by number, and sets the insertion cursor | > > > > | 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 | $w configure -height $numLines update idletasks ;# needed for ctext set path [wcb::pathname $w] if {[winfo exists $path]} { [winfo parent $path] configure -height [winfo reqheight $path] } set win [getTablelistPath $path] upvar ::tablelist::ns${win}::data data seeRow $win $data(editRow) } #------------------------------------------------------------------------------ # tablelist::setMentryCursor # # Sets the focus to the entry child of the mentry widget w that contains the # global character position specified by number, and sets the insertion cursor |
︙ | ︙ | |||
2619 2620 2621 2622 2623 2624 2625 | set tablelist::w [$tablelist::W cget -ymousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { mwutil::genMouseWheelEvent $tablelist::w \ <MouseWheel> %X %Y %D break } | | > | > | > | > | > | > | 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 | set tablelist::w [$tablelist::W cget -ymousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { mwutil::genMouseWheelEvent $tablelist::w \ <MouseWheel> %X %Y %D break } } elseif {![tablelist::isComboTopMapped %W] && ![tablelist::isMenuPosted %W]} { set tablelist::W [tablelist::getTablelistPath %W] mwutil::genMouseWheelEvent [$tablelist::W bodypath] \ <MouseWheel> %X %Y %D } } bind TablelistEditBreak <MouseWheel> { break } bind TablelistEdit <Option-MouseWheel> { if {[tablelist::hasMouseWheelBindings %W y]} { set tablelist::W [tablelist::getTablelistPath %W] set tablelist::w [$tablelist::W cget -ymousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { mwutil::genMouseWheelEvent $tablelist::w \ <Option-MouseWheel> %X %Y %D break } } elseif {![tablelist::isComboTopMapped %W] && ![tablelist::isMenuPosted %W]} { set tablelist::W [tablelist::getTablelistPath %W] mwutil::genMouseWheelEvent [$tablelist::W bodypath] \ <Option-MouseWheel> %X %Y %D } } bind TablelistEditBreak <Option-MouseWheel> { break } } catch { bind TablelistEdit <Shift-MouseWheel> { if {[tablelist::hasMouseWheelBindings %W x]} { set tablelist::W [tablelist::getTablelistPath %W] set tablelist::w [$tablelist::W cget -xmousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { mwutil::genMouseWheelEvent $tablelist::w \ <Shift-MouseWheel> %X %Y %D break } } elseif {![tablelist::isComboTopMapped %W] && ![tablelist::isMenuPosted %W]} { set tablelist::W [tablelist::getTablelistPath %W] mwutil::genMouseWheelEvent [$tablelist::W bodypath] \ <Shift-MouseWheel> %X %Y %D } } bind TablelistEditBreak <Shift-MouseWheel> { break } bind TablelistEdit <Shift-Option-MouseWheel> { if {[tablelist::hasMouseWheelBindings %W x]} { set tablelist::W [tablelist::getTablelistPath %W] set tablelist::w [$tablelist::W cget -xmousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { mwutil::genMouseWheelEvent $tablelist::w \ <Shift-Option-MouseWheel> %X %Y %D break } } elseif {![tablelist::isComboTopMapped %W] && ![tablelist::isMenuPosted %W]} { set tablelist::W [tablelist::getTablelistPath %W] mwutil::genMouseWheelEvent [$tablelist::W bodypath] \ <Shift-Option-MouseWheel> %X %Y %D } } bind TablelistEditBreak <Shift-Option-MouseWheel> { break } } if {[string compare $winSys "x11"] == 0} { foreach detail {4 5} { bind TablelistEdit <Button-$detail> [format { if {[tablelist::hasMouseWheelBindings %%W y]} { set tablelist::W [tablelist::getTablelistPath %%W] set tablelist::w [$tablelist::W cget -ymousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { event generate $tablelist::w <Button-%s> \ -rootx %%X -rooty %%Y break } } elseif {![tablelist::isComboTopMapped %%W] && ![tablelist::isMenuPosted %%W]} { set tablelist::W [tablelist::getTablelistPath %%W] event generate [$tablelist::W bodypath] <Button-%s> \ -rootx %%X -rooty %%Y } } $detail $detail] bind TablelistEditBreak <Button-$detail> { break } bind TablelistEdit <Shift-Button-$detail> [format { if {[tablelist::hasMouseWheelBindings %%W x]} { set tablelist::W [tablelist::getTablelistPath %%W] set tablelist::w [$tablelist::W cget -xmousewheelwindow] if {[winfo exists $tablelist::w] && ![mwutil::hasFocus $tablelist::W]} { event generate $tablelist::w <Shift-Button-%s> \ -rootx %%X -rooty %%Y break } } elseif {![tablelist::isComboTopMapped %%W && ![tablelist::isMenuPosted %%W]]} { set tablelist::W [tablelist::getTablelistPath %%W] event generate [$tablelist::W bodypath] <Shift-Button-%s> \ -rootx %%X -rooty %%Y } } $detail $detail] bind TablelistEditBreak <Shift-Button-$detail> { break } } |
︙ | ︙ | |||
3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 | # its toplevel component is mapped. #------------------------------------------------------------------------------ proc tablelist::isComboTopMapped w { set par [winfo parent $w] if {[string compare [winfo class $par] "Combobox"] == 0 && [winfo exists $par.top] && [winfo ismapped $par.top]} { return 1 } else { return 0 } } | > > > > > > > > > > > > > > > > > | 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 | # its toplevel component is mapped. #------------------------------------------------------------------------------ proc tablelist::isComboTopMapped w { set par [winfo parent $w] if {[string compare [winfo class $par] "Combobox"] == 0 && [winfo exists $par.top] && [winfo ismapped $par.top]} { return 1 } else { return 0 } } #------------------------------------------------------------------------------ # tablelist::isMenuPosted # # Checks whether the given widget is a menubutton having its menu posted. This # is needed in our binding scripts for mouse wheel events to make sure that # they won't generate an endless loop, because of the global grab set on the # menu when the latter is posted. #------------------------------------------------------------------------------ proc tablelist::isMenuPosted w { if {[string compare [winfo class $w] "Menubutton"] == 0 && [winfo ismapped [$w cget -menu]]} { return 1 } else { return 0 } } |
Changes to assets/tklib0.6/tablelist/scripts/tablelistImages.tcl.
︙ | ︙ | |||
733 734 735 736 737 738 739 | variable adwaita_${mode}Img \ [image create photo tablelist_adwaita_${mode}Img] } variable pngSupported if {$pngSupported} { tablelist_adwaita_collapsedImg put " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 | variable adwaita_${mode}Img \ [image create photo tablelist_adwaita_${mode}Img] } variable pngSupported if {$pngSupported} { tablelist_adwaita_collapsedImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAUklE QVQ4T52LsQ3AMAzD9Gan/NgHXRgZYqJGImTgQAlURFzRjg4UaVTfQZFeN6bM0IopKzzGFIbbmPIP n/pXKGaUUMwooZhRQjGjpB0d2vFM6AMkZwGtV+hP7wAAAABJRU5ErkJggg== " tablelist_adwaita_expandedImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAUUlE QVQ4T53LUQrAMAgEUe+Yr14zF7RaQiA4rUsDD+LCmLv/gqMCRwWOChwV+UaYjauEq/6KS/Q0+8Mx Ruk8zvg1SnWIoIsSjgocFTgqcOy53bmYAXcYbKcDAAAAAElFTkSuQmCC " tablelist_adwaita_collapsedSelImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAU0lE QVQ4T52LQQrAMAzD8s39oO/bB7N4UCgiW00POlhYkZlHtNKBYmB/QnEXVkyh0IopZriNKdbwN6Zg eBX8vFBYkaCwIkFhRYLCikQrHVq5J+MBfENbgN9EUrEAAAAASUVORK5CYII= " tablelist_adwaita_expandedSelImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAATUlE QVQ4T53LsQ0AIAwDQXakYk0WDLhD8BCL4iLlJZeI+ILRgdGB0YHRoVOnnmjTMczGx0jWh8Y4kj2s 4+tIKGrwHAlGB0YHRgfGXJQByYxbHYdyNm0AAAAASUVORK5CYII= " tablelist_adwaita_collapsedActImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAU0lE QVQ4T52LQQ6AMAzD8tM9BX5eqDisFmWLOPjgRFZE/KIdHSjSqL6CcqsbU57Qiikz3MYUhslnTHmH R/0rFDNKKGaUUMwooUhn9RXt6NCOe0IXeqwIcNEv1OkAAAAASUVORK5CYII= " tablelist_adwaita_expandedActImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAUklE QVQ4T53LUQqAMAwE0dzaT715dKUU2kzrYuFBOrCRmb9gdGB0YHRgdOgdD107Zxm29W5cRu+mHzzG kYyfcbwcSQ0Rl8x9htGB0YHRgfFbxg0RwQjxGF3ifAAAAABJRU5ErkJggg== " tablelist_adwaita_collapsedSelActImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAUElE QVQ4T52LQQoAIAgEe3rHfm1tEMSgKS3MwcFpZvaFKytQDNwhFFoppjhLY4p7z5iCC2MKri/4s6G4 F0aC4uwZCQotjQRFKRKurODKHGsTLGRi5/Yt6JoAAAAASUVORK5CYII= " tablelist_adwaita_expandedSelActImg put " iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAABGdBTUEAALGPC/xhBQAAAAlwSFlz AAAOwQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAS0lE QVQ4T53LQQoAIAwDQX/t1Z9XcxO72qAwQhfSIuILRgdGB0YHRoe+vlRvLGlYjdNI9oPGOJIz7OPr SChq8BwJRgdGB0YHxlq0CSfbYptH4iuzAAAAAElFTkSuQmCC " } else { tablelist_adwaita_collapsedImg put " R0lGODlhDgAOAMIEAAAAAE1NTaCgoKampv///////////////yH5BAEKAAAALAAAAAAOAA4AAAMb CLrc/kvAFuRUoV6Q9ezeAw5fRpbnl07r5m4JADs= " tablelist_adwaita_expandedImg put " R0lGODlhDgAOAMIEAAAAAE1NTaampqysrP///////////////yH5BAEKAAAALAAAAAAOAA4AAAMa CLrc/jDKyUa4+Ipmc9hOp0UdGAkmpa7skwAAOw== " tablelist_adwaita_collapsedSelImg put " R0lGODlhDgAOAKEBAAAAAP///////////yH5BAEKAAAALAAAAAAOAA4AAAIXhI+pe8EZ3DNRvmoX zhDfOoEhp03mmRQAOw== " tablelist_adwaita_expandedSelImg put " R0lGODlhDgAOAKEBAAAAAP///////////yH5BAEKAAAALAAAAAAOAA4AAAIUhI+py+2Pgpw00apu aJhvCIZiUwAAOw== " tablelist_adwaita_collapsedActImg put " R0lGODlhDgAOAMIEAAAAAH9/f4CAgKCgoP///////////////yH5BAEKAAQALAAAAAAOAA4AAAMc SLrc/mvABuRUoF6S9ezeAwpfRpbnl07B5r5KAgA7 " tablelist_adwaita_expandedActImg put " R0lGODlhDgAOAMIEAAAAAH9/f4CAgIiIiP///////////////yH5BAEKAAQALAAAAAAOAA4AAAMa SLrc/jDKyQa4+IpmM9hOp0UdGAUBpa6slAAAOw== " tablelist_adwaita_collapsedSelActImg put " R0lGODlhDgAOAKEBAAAAAP///////////yH5BAEKAAAALAAAAAAOAA4AAAIXhI+pe8EZ3DNRvmoX zhDfOoEhp03mmRQAOw== " tablelist_adwaita_expandedSelActImg put " R0lGODlhDgAOAKEBAAAAAP///////////yH5BAEKAAAALAAAAAAOAA4AAAIUhI+py+2Pgpw00apu aJhvCIZiUwAAOw== " } } #------------------------------------------------------------------------------ # tablelist::ambianceTreeImgs #------------------------------------------------------------------------------ |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tablelistMove.tcl.
︙ | ︙ | |||
81 82 83 84 85 86 87 | set target [nodeRow $win $targetParentKey $targetChildIdx] if {$target < 0} { set target 0 } set sourceItem [lindex $data(itemList) $source] set sourceKey [lindex $sourceItem end] | < < < < | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | set target [nodeRow $win $targetParentKey $targetChildIdx] if {$target < 0} { set target 0 } set sourceItem [lindex $data(itemList) $source] set sourceKey [lindex $sourceItem end] set sourceParentKey $data($sourceKey-parent) if {[string compare $targetParentKey $sourceParentKey] == 0 && $target == $source && $withDescendants} { return "" } set sourceDescCount [descCount $win $sourceKey] |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tablelistUtil.tcl.
︙ | ︙ | |||
251 252 253 254 255 256 257 | } } incr x [winfo rootx $data(body)] # # Get the (scheduled) root X coordinate of $data(hdrTxtFrm) # | | > > > | > > > | > | > | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | } } incr x [winfo rootx $data(body)] # # Get the (scheduled) root X coordinate of $data(hdrTxtFrm) # set baseX [winfo rootx $data(hdrTxt)] set bbox [$data(hdrTxt) bbox 1.0] set viewChanged 0 if {[llength $bbox] == 0} { $data(hdrTxt) yview 0 set bbox [$data(hdrTxt) bbox 1.0] set viewChanged 1 } incr baseX [lindex $bbox 0] if {$viewChanged} { $data(hdrTxt) yview 1 } set lastVisibleCol -1 for {set col 0} {$col < $data(colCount)} {incr col} { if {$data($col-elide) || $data($col-hide)} { continue } |
︙ | ︙ | |||
3644 3645 3646 3647 3648 3649 3650 | } set activeLine [expr {$data(activeRow) + 1}] set activeCol $data(activeCol) if {[string compare $data(-selecttype) "row"] == 0} { $w tag add active $activeLine.0 $activeLine.end updateColors $win $activeLine.0 $activeLine.end | | | | 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 | } set activeLine [expr {$data(activeRow) + 1}] set activeCol $data(activeCol) if {[string compare $data(-selecttype) "row"] == 0} { $w tag add active $activeLine.0 $activeLine.end updateColors $win $activeLine.0 $activeLine.end } elseif {$activeLine > 0 && $activeCol >= 0 && $activeCol < $data(colCount) && !$data($activeCol-hide)} { $w tag add curRow $activeLine.0 $activeLine.end findTabs $win $w $activeLine $activeCol $activeCol tabIdx1 tabIdx2 variable pu $w tag add active $tabIdx1 $tabIdx2+1$pu updateColors $win $activeLine.0 $activeLine.end } } |
︙ | ︙ | |||
5974 5975 5976 5977 5978 5979 5980 | catch { set state [$w cget -state] if {[string compare $state "disabled"] == 0} { set labelFg [$w cget -disabledforeground] } elseif {[string compare $state "active"] == 0} { variable winSys | | | | 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 | catch { set state [$w cget -state] if {[string compare $state "disabled"] == 0} { set labelFg [$w cget -disabledforeground] } elseif {[string compare $state "active"] == 0} { variable winSys if {[string compare $winSys "classic"] != 0 && [string compare $winSys "aqua"] != 0 && $::tk_version > 8.4} { set labelBg [$w cget -activebackground] set labelFg [$w cget -activeforeground] } } } } |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tablelistWidget.tcl.
︙ | ︙ | |||
145 146 147 148 149 150 151 152 153 154 155 156 157 158 | -populatecommand {populateCommand PopulateCommand w} -protecttitlecolumns {protectTitleColumns ProtectTitleColumns w} -relief {relief Relief f} -resizablecolumns {resizableColumns ResizableColumns w} -resizecursor {resizeCursor ResizeCursor w} -selectbackground {selectBackground Foreground w} -selectborderwidth {selectBorderWidth BorderWidth w} -selectforeground {selectForeground Background w} -selectmode {selectMode SelectMode w} -selecttype {selectType SelectType w} -setfocus {setFocus SetFocus w} -setgrid {setGrid SetGrid w} -showarrow {showArrow ShowArrow w} -showbusycursor {showBusyCursor ShowBusyCursor w} | > | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | -populatecommand {populateCommand PopulateCommand w} -protecttitlecolumns {protectTitleColumns ProtectTitleColumns w} -relief {relief Relief f} -resizablecolumns {resizableColumns ResizableColumns w} -resizecursor {resizeCursor ResizeCursor w} -selectbackground {selectBackground Foreground w} -selectborderwidth {selectBorderWidth BorderWidth w} -selectfiltercommand {selectFilterCommand SelectFilterCommand w} -selectforeground {selectForeground Background w} -selectmode {selectMode SelectMode w} -selecttype {selectType SelectType w} -setfocus {setFocus SetFocus w} -setgrid {setGrid SetGrid w} -showarrow {showArrow ShowArrow w} -showbusycursor {showBusyCursor ShowBusyCursor w} |
︙ | ︙ | |||
230 231 232 233 234 235 236 237 238 239 240 241 242 243 | -labelpady {labelPadY Pad } -labelrelief {labelRelief Relief } -labelvalign {labelValign Valign } -maxwidth {maxWidth MaxWidth } -name {name Name } -resizable {resizable Resizable } -selectbackground {selectBackground Foreground } -selectforeground {selectForeground Background } -showarrow {showArrow ShowArrow } -showlinenumbers {showLineNumbers ShowLineNumbers } -sortcommand {sortCommand SortCommand } -sortmode {sortMode SortMode } -stretchable {stretchable Stretchable } -stripebackground {stripeBackground Background } | > | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | -labelpady {labelPadY Pad } -labelrelief {labelRelief Relief } -labelvalign {labelValign Valign } -maxwidth {maxWidth MaxWidth } -name {name Name } -resizable {resizable Resizable } -selectbackground {selectBackground Foreground } -selectfiltercommand {selectFilterCommand SelectFilterCommand } -selectforeground {selectForeground Background } -showarrow {showArrow ShowArrow } -showlinenumbers {showLineNumbers ShowLineNumbers } -sortcommand {sortCommand SortCommand } -sortmode {sortMode SortMode } -stretchable {stretchable Stretchable } -stripebackground {stripeBackground Background } |
︙ | ︙ | |||
785 786 787 788 789 790 791 792 793 794 795 796 797 798 | rowTagRefCount 0 cellTagRefCount 0 imgCount 0 winCount 0 indentCount 0 afterId "" labelClicked 0 arrowColList {} sortColList {} sortOrder "" editKey "" editRow -1 editCol -1 canceled 0 | > | 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | rowTagRefCount 0 cellTagRefCount 0 imgCount 0 winCount 0 indentCount 0 afterId "" labelClicked 0 labelModifClicked 0 arrowColList {} sortColList {} sortOrder "" editKey "" editRow -1 editCol -1 canceled 0 |
︙ | ︙ | |||
815 816 817 818 819 820 821 | root-parent "" root-childList {} keyToRowMapValid 1 searchStartIdx 0 keyBeingExpanded "" justEntered 0 inEditWin 0 | < | 818 819 820 821 822 823 824 825 826 827 828 829 830 831 | root-parent "" root-childList {} keyToRowMapValid 1 searchStartIdx 0 keyBeingExpanded "" justEntered 0 inEditWin 0 } # # The following array is used to hold arbitrary # attributes and their values for this widget # variable attribs |
︙ | ︙ | |||
1405 1406 1407 1408 1409 1410 1411 | } else { foreach {firstRow firstCol} [cellIndex $win $first 0] {} foreach {lastRow lastCol} \ [cellIndex $win [lindex $argList 2] 0] {} cellSelection $win $opt $firstRow $firstCol $lastRow $lastCol } | | | 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 | } else { foreach {firstRow firstCol} [cellIndex $win $first 0] {} foreach {lastRow lastCol} \ [cellIndex $win [lindex $argList 2] 0] {} cellSelection $win $opt $firstRow $firstCol $lastRow $lastCol } updateColorsWhenIdle $win invokeMotionHandler $win return "" } } } #------------------------------------------------------------------------------ |
︙ | ︙ | |||
5376 5377 5378 5379 5380 5381 5382 | } } else { set first [rowIndex $win $first 0] set last [rowIndex $win [lindex $argList 2] 0] rowSelection $win $opt $first $last } | | | 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 | } } else { set first [rowIndex $win $first 0] set last [rowIndex $win [lindex $argList 2] 0] rowSelection $win $opt $first $last } updateColorsWhenIdle $win invokeMotionHandler $win return "" } } } #------------------------------------------------------------------------------ |
︙ | ︙ | |||
6362 6363 6364 6365 6366 6367 6368 | {$col < $data(colCount)} {incr col} { set selStates($key,$col) 1 } } } } | < | 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 | {$col < $data(colCount)} {incr col} { set selStates($key,$col) 1 } } } } return "" } includes { set key [lindex $data(keyList) $firstRow] return [expr {[info exists selStates($key)] && $firstCol >= 0 && $firstCol < $data(colCount) || |
︙ | ︙ | |||
6432 6433 6434 6435 6436 6437 6438 | # when it loses ownership of the PRIMARY selection # if {$data(-exportselection) && [array size selStates] != 0} { selection own -command \ [list ::tablelist::lostSelection $win] $win } | < | 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 | # when it loses ownership of the PRIMARY selection # if {$data(-exportselection) && [array size selStates] != 0} { selection own -command \ [list ::tablelist::lostSelection $win] $win } return "" } } } #------------------------------------------------------------------------------ # tablelist::colWidth |
︙ | ︙ | |||
8389 8390 8391 8392 8393 8394 8395 | for {set row $first} {$row <= $last} {incr row} { set key [lindex $data(keyList) $row] arrayUnset selStates $key arrayUnset selStates $key,* } } | < | 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 | for {set row $first} {$row <= $last} {incr row} { set key [lindex $data(keyList) $row] arrayUnset selStates $key arrayUnset selStates $key,* } } return "" } includes { set key [lindex $data(keyList) $first] return [expr {([info exists selStates($key)] || [llength [array names selStates $key,*]] != 0) && |
︙ | ︙ | |||
8439 8440 8441 8442 8443 8444 8445 | # if {$data(-exportselection) && [array size selStates] != 0 && $data(colCount) != 0} { selection own -command \ [list ::tablelist::lostSelection $win] $win } | < | 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 | # if {$data(-exportselection) && [array size selStates] != 0 && $data(colCount) != 0} { selection own -command \ [list ::tablelist::lostSelection $win] $win } return "" } } } #------------------------------------------------------------------------------ # tablelist::horizMoveTo |
︙ | ︙ | |||
8737 8738 8739 8740 8741 8742 8743 | } #------------------------------------------------------------------------------ # tablelist::lostSelection # # This procedure is invoked when the tablelist widget win loses ownership of # the PRIMARY selection. It deselects all items of the widget with the aid of | | | | 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 | } #------------------------------------------------------------------------------ # tablelist::lostSelection # # This procedure is invoked when the tablelist widget win loses ownership of # the PRIMARY selection. It deselects all items of the widget with the aid of # the selectionSubCmd procedure if the selection is exported. #------------------------------------------------------------------------------ proc tablelist::lostSelection win { upvar ::tablelist::ns${win}::data data if {$data(-exportselection)} { selectionSubCmd $win [list clear 0 $data(lastRow)] event generate $win <<TablelistSelectionLost>> } } #------------------------------------------------------------------------------ # tablelist::activeTrace # |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/scripts/tclIndex.
︙ | ︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | set auto_index(::tablelist::cellInRect) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::firstViewableRow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::lastViewableRow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::firstViewableCol) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::lastViewableCol) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::condChangeSelection) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::changeSelection) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistHeader) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_handleMotionDelayed) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_handleMotion) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_showOrHideTooltip) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistLabel) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistSubLabel) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistArrow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelEnter) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelLeave) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Motion) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Enter) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Leave) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Up) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB3Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelDblB1) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::escape) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::horizAutoScan) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::inResizeArea) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::extendConfigSpecs) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doCget) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doColConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doColCget) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doRowConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doRowCget) [list source [file join $dir tablelistConfig.tcl]] | > > > > > > > > > > > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | set auto_index(::tablelist::cellInRect) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::firstViewableRow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::lastViewableRow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::firstViewableCol) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::lastViewableCol) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::condChangeSelection) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::changeSelection) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::genTablelistSelectEvent) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistHeader) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_handleMotionDelayed) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_handleMotion) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::hdr_showOrHideTooltip) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistLabel) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistSubLabel) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::defineTablelistArrow) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelEnter) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelLeave) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Motion) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Enter) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Leave) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB1Up) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelB3Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelDblB1) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::escape) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::horizAutoScan) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::inResizeArea) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelModifB1Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelModifB1Motion) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelModifB1Up) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelModifShiftB1Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::labelModifCtrlB1Down) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::selectColRange) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::deselectColRange) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::firstSelCellOfCol) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::isColSelected) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::wasColSelected) [list source [file join $dir tablelistBind.tcl]] set auto_index(::tablelist::extendConfigSpecs) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doCget) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doColConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doColCget) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doRowConfig) [list source [file join $dir tablelistConfig.tcl]] set auto_index(::tablelist::doRowCget) [list source [file join $dir tablelistConfig.tcl]] |
︙ | ︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | set auto_index(::tablelist::goLeftRight) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goUpDown) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goToPrevNextLine) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goToPriorNextPage) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::isKeyReserved) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::hasMouseWheelBindings) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::isComboTopMapped) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::flat5x3Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat5x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat6x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x5Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x7Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat8x4Arrows) [list source [file join $dir tablelistImages.tcl]] | > | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | set auto_index(::tablelist::goLeftRight) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goUpDown) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goToPrevNextLine) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::goToPriorNextPage) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::isKeyReserved) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::hasMouseWheelBindings) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::isComboTopMapped) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::isMenuPosted) [list source [file join $dir tablelistEdit.tcl]] set auto_index(::tablelist::flat5x3Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat5x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat6x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x4Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x5Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat7x7Arrows) [list source [file join $dir tablelistImages.tcl]] set auto_index(::tablelist::flat8x4Arrows) [list source [file join $dir tablelistImages.tcl]] |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/tablelist.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Main Tablelist package module. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8 | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #============================================================================== # Main Tablelist package module. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8 package require -exact tablelist::common 6.6 package provide tablelist $::tablelist::version package provide Tablelist $::tablelist::version ::tablelist::useTile 0 ::tablelist::createBindings |
Changes to assets/tklib0.6/tablelist/tablelistPublic.tcl.
︙ | ︙ | |||
20 21 22 23 24 25 26 | return 200 } } # # Public variables: # | | | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | return 200 } } # # Public variables: # variable version 6.6 variable library if {$::tcl_version >= 8.4} { set library [file normalize [DIR]] } else { set library [DIR] ;# no "file normalize" yet } variable scalingpct [scalingPercentage] |
︙ | ︙ |
Changes to assets/tklib0.6/tablelist/tablelist_tile.tcl.
1 2 3 4 5 6 7 8 9 10 | #============================================================================== # Main Tablelist_tile package module. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} { package require tile 0.6 } | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #============================================================================== # Main Tablelist_tile package module. # # Copyright (c) 2000-2019 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} { package require tile 0.6 } package require -exact tablelist::common 6.6 package provide tablelist_tile $::tablelist::version package provide Tablelist_tile $::tablelist::version ::tablelist::useTile 1 ::tablelist::createBindings |
︙ | ︙ |