Check-in [dbbd0a6c7c]
Not logged in

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

Overview
Comment:add tklib upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dbbd0a6c7cfc9d90a38780587ea271d40d7cf9c7
User & Date: chw 2018-08-29 04:05:57
Context
2018-09-01
18:09
small improvements in topcua subtree check-in: 3f3331faf2 user: chw tags: trunk
2018-08-29
04:05
add tklib upstream changes check-in: dbbd0a6c7c user: chw tags: trunk
04:05
add tk upstream changes check-in: 239018ccb5 user: chw tags: trunk
Changes

Changes to assets/tklib0.6/tablelist/CHANGES.txt.

19
20
21
22
23
24
25
26

27
28
29
30
31
32
33

4.  Besides the north-east corner frame there is now a south-west corner
    frame, designed to be used when managing the horizontal scrollbar
    in the presence of title columns.  The "cornerpath" subcommand now
    accepts the corner specification as optional argument.

5.  Significant optimizations in the item insertion as well as in the
    selection-related code.


6.  Adapted to some changes in future Tcl and Tk releases (for example,
    made sure that it works with Tcl 9.0 and Tk 8.7).

7.  Further improvements related to the interactive cell editing with
    the aid of the ctext widget (thanks to Sait Dogru for discussions on
    this subject).







|
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

4.  Besides the north-east corner frame there is now a south-west corner
    frame, designed to be used when managing the horizontal scrollbar
    in the presence of title columns.  The "cornerpath" subcommand now
    accepts the corner specification as optional argument.

5.  Significant optimizations in the item insertion as well as in the
    selection-related code (thanks to Johann Oberdorfer for testing and
    discussions on this subject).

6.  Adapted to some changes in future Tcl and Tk releases (for example,
    made sure that it works with Tcl 9.0 and Tk 8.7).

7.  Further improvements related to the interactive cell editing with
    the aid of the ctext widget (thanks to Sait Dogru for discussions on
    this subject).

Changes to assets/tklib0.6/tablelist/ChangeLog.











1
2
3
4
5
6
7










2018-08-17 Csaba Nemethi <csaba.nemethi@t-online.de>

	* tablelistPublic.tcl: Adapted to some changes in future Tcl and Tk
	* tablelist.tcl        releases (TIP 278, independent Tcl and Tk
	* tablelist_tile.tcl   versions).
	* scripts/mwutil.tcl

>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2018-08-28 Csaba Nemethi <csaba.nemethi@t-online.de>

	* CHANGES.txt: Slightly extended.

	* scripts/tablelistWidget.tcl: Bugfixes and further optimizations.

2018-08-18 Csaba Nemethi <csaba.nemethi@t-online.de>

	* CHANGES.txt: Updated to reflect the changes committed yesterday.

2018-08-17 Csaba Nemethi <csaba.nemethi@t-online.de>

	* tablelistPublic.tcl: Adapted to some changes in future Tcl and Tk
	* tablelist.tcl        releases (TIP 278, independent Tcl and Tk
	* tablelist_tile.tcl   versions).
	* scripts/mwutil.tcl

Changes to assets/tklib0.6/tablelist/scripts/tablelistWidget.tcl.

7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
....
7285
7286
7287
7288
7289
7290
7291












7292





7293
7294
7295
7296
7297
7298
7299
....
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
....
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
....
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540























7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553

7554
7555
7556
7557
7558
7559
7560
7561
....
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
....
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
....
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
			    childIdx} {
    set argCount [llength $argList]
    if {$argCount == 0} {
	return {}
    }

    upvar ::tablelist::ns${win}::data data
    if {$index < $data(itemCount)} {
	displayItems $win
    }

    if {$index < 0} {
	set index 0
    } elseif {$index > $data(itemCount)} {
	set index $data(itemCount)
    }

    set childCount [llength $data($parentKey-children)]
................................................................................
	}

	lappend result $key

	incr row
	incr childIdx
    }












    lappend data(segmentsToDisplay) $index $argCount





    incr data(itemCount) $argCount
    set data(lastRow) [expr {$data(itemCount) - 1}]

    if {$updateListVar} {
	trace variable var wu $data(listVarTraceCmd)
    }

................................................................................
			      $pixels $snipSide $snipStr]
		}
	    }

	    if {$multiline} {
		lappend insertArgs "\t\t" $colTags
		lappend multilineData \
			$line $col $text $colFont $pixels $alignment
	    } else {
		lappend insertArgs "\t$text\t" $colTags
	    }

	    incr col
	}

