Tk Library Source Code
Check-in [06484d736e]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment: * scripts/*.tcl: Made the variable "tablelist::scalingpct" read-only; automatic scaling of the default arrow style on the windowing system "x11" and for a few tile themes; made sure that the widgets used for interactive cell editing will appear properly scaled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:06484d736e3676a005e80094074a44f0fce30170306cfb6f84dc065199bac6b6
User & Date: csaba 2020-06-23 09:17:40
Context
2020-06-23
09:19
* scripts/scaleutil.tcl: New file containing scaling-related stuff: getting the display's DPI scaling percentage; scaling the default width of the Tk core scrollbars on X11, the default width of the ttk::scrollbar widget in a few built-in themes, the arrows of the ttk::combobox, ttk::spinbox, and ttk::menubutton widgets, and the indicators of the ttk::checkbutton and ttk::radiobutton widgets; a workaround for a long-standing scaling-related bug in the implementation of the ttk::checkbutton and ttk::radiobutton widgets in the "vista" and "xpnative" themes; procedures for scaling several widgets used for interactive cell editing. check-in: e0e150515f user: csaba tags: trunk
09:17
* scripts/*.tcl: Made the variable "tablelist::scalingpct" read-only; automatic scaling of the default arrow style on the windowing system "x11" and for a few tile themes; made sure that the widgets used for interactive cell editing will appear properly scaled. check-in: 06484d736e user: csaba tags: trunk
09:14
* CHANGES.txt: Updated to reflect the changes. * doc/*.html: check-in: 2bd15d69a4 user: csaba tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/tablelist/scripts/mwutil.tcl.

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
    #
    namespace export	wrongNumArgs getAncestorByClass convEventFields \
			defineKeyNav processTraversal focusNext focusPrev \
			configureWidget fullConfigOpt fullOpt enumOpts \
			configureSubCmd attribSubCmd hasattribSubCmd \
			unsetattribSubCmd getScrollInfo getScrollInfo2 \
			isScrollable hasFocus genMouseWheelEvent \
			windowingSystem currentTheme scalingPercentage

    #
    # Make modified versions of the procedures tk_focusNext and
    # tk_focusPrev, to be invoked in the processTraversal command
    #
    proc makeFocusProcs {} {
	#
................................................................................
	return $::ttk::currentTheme
    } elseif {[info exists ::tile::currentTheme]} {
	return $::tile::currentTheme
    } else {
	return ""
    }
}

#------------------------------------------------------------------------------
# mwutil::scalingPercentage
#
# Returns the display's current scaling percentage (100, 125, 150, 175, or 200).
#------------------------------------------------------------------------------
proc mwutil::scalingPercentage {} {
    set pct [expr {[tk scaling] * 75}]

    if {[string compare [windowingSystem] "x11"] == 0} {
	set factor 1
	if {[catch {exec ps -e | grep xfce}] == 0} {			;# Xfce
	    if {[catch {exec xfconf-query -c xsettings \
		 -p /Gdk/WindowScalingFactor} result] == 0} {
		set factor $result
		set pct [expr {100 * $factor}]
	    }
	} elseif {[catch {exec ps -e | grep mate}] == 0} {		;# MATE
	    if {[catch {exec gsettings get org.mate.interface \
		 window-scaling-factor} result] == 0} {
		if {$result == 0} {			;# means: "Auto-detect"
		    #
		    # Try to get the scaling factor from the cursor size
		    #
		    if {[catch {exec xrdb -query | grep Xcursor.size} \
			 result] == 0 &&
			[catch {exec gsettings get org.mate.peripherals-mouse \
			 cursor-size} defCursorSize] == 0} {
			scan $result "%*s %d" cursorSize
			set factor [expr {($cursorSize + $defCursorSize - 1) /
					  $defCursorSize}]
			set pct [expr {100 * $factor}]
		    }
		} else {
		    set factor $result
		    set pct [expr {100 * $factor}]
		}
	    }
	} elseif {[catch {exec gsettings get \
		   org.gnome.settings-daemon.plugins.xsettings overrides} \
		   result] == 0 &&
		  [set idx \
		   [string first "'Gdk/WindowScalingFactor'" $result]] >= 0} {
	    scan [string range $result $idx end] "%*s <%d>" factor
	    set pct [expr {100 * $factor}]
	} elseif {[catch {exec xrdb -query | grep Xft.dpi} result] == 0} {
	    scan $result "%*s %f" dpi
	    set pct [expr {100 * $dpi / 96}]
	} elseif {$::tk_version >= 8.3 &&
		  [catch {exec ps -e | grep gnome}] == 0 &&
		  ![info exists ::env(WAYLAND_DISPLAY)] &&
		  [catch {exec xrandr | grep " connected"} result] == 0 &&
		  [catch {open $::env(HOME)/.config/monitors.xml} chan] == 0} {
	    #
	    # Get the list of connected outputs reported by xrandr
	    #
	    set outputList {}
	    foreach line [split $result "\n"] {
		set idx [string first " " $line]
		set output [string range $line 0 [incr idx -1]]
		lappend outputList $output
	    }
	    set outputList [lsort $outputList]

	    #
	    # Get the content of the file ~/.config/monitors.xml
	    #
	    set str [read $chan]
	    close $chan

	    #
	    # Run over the file's "configuration" sections
	    #
	    set idx 0
	    while {[set idx2 [string first "<configuration>" $str $idx]] >= 0} {
		set idx2 [string first ">" $str $idx2]
		set idx [string first "</configuration>" $str $idx2]
		set config [string range $str [incr idx2] [incr idx -1]]

		#
		# Get the list of connectors within this configuration
		#
		set connectorList {}
		foreach {dummy connector} [regexp -all -inline \
			{<connector>([^<]+)</connector>} $config] {
		    lappend connectorList $connector
		}
		set connectorList [lsort $connectorList]

		#
		# If $outputList and $connectorList are identical then set the
		# variable pct to 100 or 200, depending on the max. scaling
		# within this configuration, and exit the loop.  (Due to the
		# way fractional scaling is implemented in GNOME, we have to
		# set the variable pct to 200 rather than 125, 150, or 175.)
		#
		if {[string compare $outputList $connectorList] == 0} {
		    set maxScaling 0.0
		    foreach {dummy scaling} [regexp -all -inline \
			    {<scale>([^<]+)</scale>} $config] {
			if {$scaling > $maxScaling} {
			    set maxScaling $scaling
			}
		    }
		    set pct [expr {$maxScaling > 1.0 ? 200 : 100}]
		    break
		}
	    }
	}

	#
	# Correct the sizes of the standard fonts by replacing the sizes
	# in pixels contained in the file $::tk_library/ttk/fonts.tcl
	# with sizes in points, and then multiply them with $factor
	#
	if {$::tk_version >= 8.5} {
	    if {$factor > 2} {
		set factor 2
	    }

	    set chan [open $::tk_library/ttk/fonts.tcl]
	    set str [read $chan]
	    close $chan

	    set idx [string first "courier" $str]
	    set str [string range $str $idx end]

	    set idx [string first "F(size)" $str]
	    scan [string range $str $idx end] "%*s %d" size
	    if {$size < 0} { set size 9 }	;# -12 -> 9, for compatibility
	    foreach font {TkDefaultFont TkTextFont TkHeadingFont
			  TkIconFont TkMenuFont} {
		font configure $font -size [expr {$factor * $size}]
	    }

	    set idx [string first "F(ttsize)" $str]
	    scan [string range $str $idx end] "%*s %d" size
	    if {$size < 0} { set size 8 }	;# -10 > 8, for compatibility
	    foreach font {TkTooltipFont TkSmallCaptionFont} {
		font configure $font -size [expr {$factor * $size}]
	    }

	    set idx [string first "F(capsize)" $str]
	    scan [string range $str $idx end] "%*s %d" size
	    if {$size < 0} { set size 11 }	;# -14 -> 11, for compatibility
	    font configure TkCaptionFont -size [expr {$factor * $size}]

	    set idx [string first "F(fixedsize)" $str]
	    scan [string range $str $idx end] "%*s %d" size
	    if {$size < 0} { set size 9 }	;# -12 -> 9, for compatibility
	    font configure TkFixedFont -size [expr {$factor * $size}]
	}
    }

    if {$pct < 100 + 12.5} {
	return 100
    } elseif {$pct < 125 + 12.5} {
	return 125 
    } elseif {$pct < 150 + 12.5} {
	return 150 
    } elseif {$pct < 175 + 12.5} {
	return 175 
    } else {
	return 200
    }
}







|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
637
638
639
640
641
642
643






































































































































































    #
    namespace export	wrongNumArgs getAncestorByClass convEventFields \
			defineKeyNav processTraversal focusNext focusPrev \
			configureWidget fullConfigOpt fullOpt enumOpts \
			configureSubCmd attribSubCmd hasattribSubCmd \
			unsetattribSubCmd getScrollInfo getScrollInfo2 \
			isScrollable hasFocus genMouseWheelEvent \
			windowingSystem currentTheme

    #
    # Make modified versions of the procedures tk_focusNext and
    # tk_focusPrev, to be invoked in the processTraversal command
    #
    proc makeFocusProcs {} {
	#
................................................................................
	return $::ttk::currentTheme
    } elseif {[info exists ::tile::currentTheme]} {
	return $::tile::currentTheme
    } else {
	return ""
    }
}






































































































































































Changes to modules/tablelist/scripts/tablelistConfig.tcl.

244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
....
3986
3987
3988
3989
3990
3991
3992












3993
3994
3995
3996
3997
3998
3999
4000
4001

4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
	# Set the default values of the -arrowcolor,
	# -arrowdisabledcolor, -arrowstyle, and -treestyle options
	#
	switch $winSys {
	    x11 {
		set arrowColor		black
		set arrowDisabledColor	#a3a3a3
		set arrowStyle		flat8x4
		set treeStyle		gtk
	    }

	    win32 {
		if {$::tcl_platform(osVersion) < 5.1} {		;# Win native
		    set arrowColor		{}
		    set arrowDisabledColor	{}
................................................................................
		return $data($key,$col$opt)
	    } else {
		return ""
	    }
	}
    }
}













#------------------------------------------------------------------------------
# tablelist::defaultWinArrowSize
#
# Returns the size (of the form "<width>x<height>") of the default sort arrow
# on Windows, corresponding to the display's scaling level.
#------------------------------------------------------------------------------
proc tablelist::defaultWinArrowSize {} {
    variable scalingpct

    switch $scalingpct {
	100 { return "7x4" }
	125 { return "9x5" }
	150 { return "11x6" }
	175 { return "13x7" }
	200 { return "15x8" }
    }
}

#------------------------------------------------------------------------------
# tablelist::makeListVar
#
# Arranges for the global variable specified by varName to become the list
# variable associated with the tablelist widget win.







|







 







>
>
>
>
>
>
>
>
>
>
>
>









>
|
<
<
<
<
<
<







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
....
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015






4016
4017
4018
4019
4020
4021
4022
	# Set the default values of the -arrowcolor,
	# -arrowdisabledcolor, -arrowstyle, and -treestyle options
	#
	switch $winSys {
	    x11 {
		set arrowColor		black
		set arrowDisabledColor	#a3a3a3
		set arrowStyle		[defaultX11ArrowStyle]
		set treeStyle		gtk
	    }

	    win32 {
		if {$::tcl_platform(osVersion) < 5.1} {		;# Win native
		    set arrowColor		{}
		    set arrowDisabledColor	{}
................................................................................
		return $data($key,$col$opt)
	    } else {
		return ""
	    }
	}
    }
}

#------------------------------------------------------------------------------
# tablelist::defaultX11ArrowStyle
#
# Returns the default sort arrow style on X11, corresponding to the display's
# scaling level.
#------------------------------------------------------------------------------
proc tablelist::defaultX11ArrowStyle {} {
    variable scalingpct
    array set arr {100 8x4  125 9x5  150 11x6  175 13x7  200 15x8}
    return flat$arr($scalingpct)
}

#------------------------------------------------------------------------------
# tablelist::defaultWinArrowSize
#
# Returns the size (of the form "<width>x<height>") of the default sort arrow
# on Windows, corresponding to the display's scaling level.
#------------------------------------------------------------------------------
proc tablelist::defaultWinArrowSize {} {
    variable scalingpct
    array set arr {100 7x4  125 9x5  150 11x6  175 13x7  200 15x8}
    return $arr($scalingpct)






}

#------------------------------------------------------------------------------
# tablelist::makeListVar
#
# Arranges for the global variable specified by varName to become the list
# variable associated with the tablelist widget win.

Changes to modules/tablelist/scripts/tablelistEdit.tcl.

292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
...
443
444
445
446
447
448
449








450
451
452
453
454
455
456
....
1308
1309
1310
1311
1312
1313
1314






1315
1316
1317
1318
1319
1320
1321
....
1367
1368
1369
1370
1371
1372
1373





1374
1375
1376
1377
1378
1379
1380
1381
1382
1383













1384
1385
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
....
1425
1426
1427
1428
1429
1430
1431
1432




1433
1434
1435
1436
1437
1438
1439
....
2259
2260
2261
2262
2263
2264
2265

2266
2267
2268
2269
2270
2271
2272


2273

2274
2275
2276
2277
2278
2279
2280
....
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
....
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
....
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
# editing.
#------------------------------------------------------------------------------
proc tablelist::addBWidgetSpinBox {{name SpinBox}} {
    checkEditWinName $name

    variable editWin
    array set editWin [list \
	$name-creationCmd	"SpinBox %W -editable 1 -width 0" \
	$name-putValueCmd	"%W configure -text %T" \
	$name-getValueCmd	"%W cget -text" \
	$name-putTextCmd	"%W configure -text %T" \
	$name-getTextCmd	"%W cget -text" \
	$name-putListCmd	"" \
	$name-getListCmd	"" \
	$name-selectCmd		"" \
................................................................................
	$name-fontOpt		-textfont \
	$name-useReqWidth	1 \
	$name-usePadX		[string match "*entry" $widgetType] \
	$name-useFormat		1 \
	$name-isEntryLike	1 \
	$name-reservedKeys	{Left Right Up Down} \
    ]








    if {$useClicks} {
	lappend editWin($name-getValueCmd) -clicks
	set editWin($name-useFormat) 0
    }
    if {[string match "date*" $widgetType]} {
	set editWin($name-focusWin) {[%W component date]}
    } else {
................................................................................
    }

    ttk::combobox $w -style Tablelist.TCombobox

    foreach {opt val} $args {
	$w configure $opt $val
    }






}

#------------------------------------------------------------------------------
# tablelist::createTileCheckbutton
#
# Creates a tile checkbutton widget of the given path name for interactive cell
# editing in a tablelist widget.
................................................................................
	    set data(useCustomMDEFSav) $::tk::mac::useCustomMDEF
	    set ::tk::mac::useCustomMDEF 1
	}
    }

    set menu $w.menu
    menu $menu -tearoff 0 -postcommand [list tablelist::postMenuCmd $w]





    if {[string compare $winSys "x11"] == 0} {
	$menu configure -background $data(-background) \
			-foreground $data(-foreground) \
			-activebackground $data(-selectbackground) \
			-activeforeground $data(-selectforeground) \
			-activeborderwidth $data(-selectborderwidth)
    }

    $w configure -menu $menu
}














#------------------------------------------------------------------------------
# tablelist::createBWidgetComboBox
#
# Creates a BWidget ComboBox widget of the given path name for interactive cell
# editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createBWidgetComboBox {w args} {
    eval [list ComboBox $w -editable 1 -width 0] $args
    ComboBox::_create_popup $w



    foreach event {<Map> <Unmap>} {
	bind $w.shell.listb $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }
}



























#------------------------------------------------------------------------------
# tablelist::createIncrCombobox
#
# Creates an [incr Widgets] combobox of the given path name for interactive
# cell editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createIncrCombobox {w args} {
    eval [list iwidgets::combobox $w -dropdown 1 -editable 1 -grab global \
	  -width 0] $args




    foreach event {<Map> <Unmap>} {
	bind [$w component list] $event {+
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }

    #
................................................................................
#------------------------------------------------------------------------------
# tablelist::createOakleyCombobox
#
# Creates an Oakley combobox widget of the given path name for interactive cell
# editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createOakleyCombobox {w args} {
    eval [list combobox::combobox $w -editable 1 -width 0] $args





    foreach event {<Map> <Unmap>} {
	bind $w.top.list $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }

................................................................................
#
# Saves the non-default values of the configuration options of the edit window
# w associated with a tablelist widget, as well as those of its descendants.
#------------------------------------------------------------------------------
proc tablelist::saveEditConfigOpts w {
    regexp {^(.+)\.body\.f\.(e.*)$} $w dummy win tail
    upvar ::tablelist::ns${win}::data data


    foreach configSet [$w configure] {
	if {[llength $configSet] != 2} {
	    set default [lindex $configSet 3]
	    set current [lindex $configSet 4]
	    if {[string compare $default $current] != 0} {
		set opt [lindex $configSet 0]


		set data($tail$opt) $current

	    }
	}
    }

    foreach c [winfo children $w] {
	saveEditConfigOpts $c
    }
................................................................................
# Restores the non-default values of the configuration options of the edit
# window w associated with a tablelist widget, as well as those of its
# descendants.
#------------------------------------------------------------------------------
proc tablelist::restoreEditConfigOpts w {
    regexp {^(.+)\.body\.f\.(e.*)$} $w dummy win tail
    upvar ::tablelist::ns${win}::data data
    set isMentry [expr {[string compare [winfo class $w] "Mentry"] == 0}]

    foreach name [array names data $tail-*] {
	set opt [string range $name [string last "-" $name] end]
	if {!$isMentry || [string compare $opt "-body"] != 0} {
	    $w configure $opt $data($name)
	}
	unset data($name)
    }

    foreach c [winfo children $w] {
	restoreEditConfigOpts $c
    }

................................................................................
		    set tablelist::w [$tablelist::W cget -xmousewheelwindow]
		    if {[winfo exists $tablelist::w] &&
			![mwutil::hasFocus $tablelist::W]} {
			event generate $tablelist::w <Shift-Button-%s> \
			    -rootx %%X -rooty %%Y
			break
		    }
		} elseif {![tablelist::isComboTopMapped %%W &&
			  ![tablelist::isMenuPosted %%W]]} {
		    set tablelist::W [tablelist::getTablelistPath %%W]
		    event generate [$tablelist::W bodypath] <Shift-Button-%s> \
			-rootx %%X -rooty %%Y
		}
	    } $detail $detail]
	    bind TablelistEditBreak <Shift-Button-$detail> { break }
	}
................................................................................
			set tablelist::w [$tablelist::W cget -xmousewheelwindow]
			if {[winfo exists $tablelist::w] &&
			    ![mwutil::hasFocus $tablelist::W]} {
			    event generate $tablelist::w <Button-%s> \
				-rootx %%X -rooty %%Y
			    break
			}
		    } elseif {![tablelist::isComboTopMapped %%W &&
			      ![tablelist::isMenuPosted %%W]]} {
			set tablelist::W [tablelist::getTablelistPath %%W]
			event generate [$tablelist::W bodypath] <Button-%s> \
			    -rootx %%X -rooty %%Y
		    }
		} $detail $detail]
		bind TablelistEditBreak <Button-$detail> { break }
	    }







|







 







>
>
>
>
>
>
>
>







 







>
>
>
>
>
>







 







>
>
>
>
>










>
>
>
>
>
>
>
>
>
>
>
>
>









|
>
>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>











>
>
>







 







|
>
>
>
>







 







>







>
>
|
>







 







<



<
|
<







 







|
|







 







|
|







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
...
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
....
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
....
1381
1382
1383
1384
1385
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
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
....
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
....
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
....
2462
2463
2464
2465
2466
2467
2468

2469
2470
2471

2472

2473
2474
2475
2476
2477
2478
2479
....
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
....
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
# editing.
#------------------------------------------------------------------------------
proc tablelist::addBWidgetSpinBox {{name SpinBox}} {
    checkEditWinName $name

    variable editWin
    array set editWin [list \
	$name-creationCmd	"createBWidgetSpinBox %W" \
	$name-putValueCmd	"%W configure -text %T" \
	$name-getValueCmd	"%W cget -text" \
	$name-putTextCmd	"%W configure -text %T" \
	$name-getTextCmd	"%W cget -text" \
	$name-putListCmd	"" \
	$name-getListCmd	"" \
	$name-selectCmd		"" \
................................................................................
	$name-fontOpt		-textfont \
	$name-useReqWidth	1 \
	$name-usePadX		[string match "*entry" $widgetType] \
	$name-useFormat		1 \
	$name-isEntryLike	1 \
	$name-reservedKeys	{Left Right Up Down} \
    ]
    switch $widgetType {
	dateentry {
	    set editWin($name-creationCmd) "createIncrDateentry %W"
	}
	timeentry {
	    set editWin($name-creationCmd) "createIncrTimeentry %W"
	}
    }
    if {$useClicks} {
	lappend editWin($name-getValueCmd) -clicks
	set editWin($name-useFormat) 0
    }
    if {[string match "date*" $widgetType]} {
	set editWin($name-focusWin) {[%W component date]}
    } else {
................................................................................
    }

    ttk::combobox $w -style Tablelist.TCombobox

    foreach {opt val} $args {
	$w configure $opt $val
    }

    foreach event {<Map> <Unmap>} {
	bind [ttk::combobox::PopdownWindow $w] $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }
}

#------------------------------------------------------------------------------
# tablelist::createTileCheckbutton
#
# Creates a tile checkbutton widget of the given path name for interactive cell
# editing in a tablelist widget.
................................................................................
	    set data(useCustomMDEFSav) $::tk::mac::useCustomMDEF
	    set ::tk::mac::useCustomMDEF 1
	}
    }

    set menu $w.menu
    menu $menu -tearoff 0 -postcommand [list tablelist::postMenuCmd $w]
    foreach event {<Map> <Unmap>} {
	bind $menu $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }
    if {[string compare $winSys "x11"] == 0} {
	$menu configure -background $data(-background) \
			-foreground $data(-foreground) \
			-activebackground $data(-selectbackground) \
			-activeforeground $data(-selectforeground) \
			-activeborderwidth $data(-selectborderwidth)
    }

    $w configure -menu $menu
}

#------------------------------------------------------------------------------
# tablelist::createBWidgetSpinBox
#
# Creates a BWidget SpinBox widget of the given path name for interactive cell
# editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createBWidgetSpinBox {w args} {
    eval [list SpinBox $w -editable 1 -width 0] $args

    variable scalingpct
    scaleutil::scaleBWidgetSpinBox $w $scalingpct
}

#------------------------------------------------------------------------------
# tablelist::createBWidgetComboBox
#
# Creates a BWidget ComboBox widget of the given path name for interactive cell
# editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createBWidgetComboBox {w args} {
    eval [list ComboBox $w -editable 1 -width 0] $args

    variable scalingpct
    scaleutil::scaleBWidgetComboBox $w $scalingpct

    foreach event {<Map> <Unmap>} {
	bind $w.shell.listb $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }
}

#------------------------------------------------------------------------------
# tablelist::createIncrDateentry
#
# Creates an [incr Widgets] dateentry of the given path name for interactive
# cell editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createIncrDateentry {w args} {
    eval [list iwidgets::dateentry $w] $args

    variable scalingpct
    scaleutil::scaleIncrDateentry $w $scalingpct
}

#------------------------------------------------------------------------------
# tablelist::createIncrTimeentry
#
# Creates an [incr Widgets] timeentry of the given path name for interactive
# cell editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createIncrTimeentry {w args} {
    eval [list iwidgets::timeentry $w] $args

    variable scalingpct
    scaleutil::scaleIncrTimeentry $w $scalingpct
}

#------------------------------------------------------------------------------
# tablelist::createIncrCombobox
#
# Creates an [incr Widgets] combobox of the given path name for interactive
# cell editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createIncrCombobox {w args} {
    eval [list iwidgets::combobox $w -dropdown 1 -editable 1 -grab global \
	  -width 0] $args

    variable scalingpct
    scaleutil::scaleIncrCombobox $w $scalingpct

    foreach event {<Map> <Unmap>} {
	bind [$w component list] $event {+
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }

    #
................................................................................
#------------------------------------------------------------------------------
# tablelist::createOakleyCombobox
#
# Creates an Oakley combobox widget of the given path name for interactive cell
# editing in a tablelist widget.
#------------------------------------------------------------------------------
proc tablelist::createOakleyCombobox {w args} {
    eval [list combobox::combobox $w -editable 1 -elementborderwidth 1 \
	  -width 0] $args

    variable scalingpct
    scaleutil::scaleOakleyComboboxArrow $scalingpct

    foreach event {<Map> <Unmap>} {
	bind $w.top.list $event {
	    tablelist::invokeMotionHandler [tablelist::getTablelistPath %W]
	}
    }

................................................................................
#
# Saves the non-default values of the configuration options of the edit window
# w associated with a tablelist widget, as well as those of its descendants.
#------------------------------------------------------------------------------
proc tablelist::saveEditConfigOpts w {
    regexp {^(.+)\.body\.f\.(e.*)$} $w dummy win tail
    upvar ::tablelist::ns${win}::data data
    set isMentry [expr {[string compare [winfo class $w] "Mentry"] == 0}]

    foreach configSet [$w configure] {
	if {[llength $configSet] != 2} {
	    set default [lindex $configSet 3]
	    set current [lindex $configSet 4]
	    if {[string compare $default $current] != 0} {
		set opt [lindex $configSet 0]
		if {[string compare $opt "-class"] != 0 &&
		    !(!$isMentry && [string compare $opt "-body"] == 0)} {
		    set data($tail$opt) $current
		}
	    }
	}
    }

    foreach c [winfo children $w] {
	saveEditConfigOpts $c
    }
................................................................................
# Restores the non-default values of the configuration options of the edit
# window w associated with a tablelist widget, as well as those of its
# descendants.
#------------------------------------------------------------------------------
proc tablelist::restoreEditConfigOpts w {
    regexp {^(.+)\.body\.f\.(e.*)$} $w dummy win tail
    upvar ::tablelist::ns${win}::data data


    foreach name [array names data $tail-*] {
	set opt [string range $name [string last "-" $name] end]

	$w configure $opt $data($name)

	unset data($name)
    }

    foreach c [winfo children $w] {
	restoreEditConfigOpts $c
    }

................................................................................
		    set tablelist::w [$tablelist::W cget -xmousewheelwindow]
		    if {[winfo exists $tablelist::w] &&
			![mwutil::hasFocus $tablelist::W]} {
			event generate $tablelist::w <Shift-Button-%s> \
			    -rootx %%X -rooty %%Y
			break
		    }
		} elseif {![tablelist::isComboTopMapped %%W] &&
			  ![tablelist::isMenuPosted %%W]} {
		    set tablelist::W [tablelist::getTablelistPath %%W]
		    event generate [$tablelist::W bodypath] <Shift-Button-%s> \
			-rootx %%X -rooty %%Y
		}
	    } $detail $detail]
	    bind TablelistEditBreak <Shift-Button-$detail> { break }
	}
................................................................................
			set tablelist::w [$tablelist::W cget -xmousewheelwindow]
			if {[winfo exists $tablelist::w] &&
			    ![mwutil::hasFocus $tablelist::W]} {
			    event generate $tablelist::w <Button-%s> \
				-rootx %%X -rooty %%Y
			    break
			}
		    } elseif {![tablelist::isComboTopMapped %%W] &&
			      ![tablelist::isMenuPosted %%W]} {
			set tablelist::W [tablelist::getTablelistPath %%W]
			event generate [$tablelist::W bodypath] <Button-%s> \
			    -rootx %%X -rooty %%Y
		    }
		} $detail $detail]
		bind TablelistEditBreak <Button-$detail> { break }
	    }

Changes to modules/tablelist/scripts/tablelistImages.tcl.

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
"
}

#------------------------------------------------------------------------------
# tablelist::createCheckbuttonImgs
#------------------------------------------------------------------------------
proc tablelist::createCheckbuttonImgs {} {
    variable checkedImg [image create bitmap tablelist_checkedImg -data "










#define checked_width 9
#define checked_height 9
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xe2, 0x00, 0x76, 0x00, 0x3e, 0x00,
   0x1c, 0x00, 0x08, 0x00, 0x00, 0x00};
"]


    variable uncheckedImg [image create bitmap tablelist_uncheckedImg -data "







#define unchecked_width 9
#define unchecked_height 9
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"]








































































































































































}

#------------------------------------------------------------------------------
# tablelist::adwaitaTreeImgs
#------------------------------------------------------------------------------
proc tablelist::adwaitaTreeImgs {} {
    foreach mode {collapsed expanded collapsedSel expandedSel







|
>
>
>
>
>
>
>
>
>
>





<
|
>
|
>
>
>
>
>
>
>





<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
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
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
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
"
}

#------------------------------------------------------------------------------
# tablelist::createCheckbuttonImgs
#------------------------------------------------------------------------------
proc tablelist::createCheckbuttonImgs {} {
    variable checkedImg   [image create bitmap tablelist_checkedImg]
    variable uncheckedImg [image create bitmap tablelist_uncheckedImg]

    variable scalingpct
    variable winSys
    set onX11 [expr {[string compare $winSys "x11"] == 0}]

    switch $scalingpct {
	100 {
	    if {$onX11} {
		set checkedData "
#define checked_width 9
#define checked_height 9
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xe2, 0x00, 0x76, 0x00, 0x3e, 0x00,
   0x1c, 0x00, 0x08, 0x00, 0x00, 0x00};

"
	    } else {
		set checkedData "
#define checked_width 7
#define checked_height 7
static unsigned char checked_bits[] = {
   0x40, 0x60, 0x71, 0x3b, 0x1f, 0x0e, 0x04};
"
	    }
	    set uncheckedData "
#define unchecked_width 9
#define unchecked_height 9
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

"
	}

	125 {
	    if {$onX11} {
		set checkedData "
#define checked_width 12
#define checked_height 12
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x80, 0x03, 0xc4, 0x01,
   0xec, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 12
#define unchecked_height 12
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    } else {
		set checkedData "
#define checked_width 8
#define checked_height 8
static unsigned char checked_bits[] = {
   0x80, 0xc0, 0xe0, 0x71, 0x3b, 0x1f, 0x0e, 0x04};
"
		set uncheckedData "
#define unchecked_width 10
#define unchecked_height 10
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    }
	}

	150 {
	    if {$onX11} {
		set checkedData "
#define checked_width 16
#define checked_height 16
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x38, 0x00, 0x3c,
   0x00, 0x1e, 0x0c, 0x0f, 0x9c, 0x07, 0xfc, 0x03, 0xf8, 0x01, 0xf0, 0x00,
   0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 16
#define unchecked_height 16
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    } else {
		set checkedData "
#define checked_width 12
#define checked_height 12
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x0f, 0x80, 0x07, 0xc3, 0x03,
   0xe7, 0x01, 0xff, 0x00, 0x7e, 0x00, 0x3c, 0x00, 0x18, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 14
#define unchecked_height 14
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00};
"
	    }
	}

	175 {
	    if {$onX11} {
		set checkedData "
#define checked_width 19
#define checked_height 19
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
   0x00, 0xc0, 0x01, 0x00, 0xe0, 0x01, 0x00, 0xf0, 0x01, 0x00, 0xf8, 0x00,
   0x0c, 0x7c, 0x00, 0x1c, 0x3e, 0x00, 0x3c, 0x1f, 0x00, 0xfc, 0x0f, 0x00,
   0xf8, 0x07, 0x00, 0xf0, 0x03, 0x00, 0xe0, 0x01, 0x00, 0xc0, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 19
#define unchecked_height 19
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    } else {
		set checkedData "
#define checked_width 15
#define checked_height 15
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x60, 0x00, 0x70, 0x00, 0x78, 0x00, 0x7c, 0x00, 0x3e,
   0x03, 0x1f, 0x87, 0x0f, 0xcf, 0x07, 0xff, 0x03, 0xfe, 0x01, 0xfc, 0x00,
   0x78, 0x00, 0x30, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 17
#define unchecked_height 17
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00};
"
	    }
	}

	200 {
	    if {$onX11} {
		set checkedData "
#define checked_width 22
#define checked_height 22
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
   0x00, 0x00, 0x0e, 0x00, 0x00, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x0f,
   0x00, 0xe0, 0x07, 0x0c, 0xf0, 0x03, 0x1c, 0xf8, 0x01, 0x3c, 0xfc, 0x00,
   0x7c, 0x7e, 0x00, 0xfc, 0x3f, 0x00, 0xf8, 0x1f, 0x00, 0xf0, 0x0f, 0x00,
   0xe0, 0x07, 0x00, 0xc0, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 22
#define unchecked_height 22
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    } else {
		set checkedData "
#define checked_width 18
#define checked_height 18
static unsigned char checked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x80, 0x03, 0x00, 0xc0, 0x03,
   0x00, 0xe0, 0x03, 0x00, 0xf0, 0x03, 0x00, 0xf8, 0x01, 0x03, 0xfc, 0x00,
   0x07, 0x7e, 0x00, 0x0f, 0x3f, 0x00, 0x9f, 0x1f, 0x00, 0xff, 0x0f, 0x00,
   0xfe, 0x07, 0x00, 0xfc, 0x03, 0x00, 0xf8, 0x01, 0x00, 0xf0, 0x00, 0x00,
   0x60, 0x00, 0x00, 0x00, 0x00, 0x00};
"
		set uncheckedData "
#define unchecked_width 20
#define unchecked_height 20
static unsigned char unchecked_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
"
	    }
	}
    }

    tablelist_checkedImg   configure -data $checkedData
    tablelist_uncheckedImg configure -data $uncheckedData
}

#------------------------------------------------------------------------------
# tablelist::adwaitaTreeImgs
#------------------------------------------------------------------------------
proc tablelist::adwaitaTreeImgs {} {
    foreach mode {collapsed expanded collapsedSel expandedSel

Changes to modules/tablelist/scripts/tablelistThemes.tcl.

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
...
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
...
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
...
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
	-labeldisabledFg	#a3a3a3 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		winnative \
    ]
}

#------------------------------------------------------------------------------
# tablelist::aquaTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#999999 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		3 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::classicTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#a3a3a3 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	1 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::keramikTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#b2b2b2 \
	-labelactiveFg		#ffe7cb \
	-labelpressedFg		#ffe7cb \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::plastikTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#666666 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::srivlgTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#666666 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::stepTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#808080 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		flat8x4 \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::tileqtTheme
#







|







 







|







 







|







 







|







 







|







 







|







 







|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
...
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
...
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
...
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
	-labeldisabledFg	#a3a3a3 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		winnative \
    ]
}

#------------------------------------------------------------------------------
# tablelist::aquaTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#999999 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		3 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::classicTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#a3a3a3 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	1 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::keramikTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#b2b2b2 \
	-labelactiveFg		#ffe7cb \
	-labelpressedFg		#ffe7cb \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::plastikTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#666666 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::srivlgTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#666666 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::stepTheme
#------------------------------------------------------------------------------
................................................................................
	-labeldisabledFg	#808080 \
	-labelactiveFg		black \
	-labelpressedFg		black \
	-labelfont		TkDefaultFont \
	-labelborderwidth	2 \
	-labelpady		1 \
	-arrowcolor		black \
	-arrowstyle		[defaultX11ArrowStyle] \
	-treestyle		gtk \
    ]
}

#------------------------------------------------------------------------------
# tablelist::tileqtTheme
#

Changes to modules/tablelist/scripts/tablelistUtil.tcl.

6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577


6578
6579
6580
6581
6582
6583
6584
6585
6586

6587
6588








6589
6590
6591
6592
6593
6594
6595
....
6673
6674
6675
6676
6677
6678
6679
6680

6681









6682

6683










6684

6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695

6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
....
6714
6715
6716
6717
6718
6719
6720
6721
6722


6723
6724
6725
6726


6727

6728
6729
6730
6731
6732
6733
6734
....
6788
6789
6790
6791
6792
6793
6794
6795

6796
6797

6798


6799
6800

6801
6802
6803
6804
6805
6806
6807
6808
6809
	    if {![info exists checkedImg]} {
		createCheckbuttonImgs
	    }

	    $w configure -borderwidth 2 -indicatoron 0 \
		-image $uncheckedImg -selectimage $checkedImg
	    if {$::tk_version >= 8.4} {
		$w configure -offrelief sunken	;# -offrelief was added in Tk8.4
	    }
	    pack $w
	}

	win32 {


	    $frm configure -width 13 -height 13
	    $w configure -borderwidth 0 -font {"MS Sans Serif" 8}
	    switch [winfo reqheight $w] {
		15	{ set y -1 }
		18	{ set y -3 }
		23	{ set y -5 }
		28 -
		29	{ set y -8 }
		default	{ set y -1 }

	    }
	    place $w -x -1 -y $y








	}

	classic {
	    $frm configure -width 16 -height 14
	    $w configure -borderwidth 0 -font "system"
	    place $w -x 0 -y -1
	}
................................................................................
    createTileAliases 

    #
    # Define the checkbutton layout; use catch to suppress
    # the error message in case the layout already exists
    #
    set currentTheme [mwutil::currentTheme]
    if {[string compare $currentTheme "aqua"] == 0} {

	catch {style layout Tablelist.TCheckbutton { Checkbutton.button }}









    } else {

	catch {style layout Tablelist.TCheckbutton { Checkbutton.indicator }}










	styleConfig Tablelist.TCheckbutton -indicatormargin 0

    }

    ttk::checkbutton $w -style Tablelist.TCheckbutton -takefocus 0

    #
    # Adjust the dimensions of the tile checkbutton's parent
    # and manage the checkbutton, depending on the current theme
    #
    set frm [winfo parent $w]
    switch -- $currentTheme {
	aqua {

	    variable newAquaSupport
	    if {$newAquaSupport} {
		$frm configure -width 18 -height 18
		place $w -x 0 -y -1
	    } else {
		$frm configure -width 16 -height 16
		place $w -x -3 -y -3
	    }
	}

	Aquativo -
	aquativo -
	Arc {
................................................................................
	winxpblue {
	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height
	    place $w -x 0
	}

	clam {
	    $frm configure -width 11 -height 11
	    place $w -x 0


	}

	classic -
	default {


	    styleConfig Tablelist.TCheckbutton -background white

	    pack $w
	}

	clearlooks {
	    $frm configure -width 13 -height 13
	    place $w -x -2 -y -2
	}
................................................................................
		    set height [winfo reqheight $w]
		    $frm configure -width $height -height $height
		    place $w -x 0
		}
	    }
	}

	vista {

	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height

	    place $w -x 0


	}


	winnative -
	xpnative {
	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height
	    if {[info exists ::tile::version]} {
		place $w -x -2
	    } else {
		place $w -x 0
	    }







|





>
>
|
|
<
<
|
|
|
|
|
>
|
<
>
>
>
>
>
>
>
>







 







|
>
|
>
>
>
>
>
>
>
>
>
|
>
|
>
>
>
>
>
>
>
>
>
>
|
>











>


<
|

<







 







|
|
>
>




>
>
|
>







 







|
>


>
|
>
>
|
|
>
|
<







6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581


6582
6583
6584
6585
6586
6587
6588

6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
....
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728

6729
6730

6731
6732
6733
6734
6735
6736
6737
....
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
....
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840

6841
6842
6843
6844
6845
6846
6847
	    if {![info exists checkedImg]} {
		createCheckbuttonImgs
	    }

	    $w configure -borderwidth 2 -indicatoron 0 \
		-image $uncheckedImg -selectimage $checkedImg
	    if {$::tk_version >= 8.4} {
		$w configure -offrelief sunken	;# -offrelief added in Tk8.4
	    }
	    pack $w
	}

	win32 {
	    variable scalingpct
	    if {$scalingpct == 100} {
		$frm configure -width 13 -height 13
		$w configure -borderwidth 0 -font {"MS Sans Serif" 8}


		place $w -x -1 -y -1
	    } else {
		variable checkedImg
		variable uncheckedImg
		if {![info exists checkedImg]} {
		    createCheckbuttonImgs
		}


		$w configure -borderwidth 2 -indicatoron 0 \
		    -image $uncheckedImg -selectimage $checkedImg
		if {$::tk_version >= 8.4} {
		    $w configure -offrelief sunken ;# -offrelief added in Tk8.4
		}
		pack $w
	    }
	}

	classic {
	    $frm configure -width 16 -height 14
	    $w configure -borderwidth 0 -font "system"
	    place $w -x 0 -y -1
	}
................................................................................
    createTileAliases 

    #
    # Define the checkbutton layout; use catch to suppress
    # the error message in case the layout already exists
    #
    set currentTheme [mwutil::currentTheme]
    switch -- $currentTheme {
	aqua {
	    catch {style layout Tablelist.TCheckbutton { Checkbutton.button }}
	}

	vista -
	xpnative {
	    if {[llength [style lookup TCheckbutton -padding]] == 1} {
		catch {
		    style layout Tablelist.TCheckbutton \
			  { Checkbutton.indicator }
		}
	    } else {
		catch {
		    style layout Tablelist.TCheckbutton \
			  { Checkbutton.vsapi_indicator }
		}
	    }
	}

	default {
	    catch {
		style layout Tablelist.TCheckbutton \
		      { Checkbutton.indicator }
	    }
	    styleConfig Tablelist.TCheckbutton -indicatormargin 0
	}
    }

    ttk::checkbutton $w -style Tablelist.TCheckbutton -takefocus 0

    #
    # Adjust the dimensions of the tile checkbutton's parent
    # and manage the checkbutton, depending on the current theme
    #
    set frm [winfo parent $w]
    switch -- $currentTheme {
	aqua {
	    $frm configure -width 16 -height 16
	    variable newAquaSupport
	    if {$newAquaSupport} {

		place $w -x -1 -y -2
	    } else {

		place $w -x -3 -y -3
	    }
	}

	Aquativo -
	aquativo -
	Arc {
................................................................................
	winxpblue {
	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height
	    place $w -x 0
	}

	clam {
	    variable scalingpct
	    array set arr {100 11  125 14  150 18  175 21  200 24}
	    styleConfig Tablelist.TCheckbutton -indicatorsize $arr($scalingpct)
	    pack $w
	}

	classic -
	default {
	    variable scalingpct
	    array set arr {100 11  125 14  150 18  175 21  200 24}
	    styleConfig Tablelist.TCheckbutton -background white \
		-indicatordiameter $arr($scalingpct)
	    pack $w
	}

	clearlooks {
	    $frm configure -width 13 -height 13
	    place $w -x -2 -y -2
	}
................................................................................
		    set height [winfo reqheight $w]
		    $frm configure -width $height -height $height
		    place $w -x 0
		}
	    }
	}

	vista -
	xpnative {
	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height
	    if {[llength [style lookup TCheckbutton -padding]] == 1} {
		place $w -x 0
	    } else {
		place $w -x -4
	    }
	}

	winnative {

	    set height [winfo reqheight $w]
	    $frm configure -width $height -height $height
	    if {[info exists ::tile::version]} {
		place $w -x -2
	    } else {
		place $w -x 0
	    }

Changes to modules/tablelist/scripts/tablelistWidget.tcl.

21
22
23
24
25
26
27














28











29
30
31
32
33
34
35
    # Get the windowing system ("x11", "win32", "classic", or "aqua")
    #
    variable winSys [mwutil::windowingSystem]

    #
    # Get the display's current scaling percentage (100, 125, 150, 175, or 200)
    #














    variable scalingpct [mwutil::scalingPercentage]












    #
    # Create aliases for a few tile commands if not yet present
    #
    proc createTileAliases {} {
	if {[string length [interp alias {} ::tablelist::style]] != 0} {
	    return ""







>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    # Get the windowing system ("x11", "win32", "classic", or "aqua")
    #
    variable winSys [mwutil::windowingSystem]

    #
    # Get the display's current scaling percentage (100, 125, 150, 175, or 200)
    #
    variable scalingpct [scaleutil::scalingPercentage $winSys]

    #
    # Make the variable scalingpct read-only
    #
    trace variable scalingpct wu \
	  [list tablelist::restoreScalingpct $scalingpct]

    #
    # The following trace procedure is executed whenever the
    # variable scalingpct is written or unset.  It restores the
    # variable to its original value, given by the first argument.
    #
    proc restoreScalingpct {origVal varName index op} {
	variable scalingpct $origVal
	switch $op {
	    w {
		return -code error "the variable ::tablelist::scalingpct is\
				    read-only"
	    }
	    u {
		trace variable scalingpct wu \
		      [list tablelist::restoreScalingpct $origVal]
	    }
	}
    }

    #
    # Create aliases for a few tile commands if not yet present
    #
    proc createTileAliases {} {
	if {[string length [interp alias {} ::tablelist::style]] != 0} {
	    return ""