Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Scrollutil: Updated for version 2.5. See the ChangeLog for details. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8d9c4fd92ef56bfc3528d70e4e7c999e |
User & Date: | csaba 2025-03-20 19:13:05.117 |
Context
2025-03-21
| ||
10:06 | Scrollutil: Updated the file CHANGES.txt. check-in: 3c4c5c6f96 user: csaba tags: trunk | |
2025-03-20
| ||
19:13 | Scrollutil: Updated for version 2.5. See the ChangeLog for details. check-in: 8d9c4fd92e user: csaba tags: trunk | |
14:08 | Tablelist: Updated for version 7.5. See the ChangeLog for details. check-in: 6bd0090cf0 user: csaba tags: trunk | |
Changes
Changes to examples/scrollutil/BwScrollableFrmContent.tcl.
1 2 3 4 | #============================================================================== # Populates the content frame of the BWidget ScrollableFrame widget created in # the demo script BwScrollableFrmDemo2.tcl. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | #============================================================================== # Populates the content frame of the BWidget ScrollableFrame widget created in # the demo script BwScrollableFrmDemo2.tcl. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Create some widgets in the content frame # # |
︙ | ︙ | |||
244 245 246 247 248 249 250 | pack $sa -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrollarea # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | pack $sa -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrollarea # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ -command [list configTablelist $tbl]] set b2 [ttk::button $bf.b2 -text "Close" -command exit] pack $b2 -side right -padx 7p -pady {0 7p} pack $b1 -side left -padx 7p -pady {0 7p} pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both |
︙ | ︙ | |||
293 294 295 296 297 298 299 | [winfo reqheight $cf.sa1] + 2*[winfo pixels . 7p]}] $sf configure -width $width -height $height \ -yscrollincrement [expr {[winfo reqheight $lb] / 10}] } #------------------------------------------------------------------------------ | | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | [winfo reqheight $cf.sa1] + 2*[winfo pixels . 7p]}] $sf configure -width $width -height $height \ -yscrollincrement [expr {[winfo reqheight $lb] / 10}] } #------------------------------------------------------------------------------ proc configTablelist tbl { set top .top if {[winfo exists $top]} { raise $top focus $top return "" } |
︙ | ︙ | |||
336 337 338 339 340 341 342 | # set cf [$sf getframe] # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # | | > | 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | # set cf [$sf getframe] # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # global tswLoaded set tswLoaded [expr {[catch {package require tsw}] == 0}] set row 0 foreach configSet [$tbl configure] { if {[llength $configSet] != 5} { continue } set opt [lindex $configSet 0] |
︙ | ︙ | |||
380 381 382 383 384 385 386 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] | | | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] bind $w <<ComboboxSelected>> [list applyValue %W $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::combobox widget # scrollutil::adaptWheelEventHandling $w |
︙ | ︙ | |||
414 415 416 417 418 419 420 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { | > > > > | | | | > > < < | | | | 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 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { if {$tswLoaded} { tsw::toggleswitch $w $w switchstate [$tbl cget $opt] } else { ttk::checkbutton $w upvar #0 $w var set var [$tbl cget $opt] $w configure -text [expr {$var ? "on": "off"}] } $w configure -command [list applyBoolean $w $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} } -borderwidth - -height - -labelborderwidth - -labelpady - -selectborderwidth - -spacing - -stripeheight - -titlecolumns - -treecolumn - -width { ttk::spinbox $w -from 0 -to 999 -width 4 -command \ [list applyValue $w $tbl $opt] $w set [$tbl cget $opt] $w configure -invalidcommand bell -validate key \ -validatecommand \ {expr {[string length %P] <= 3 && [regexp {^[0-9]*$} %S]}} foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::spinbox widget # scrollutil::adaptWheelEventHandling $w } default { ttk::entry $w -width 25 $w insert 0 [$tbl cget $opt] foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky we -padx 3p -pady {3p 0} } } # # Make the keyboard navigation more user-friendly |
︙ | ︙ | |||
489 490 491 492 493 494 495 | # Set the ScrollableFrame's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ | | < | | > > > | < | > > | 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 | # Set the ScrollableFrame's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ proc applyValue {w tbl opt} { if {[catch {$tbl configure $opt [$w get]} result] != 0} { bell tk_messageBox -title "Error" -icon error -message $result \ -parent [winfo toplevel $w] ### $w set [$tbl cget $opt] ;# not supported by ttk::entry $w delete 0 end; $w insert 0 [$tbl cget $opt] } } #------------------------------------------------------------------------------ proc applyBoolean {w tbl opt} { global tswLoaded if {$tswLoaded} { $tbl configure $opt [$w switchstate] } else { upvar #0 $w var $w configure -text [expr {$var ? "on" : "off"}] $tbl configure $opt $var } } #------------------------------------------------------------------------------ proc configTopSf {sf cf row} { set width [winfo reqwidth $cf] set rowHeight [expr {[winfo reqheight $cf] / $row}] set height [expr {10*$rowHeight + [winfo pixels .top 3p]}] $sf configure -width $width -height $height -yscrollincrement $rowHeight } |
Changes to examples/scrollutil/ScrolledFrmContent.tcl.
1 2 3 4 | #============================================================================== # Populates the content frame of the iwidgets::scrolledframe widget created in # the demo script ScrolledFrmDemo2.tcl. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | #============================================================================== # Populates the content frame of the iwidgets::scrolledframe widget created in # the demo script ScrolledFrmDemo2.tcl. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Create some widgets in the content frame # # |
︙ | ︙ | |||
244 245 246 247 248 249 250 | pack $sf -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrolledframe # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | pack $sf -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrolledframe # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ -command [list configTablelist $tbl]] set b2 [ttk::button $bf.b2 -text "Close" -command exit] pack $b2 -side right -padx 7p -pady {0 7p} pack $b1 -side left -padx 7p -pady {0 7p} pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both |
︙ | ︙ | |||
296 297 298 299 300 301 302 | set canvas [$sf component canvas] $canvas configure -yscrollincrement [expr {[winfo reqheight $lb] / 10}] after 100 [list $sf configure -hscrollmode dynamic] } #------------------------------------------------------------------------------ | | | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | set canvas [$sf component canvas] $canvas configure -yscrollincrement [expr {[winfo reqheight $lb] / 10}] after 100 [list $sf configure -hscrollmode dynamic] } #------------------------------------------------------------------------------ proc configTablelist tbl { set top .top if {[winfo exists $top]} { raise $top focus $top return "" } |
︙ | ︙ | |||
340 341 342 343 344 345 346 | set cf [$sf childsite] $cf configure -background $::bg # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # | | > | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | set cf [$sf childsite] $cf configure -background $::bg # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # global tswLoaded set tswLoaded [expr {[catch {package require tsw}] == 0}] set row 0 foreach configSet [$tbl configure] { if {[llength $configSet] != 5} { continue } set opt [lindex $configSet 0] |
︙ | ︙ | |||
384 385 386 387 388 389 390 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] | | | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] bind $w <<ComboboxSelected>> [list applyValue %W $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::combobox widget # scrollutil::adaptWheelEventHandling $w |
︙ | ︙ | |||
418 419 420 421 422 423 424 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { | > > > > | | | | > > < < | | | | 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 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { if {$tswLoaded} { tsw::toggleswitch $w $w switchstate [$tbl cget $opt] } else { ttk::checkbutton $w upvar #0 $w var set var [$tbl cget $opt] $w configure -text [expr {$var ? "on": "off"}] } $w configure -command [list applyBoolean $w $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} } -borderwidth - -height - -labelborderwidth - -labelpady - -selectborderwidth - -spacing - -stripeheight - -titlecolumns - -treecolumn - -width { ttk::spinbox $w -from 0 -to 999 -width 4 -command \ [list applyValue $w $tbl $opt] $w set [$tbl cget $opt] $w configure -invalidcommand bell -validate key \ -validatecommand \ {expr {[string length %P] <= 3 && [regexp {^[0-9]*$} %S]}} foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::spinbox widget # scrollutil::adaptWheelEventHandling $w } default { ttk::entry $w -width 25 $w insert 0 [$tbl cget $opt] foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky we -padx 3p -pady {3p 0} } } incr row } |
︙ | ︙ | |||
488 489 490 491 492 493 494 | # Set the scrolledframe's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ | | < | | > > > | < | > > | 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 | # Set the scrolledframe's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ proc applyValue {w tbl opt} { if {[catch {$tbl configure $opt [$w get]} result] != 0} { bell tk_messageBox -title "Error" -icon error -message $result \ -parent [winfo toplevel $w] ### $w set [$tbl cget $opt] ;# not supported by ttk::entry $w delete 0 end; $w insert 0 [$tbl cget $opt] } } #------------------------------------------------------------------------------ proc applyBoolean {w tbl opt} { global tswLoaded if {$tswLoaded} { $tbl configure $opt [$w switchstate] } else { upvar #0 $w var $w configure -text [expr {$var ? "on" : "off"}] $tbl configure $opt $var } } #------------------------------------------------------------------------------ proc configTopSf {sf cf row} { set vsb [$sf component vertsb] set width [expr {[winfo reqwidth $cf] + [winfo reqwidth $vsb] + 2}] set rowHeight [expr {[winfo reqheight $cf] / $row}] set height [expr {10*$rowHeight + [winfo pixels .top 3p] + 2}] $sf configure -width $width -height $height set canvas [$sf component canvas] $canvas configure -yscrollincrement $rowHeight } |
Changes to examples/scrollutil/SuScrollableFrmContent.tcl.
1 2 3 4 | #============================================================================== # Populates the content frame of the scrollutil::scrollableframe widget created # in the demo script SuScrollableFrmDemo2.tcl. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 | #============================================================================== # Populates the content frame of the scrollutil::scrollableframe widget created # in the demo script SuScrollableFrmDemo2.tcl. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Create some widgets in the content frame # # |
︙ | ︙ | |||
244 245 246 247 248 249 250 | pack $sa -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrollarea # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ | | | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | pack $sa -expand yes -fill both -padx 7p -pady 7p # # Create two ttk::button widgets within a frame outside the scrollarea # set bf [ttk::frame .bf] set b1 [ttk::button $bf.b1 -text "Configure Tablelist Widget" \ -command [list configTablelist $tbl]] set b2 [ttk::button $bf.b2 -text "Close" -command exit] pack $b2 -side right -padx 7p -pady {0 7p} pack $b1 -side left -padx 7p -pady {0 7p} pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both |
︙ | ︙ | |||
293 294 295 296 297 298 299 | [winfo reqheight $cf.sa1] + 2*[winfo pixels . 7p]}] $sf configure -width $width -height $height \ -yscrollincrement [expr {[winfo reqheight $lb] / 10}] } #------------------------------------------------------------------------------ | | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | [winfo reqheight $cf.sa1] + 2*[winfo pixels . 7p]}] $sf configure -width $width -height $height \ -yscrollincrement [expr {[winfo reqheight $lb] / 10}] } #------------------------------------------------------------------------------ proc configTablelist tbl { set top .top if {[winfo exists $top]} { raise $top focus $top return "" } |
︙ | ︙ | |||
321 322 323 324 325 326 327 | # set cf [$sf contentframe] # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # | | > | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | # set cf [$sf contentframe] # # Create some widgets in the content frame, corresponding # to the configuration options of the tablelist widget # global tswLoaded set tswLoaded [expr {[catch {package require tsw}] == 0}] set row 0 foreach configSet [$tbl configure] { if {[llength $configSet] != 5} { continue } set opt [lindex $configSet 0] |
︙ | ︙ | |||
365 366 367 368 369 370 371 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] | | | 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | -treestyle { set values $tablelist::treeStyles ;# dirty, but safe } } $w configure -values $values $w set [$tbl cget $opt] bind $w <<ComboboxSelected>> [list applyValue %W $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::combobox widget # scrollutil::adaptWheelEventHandling $w |
︙ | ︙ | |||
399 400 401 402 403 404 405 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { | > > > > | | | | > > < < | | | | 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 | -showarrow - -showbusycursor - -showeditcursor - -showhorizseparator - -showlabels - -showseparators - -tight { if {$tswLoaded} { tsw::toggleswitch $w $w switchstate [$tbl cget $opt] } else { ttk::checkbutton $w upvar #0 $w var set var [$tbl cget $opt] $w configure -text [expr {$var ? "on": "off"}] } $w configure -command [list applyBoolean $w $tbl $opt] grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} } -borderwidth - -height - -labelborderwidth - -labelpady - -selectborderwidth - -spacing - -stripeheight - -titlecolumns - -treecolumn - -width { ttk::spinbox $w -from 0 -to 999 -width 4 -command \ [list applyValue $w $tbl $opt] $w set [$tbl cget $opt] $w configure -invalidcommand bell -validate key \ -validatecommand \ {expr {[string length %P] <= 3 && [regexp {^[0-9]*$} %S]}} foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky w -padx 3p -pady {3p 0} # # Adapt the handling of the mouse wheel # events for the ttk::spinbox widget # scrollutil::adaptWheelEventHandling $w } default { ttk::entry $w -width 25 $w insert 0 [$tbl cget $opt] foreach event {<Return> <KP_Enter> <FocusOut>} { bind $w $event [list applyValue %W $tbl $opt] } grid $w -row $row -column 1 -sticky we -padx 3p -pady {3p 0} } } # # Make the keyboard navigation more user-friendly |
︙ | ︙ | |||
474 475 476 477 478 479 480 | # Set the scrollableframe's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ | | < | | > > > | < | > > | 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 | # Set the scrollableframe's width, height, and yscrollincrement # after 50 [list configTopSf $sf $cf $row] } #------------------------------------------------------------------------------ proc applyValue {w tbl opt} { if {[catch {$tbl configure $opt [$w get]} result] != 0} { bell tk_messageBox -title "Error" -icon error -message $result \ -parent [winfo toplevel $w] ### $w set [$tbl cget $opt] ;# not supported by ttk::entry $w delete 0 end; $w insert 0 [$tbl cget $opt] } } #------------------------------------------------------------------------------ proc applyBoolean {w tbl opt} { global tswLoaded if {$tswLoaded} { $tbl configure $opt [$w switchstate] } else { upvar #0 $w var $w configure -text [expr {$var ? "on" : "off"}] $tbl configure $opt $var } } #------------------------------------------------------------------------------ proc configTopSf {sf cf row} { set width [winfo reqwidth $cf] set rowHeight [expr {[winfo reqheight $cf] / $row}] set height [expr {10*$rowHeight + [winfo pixels .top 3p]}] $sf configure -width $width -height $height -yscrollincrement $rowHeight } |
Changes to modules/scrollutil/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 | What is new in Scrollutil 2.5? ------------------------------ 1. Improvements in the error handling for the scrollednotebook and plainnotebook widgets. 2. Improved the keyboard traversal via "Shift-Tab" for all scrollutil::* widgets by refining the handling of the <FocusIn> event when the detail field is "NotifyInferior" (whose support was introduced in Tk 8.6.15, 8.7b1, and 9.0.0). 3. The scaleutil package now also scales the "-sashthickness" and "-gripsize" options of the "Sash" style. 4. The demo scripts "BwScrollableFrmDemo2.tcl", "ScrolledFrmDemo2.tcl", and "SuScrollableFrmDemo2.tcl" now use toggleswitch widgets rather than checkbuttons if they can load the Tsw package. What was new in Scrollutil 2.4? ------------------------------- 1. Made sure that the Migration Tool for Tcl 9 by Ashok Nadkarni won't output any warnings or notes (thanks to Andreas Kupries for his valuable input). 2. Minor improvements in the handling of the "closetab" style element. |
︙ | ︙ |
Changes to modules/scrollutil/COPYRIGHT.txt.
|
| | | 1 2 3 4 5 6 7 8 | Scrolling utilities package Scrollutil 2.5 Copyright (c) 2019-2024 Csaba Nemethi (E-mail: [email protected]) 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 modules/scrollutil/ChangeLog.
1 2 3 4 5 6 7 | 2024-11-29 Csaba Nemethi <[email protected]> * Released Scrollutil 2.4. 2024-10-19 Csaba Nemethi <[email protected]> * *.tcl: Bumped the version number to 2.4. | > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | 2025-03-20 Csaba Nemethi <[email protected]> * *.tcl: Bumped the version number to 2.5. * COPYRIGHT.txt: * README.txt: * CHANGES.txt: Updated to reflect the changes. * doc/*.html: * scripts/*.tcl: Improvements in the error handling for the scrollednotebook and plainnotebook widgets; improved the keyboard traversal via "Shift-Tab" for all scrollutil::* widgets by refining the handling of the <FocusIn> event when the detail field is "NotifyInferior". * scripts/tclIndex: Newly generated. * scripts/utils/*.tcl: Extensions in the packages mwutil and scaleutil. * doc/ScrollableFrmDemo2.png: Updated screenshot. * doc/TablelistConfig2.png: Added screenshot. * ../../examples/scrollutil/*FrmContent.tcl: These scripts now use toggleswitch widgets rather than checkbuttons if they can load the Tsw package. 2024-11-29 Csaba Nemethi <[email protected]> * Released Scrollutil 2.4. 2024-10-19 Csaba Nemethi <[email protected]> * *.tcl: Bumped the version number to 2.4. |
︙ | ︙ |
Changes to modules/scrollutil/README.txt.
︙ | ︙ | |||
41 42 43 44 45 46 47 | How to Get It? -------------- Scrollutil is available for free download from the Web page https://www.nemethi.de | | | | < < | | | | | | | | | | 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 | How to Get It? -------------- Scrollutil is available for free download from the Web page https://www.nemethi.de The distribution file is "scrollutil2.5.tar.gz" for UNIX and "scrollutil2_5.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. Scrollutil is also included in tklib, which has the address https://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 subdirectory of the "lib" directory within your Tcl/Tk installation. To install Scrollutil on UNIX, "cd" to the desired directory and unpack the distribution file "scrollutil2.5.tar.gz": gunzip -c scrollutil2.5.tar.gz | tar -xf - On most UNIX systems this can be replaced with tar -zxf scrollutil2.5.tar.gz Both commands will create a directory named "scrollutil2.5", with the subdirectories "demos", "doc", and "scripts". On Windows, use WinZip or some other program capable of unpacking the distribution file "scrollutil2_5.zip" into the directory "scrollutil2.5", 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, scrollsync, and scrollableframe widgets, and provides the themed scrollednotebook and plainnotebook widgets; this package requires tile 0.8 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 (except for the commands "scrollutil::scrollednotebook", "scrollutil::plainnotebook", "scrollutil::addclosetab", "scrollutil::removeclosetab", and "scrollutil::closetabstate", which are provided by the Scrollutil_tile package only). To be able to use the commands and variables implemented in the Scrollutil package, 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 Scrollutil_tile package, 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. |
Changes to modules/scrollutil/doc/ScrollableFrmDemo2.png.
cannot compute difference between binary files
Added modules/scrollutil/doc/TablelistConfig2.png.
cannot compute difference between binary files
Changes to modules/scrollutil/doc/index.html.
1 2 3 | <!DOCTYPE html> <html> <head> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html> <html> <head> <title>The Scrolling Utilities Package Scrollutil 2.5</title> <meta name="Author" content="Csaba Nemethi"> <meta name="Keywords" content= "mouse wheel event, binding, event handling, scrolling, scrollable widget container, focus, scrollarea, scrollsync, scrollableframe"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The Scrolling Utilities Package Scrollutil 2.5</h1> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/pagesman.html.
︙ | ︙ | |||
9 10 11 12 13 14 15 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::pagesman</b></code> Command</h1> | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::pagesman</b></code> Command</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/plainnotebook.html.
︙ | ︙ | |||
9 10 11 12 13 14 15 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::plainnotebook</b></code> Command</h1> | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::plainnotebook</b></code> Command</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ | |||
543 544 545 546 547 548 549 | </table> <blockquote> <p>This option determines whether the plainnotebook widget accepts the focus during keyboard traversal. It is almost identical to the standard option of the same name (see the <b>options</b> manual entry for details). The only difference is that not the plainnotebook | | | | | | | 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | </table> <blockquote> <p>This option determines whether the plainnotebook widget accepts the focus during keyboard traversal. It is almost identical to the standard option of the same name (see the <b>options</b> manual entry for details). The only difference is that not the plainnotebook widget itself but the content frame of the scrollableframe contained in it will receive the focus during keyboard traversal with the standard keys (<code>Tab</code> and <code>Shift-Tab</code>). The default is <code>"ttk::takefocus"</code> (just like for ttk::notebook and several other Tk themed widgets).</p> </blockquote> </dd> <dd id="title"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td>Command-Line Name: </td> |
︙ | ︙ |
Changes to modules/scrollutil/doc/scrollableframe.html.
︙ | ︙ | |||
9 10 11 12 13 14 15 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::scrollableframe</b></code> Command</h1> | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>The <code><b>scrollutil::scrollableframe</b></code> Command</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/scrollarea.html.
︙ | ︙ | |||
11 12 13 14 15 16 17 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollarea</b></code> and<br> <code><b>scrollutil::getscrollarea</b></code> Commands</h1> | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollarea</b></code> and<br> <code><b>scrollutil::getscrollarea</b></code> Commands</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/scrollednotebook.html.
︙ | ︙ | |||
12 13 14 15 16 17 18 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollednotebook</b></code> Command<br> and the <code><b>closetab</b></code> Style Element</h1> | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollednotebook</b></code> Command<br> and the <code><b>closetab</b></code> Style Element</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/scrollsync.html.
︙ | ︙ | |||
11 12 13 14 15 16 17 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollsync</b></code> and<br> <code><b>scrollutil::getscrollsync</b></code> Commands</h1> | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | </head> <body> <div> <h1>The <code><b>scrollutil::scrollsync</b></code> and<br> <code><b>scrollutil::getscrollsync</b></code> Commands</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/doc/scrollutil.html.
︙ | ︙ | |||
10 11 12 13 14 15 16 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>Scrollutil Programmer's Guide</h1> | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div> <h1>Scrollutil Programmer's Guide</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ | |||
315 316 317 318 319 320 321 | <blockquote> <address> <a href="https://www.nemethi.de">https://www.nemethi.de</a> </address> </blockquote> | | | | < < | | | | | | | | 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 | <blockquote> <address> <a href="https://www.nemethi.de">https://www.nemethi.de</a> </address> </blockquote> <p>The distribution file is <code>scrollutil2.5.tar.gz</code> for UNIX and <code>scrollutil2_5.zip</code> 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.</p> <p>Scrollutil is also included in tklib, which has the address</p> <blockquote> <address> <a href="https://core.tcl.tk/tklib">https://core.tcl.tk/tklib</a> </address> </blockquote> <h3 id="ov_install">How to Install It?</h3> <p>Install the package as a subdirectory of one of the directories given by the <code>auto_path</code> variable. For example, you can install it as a subdirectory of the <code>lib</code> directory within your Tcl/Tk installation.</p> <p>To install Scrollutil <i>on UNIX</i>, <code>cd</code> to the desired directory and unpack the distribution file <code>scrollutil2.5.tar.gz</code>:</p> <blockquote> <pre> gunzip -c scrollutil2.5.tar.gz | tar -xf - </pre> </blockquote> <p>On most UNIX systems this can be replaced with</p> <blockquote> <pre> tar -zxf scrollutil2.5.tar.gz </pre> </blockquote> <p>Both commands will create a directory named <code>scrollutil2.5</code>, with the subdirectories <code>demos</code>, <code>doc</code>, and <code>scripts</code>.</p> <p><i>On Windows</i>, use WinZip or some other program capable of unpacking the distribution file <code>scrollutil2_5.zip</code> into the directory <code>scrollutil2.5</code>, with the subdirectories <code>demos</code>, <code>doc</code>, and <code>scripts</code>.</p> <p>Notice that in tklib the Scrollutil <code>demos</code> directory is replaced with the subdirectory <code>scrollutil</code> of the <code>examples</code> directory. Please take this into account when reading the <a href="#examples">examples</a> below.</p> |
︙ | ︙ | |||
386 387 388 389 390 391 392 | in the same <code>scrollutil</code> namespace and provide identical commands (except for the commands <code>scrollutil::scrollednotebook</code>, <code>scrollutil::plainnotebook</code>, <code>scrollutil::addclosetab</code>, <code>scrollutil::removeclosetab</code>, and <code>scrollutil::closetabstate</code>, which are provided by the Scrollutil_tile package only).</p> | | | | | 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 | in the same <code>scrollutil</code> namespace and provide identical commands (except for the commands <code>scrollutil::scrollednotebook</code>, <code>scrollutil::plainnotebook</code>, <code>scrollutil::addclosetab</code>, <code>scrollutil::removeclosetab</code>, and <code>scrollutil::closetabstate</code>, which are provided by the Scrollutil_tile package only).</p> <p>To be able to access the commands and variables defined in the Scrollutil package, your scripts must contain one of the lines</p> <blockquote> <pre> package require scrollutil ?<i>version</i>? package require Scrollutil ?<i>version</i>? </pre> </blockquote> <p>You can use either one of the two statements above because the file <code>scrollutil.tcl</code> contains both lines</p> <blockquote> <pre> package provide scrollutil ... package provide Scrollutil ... </pre> </blockquote> <p>Likewise, to be able to access the commands and variables defined in the Scrollutil_tile package, your scripts must contain one of the lines</p> <blockquote> <pre> package require scrollutil_tile ?<i>version</i>? package require Scrollutil_tile ?<i>version</i>? </pre> </blockquote> |
︙ | ︙ | |||
458 459 460 461 462 463 464 | <li>The variable <code>scrollutil::version</code> holds the current version number of the Scrollutil package.</li> <li>The variable <code>scrollutil::library</code> holds the location of the Scrollutil installation directory.</li> <li>The read-only variable <code>scrollutil::scalingpct</code> is set when | | | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | <li>The variable <code>scrollutil::version</code> holds the current version number of the Scrollutil package.</li> <li>The variable <code>scrollutil::library</code> holds the location of the Scrollutil installation directory.</li> <li>The read-only variable <code>scrollutil::scalingpct</code> is set when loading the Scrollutil or Scrollutil_tile package via <code>package require</code> to the scaling percentage corresponding to the display's DPI scaling level. Scrollutil adapts, among others, the default width of the Tk core scrollbars on X11 and that of the ttk::scrollbar widget for the built-in themes <code>alt</code>, <code>clam</code>, <code>classic</code>, and <code>default</code> to the value of this variable. The currently supported values are <code>100</code>, <code>125</code>, <code>150</code>, <code>175</code>, and |
︙ | ︙ | |||
481 482 483 484 485 486 487 | or 8.6 and the tksvg extension can be loaded into the interpreter, then the variable <code>scrollutil::svgfmt</code> is set to a Tcl list that you can pass to the commands that create or manipulate SVG images as the value of their <code>-format</code> option to make sure that your images will be properly scaled.</li> <li>The read-only variable <code>scrollutil::usingTile</code> has the value | | | 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | or 8.6 and the tksvg extension can be loaded into the interpreter, then the variable <code>scrollutil::svgfmt</code> is set to a Tcl list that you can pass to the commands that create or manipulate SVG images as the value of their <code>-format</code> option to make sure that your images will be properly scaled.</li> <li>The read-only variable <code>scrollutil::usingTile</code> has the value <code>0</code> in the Scrollutil package and the value <code>1</code> in Scrollutil_tile.</li> </ul> <p>The Scrollutil_tile package checks whether the required Tk and tile versions are present, by executing the commands</p> <blockquote> |
︙ | ︙ | |||
679 680 681 682 683 684 685 | <li class="tm">the default length of the ttk::scale and ttk::progressbar widgets;</li> <li class="tm">for the built-in themes <code>alt</code> and <code>default</code>, some styling options of the ttk::scrollbar, ttk::scale, ttk::progressbar, ttk::combobox, ttk::spinbox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, | | | | | | | | 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 | <li class="tm">the default length of the ttk::scale and ttk::progressbar widgets;</li> <li class="tm">for the built-in themes <code>alt</code> and <code>default</code>, some styling options of the ttk::scrollbar, ttk::scale, ttk::progressbar, ttk::combobox, ttk::spinbox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, and ttk::treeview widgets;</li> <li class="tm">for the built-in theme <code>clam</code>, some styling options of the ttk::scrollbar, ttk::scale, ttk::progressbar, ttk::combobox, ttk::spinbox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, ttk::treeview, and ttk::labelframe widgets;</li> <li class="tm">for the built-in theme <code>classic</code>, some styling options of the ttk::scrollbar, ttk::scale, ttk::progressbar, ttk::combobox, ttk::spinbox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, and ttk::treeview widgets;</li> <li class="tm">for the built-in theme <code>vista</code>, some styling options of the ttk::combobox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, and ttk::treeview widgets;</li> <li class="tm">for the built-in theme <code>winnative</code>, some styling options of the ttk::scale, ttk::progressbar, ttk::combobox, ttk::spinbox, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, and ttk::treeview widgets;</li> <li class="tm">for the built-in theme <code>xpnative</code>, some styling options of the ttk::combobox, ttk::spinbox, ttk::button, toolbutton, ttk::menubutton, ttk::checkbutton, ttk::radiobutton, ttk::notebook, ttk::panedwindow, and ttk::treeview widgets.</li> </ul> <p>In addition, the procedure <code>scaleutil::scalingPercentage</code> makes sure that in the <code>vista</code> and <code>xpnative</code> themes the indicators of the ttk::checkbutton and ttk::radiobutton widgets will appear properly scaled, regardless of the Tk release being used. (A long-standing bug in the implementation of these widgets was fixed in May |
︙ | ︙ | |||
1768 1769 1770 1771 1772 1773 1774 | <code>-command</code> option. This procedure opens a toplevel window that contains a <a href= "scrollableframe.html">scrollutil::scrollableframe</a> widget created with the <code><a href= "scrollableframe.html#fitcontentwidth">-fitcontentwidth</a> yes</code> setting within a <a href="scrollarea.html">scrollarea</a>. After that it populates the content frame of the scrollableframe with ttk::label, | | | > > > | | | | > > | | > > > > | 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 | <code>-command</code> option. This procedure opens a toplevel window that contains a <a href= "scrollableframe.html">scrollutil::scrollableframe</a> widget created with the <code><a href= "scrollableframe.html#fitcontentwidth">-fitcontentwidth</a> yes</code> setting within a <a href="scrollarea.html">scrollarea</a>. After that it populates the content frame of the scrollableframe with ttk::label, ttk::combobox, ttk::spinbox, ttk::entry, and ttk::checkbutton or tsw::toggleswitch widgets used to display and edit the configuration options of the tablelist widget. If the toggle switch widget package Tsw can be loaded into the interpreter then we use toggleswitch widgets rather than checkbuttons. The procedure handles the <code><<TraverseIn>></code> virtual event sent to one of these widgets with the aid of the scrollableframe's <code><a href= "scrollableframe.html#see">see</a></code> subcommand. Whenever a ttk::combobox or ttk::spinbox is created, the <code><a href= "wheelEvent.html#adapt">scrollutil::adaptWheelEventHandling</a></code> command is invoked for it, being that these widgets have built-in bindings for the mouse wheel and <code><TouchpadScroll></code> events.</p> <p>The widgets populating the content frame are managed using <code>grid</code>. In case of the ttk::entry widgets we invoke <code>grid</code> with <code>-sticky we</code>. Due to this and the <code>-fitcontentwidth yes</code> scrollableframe setting, the ttk::entry widgets will stretch or shrink whenever the width of the scrollableframe changes as a result of resizing the toplevel window.</p> <blockquote> <table border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td><img src="TablelistConfig.png" alt="TablelistConfig" width="431" height="414"></td> <td><img src="TablelistConfig2.png" alt="TablelistConfig2" width="431" height="414"></td> </tr> </table> </blockquote> <h3 id="ex_BwScrollableFrameDemo2">A Script Using Two BWidget ScrollableFrame Widgets</h3> <p>The script <code>BwScrollableFrmDemo2.tcl</code> in the <code>demos</code> directory creates a BWidget ScrollableFrame embedded into a <a href= |
︙ | ︙ |
Changes to modules/scrollutil/doc/wheelEvent.html.
︙ | ︙ | |||
12 13 14 15 16 17 18 | </head> <body> <div> <h1>Commands Related to Mouse Wheel and <code><b><TouchpadScroll></b></code> Event Handling</h1> | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | </head> <body> <div> <h1>Commands Related to Mouse Wheel and <code><b><TouchpadScroll></b></code> Event Handling</h1> <h2>For Scrollutil Version 2.5</h2> <h3>by</h3> <h2>Csaba Nemethi</h2> <address> <a href="mailto:[email protected]">[email protected]</a> |
︙ | ︙ |
Changes to modules/scrollutil/pkgIndex.tcl.
1 2 3 | #============================================================================== # Scrollutil and Scrollutil_tile package index file. # | | | | | | | | | | 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-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Regular packages: # package ifneeded scrollutil 2.5 \ [list source [file join $dir scrollutil.tcl]] package ifneeded scrollutil_tile 2.5 \ [list source [file join $dir scrollutil_tile.tcl]] # # Aliases: # package ifneeded Scrollutil 2.5 \ [list package require -exact scrollutil 2.5] package ifneeded Scrollutil_tile 2.5 \ [list package require -exact scrollutil_tile 2.5] # # Code common to all packages: # package ifneeded scrollutil::common 2.5 \ [list source [file join $dir scrollutilCommon.tcl]] |
Deleted modules/scrollutil/scripts/attrib.tcl.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to modules/scrollutil/scripts/pagesman.tcl.
1 2 3 4 5 6 7 8 9 10 11 | #============================================================================== # Contains the implementation of the pagesman widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new pagesman widget # - Private configuration procedures # - Private procedures implementing the pagesman widget command # - Private procedures used in bindings # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #============================================================================== # Contains the implementation of the pagesman widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new pagesman widget # - Private configuration procedures # - Private procedures implementing the pagesman widget command # - Private procedures used in bindings # # Copyright (c) 2021-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
123 124 125 126 127 128 129 | #------------------------------------------------------------------------------ # scrollutil::pm::createBindings # # Creates the default bindings for the binding tag Pagesman. #------------------------------------------------------------------------------ proc scrollutil::pm::createBindings {} { bind Pagesman <KeyPress> continue | | | < < | < < > | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | #------------------------------------------------------------------------------ # scrollutil::pm::createBindings # # Creates the default bindings for the binding tag Pagesman. #------------------------------------------------------------------------------ proc scrollutil::pm::createBindings {} { bind Pagesman <KeyPress> continue bind Pagesman <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Pagesman <FocusIn> { scrollutil::pm::onFocusIn %W %d } bind Pagesman <Map> { scrollutil::pm::resizeWidgetDelayed %W 100 } bind Pagesman <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} } } # |
︙ | ︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | # namespace eval ns$win { # # The following array holds various data for this widget # variable data array set data { pageList {} paddingList {} stickyList {} pageCount 0 currentPage "" delay 0 } | > | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | # namespace eval ns$win { # # The following array holds various data for this widget # variable data array set data { traversedIn 0 pageList {} paddingList {} stickyList {} pageCount 0 currentPage "" delay 0 } |
︙ | ︙ | |||
355 356 357 358 359 360 361 362 363 364 365 366 367 368 | mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] switch $cmd { add { if {$argCount < 2} { mwutil::wrongNumArgs \ "$win $cmd window ?option value option value ...?" } | > | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { add { if {$argCount < 2} { mwutil::wrongNumArgs \ "$win $cmd window ?option value option value ...?" } |
︙ | ︙ | |||
409 410 411 412 413 414 415 | mwutil::wrongNumArgs "$win $cmd" } return [resizeWidget $win 1] } attrib { | | < | < | 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 | mwutil::wrongNumArgs "$win $cmd" } return [resizeWidget $win 1] } attrib { return [::scrollutil::attribSubCmd $win "widget" $argList] } cget { if {$argCount != 2} { mwutil::wrongNumArgs "$win $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 $win configSpecs \ scrollutil::pm::doConfig scrollutil::pm::doCget $argList] } forget { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd pageIndex" } |
︙ | ︙ | |||
458 459 460 461 462 463 464 | set data(pageList) [lreplace $data(pageList) $pageIdx $pageIdx] set data(paddingList) \ [lreplace $data(paddingList) $pageIdx $pageIdx] set data(stickyList) [lreplace $data(stickyList) $pageIdx $pageIdx] incr data(pageCount) -1 upvar ::scrollutil::ns${win}::attribs attribs | < | < | 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | set data(pageList) [lreplace $data(pageList) $pageIdx $pageIdx] set data(paddingList) \ [lreplace $data(paddingList) $pageIdx $pageIdx] set data(stickyList) [lreplace $data(stickyList) $pageIdx $pageIdx] incr data(pageCount) -1 upvar ::scrollutil::ns${win}::attribs attribs array unset attribs $widget-* if {$widget eq $data(currentPage)} { # # Select the next/previous page # if {$pageIdx < $data(pageCount)} { ::$win select $pageIdx |
︙ | ︙ | |||
752 753 754 755 756 757 758 759 760 761 762 763 764 765 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::pm::resizeWidgetDelayed #------------------------------------------------------------------------------ proc scrollutil::pm::resizeWidgetDelayed {win ms {force 0}} { upvar ::scrollutil::ns${win}::data data if {![info exists data(afterId)]} { | > > > > > > > > > > > > > > > > > > > | 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 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::pm::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::pm::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus $data(currentPage) } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::pm::resizeWidgetDelayed #------------------------------------------------------------------------------ proc scrollutil::pm::resizeWidgetDelayed {win ms {force 0}} { upvar ::scrollutil::ns${win}::data data if {![info exists data(afterId)]} { |
︙ | ︙ |
Changes to modules/scrollutil/scripts/plainnotebook.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 | #============================================================================== # Contains the implementation of the plainnotebook widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new plainnotebook widget # - Private configuration procedures # - Private procedures implementing the plainnotebook widget command # - Private procedures used in bindings # - Private utility procedures # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #============================================================================== # Contains the implementation of the plainnotebook widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new plainnotebook widget # - Private configuration procedures # - Private procedures implementing the plainnotebook widget command # - Private procedures used in bindings # - Private utility procedures # # Copyright (c) 2021-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
277 278 279 280 281 282 283 | # scrollutil::pnb::createBindings # # Creates the default bindings for the binding tags Plainnotebook, # PlainnotebookMain, PnbTab, PnbRadiobtn, PnbMiddleFrame, and PnbContentFrame. #------------------------------------------------------------------------------ proc scrollutil::pnb::createBindings {} { bind Plainnotebook <KeyPress> continue | | | < | < > | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | # scrollutil::pnb::createBindings # # Creates the default bindings for the binding tags Plainnotebook, # PlainnotebookMain, PnbTab, PnbRadiobtn, PnbMiddleFrame, and PnbContentFrame. #------------------------------------------------------------------------------ proc scrollutil::pnb::createBindings {} { bind Plainnotebook <KeyPress> continue bind Plainnotebook <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Plainnotebook <FocusIn> { scrollutil::pnb::onFocusIn %W %d } bind Plainnotebook <Map> { scrollutil::pnb::onPlainnotebookMap %W } bind Plainnotebook <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} } bind Plainnotebook <<TkWorldChanged>> { if {"%d" eq "FontChanged"} { scrollutil::pnb::onFontChanged %W |
︙ | ︙ | |||
425 426 427 428 429 430 431 | variable pnb::configOpts if {[llength $args] == 0} { mwutil::wrongNumArgs "plainnotebook pathName ?options?" } # | | | 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | variable pnb::configOpts if {[llength $args] == 0} { mwutil::wrongNumArgs "plainnotebook pathName ?options?" } # # Create a ttk::frame of the class Plainnotebook # set win [lindex $args 0] if {[catch { ttk::frame $win -class Plainnotebook -borderwidth 0 -relief flat \ -height 0 -width 0 -padding 0 } result] != 0} { return -code error $result |
︙ | ︙ | |||
463 464 465 466 467 468 469 | set data($opt) [lindex $configSpecs($opt) 3] } # # Create a frame with the ascend toolbutton, # the title label, and a separator as children # | | | | | > | 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 | set data($opt) [lindex $configSpecs($opt) 3] } # # Create a frame with the ascend toolbutton, # the title label, and a separator as children # set frm [ttk::frame $win.frm -padding 0 -takefocus 0] pnb::configFrame $win.frm if {[lsearch -exact [image names] "scrollutil_ascendImg"] < 0} { createAscendImage } set ascend [ttk::button $frm.ascend -style Toolbutton \ -image scrollutil_ascendImg] set title [ttk::label $frm.title -style PnbTitle.TLabel] set sep [ttk::separator $frm.sep] # # Create a scrollableframe within a scrollarea, # which in turn is a child of the above frame # set sa [scrollarea $frm.sa -borderwidth 0 -relief flat] set charWidth [font measure TkDefaultFont -displayof $win "0"] set sf [scrollableframe $sa.sf -borderwidth 0 -contentheight 0 \ -contentwidth 0 -fitcontentheight 0 -fitcontentwidth 0 -height 0 \ -relief flat -takefocus 0 -xscrollincrement $charWidth \ -yscrollincrement 0 -width 0] $sa setwidget $sf if {$::tcl_platform(platform) ne "windows" || ($::tk_version >= 8.6 && [package vcompare $::tk_patchLevel "8.6b2"] >= 0)} { disableScrollingByWheel $sf } grid $ascend -row 0 -column 0 -padx {1.5p 0} -pady 1.5p grid $title -row 0 -column 1 -sticky w -padx 3p -pady 1.5p grid $sep -columnspan 2 -sticky we grid $sa -columnspan 2 -sticky nswe grid rowconfigure $frm 2 -weight 1 grid columnconfigure $frm 1 -weight 1 grid remove $ascend $title $sep # # Create a plain ttk::notebook widget and deactivate # the TNotebook keyboard bindings for it # set nb [ttk::notebook $win.nb -style Plainnotebook.TNotebook -takefocus 0] foreach event {<Right> <Left> <Control-Tab> <Control-Shift-Tab>} { bind $nb $event break } catch {bind $nb <Control-ISO_Left_Tab> break} pack $frm -side left -fill y pack $nb -side left -expand 1 -fill both array set data [list \ traversedIn 0 \ sf $sf \ cf [$sf contentframe] \ cfWidth 0 \ rbCount 0 \ auxCount 0 \ currentPage "" \ ] |
︙ | ︙ | |||
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data set nb $win.nb variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { add { set widget [lindex $args 1] set tabIdx [lsearch -exact [$nb tabs] $widget] if {[set isNew [expr {$tabIdx < 0}]]} { set tabIdx [$nb index end] } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | > | | 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 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data set nb $win.nb set mapping [list $nb $win] variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { add { set widget [lindex $args 1] set tabIdx [lsearch -exact [$nb tabs] $widget] if {[set isNew [expr {$tabIdx < 0}]]} { set tabIdx [$nb index end] } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$isNew} { set rb [ttk::radiobutton $data(cf).rb$data(rbCount) \ -style $data(rbStyle) \ -command [list $nb select $widget] -value $widget \ -variable ::scrollutil::ns${win}::data(selectedPage)] |
︙ | ︙ | |||
825 826 827 828 829 830 831 832 833 834 835 836 837 838 | set aux [ttk::separator $data(cf).$name -takefocus 0] grid $aux -sticky we incr data(auxCount) bindtags $aux [linsert [bindtags $aux] 1 PnbTab] return $aux } attrib { return [::scrollutil::attribSubCmd $win "widget" $argList] } cget { if {$argCount != 2} { | > > > > > > > > | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | set aux [ttk::separator $data(cf).$name -takefocus 0] grid $aux -sticky we incr data(auxCount) bindtags $aux [linsert [bindtags $aux] 1 PnbTab] return $aux } adjustsize { if {$argCount != 1} { mwutil::wrongNumArgs "$win $cmd" } return [adjustsizeSubCmd $win] } attrib { return [::scrollutil::attribSubCmd $win "widget" $argList] } cget { if {$argCount != 2} { |
︙ | ︙ | |||
896 897 898 899 900 901 902 | if {[set forgetCmd $data(-forgetcommand)] ne "" && ![uplevel #0 $forgetCmd [list $win $widget]]} { return 0 } } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | | | 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 | if {[set forgetCmd $data(-forgetcommand)] ne "" && ![uplevel #0 $forgetCmd [list $win $widget]]} { return 0 } } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } upvar ::scrollutil::ns${win}::attribs attribs array unset attribs $widget-* destroy $tabPath return 1 |
︙ | ︙ | |||
942 943 944 945 946 947 948 | hide { if {[catch {::$win index [lindex $args 1]} tabIdx] == 0 && $tabIdx >= 0 && $tabIdx < [$nb index end]} { set widget [lindex [$nb tabs] $tabIdx] set tabPath [widgetToTab $win $widget] } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | | | 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | hide { if {[catch {::$win index [lindex $args 1]} tabIdx] == 0 && $tabIdx >= 0 && $tabIdx < [$nb index end]} { set widget [lindex [$nb tabs] $tabIdx] set tabPath [widgetToTab $win $widget] } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } grid remove $tabPath return "" } index { |
︙ | ︙ | |||
979 980 981 982 983 984 985 | } incr tabIdx } return "" } else { | | | > > > | | 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | } incr tabIdx } return "" } else { if {[catch {$nb $cmd $tabId} result] != 0} { return -code error [string map $mapping $result] } return $result } } insert { set widget [lindex $args 2] set isNew [expr {[lsearch -exact [$nb tabs] $widget] < 0}] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$isNew} { set rb [ttk::radiobutton $data(cf).rb$data(rbCount) \ -style $data(rbStyle) \ -command [list $nb select $widget] -value $widget \ -variable ::scrollutil::ns${win}::data(selectedPage)] |
︙ | ︙ | |||
1111 1112 1113 1114 1115 1116 1117 | mwutil::wrongNumArgs "$win $cmd stateSpec ?script?" } set stateSpec [lindex $args 1] if {$argCount == 2} { return [$nb instate $stateSpec] } elseif {[$nb instate $stateSpec]} { | | > < < < < < < < < | | > > > | | 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 | mwutil::wrongNumArgs "$win $cmd stateSpec ?script?" } set stateSpec [lindex $args 1] if {$argCount == 2} { return [$nb instate $stateSpec] } elseif {[$nb instate $stateSpec]} { set code [catch {uplevel 1 [lindex $args 2]} result] return -code $code $result } else { return "" } } see { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd tabId" } set tabId [lindex $args 1] if {[catch {::$win index $tabId} tabIdx] != 0} { return -code error $tabIdx } elseif {$tabIdx < 0 || $tabIdx >= [$nb index end]} { return -code error "tab index $tabId out of bounds" } set widget [lindex [$nb tabs] $tabIdx] set tabPath [widgetToTab $win $widget] $data(sf) see $tabPath return "" } select - tabs { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } return $result } state { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$argCount > 1} { set stateSpec [expr { [$nb instate disabled] ? "disabled" : "!disabled"}] foreach w [list $win.frm.ascend $win.frm.title $win.frm.sep] { $w state $stateSpec |
︙ | ︙ | |||
1184 1185 1186 1187 1188 1189 1190 | set widget [lindex [$nb tabs] $tabIdx] if {$widget ne ""} { set tabPath [widgetToTab $win $widget] set tabClass [winfo class $tabPath] } } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | | | 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 | set widget [lindex [$nb tabs] $tabIdx] if {$widget ne ""} { set tabPath [widgetToTab $win $widget] set tabClass [winfo class $tabPath] } } if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$argCount == 2} { set idx [expr {[lsearch -exact $result "-state"] + 1}] set state [lindex $result $idx] if {$state eq "disabled" && $tabClass ne "TRadiobutton"} { set state [expr {[$tabPath instate disabled] ? |
︙ | ︙ | |||
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::pnb::onPlainnotebookMap #------------------------------------------------------------------------------ proc scrollutil::pnb::onPlainnotebookMap win { onNbTabChanged $win.nb 0 bind $win.nb <<NotebookTabChanged>> { scrollutil::pnb::onNbTabChanged %W 1 } | > > > > > > > > > > > > > > > > > > > | 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::pnb::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::pnb::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus $data(cf) } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::pnb::onPlainnotebookMap #------------------------------------------------------------------------------ proc scrollutil::pnb::onPlainnotebookMap win { onNbTabChanged $win.nb 0 bind $win.nb <<NotebookTabChanged>> { scrollutil::pnb::onNbTabChanged %W 1 } |
︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 | # whether the menu exists and has items # if {![winfo exists $menu] || [winfo class $menu] ne "Menu" || [$menu index end] eq "none"} { return "" } # # For awthemes: # catch {ttk::theme::[mwutil::currentTheme]::setMenuColors $menu} tk_popup $menu $rootX $rootY } | > > > > | 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 | # whether the menu exists and has items # if {![winfo exists $menu] || [winfo class $menu] ne "Menu" || [$menu index end] eq "none"} { return "" } set bg [ttk::style lookup . -background] set fg [ttk::style lookup . -foreground] $menu configure -background $bg -foreground $fg # # For awthemes: # catch {ttk::theme::[mwutil::currentTheme]::setMenuColors $menu} tk_popup $menu $rootX $rootY } |
︙ | ︙ |
Changes to modules/scrollutil/scripts/scrollableframe.tcl.
1 2 3 4 5 6 7 8 9 10 11 | #============================================================================== # Contains the implementation of the scrollableframe widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new scrollableframe widget # - Private configuration procedures # - Private procedures implementing the scrollableframe widget command # - Private procedures used in bindings # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #============================================================================== # Contains the implementation of the scrollableframe widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedure creating a new scrollableframe widget # - Private configuration procedures # - Private procedures implementing the scrollableframe widget command # - Private procedures used in bindings # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
129 130 131 132 133 134 135 | # scrollutil::sf::createBindings # # Creates the default bindings for the binding tags Scrollableframe, # ScrollableframeMf, and ScrollableframeCf. #------------------------------------------------------------------------------ proc scrollutil::sf::createBindings {} { bind Scrollableframe <KeyPress> continue | | | < | < > | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | # scrollutil::sf::createBindings # # Creates the default bindings for the binding tags Scrollableframe, # ScrollableframeMf, and ScrollableframeCf. #------------------------------------------------------------------------------ proc scrollutil::sf::createBindings {} { bind Scrollableframe <KeyPress> continue bind Scrollableframe <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Scrollableframe <FocusIn> { scrollutil::sf::onFocusIn %W %d } bind Scrollableframe <Map> { scrollutil::sf::updateHorizPlaceOpts %W scrollutil::sf::updateVertPlaceOpts %W } bind Scrollableframe <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} |
︙ | ︙ | |||
207 208 209 210 211 212 213 214 215 216 217 218 219 220 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { autoFillX 0 autoFillY 0 xOffset 0 cfWidth 0 cfReqWidth 0 mfWidth 0 yOffset 0 | > | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { traversedIn 0 autoFillX 0 autoFillY 0 xOffset 0 cfWidth 0 cfReqWidth 0 mfWidth 0 yOffset 0 |
︙ | ︙ | |||
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::sf::onScrollableframeMfConfigure #------------------------------------------------------------------------------ proc scrollutil::sf::onScrollableframeMfConfigure {mf mfWidth mfHeight} { set win [winfo parent $mf] upvar ::scrollutil::ns${win}::data data | > > > > > > > > > > > > > > > > > > > | 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | } } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::sf::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::sf::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus $data(cf) } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::sf::onScrollableframeMfConfigure #------------------------------------------------------------------------------ proc scrollutil::sf::onScrollableframeMfConfigure {mf mfWidth mfHeight} { set win [winfo parent $mf] upvar ::scrollutil::ns${win}::data data |
︙ | ︙ |
Changes to modules/scrollutil/scripts/scrollarea.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #============================================================================== # Contains the implementation of the scrollarea widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures creating or querying a scrollarea widget # - Private configuration procedures # - Private procedures implementing the scrollarea widget command # - Private callback procedures # - Private procedures used in bindings # - Private utility procedures # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #============================================================================== # Contains the implementation of the scrollarea widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures creating or querying a 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-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
171 172 173 174 175 176 177 | # scrollutil::sa::createBindings # # Creates the default bindings for the binding tags Scrollarea, ScrollareaTop, # ScrollareaScrollbar, DynamicHScrollbar, and WidgetOfScrollarea. #------------------------------------------------------------------------------ proc scrollutil::sa::createBindings {} { bind Scrollarea <KeyPress> continue | | | < | < > | | | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | # scrollutil::sa::createBindings # # Creates the default bindings for the binding tags Scrollarea, ScrollareaTop, # ScrollareaScrollbar, DynamicHScrollbar, and WidgetOfScrollarea. #------------------------------------------------------------------------------ proc scrollutil::sa::createBindings {} { bind Scrollarea <KeyPress> continue bind Scrollarea <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Scrollarea <FocusIn> { scrollutil::sa::onFocusIn %W %d } bind Scrollarea <Configure> { scrollutil::sa::onScrollareaConfigure %W %w %h } bind Scrollarea <Enter> { scrollutil::sa::onScrollareaEnter %W } bind Scrollarea <Leave> { scrollutil::sa::onScrollareaLeave %W } bind Scrollarea <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} } bind ScrollareaTop <Configure> { after 100 [list set scrollutil::sa::topWidthArr(%W) %w] |
︙ | ︙ | |||
265 266 267 268 269 270 271 272 273 274 275 276 277 278 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { height 1 width 1 hsbManaged 0 vsbManaged 0 hsbLocked 0 vsbLocked 0 hsbLockTime 0 | > | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { traversedIn 0 height 1 width 1 hsbManaged 0 vsbManaged 0 hsbLocked 0 vsbLocked 0 hsbLockTime 0 |
︙ | ︙ | |||
565 566 567 568 569 570 571 572 573 574 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } variable cmdOpts set cmd [mwutil::fullOpt "option" [lindex $args 0] $cmdOpts] switch $cmd { attrib { | > | < | < | 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 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } variable cmdOpts set cmd [mwutil::fullOpt "option" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { attrib { return [::scrollutil::attribSubCmd $win "widget" $argList] } cget { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd option" } # # Return the value of the specified configuration option # upvar ::scrollutil::ns${win}::data data variable configSpecs set opt [mwutil::fullConfigOpt [lindex $args 1] configSpecs] return $data($opt) } configure { variable configSpecs return [mwutil::configureSubCmd $win configSpecs \ scrollutil::sa::doConfig scrollutil::sa::doCget $argList] } hasattrib - unsetattrib { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd name" } |
︙ | ︙ | |||
802 803 804 805 806 807 808 809 810 811 812 813 814 815 | updateHScrollbar $win } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::sa::onScrollareaConfigure #------------------------------------------------------------------------------ proc scrollutil::sa::onScrollareaConfigure {win width height} { upvar ::scrollutil::ns${win}::data data | > > > > > > > > > > > > > > > > > > > | 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 826 827 828 829 830 831 832 833 | updateHScrollbar $win } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::sa::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::sa::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus $data(widget) } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::sa::onScrollareaConfigure #------------------------------------------------------------------------------ proc scrollutil::sa::onScrollareaConfigure {win width height} { upvar ::scrollutil::ns${win}::data data |
︙ | ︙ |
Changes to modules/scrollutil/scripts/scrollednotebook.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #============================================================================== # Contains the implementation of the scrollednotebook widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures # - Private configuration procedures # - Private procedures implementing the scrollednotebook widget command # - Private callback procedure # - Private procedures used in bindings # - Private utility procedures # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #============================================================================== # Contains the implementation of the scrollednotebook widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures # - Private configuration procedures # - Private procedures implementing the scrollednotebook widget command # - Private callback procedure # - Private procedures used in bindings # - Private utility procedures # # Copyright (c) 2021-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
131 132 133 134 135 136 137 | # Creates the default bindings for the binding tags Scrollednotebook, # ScrollednotebookMain, SnbNb, SnbLArrow, and SnbRArrow, and extends the # default bindings for TNotebook. In addition, creates a <Destroy> binding for # the binding tag DisabledClosetab. #------------------------------------------------------------------------------ proc scrollutil::snb::createBindings {} { bind Scrollednotebook <KeyPress> continue | | | < | < > | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | # Creates the default bindings for the binding tags Scrollednotebook, # ScrollednotebookMain, SnbNb, SnbLArrow, and SnbRArrow, and extends the # default bindings for TNotebook. In addition, creates a <Destroy> binding for # the binding tag DisabledClosetab. #------------------------------------------------------------------------------ proc scrollutil::snb::createBindings {} { bind Scrollednotebook <KeyPress> continue bind Scrollednotebook <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Scrollednotebook <FocusIn> { scrollutil::snb::onFocusIn %W %d } bind Scrollednotebook <Map> { after 100 [list scrollutil::snb::onScrollednotebookMap %W] } bind Scrollednotebook <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} } |
︙ | ︙ | |||
242 243 244 245 246 247 248 | variable snb::configOpts if {[llength $args] == 0} { mwutil::wrongNumArgs "scrollednotebook pathName ?options?" } # | | | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | variable snb::configOpts if {[llength $args] == 0} { mwutil::wrongNumArgs "scrollednotebook pathName ?options?" } # # Create a ttk::frame of the class Scrollednotebook # set win [lindex $args 0] if {[catch { ttk::frame $win -class Scrollednotebook -borderwidth 0 -relief flat \ -height 0 -width 0 -padding 0 } result] != 0} { return -code error $result |
︙ | ︙ | |||
292 293 294 295 296 297 298 | # set sf [scrollableframe $win.sf -borderwidth 0 -contentheight 0 \ -contentwidth 0 -fitcontentheight 1 -relief flat -takefocus 0 \ -xscrollincrement 1 -yscrollcommand "" -yscrollincrement 1] $sf autofillx 1 ;# sets/clears the -fitcontentwidth option dynamically pack $sf -expand 1 -fill both set cf [$sf contentframe] | | | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | # set sf [scrollableframe $win.sf -borderwidth 0 -contentheight 0 \ -contentwidth 0 -fitcontentheight 1 -relief flat -takefocus 0 \ -xscrollincrement 1 -yscrollcommand "" -yscrollincrement 1] $sf autofillx 1 ;# sets/clears the -fitcontentwidth option dynamically pack $sf -expand 1 -fill both set cf [$sf contentframe] set nb [ttk::notebook $cf.nb -height 0 -width 0 -takefocus 0] pack $nb -expand 1 -fill both bindtags $nb [linsert [bindtags $nb] 1 SnbNb] # # Create the left and right arrow buttons # |
︙ | ︙ | |||
316 317 318 319 320 321 322 323 324 325 326 327 328 329 | # set f [ttk::frame $win.f -borderwidth 0 -relief flat \ -height 0 -width 0 -padding 0 -takefocus 0] place $f -bordermode outside -relwidth 1.0 -relheight 1.0 lower $f array set data [list \ sf $sf \ cf $cf \ nb $nb \ lArrow $lArrow \ rArrow $rArrow \ arrowAction 0 \ currentPage "" \ | > | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | # set f [ttk::frame $win.f -borderwidth 0 -relief flat \ -height 0 -width 0 -padding 0 -takefocus 0] place $f -bordermode outside -relwidth 1.0 -relheight 1.0 lower $f array set data [list \ traversedIn 0 \ sf $sf \ cf $cf \ nb $nb \ lArrow $lArrow \ rArrow $rArrow \ arrowAction 0 \ currentPage "" \ |
︙ | ︙ | |||
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data set nb $data(nb) variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { add { set widget [lindex $args 1] set isNew [expr {[lsearch -exact [$nb tabs] $widget] < 0}] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | > | | 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 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } upvar ::scrollutil::ns${win}::data data set nb $data(nb) set mapping [list $nb $win] variable cmdOpts set cmd [mwutil::fullOpt "command" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { add { set widget [lindex $args 1] set isNew [expr {[lsearch -exact [$nb tabs] $widget] < 0}] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$isNew || [lsearch -glob $args "-p*"] >= 2} { savePaddings $win $widget updateNbWidth $win } return "" |
︙ | ︙ | |||
699 700 701 702 703 704 705 | if {[set forgetCmd $data(-forgetcommand)] ne "" && ![uplevel #0 $forgetCmd [list $win $widget]]} { return 0 } } if {[catch {$nb $cmd $nbTabId} result] != 0} { | | | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | if {[set forgetCmd $data(-forgetcommand)] ne "" && ![uplevel #0 $forgetCmd [list $win $widget]]} { return 0 } } if {[catch {$nb $cmd $nbTabId} result] != 0} { return -code error [string map $mapping $result] } upvar ::scrollutil::ns${win}::attribs attribs array unset attribs $widget-* forgetPaddings $win $widget updateNbWidth $win |
︙ | ︙ | |||
728 729 730 731 732 733 734 | if {$argCount != 3} { mwutil::wrongNumArgs "$win $cmd tab name" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { | | | | > > > | | | > > > | | 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 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 | if {$argCount != 3} { mwutil::wrongNumArgs "$win $cmd tab name" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { return -code error [string map $mapping $tabIdx] } elseif {$tabIdx < 0 || $tabIdx >= [$nb index end]} { return -code error "tab index $tabId out of bounds" } set first [string first "tab" $cmd] set last [expr {$first + 2}] set cmd [string replace $cmd $first $last] ;# (has|unset)attrib set widget [lindex [$nb tabs] $tabIdx] return [::scrollutil::${cmd}SubCmd $win $widget [lindex $args 2]] } hide { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd tab" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb $cmd $nbTabId} result] != 0} { return -code error [string map $mapping $result] } return $result } identify { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } set xIdx [expr {$argCount - 3}] set x [lindex $argList $xIdx] foreach {first last} [$data(sf) xview] {} set cfWidth [winfo width $data(cf)] incr x [expr {int($first * $cfWidth + 0.5)}] set argList [lreplace $argList $xIdx $xIdx $x] return [eval [list $nb $cmd] $argList] } index { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd tab" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb $cmd $nbTabId} result] != 0} { return -code error [string map $mapping $result] } return $result } insert { set widget [lindex $args 2] set isNew [expr {[lsearch -exact [$nb tabs] $widget] < 0}] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$isNew || [lsearch -glob $args "-p*"] >= 3} { savePaddings $win $widget updateNbWidth $win } if {[::$win index $widget] == [::$win index current]} { |
︙ | ︙ | |||
802 803 804 805 806 807 808 | mwutil::wrongNumArgs "$win $cmd stateSpec ?script?" } set stateSpec [lindex $args 1] if {$argCount == 2} { return [$nb instate $stateSpec] } elseif {[$nb instate $stateSpec]} { | | > | 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | mwutil::wrongNumArgs "$win $cmd stateSpec ?script?" } set stateSpec [lindex $args 1] if {$argCount == 2} { return [$nb instate $stateSpec] } elseif {[$nb instate $stateSpec]} { set code [catch {uplevel 1 [lindex $args 2]} result] return -code $code $result } else { return "" } } notebookpath { if {$argCount != 1} { |
︙ | ︙ | |||
824 825 826 827 828 829 830 | if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd tab" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { | | | | 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd tab" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { return -code error [string map $mapping $tabIdx] } elseif {$tabIdx < 0 || $tabIdx >= [$nb index end]} { return -code error "tab index $tabId out of bounds" } set code [catch {seeSubCmd $win $tabIdx} result] return -code $code $result } select { switch $argCount { 1 { return [$nb $cmd] } 2 { set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { return -code error [string map $mapping $tabIdx] } elseif {$tabIdx < 0 || $tabIdx >= [$nb index end]} { return -code error "tab index $tabId out of bounds" } # # Adjust the horizontal padding of the pane corresponding # to $tabIdx prior to selecting the tab -- this will |
︙ | ︙ | |||
866 867 868 869 870 871 872 | } default { mwutil::wrongNumArgs "$win $cmd ?tab?" } } } state { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | | | 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 | } default { mwutil::wrongNumArgs "$win $cmd ?tab?" } } } state { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } if {$argCount > 1} { set stateSpec [expr { [$nb instate disabled] ? "disabled" : "!disabled"}] foreach w [list $data(lArrow) $data(rArrow)] { $w state $stateSpec |
︙ | ︙ | |||
900 901 902 903 904 905 906 | "$win $cmd tab ?option ?value option value ...??" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] set argList [lreplace $argList 0 0 $nbTabId] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { | | | 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 | "$win $cmd tab ?option ?value option value ...??" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] set argList [lreplace $argList 0 0 $nbTabId] if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } set tabIdx [$nb index $nbTabId] if {$argCount == 2} { set idx [expr {[lsearch -exact $result "-padding"] + 1}] set result \ [lreplace $result $idx $idx [origPadding $win $tabIdx]] |
︙ | ︙ | |||
927 928 929 930 931 932 933 | mwutil::wrongNumArgs \ "$win $cmd tab ?name ?value name value ...??" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { | | | | > > > | 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 | mwutil::wrongNumArgs \ "$win $cmd tab ?name ?value name value ...??" } set tabId [lindex $args 1] set nbTabId [snbTabIdToNbTabId $win $tabId] if {[catch {$nb index $nbTabId} tabIdx] != 0} { return -code error [string map $mapping $tabIdx] } elseif {$tabIdx < 0 || $tabIdx >= [$nb index end]} { return -code error "tab index $tabId out of bounds" } set widget [lindex [$nb tabs] $tabIdx] return [::scrollutil::attribSubCmd $win $widget \ [lrange $args 2 end]] } tabs { if {[catch {eval [list $nb $cmd] $argList} result] != 0} { return -code error [string map $mapping $result] } return $result } } } #------------------------------------------------------------------------------ # scrollutil::snb::adjustsizeSubCmd # |
︙ | ︙ | |||
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 | showHideArrowsDelayed $win } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::snb::onScrollednotebookMap #------------------------------------------------------------------------------ proc scrollutil::snb::onScrollednotebookMap win { if {[destroyed $win]} { return "" | > > > > > > > > > > > > > > > > > > > | 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 | showHideArrowsDelayed $win } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::snb::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::snb::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus $data(nb) } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::snb::onScrollednotebookMap #------------------------------------------------------------------------------ proc scrollutil::snb::onScrollednotebookMap win { if {[destroyed $win]} { return "" |
︙ | ︙ | |||
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 | # whether the menu exists and has items # if {![winfo exists $menu] || [winfo class $menu] ne "Menu" || [$menu index end] eq "none"} { return "" } # # For awthemes: # catch {ttk::theme::[mwutil::currentTheme]::setMenuColors $menu} tk_popup $menu $rootX $rootY } | > > > > | 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 | # whether the menu exists and has items # if {![winfo exists $menu] || [winfo class $menu] ne "Menu" || [$menu index end] eq "none"} { return "" } set bg [ttk::style lookup . -background] set fg [ttk::style lookup . -foreground] $menu configure -background $bg -foreground $fg # # For awthemes: # catch {ttk::theme::[mwutil::currentTheme]::setMenuColors $menu} tk_popup $menu $rootX $rootY } |
︙ | ︙ |
Changes to modules/scrollutil/scripts/scrollsync.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #============================================================================== # Contains the implementation of the scrollsync widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures creating or querying a scrollsync widget # - Private configuration procedures # - Private procedures implementing the scrollsync widget command # - Private callback procedure # - Private procedures used in bindings # - Private utility procedures # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #============================================================================== # Contains the implementation of the scrollsync widget. # # Structure of the module: # - Namespace initialization # - Private procedure creating the default bindings # - Public procedures creating or querying a scrollsync widget # - Private configuration procedures # - Private procedures implementing the scrollsync widget command # - Private callback procedure # - Private procedures used in bindings # - Private utility procedures # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== # # Namespace initialization # ======================== # |
︙ | ︙ | |||
100 101 102 103 104 105 106 | # scrollutil::ss::createBindings # # Creates the default bindings for the binding tags Scrollsync and # WidgetOfScrollsync. #------------------------------------------------------------------------------ proc scrollutil::ss::createBindings {} { bind Scrollsync <KeyPress> continue | | | < | < > | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | # scrollutil::ss::createBindings # # Creates the default bindings for the binding tags Scrollsync and # WidgetOfScrollsync. #------------------------------------------------------------------------------ proc scrollutil::ss::createBindings {} { bind Scrollsync <KeyPress> continue bind Scrollsync <<TraverseIn>> { set scrollutil::ns%W::data(traversedIn) 1 } bind Scrollsync <FocusIn> { scrollutil::ss::onFocusIn %W %d } bind Scrollsync <Configure> { after 50 [list scrollutil::ss::updateMasterWidgets %W] } bind Scrollsync <Destroy> { namespace delete scrollutil::ns%W catch {rename %W ""} } |
︙ | ︙ | |||
164 165 166 167 168 169 170 171 172 173 174 175 176 177 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { xView {-1 -1} yView {-1 -1} xViewLocked 0 yViewLocked 0 widgetList {} xScrollableList {} yScrollableList {} | > | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | # namespace eval ns$win { # # The folowing array holds various data for this widget # variable data array set data { traversedIn 0 xView {-1 -1} yView {-1 -1} xViewLocked 0 yViewLocked 0 widgetList {} xScrollableList {} yScrollableList {} |
︙ | ︙ | |||
300 301 302 303 304 305 306 307 308 309 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } variable cmdOpts set cmd [mwutil::fullOpt "option" [lindex $args 0] $cmdOpts] switch $cmd { attrib { | > | < | < | 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 | set argCount [llength $args] if {$argCount == 0} { mwutil::wrongNumArgs "$win option ?arg arg ...?" } variable cmdOpts set cmd [mwutil::fullOpt "option" [lindex $args 0] $cmdOpts] set argList [lrange $args 1 end] switch $cmd { attrib { return [::scrollutil::attribSubCmd $win "widget" $argList] } cget { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd option" } # # Return the value of the specified configuration option # upvar ::scrollutil::ns${win}::data data variable configSpecs set opt [mwutil::fullConfigOpt [lindex $args 1] configSpecs] return $data($opt) } configure { variable configSpecs return [mwutil::configureSubCmd $win configSpecs \ scrollutil::ss::doConfig scrollutil::ss::doCget $argList] } hasattrib - unsetattrib { if {$argCount != 2} { mwutil::wrongNumArgs "$win $cmd name" } |
︙ | ︙ | |||
354 355 356 357 358 359 360 | mwutil::wrongNumArgs "$win $cmd" } upvar ::scrollutil::ns${win}::data data return $data(widgetList) } | | | | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | mwutil::wrongNumArgs "$win $cmd" } upvar ::scrollutil::ns${win}::data data return $data(widgetList) } xview { return [viewSubCmd $win x $argList] } yview { return [viewSubCmd $win y $argList] } } } #------------------------------------------------------------------------------ # scrollutil::ss::setwidgetsSubCmd # # Processes the scrollsync setwidgets subcommmand. |
︙ | ︙ | |||
525 526 527 528 529 530 531 532 533 534 535 536 537 538 | after 1 [list scrollutil::ss::unlockView $win $axis] } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::ss::updateMasterWidgets #------------------------------------------------------------------------------ proc scrollutil::ss::updateMasterWidgets win { if {![winfo exists $win] || [winfo class $win] ne "Scrollsync"} { return "" | > > > > > > > > > > > > > > > > > > > | 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 | after 1 [list scrollutil::ss::unlockView $win $axis] } # # Private procedures used in bindings # =================================== # #------------------------------------------------------------------------------ # scrollutil::ss::onFocusIn #------------------------------------------------------------------------------ proc scrollutil::ss::onFocusIn {win detail} { upvar ::scrollutil::ns${win}::data data if {[focus -lastfor $win] eq $win} { if {$detail eq "NotifyInferior"} { if {$data(traversedIn)} { event generate $win <Shift-Tab> } } else { focus [lindex $data(widgetList) 0] } } set data(traversedIn) 0 } #------------------------------------------------------------------------------ # scrollutil::ss::updateMasterWidgets #------------------------------------------------------------------------------ proc scrollutil::ss::updateMasterWidgets win { if {![winfo exists $win] || [winfo class $win] ne "Scrollsync"} { return "" |
︙ | ︙ |
Changes to modules/scrollutil/scripts/tclIndex.
1 2 3 4 5 6 7 8 | # 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. | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # 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(::scrollutil::getForegroundColors) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::createCloseImages) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::createLeftArrowImage) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::createRightArrowImage) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::createDescendImages) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::createAscendImage) [list source [file join $dir notebookImages.tcl]] set auto_index(::scrollutil::setImgForeground) [list source [file join $dir notebookImages.tcl]] |
︙ | ︙ | |||
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 | set auto_index(::scrollutil::pagesman) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doConfig) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doCget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doPageConfig) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doPageCget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::pagesmanWidgetCmd) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::getPageOpts) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::resizeWidgetDelayed) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::resizeWidget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pnb::createDescendElement) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createDescToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createClosebtnElement) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createClosablePageToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createTitleFont) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::configStyles) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createBindings) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::plainnotebook) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::doConfig) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::doCget) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::plainnotebookWidgetCmd) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::adjustsizeSubCmd) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::configTab) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::reorderTabs) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onPlainnotebookMap) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onNbTabChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::restoreTabChangedBinding) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::setYScrollIncr) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onFontChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onThemeChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onMotion) [list source [file join $dir plainnotebook.tcl]] | > > | 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 | set auto_index(::scrollutil::pagesman) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doConfig) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doCget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doPageConfig) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::doPageCget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::pagesmanWidgetCmd) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::getPageOpts) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::onFocusIn) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::resizeWidgetDelayed) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pm::resizeWidget) [list source [file join $dir pagesman.tcl]] set auto_index(::scrollutil::pnb::createDescendElement) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createDescToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createClosebtnElement) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createClosablePageToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createTitleFont) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::configStyles) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::createBindings) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::plainnotebook) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::doConfig) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::doCget) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::plainnotebookWidgetCmd) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::adjustsizeSubCmd) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::configTab) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::reorderTabs) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onFocusIn) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onPlainnotebookMap) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onNbTabChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::restoreTabChangedBinding) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::setYScrollIncr) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onFontChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onThemeChanged) [list source [file join $dir plainnotebook.tcl]] set auto_index(::scrollutil::pnb::onMotion) [list source [file join $dir plainnotebook.tcl]] |
︙ | ︙ | |||
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 | set auto_index(::scrollutil::sf::xviewSubCmd) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::yviewSubCmd) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::doAutosize) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundUp) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundDn) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundUpOrDn) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::applyOffset) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onScrollableframeMfConfigure) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onScrollableframeCfConfigure) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onButton1) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onB1Motion) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onButtonRelease1) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onNoManagedChild) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::restoreScalingpct) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::extendConfigSpecs) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::createBindings) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::scrollarea) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::getscrollarea) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::doConfig) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::doCget) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::scrollareaWidgetCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setwidgetSubCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setHScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setVScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaConfigure) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaEnter) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaLeave) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onToplevelFocusIn) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onToplevelFocusOut) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollbarClicked) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onDynamicHScrollbarMap) [list source [file join $dir scrollarea.tcl]] | > > | 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 | set auto_index(::scrollutil::sf::xviewSubCmd) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::yviewSubCmd) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::doAutosize) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundUp) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundDn) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::roundUpOrDn) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::applyOffset) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onFocusIn) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onScrollableframeMfConfigure) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onScrollableframeCfConfigure) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onButton1) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onB1Motion) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onButtonRelease1) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::sf::onNoManagedChild) [list source [file join $dir scrollableframe.tcl]] set auto_index(::scrollutil::restoreScalingpct) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::extendConfigSpecs) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::createBindings) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::scrollarea) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::getscrollarea) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::doConfig) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::doCget) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::scrollareaWidgetCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setwidgetSubCmd) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setHScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::setVScrollbar) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onFocusIn) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaConfigure) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaEnter) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollareaLeave) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onToplevelFocusIn) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onToplevelFocusOut) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onScrollbarClicked) [list source [file join $dir scrollarea.tcl]] set auto_index(::scrollutil::sa::onDynamicHScrollbarMap) [list source [file join $dir scrollarea.tcl]] |
︙ | ︙ | |||
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | set auto_index(::scrollutil::closetabstate) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::doConfig) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::doCget) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::scrollednotebookWidgetCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::adjustsizeSubCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seeSubCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::adjustXPad) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onScrollednotebookMap) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onThemeChanged) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onNbTabChanged) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::restoreTabChangedBinding) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seePrevTab) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seeNextTab) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onMotion) [list source [file join $dir scrollednotebook.tcl]] | > | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | set auto_index(::scrollutil::closetabstate) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::doConfig) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::doCget) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::scrollednotebookWidgetCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::adjustsizeSubCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seeSubCmd) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::adjustXPad) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onFocusIn) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onScrollednotebookMap) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onThemeChanged) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onNbTabChanged) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::restoreTabChangedBinding) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seePrevTab) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::seeNextTab) [list source [file join $dir scrollednotebook.tcl]] set auto_index(::scrollutil::snb::onMotion) [list source [file join $dir scrollednotebook.tcl]] |
︙ | ︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | set auto_index(::scrollutil::getscrollsync) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::doConfig) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::doCget) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::scrollsyncWidgetCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::setwidgetsSubCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::viewSubCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::scrollCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::updateMasterWidgets) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::onWidgetOfScrollsyncDestroy) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::sortScrollableList) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::compareViews) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::unlockView) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::createBindings) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::addMouseWheelSupport) [list source [file join $dir wheelEvent.tcl]] | > | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | set auto_index(::scrollutil::getscrollsync) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::doConfig) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::doCget) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::scrollsyncWidgetCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::setwidgetsSubCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::viewSubCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::scrollCmd) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::onFocusIn) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::updateMasterWidgets) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::onWidgetOfScrollsyncDestroy) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::sortScrollableList) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::compareViews) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::ss::unlockView) [list source [file join $dir scrollsync.tcl]] set auto_index(::scrollutil::createBindings) [list source [file join $dir wheelEvent.tcl]] set auto_index(::scrollutil::addMouseWheelSupport) [list source [file join $dir wheelEvent.tcl]] |
︙ | ︙ |
Changes to modules/scrollutil/scripts/utils/mwutil.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Contains utility procedures for mega-widgets. # # Structure of the module: # - Namespace initialization # - Public utility procedures # | | | | > | 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 | #============================================================================== # Contains utility procedures for mega-widgets. # # Structure of the module: # - Namespace initialization # - Public utility procedures # # Copyright (c) 2000-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== if {[catch {package require Tk 8.4-}]} { package require Tk 8.4 } # # Namespace initialization # ======================== # namespace eval mwutil { # # Public variables: # variable version 2.24 variable library [file dirname [file normalize [info script]]] # # Public procedures: # namespace export wrongNumArgs getAncestorByClass convEventFields \ defineKeyNav processTraversal focusNext focusPrev \ configureWidget fullConfigOpt fullOpt enumOpts \ configureSubCmd attribSubCmdEx attribSubCmd \ hasattribSubCmdEx hasattribSubCmd unsetattribSubCmdEx \ unsetattribSubCmd getScrollInfo getScrollInfo2 \ isScrollable scrollByUnits genMouseWheelEvent \ containsPointer hasFocus windowingSystem currentTheme \ normalizeColor parsePadding # # Make modified versions of the procedures tk_focusNext and |
︙ | ︙ | |||
142 143 144 145 146 147 148 | # 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] } | < < < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | # 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] } } #------------------------------------------------------------------------------ # 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 |
︙ | ︙ | |||
345 346 347 348 349 350 351 352 353 354 355 356 357 358 | # 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 "," | > | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | # 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 { set opt [list $opt] if {$n == 1} { set str $opt } elseif {$n < $optCount} { append str ", $opt" } else { if {$optCount > 2} { append str "," |
︙ | ︙ | |||
407 408 409 410 411 412 413 | } } return $result } } #------------------------------------------------------------------------------ | | | < | | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | } } return $result } } #------------------------------------------------------------------------------ # mwutil::attribSubCmdEx # # This procedure is invoked to process *attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::attribSubCmdEx {rootNs win prefix argList} { upvar ::${rootNs}::ns${win}::attribs attribs set argCount [llength $argList] if {$argCount > 1} { # # Set the specified attributes to the given values # if {$argCount % 2 != 0} { |
︙ | ︙ | |||
451 452 453 454 455 456 457 458 459 460 461 462 463 464 | 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} { | > > > > > > > > > > > > > > > > > > > > > | > > > > > > > > > | > | > > > > | < | < < < < < < | 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 | foreach name [lsort [array names attribs "$prefix-*"]] { set attr [string range $name $len end] lappend result [list $attr $attribs($name)] } return $result } } #------------------------------------------------------------------------------ # mwutil::attribSubCmd # # This procedure is invoked to process *attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::attribSubCmd {win prefix argList} { set rootNs [string tolower [winfo class $win]] return [attribSubCmdEx $rootNs $win $prefix $argList] } #------------------------------------------------------------------------------ # mwutil::hasattribSubCmdEx # # This procedure is invoked to process has*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::hasattribSubCmdEx {rootNs win prefix attr} { upvar ::${rootNs}::ns${win}::attribs attribs return [info exists attribs($prefix-$attr)] } #------------------------------------------------------------------------------ # mwutil::hasattribSubCmd # # This procedure is invoked to process has*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::hasattribSubCmd {win prefix attr} { set rootNs [string tolower [winfo class $win]] return [hasattribSubCmdEx $rootNs $win $prefix $attr] } #------------------------------------------------------------------------------ # mwutil::unsetattribSubCmdEx # # This procedure is invoked to process unset*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::unsetattribSubCmdEx {rootNs win prefix attr} { upvar ::${rootNs}::ns${win}::attribs attribs set name $prefix-$attr if {[info exists attribs($name)]} { unset attribs($name) } return "" } #------------------------------------------------------------------------------ # mwutil::unsetattribSubCmd # # This procedure is invoked to process unset*attrib subcommands. #------------------------------------------------------------------------------ proc mwutil::unsetattribSubCmd {win prefix attr} { set rootNs [string tolower [winfo class $win]] return [unsetattribSubCmdEx $rootNs $win $prefix $attr] } #------------------------------------------------------------------------------ # 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 |
︙ | ︙ |
Changes to modules/scrollutil/scripts/utils/pkgIndex.tcl.
1 2 3 | #============================================================================== # mwutil, scaleutil, and themepatch package index file. # | | | | | | 1 2 3 4 5 6 7 8 9 | #============================================================================== # mwutil, scaleutil, and themepatch package index file. # # Copyright (c) 2020-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== package ifneeded mwutil 2.24 [list source [file join $dir mwutil.tcl]] package ifneeded scaleutil 1.15 [list source [file join $dir scaleutil.tcl]] package ifneeded themepatch 1.8 [list source [file join $dir themepatch.tcl]] |
Changes to modules/scrollutil/scripts/utils/scaleutil.tcl.
1 2 3 4 5 6 7 8 | #============================================================================== # Contains scaling-related utility procedures. # # Structure of the module: # - Namespace initialization # - Public utility procedures # - Private helper procedures # | | | | 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 | #============================================================================== # Contains scaling-related utility procedures. # # Structure of the module: # - Namespace initialization # - Public utility procedures # - Private helper procedures # # Copyright (c) 2020-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== if {[catch {package require Tk 8.4-}]} { package require Tk 8.4 } # # Namespace initialization # ======================== # namespace eval scaleutil { # # Public variables: # variable version 1.15 variable library [file dirname [file normalize [info script]]] # # Public procedures: # namespace export scalingPercentage scale |
︙ | ︙ | |||
460 461 462 463 464 465 466 | set l [scale 2 $pct]; set t $l; set r [scale 1 $pct] set margins [list $l $t $r 0] ;# {2 2 1 0} ttk::style configure TNotebook -tabmargins $margins ttk::style configure TNotebook.Tab \ -padding [list [scale 4 $pct] [scale 2 $pct]] ttk::style map TNotebook.Tab -expand [list selected $margins] | > > | > | | | 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 | set l [scale 2 $pct]; set t $l; set r [scale 1 $pct] set margins [list $l $t $r 0] ;# {2 2 1 0} ttk::style configure TNotebook -tabmargins $margins ttk::style configure TNotebook.Tab \ -padding [list [scale 4 $pct] [scale 2 $pct]] ttk::style map TNotebook.Tab -expand [list selected $margins] ttk::style configure Sash -sashthickness [scale 5 $pct] \ -gripsize [scale 20 $pct] # # -diameter was replaced with -size in Tk 9. # set l [scale 2 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargins [list $l $t $r $b] ;# {2 2 4 2} ttk::style configure Item -diameter [scale 9 $pct] \ -size [scale 9 $pct] -indicatormargins $indMargins ttk::style configure Treeview -indent [scale 20 $pct] } } #------------------------------------------------------------------------------ # scaleutil::scaleStyles_clam # # Scales a few styles for the "clam" theme. #------------------------------------------------------------------------------ proc scaleutil::scaleStyles_clam pct { ttk::style theme settings clam { # # -gripcount was replaced with -gripsize in Tk 9. # set gripCount [scale 5 $pct] set gripSize [scale 10 $pct] set scrlbarWidth [scale 14 $pct] ttk::style configure TScrollbar -gripcount $gripCount \ -gripsize $gripSize -arrowsize $scrlbarWidth -width $scrlbarWidth |
︙ | ︙ | |||
507 508 509 510 511 512 513 | ttk::style configure TButton -padding [scale 5 $pct] ttk::style configure Toolbutton -padding [scale 2 $pct] ttk::style configure TMenubutton -arrowsize [scale 5 $pct] \ -arrowpadding [scale 3 $pct] -padding [scale 5 $pct] # | | | | 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 | ttk::style configure TButton -padding [scale 5 $pct] ttk::style configure Toolbutton -padding [scale 2 $pct] ttk::style configure TMenubutton -arrowsize [scale 5 $pct] \ -arrowpadding [scale 3 $pct] -padding [scale 5 $pct] # # The -indicatorsize option was removed in Tk 8.7b1/9. # set l [scale 1 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargin [list $l $t $r $b] ;# {1 1 4 1} foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -indicatorsize [scale 10 $pct] \ -indicatormargin $indMargin -padding [scale 2 $pct] } set l [scale 6 $pct]; set t [scale 2 $pct]; set r $l; set b $t ttk::style configure TNotebook.Tab \ -padding [list $l $t $r $b] ;# {6 2 6 2} set t [scale 4 $pct] ttk::style map TNotebook.Tab \ -padding [list selected [list $l $t $r $b]] ;# {6 4 6 2} # # -gripcount was replaced with -gripsize in Tk 9. # ttk::style configure Sash -sashthickness [scale 6 $pct] \ -gripcount [scale 10 $pct] -gripsize [scale 20 $pct] ttk::style configure Heading -padding [scale 3 $pct] set l [scale 2 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargins [list $l $t $r $b] ;# {2 2 4 2} |
︙ | ︙ | |||
579 580 581 582 583 584 585 | ttk::style configure TMenubutton \ -indicatormargin [list [scale 5 $pct] 0] -padding {3m 1m} set t [scale 2 $pct]; set r [scale 4 $pct]; set b $t set indMargin [list 0 $t $r $b] ;# {0 2 4 2} foreach style {TCheckbutton TRadiobutton} { # | | | 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | ttk::style configure TMenubutton \ -indicatormargin [list [scale 5 $pct] 0] -padding {3m 1m} set t [scale 2 $pct]; set r [scale 4 $pct]; set b $t set indMargin [list 0 $t $r $b] ;# {0 2 4 2} foreach style {TCheckbutton TRadiobutton} { # # -indicatordiameter was renamed to -indicatorsize in Tk 9. # ttk::style configure $style -indicatordiameter [scale 12 $pct] \ -indicatorsize [scale 12 $pct] -indicatormargin $indMargin } ttk::style configure TNotebook.Tab -padding {3m 1m} |
︙ | ︙ | |||
633 634 635 636 637 638 639 | ttk::style configure TSpinbox -arrowsize [scale 10 $pct] \ -padding [list $l 0 $r 0] ;# {2 0 10 0} ttk::style configure TButton -padding [scale 3 $pct] ttk::style configure Toolbutton -padding [scale 2 $pct] # | | | > > > | 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 | ttk::style configure TSpinbox -arrowsize [scale 10 $pct] \ -padding [list $l 0 $r 0] ;# {2 0 10 0} ttk::style configure TButton -padding [scale 3 $pct] ttk::style configure Toolbutton -padding [scale 2 $pct] # # -indicatormargin was replaced with # -arrowsize and -arrowpadding in Tk 8.7b1/9. # ttk::style configure TMenubutton \ -indicatormargin [list [scale 5 $pct] 0] \ -arrowsize [scale 5 $pct] -arrowpadding [scale 3 $pct] \ -padding [list [scale 10 $pct] [scale 3 $pct]] set t [scale 2 $pct]; set r [scale 4 $pct]; set b $t set indMargin [list 0 $t $r $b] ;# {0 2 4 2} foreach style {TCheckbutton TRadiobutton} { # # -indicatordiameter was removed in Tk 8.7b1/9. # ttk::style configure $style -indicatordiameter [scale 10 $pct] \ -indicatormargin $indMargin -padding [scale 1 $pct] } ttk::style configure TNotebook.Tab \ -padding [list [scale 4 $pct] [scale 2 $pct]] ttk::style configure Sash -sashthickness [scale 5 $pct] \ -gripsize [scale 20 $pct] set l [scale 2 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargins [list $l $t $r $b] ;# {2 2 4 2} ttk::style configure Item -indicatorsize [scale 12 $pct] \ -indicatormargins $indMargins ttk::style configure Treeview -indent [scale 20 $pct] } |
︙ | ︙ | |||
680 681 682 683 684 685 686 687 688 689 690 691 692 693 | ttk::style configure TMenubutton \ -padding [list [scale 8 $pct] [scale 4 $pct]] foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding [scale 2 $pct] } set padding [list [scale 4 $pct] 0 0 0] ;# {4 0 0 0} ttk::style configure Item -padding $padding ttk::style configure Treeview -indent [scale 20 $pct] } } | > > > | 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | ttk::style configure TMenubutton \ -padding [list [scale 8 $pct] [scale 4 $pct]] foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding [scale 2 $pct] } ttk::style configure Sash -sashthickness [scale 5 $pct] \ -gripsize [scale 20 $pct] set padding [list [scale 4 $pct] 0 0 0] ;# {4 0 0 0} ttk::style configure Item -padding $padding ttk::style configure Treeview -indent [scale 20 $pct] } } |
︙ | ︙ | |||
719 720 721 722 723 724 725 | foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding $padding } ttk::style configure TNotebook.Tab \ -padding [list [scale 3 $pct] [scale 1 $pct]] | > > | > | | 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding $padding } ttk::style configure TNotebook.Tab \ -padding [list [scale 3 $pct] [scale 1 $pct]] ttk::style configure Sash -sashthickness [scale 5 $pct] \ -gripsize [scale 20 $pct] # # -diameter was replaced with -size in Tk 9. # set l [scale 2 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargins [list $l $t $r $b] ;# {2 2 4 2} ttk::style configure Item -diameter [scale 9 $pct] \ -size [scale 9 $pct] -indicatormargins $indMargins ttk::style configure Treeview -indent [scale 20 $pct] } |
︙ | ︙ | |||
752 753 754 755 756 757 758 | ttk::style configure TMenubutton \ -padding [list [scale 8 $pct] [scale 4 $pct]] foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding [scale 2 $pct] } | > > | > | | 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | ttk::style configure TMenubutton \ -padding [list [scale 8 $pct] [scale 4 $pct]] foreach style {TCheckbutton TRadiobutton} { ttk::style configure $style -padding [scale 2 $pct] } ttk::style configure Sash -sashthickness [scale 5 $pct] \ -gripsize [scale 20 $pct] # # -diameter was replaced with -size in Tk 9. # set l [scale 2 $pct]; set t $l; set r [scale 4 $pct]; set b $l set indMargins [list $l $t $r $b] ;# {2 2 4 2} ttk::style configure Item -diameter [scale 9 $pct] \ -size [scale 9 $pct] -indicatormargins $indMargins ttk::style configure Treeview -indent [scale 20 $pct] } |
︙ | ︙ |
Changes to modules/scrollutil/scrollutil.tcl.
1 2 3 | #============================================================================== # Main Scrollutil package module. # | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #============================================================================== # Main Scrollutil package module. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== package require -exact scrollutil::common 2.5 package provide scrollutil $scrollutil::version package provide Scrollutil $scrollutil::version scrollutil::useTile 0 scrollutil::sa::createBindings scrollutil::ss::createBindings scrollutil::sf::createBindings scrollutil::pm::createBindings scrollutil::createBindings |
Changes to modules/scrollutil/scrollutilCommon.tcl.
1 2 3 | #============================================================================== # Main Scrollutil and Scrollutil_tile package module. # | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #============================================================================== # Main Scrollutil and Scrollutil_tile package module. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== namespace eval scrollutil { proc - {} { return [expr {$::tcl_version >= 8.5 ? "-" : ""}] } package require Tk 8.4[-] # # Public variables: # variable version 2.5 variable library [file dirname [file normalize [info script]]] # # Creates a new scrollarea/scrollsync/scrollableframe/pagesman widget: # namespace export scrollarea scrollsync scrollableframe pagesman |
︙ | ︙ | |||
31 32 33 34 35 36 37 | # namespace export addMouseWheelSupport createWheelEventBindings \ enableScrollingByWheel disableScrollingByWheel \ adaptWheelEventHandling setFocusCheckWindow \ focusCheckWindow } | | | | | | | | | | | > > > > > > > | | | | | | | | | | | 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 | # namespace export addMouseWheelSupport createWheelEventBindings \ enableScrollingByWheel disableScrollingByWheel \ 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 add variable usingTile {write unset} \ [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 { write { return -code error "it is not supported to use both Scrollutil and\ Scrollutil_tile in the same application" } unset { trace add variable usingTile {write unset} \ [list scrollutil::restoreUsingTile $origVal] } } } proc scrollutil::createTkAliases {} { foreach cmd {frame scrollbar} { if {[llength [info commands ::tk::$cmd]] == 0} { interp alias {} tk::$cmd {} $cmd } } } scrollutil::createTkAliases interp alias {} scrollutil::attribSubCmd {} \ mwutil::attribSubCmdEx scrollutil interp alias {} scrollutil::hasattribSubCmd {} \ mwutil::hasattribSubCmdEx scrollutil interp alias {} scrollutil::unsetattribSubCmd {} \ mwutil::unsetattribSubCmdEx scrollutil # # 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] # # Load the packages mwutil and scaleutil from the directory "scripts/utils". # Take into account that mwutil is also included in Mentry, Tablelist, # and Tsw, and scaleutil is also included in Tablelist and Tsw. # proc scrollutil::loadUtils {} { if {[catch {package present mwutil} version] == 0 && [package vcompare $version 2.24] < 0} { package forget mwutil } package require mwutil 2.24[-] if {[catch {package present scaleutil} version] == 0 && [package vcompare $version 1.15] < 0} { package forget scaleutil } package require scaleutil 1.15[-] } scrollutil::loadUtils |
Changes to modules/scrollutil/scrollutil_tile.tcl.
1 2 3 | #============================================================================== # Main Scrollutil_tile package module. # | | | | | | | | | | | | | | | 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 | #============================================================================== # Main Scrollutil_tile package module. # # Copyright (c) 2019-2025 Csaba Nemethi (E-mail: [email protected]) #============================================================================== package require -exact scrollutil::common 2.5 if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} { package require tile 0.6[scrollutil::-] } package provide scrollutil_tile $scrollutil::version package provide Scrollutil_tile $scrollutil::version scrollutil::useTile 1 scrollutil::sa::createBindings scrollutil::ss::createBindings scrollutil::sf::createBindings scrollutil::pm::createBindings scrollutil::snb::createBindings scrollutil::pnb::createBindings scrollutil::createBindings namespace eval ::scrollutil { # # Creates a new scrollednotebook/plainnotebook widget: # namespace export scrollednotebook plainnotebook |
︙ | ︙ |