................................................................................
    # Insert the items into the header text widget
    #
    eval [list $w insert $indexLine.0] $insertArgs

    #
    # Embed the message widgets displaying multiline elements
    #
    foreach {line col text font pixels alignment} $multilineData {
	findTabs $win $w $line $col $col tabIdx1 tabIdx2
	set msgScript [list ::tablelist::displayText $win $key $col $text \
		       $font $pixels $alignment]
	$w window create $tabIdx2 -align top -pady $padY -create $msgScript
    }

    #
................................................................................
# execution of some widget commands.  It displays the inserted items.
#------------------------------------------------------------------------------
proc tablelist::displayItems win {
    #
    # Nothing to do if there are no items to display
    #
    upvar ::tablelist::ns${win}::data data
    if {![info exists data(dispId)] ||
	![info exists data(segmentsToDisplay)]} {
	return ""
    }

    #
    # Here we are in the case that the procedure was scheduled for
    # execution at idle time.  However, it might have been invoked
    # directly, before the idle time occured; in this case we should
    # cancel the execution of the previously scheduled idle callback.
    #
    after cancel $data(dispId)	;# no harm if data(dispId) is no longer valid
    unset data(dispId)
























    #
    # Insert the items into the body text widget
    #
    variable canElide
    variable snipSides
    set w $data(body)
    set widgetFont $data(-font)
    set snipStr $data(-snipstring)
    set padY [expr {[$w cget -spacing1] == 0}]
    variable pu
    set wasEmpty [$w compare end-1$pu == 1.0]
    set isEmpty $wasEmpty

    foreach {startRow rowCount} $data(segmentsToDisplay) {
	set startLine [expr {$startRow + 1}]
	if {$isEmpty} {
	    set isEmpty 0
	} else {
	    $w insert $startLine.0 "\n"
	    $w tag remove elidedRow $startLine.0
	    $w tag remove hiddenRow $startLine.0
................................................................................
			    set text [strRange $win $text $colFont \
				      $pixels $snipSide $snipStr]
			}
		    }

		    if {$multiline} {
			lappend insertArgs "\t\t" $colTags
			lappend multilineData \
				$line $col $text $colFont $pixels $alignment
		    } elseif {$data(-displayondemand)} {
			lappend insertArgs "\t\t" $colTags
		    } else {
			lappend insertArgs "\t$text\t" $colTags
		    }

		    incr col
................................................................................
			    set text [strRange $win $text $widgetFont \
				      $pixels $snipSide $snipStr]
			}
		    }

		    if {$multiline} {
			append insertStr "\t\t"
			lappend multilineData \
				$line $col $text $widgetFont $pixels $alignment
		    } elseif {$data(-displayondemand)} {
			append insertStr "\t\t"
		    } else {
			append insertStr "\t$text\t"
		    }

		    incr col
................................................................................
	} else {
	    $w insert $startLine.0 $insertStr
	}

	#
	# Embed the message widgets displaying multiline elements
	#
	foreach {line col text font pixels alignment} $multilineData {
	    findTabs $win $w $line $col $col tabIdx1 tabIdx2
	    set msgScript [list ::tablelist::displayText $win $key $col $text \
			   $font $pixels $alignment]
	    $w window create $tabIdx2 -align top -pady $padY -create $msgScript
	    $w tag add elidedWin $tabIdx2
	}
    }
    unset data(segmentsToDisplay)

    #
    # Adjust the heights of the body text widget
    # and of the listbox child, if necessary
    #
    if {$data(-height) <= 0} {
	set viewableRowCount \







<
<
<
<







 







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







 







|







 







|







 







|
<











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













>
|







 







|
|







 







|
|







 







|







<







7199
7200
7201
7202
7203
7204
7205




7206
7207
7208
7209
7210
7211
7212
....
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
....
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
....
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
....
7534
7535
7536
7537
7538
7539
7540
7541

7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
....
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
....
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
....
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789

7790
7791
7792
7793
7794
7795
7796
			    childIdx} {
    set argCount [llength $argList]
    if {$argCount == 0} {
	return {}
    }

    upvar ::tablelist::ns${win}::data data




    if {$index < 0} {
	set index 0
    } elseif {$index > $data(itemCount)} {
	set index $data(itemCount)
    }

    set childCount [llength $data($parentKey-children)]
................................................................................
	}

	lappend result $key

	incr row
	incr childIdx
    }

    #
    # Update or extend the list data(segmentList)
    #
    if {[info exists data(segmentList)]} {
	set lastSegment [lindex $data(segmentList) end]
	foreach {startRow rowCount} $lastSegment {}
	if {$index == $startRow + $rowCount} {
	    incr rowCount $argCount
	    set data(segmentList) \
		[lreplace $data(segmentList) end end [list $startRow $rowCount]]
	} else {
	    lappend data(segmentList) [list $index $argCount]
	}
    } else {
	lappend data(segmentList) [list $index $argCount]
    }

    incr data(itemCount) $argCount
    set data(lastRow) [expr {$data(itemCount) - 1}]

    if {$updateListVar} {
	trace variable var wu $data(listVarTraceCmd)
    }

................................................................................
			      $pixels $snipSide $snipStr]
		}
	    }

	    if {$multiline} {
		lappend insertArgs "\t\t" $colTags
		lappend multilineData \
			$line $key $col $text $colFont $pixels $alignment
	    } else {
		lappend insertArgs "\t$text\t" $colTags
	    }

	    incr col
	}

................................................................................
    # Insert the items into the header text widget
    #
    eval [list $w insert $indexLine.0] $insertArgs

    #
    # Embed the message widgets displaying multiline elements
    #
    foreach {line key col text font pixels alignment} $multilineData {
	findTabs $win $w $line $col $col tabIdx1 tabIdx2
	set msgScript [list ::tablelist::displayText $win $key $col $text \
		       $font $pixels $alignment]
	$w window create $tabIdx2 -align top -pady $padY -create $msgScript
    }

    #
................................................................................
# execution of some widget commands.  It displays the inserted items.
#------------------------------------------------------------------------------
proc tablelist::displayItems win {
    #
    # Nothing to do if there are no items to display
    #
    upvar ::tablelist::ns${win}::data data
    if {![info exists data(dispId)]} {

	return ""
    }

    #
    # Here we are in the case that the procedure was scheduled for
    # execution at idle time.  However, it might have been invoked
    # directly, before the idle time occured; in this case we should
    # cancel the execution of the previously scheduled idle callback.
    #
    after cancel $data(dispId)	;# no harm if data(dispId) is no longer valid
    unset data(dispId)

    if {![info exists data(segmentList)]} {
	return ""
    }

    #
    # Keep the memory consumption within reasonable
    # limits by splitting the segments into chunks
    #
    set chunkSize 5000
    set segmentList {}
    foreach segment $data(segmentList) {
	foreach {startRow rowCount} $segment {}
	while {$rowCount >= $chunkSize} {
	    lappend segmentList [list $startRow $chunkSize]
	    incr startRow  $chunkSize
	    incr rowCount -$chunkSize
	}
	if {$rowCount != 0} {
	    lappend segmentList [list $startRow $rowCount]
	}
    }
    unset data(segmentList)

    #
    # Insert the items into the body text widget
    #
    variable canElide
    variable snipSides
    set w $data(body)
    set widgetFont $data(-font)
    set snipStr $data(-snipstring)
    set padY [expr {[$w cget -spacing1] == 0}]
    variable pu
    set wasEmpty [$w compare end-1$pu == 1.0]
    set isEmpty $wasEmpty
    foreach segment $segmentList {
	foreach {startRow rowCount} $segment {}
	set startLine [expr {$startRow + 1}]
	if {$isEmpty} {
	    set isEmpty 0
	} else {
	    $w insert $startLine.0 "\n"
	    $w tag remove elidedRow $startLine.0
	    $w tag remove hiddenRow $startLine.0
................................................................................
			    set text [strRange $win $text $colFont \
				      $pixels $snipSide $snipStr]
			}
		    }

		    if {$multiline} {
			lappend insertArgs "\t\t" $colTags
			lappend multilineData $line $key $col $text \
					      $colFont $pixels $alignment
		    } elseif {$data(-displayondemand)} {
			lappend insertArgs "\t\t" $colTags
		    } else {
			lappend insertArgs "\t$text\t" $colTags
		    }

		    incr col
................................................................................
			    set text [strRange $win $text $widgetFont \
				      $pixels $snipSide $snipStr]
			}
		    }

		    if {$multiline} {
			append insertStr "\t\t"
			lappend multilineData $line $key $col $text \
					      $widgetFont $pixels $alignment
		    } elseif {$data(-displayondemand)} {
			append insertStr "\t\t"
		    } else {
			append insertStr "\t$text\t"
		    }

		    incr col
................................................................................
	} else {
	    $w insert $startLine.0 $insertStr
	}

	#
	# Embed the message widgets displaying multiline elements
	#
	foreach {line key col text font pixels alignment} $multilineData {
	    findTabs $win $w $line $col $col tabIdx1 tabIdx2
	    set msgScript [list ::tablelist::displayText $win $key $col $text \
			   $font $pixels $alignment]
	    $w window create $tabIdx2 -align top -pady $padY -create $msgScript
	    $w tag add elidedWin $tabIdx2
	}
    }


    #
    # Adjust the heights of the body text widget
    # and of the listbox child, if necessary
    #
    if {$data(-height) <= 0} {
	set viewableRowCount \