Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Tablelist: Added bindings that invoke "expand|collapse ... -fully". |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
bd4a56421e9e139b52a59ccf3e77863d |
User & Date: | csaba 2025-08-02 10:58:51.606 |
Context
2025-08-02
| ||
11:52 | Tooltip: Fix for ticket [9924aee881]. Thanks to Ralf Fassel for his patch. check-in: ced0a69b39 user: csaba tags: trunk | |
10:58 | Tablelist: Added bindings that invoke "expand|collapse ... -fully". check-in: bd4a56421e user: csaba tags: trunk | |
2025-07-29
| ||
13:55 | Tsw: Made sure that tsw::toggleswitch and future ttk::toggleswitch widgets won't conflict. check-in: 79bfeabd8f user: csaba tags: trunk | |
Changes
Changes to modules/tablelist/CHANGES.txt.
1 2 3 | What is new in Tablelist 7.7? ----------------------------- | > > > > > | | | | | 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 | What is new in Tablelist 7.7? ----------------------------- 1. Added bindings that invoke "expand|collapse ... -fully" for the events <Control-Button-1> (over an expand/collapse control), <Control-Right|plus|KP_Add>, and <Control-Left|minus|KP_Subtract> (thanks to Torsten Berg for his proposal). 2. Added explicit support for the "droid" theme, which is the default in AndroWish. 3. Improvements related to the themes provided by the awthemes package and the ones that are not explicitly supported by Tablelist. 4. Improved the interactive cell editing with the aid of the toggleswitch widget. 5. The demo scripts "dirViewer.tcl" and "dirViewer_tile.tcl" now work around the fact that on Android the directory "/" is normally not readable. What was new in Tablelist 7.6? ------------------------------ 1. Added the "-button2window" configuration option, which makes it |
︙ | ︙ |
Changes to modules/tablelist/doc/tablelistWidget.html.
︙ | ︙ | |||
8938 8939 8940 8941 8942 8943 8944 | a tree widget, i.e., elides all their descendants. The optional argument <code><b>-fully</b></code> (which is the default) indicates that the command will be performed recursively, i.e., all of the descendants of the nodes specified by <code><i>indexList</i></code> will be collapsed, so that a subsequent invocation of the non-recursive version of the <code><b><a href="#expand">expand(all)</a></b></code> subcommand will only display their children but no further descendants | | | | | | | | 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 | a tree widget, i.e., elides all their descendants. The optional argument <code><b>-fully</b></code> (which is the default) indicates that the command will be performed recursively, i.e., all of the descendants of the nodes specified by <code><i>indexList</i></code> will be collapsed, so that a subsequent invocation of the non-recursive version of the <code><b><a href="#expand">expand(all)</a></b></code> subcommand will only display their children but no further descendants of them. The <code><b>-partly</b></code> option restricts the operation to just one hierarchy level, implying that by a subsequent invocation of the non-recursive version of the <code><b>expand(all)</b></code> subcommand exactly the same descendants will be displayed again that were visible prior to collapsing the rows.</dd> <dd class="tm">Before hiding the descendants of a row, the command specified as the value of the <code><b><a href= "#collapsecommand">-collapsecommand</a></b></code> option (if any) is automatically concatenated with the path name of the tablelist widget and the row index, and the resulting script is evaluated in the global scope.</dd> |
︙ | ︙ | |||
9769 9770 9771 9772 9773 9774 9775 | <i>indexList</i> ?<b>-fully</b>|<b>-partly</b>?</code></dt> <dd>This subcommand expands the specified rows of a tablelist used as a tree widget, i.e., makes all their children visible. The optional argument <code><b>-fully</b></code> (which is the default) indicates that the command will be performed recursively, i.e., all of the descendants of the nodes specified by <code><i>indexList</i></code> | | | | | < | 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 | <i>indexList</i> ?<b>-fully</b>|<b>-partly</b>?</code></dt> <dd>This subcommand expands the specified rows of a tablelist used as a tree widget, i.e., makes all their children visible. The optional argument <code><b>-fully</b></code> (which is the default) indicates that the command will be performed recursively, i.e., all of the descendants of the nodes specified by <code><i>indexList</i></code> will be displayed. The <code><b>-partly</b></code> option restricts the operation to just one hierarchy level, indicating that only the children of the specified nodes will be displayed, without changing the expanded/collapsed state of the child nodes.</dd> <dd class="tm">Before displaying the children of a row, the command specified as the value of the <code><b><a href= "#expandcommand">-expandcommand</a></b></code> option (if any) is automatically concatenated with the path name of the tablelist widget and the row index, and the resulting script is evaluated in the global scope. This enables you to insert a tree node's children on |
︙ | ︙ | |||
12611 12612 12613 12614 12615 12616 12617 | <dd class="tm"><b>TREE WIDGET BINDINGS:</b> The following bindings associated with the binding tag <code><b>TablelistBody</b></code> apply to tablelists used as tree widgets:</dd> <dd> <ol> <li class="tm">Pressing mouse button 1 over an expand/collapse control | | > > > > > > > > > | | > > | > | | | > > > | 12610 12611 12612 12613 12614 12615 12616 12617 12618 12619 12620 12621 12622 12623 12624 12625 12626 12627 12628 12629 12630 12631 12632 12633 12634 12635 12636 12637 12638 12639 12640 12641 12642 12643 12644 12645 12646 12647 12648 12649 12650 12651 | <dd class="tm"><b>TREE WIDGET BINDINGS:</b> The following bindings associated with the binding tag <code><b>TablelistBody</b></code> apply to tablelists used as tree widgets:</dd> <dd> <ol> <li class="tm">Pressing mouse button 1 over an expand/collapse control toggles the expanded/collapsed state of the corresponding row by invoking the non-recursive version of the <code><b><a href= "#expand">expand</a></b></code> or <code><b><a href= "#collapse">collapse</a></b></code> subcommand (the one with the <code><b>-partly</b></code> argument). Pressing mouse button 1 over an expand/collapse control with the <code>Control</code> key down toggles the expanded/collapsed state of the corresponding row with the aid of the <code><b>expand</b></code> or <code><b>collapse</b></code> subcommand's recursive version (the one with the <code><b>-fully</b></code> argument).</li> <li class="tm">If the current active row contains an expand/collapse control in collapsed state then the <code>Right</code>, <code>plus</code>, and <code>KP_Add</code> keys expand that row by invoking the non-recursive version of the <code><b>expand</b></code> subcommand, while <code>Control-Right</code>, <code>Control-plus</code>, and <code>Control-KP_Add</code> expand the row with the aid of the <code><b>expand</b></code> subcommand's recursive version.</li> <li class="tm">If the current active row contains an expand/collapse control in expanded state then the <code>Left</code>, <code>minus</code>, and <code>KP_Subtract</code> keys collapse that row by invoking the non-recursive version of the <code><b>collapse</b></code> subcommand, while <code>Control-Left</code>, <code>Control-minus</code>, and <code>Control-KP_Subtract</code> collapse the row with the aid of the <code><b>collapse</b></code> subcommand's recursive version.</li> </ol> </dd> <dt class="tm" id="header_bindings"><b>DEFAULT AND INDIVIDUAL BINDINGS FOR THE HEADER ITEMS</b></dt> <dd>The header items are contained in a text widget whose binding tag |
︙ | ︙ |
Changes to modules/tablelist/scripts/tablelistBind.tcl.
︙ | ︙ | |||
945 946 947 948 949 950 951 | set tablelist::priv(justClicked) 1 after 300 [list set tablelist::priv(justClicked) 0] set tablelist::priv(clickedInEditWin) 0 if {[$tablelist::W cget -setfocus] && [$tablelist::W cget -state] eq "normal"} { focus [$tablelist::W bodypath] } | | | 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 | set tablelist::priv(justClicked) 1 after 300 [list set tablelist::priv(justClicked) 0] set tablelist::priv(clickedInEditWin) 0 if {[$tablelist::W cget -setfocus] && [$tablelist::W cget -state] eq "normal"} { focus [$tablelist::W bodypath] } if {[tablelist::wasExpCollCtrlClicked %W %x %y <Button-1>]} { set tablelist::priv(clickedExpCollCtrl) 1 tablelist::doFinishEditing $tablelist::W } else { tablelist::condEditContainingCell $tablelist::W \ $tablelist::x $tablelist::y tablelist::condBeginMove $tablelist::W $tablelist::priv(row) tablelist::beginSelect $tablelist::W \ |
︙ | ︙ | |||
1044 1045 1046 1047 1048 1049 1050 | bind TablelistBody <Control-Button-1> { foreach {tablelist::W tablelist::x tablelist::y} \ [tablelist::convEventFields %W %x %y] {} if {$tablelist::y < [winfo y [$tablelist::W bodypath]]} { continue ;# on a vertical separator, outside the body } | > > > > > | | | < > | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 | bind TablelistBody <Control-Button-1> { foreach {tablelist::W tablelist::x tablelist::y} \ [tablelist::convEventFields %W %x %y] {} if {$tablelist::y < [winfo y [$tablelist::W bodypath]]} { continue ;# on a vertical separator, outside the body } if {[tablelist::wasExpCollCtrlClicked %W %x %y <Control-Button-1>]} { set tablelist::priv(clickedExpCollCtrl) 1 tablelist::condFinishEditing $tablelist::W \ $tablelist::x $tablelist::y } else { tablelist::beginToggle $tablelist::W \ [$tablelist::W nearest $tablelist::y] \ [$tablelist::W nearestcolumn $tablelist::x] } } bind TablelistBody <Button-2> { tablelist::handleBtn2Event <Button-2> %W %x %y %X %Y } bind TablelistBody <B2-Motion> { tablelist::handleBtn2Event <B2-Motion> %W %x %y %X %Y } |
︙ | ︙ | |||
1074 1075 1076 1077 1078 1079 1080 | bind TablelistBody <Shift-Tab> { tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 } bind TablelistBody <<PrevWindow>> { tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 } bind TablelistBody <plus> { | | | | | | > > > > > > > > > | > > > | 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 1106 1107 1108 1109 1110 1111 1112 1113 1114 | bind TablelistBody <Shift-Tab> { tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 } bind TablelistBody <<PrevWindow>> { tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 } bind TablelistBody <plus> { tablelist::plusMinus [tablelist::getTablelistPath %W] <plus> } bind TablelistBody <KP_Add> { tablelist::plusMinus [tablelist::getTablelistPath %W] <plus> } bind TablelistBody <minus> { tablelist::plusMinus [tablelist::getTablelistPath %W] <minus> } bind TablelistBody <KP_Subtract> { tablelist::plusMinus [tablelist::getTablelistPath %W] <minus> } bind TablelistBody <Control-plus> { tablelist::plusMinus [tablelist::getTablelistPath %W] <Control-plus> } bind TablelistBody <Control-KP_Add> { tablelist::plusMinus [tablelist::getTablelistPath %W] <Control-plus> } bind TablelistBody <Control-minus> { tablelist::plusMinus [tablelist::getTablelistPath %W] <Control-minus> } bind TablelistBody <Control-KP_Subtract> { tablelist::plusMinus [tablelist::getTablelistPath %W] <Control-minus> } foreach {virtual event} { PrevLine <Up> NextLine <Down> PrevChar <Left> NextChar <Right> LineStart <Home> LineEnd <End> PrevWord <Control-Left> NextWord <Control-Right> |
︙ | ︙ | |||
1110 1111 1112 1113 1114 1115 1116 | bind TablelistBody $eventArr(PrevLine) { tablelist::upDown [tablelist::getTablelistPath %W] -1 } bind TablelistBody $eventArr(NextLine) { tablelist::upDown [tablelist::getTablelistPath %W] 1 } bind TablelistBody $eventArr(PrevChar) { | | | > > > > > > | 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 | bind TablelistBody $eventArr(PrevLine) { tablelist::upDown [tablelist::getTablelistPath %W] -1 } bind TablelistBody $eventArr(NextLine) { tablelist::upDown [tablelist::getTablelistPath %W] 1 } bind TablelistBody $eventArr(PrevChar) { tablelist::leftRight [tablelist::getTablelistPath %W] <Left> } bind TablelistBody $eventArr(NextChar) { tablelist::leftRight [tablelist::getTablelistPath %W] <Right> } bind TablelistBody $eventArr(PrevWord) { tablelist::leftRight [tablelist::getTablelistPath %W] <Control-Left> } bind TablelistBody $eventArr(NextWord) { tablelist::leftRight [tablelist::getTablelistPath %W] <Control-Right> } bind TablelistBody <Prior> { tablelist::priorNext [tablelist::getTablelistPath %W] -1 } bind TablelistBody <Next> { tablelist::priorNext [tablelist::getTablelistPath %W] 1 } |
︙ | ︙ | |||
1331 1332 1333 1334 1335 1336 1337 | $tablelist::W selection clear 0 end tablelist::genTablelistSelectEvent $tablelist::W } } } } | < | | 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 | $tablelist::W selection clear 0 end tablelist::genTablelistSelectEvent $tablelist::W } } } } foreach event {<Control-Prior> <Control-Next> <<Copy>>} { set script [string map { "%W" "$tablelist::W" "%x" "$tablelist::x" "%y" "$tablelist::y" } [bind Listbox $event]] if {$script ne ""} { ##nagelfar ignore bind TablelistBody $event [format { |
︙ | ︙ | |||
1662 1663 1664 1665 1666 1667 1668 | } #------------------------------------------------------------------------------ # tablelist::wasExpCollCtrlClicked # # This procedure is invoked when mouse button 1 is pressed in the body of a # tablelist widget or in one of its separators. It checks whether the mouse | | > | | 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 | } #------------------------------------------------------------------------------ # tablelist::wasExpCollCtrlClicked # # This procedure is invoked when mouse button 1 is pressed in the body of a # tablelist widget or in one of its separators. It checks whether the mouse # click occurred inside an expand/collapse control, and if this was the case # then it partially or fully expands or collapses the corresponding row. #------------------------------------------------------------------------------ proc tablelist::wasExpCollCtrlClicked {w x y event} { foreach {win _x _y} [convEventFields $w $x $y] {} set row [containingRow $win $_y] set col [containingCol $win $_x] upvar ::tablelist::ns${win}::data data set key [lindex $data(keyList) $row] set indentLabel $data(body).ind_$key,$col if {![winfo exists $indentLabel]} { |
︙ | ︙ | |||
1715 1716 1717 1718 1719 1720 1721 1722 | if {!$inExpCollCtrl || $data(isDisabled)} { return 0 } # # Toggle the state of the expand/collapse control # if {[::$win cget -showbusycursor]} { ::$win setbusycursor } | > > < | < < < | 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 | if {!$inExpCollCtrl || $data(isDisabled)} { return 0 } # # Toggle the state of the expand/collapse control # set op [expr {$mode eq "collapsed" ? "expand" : "collapse"}] set how [expr {$event eq "<Button-1>" ? "-partly" : "-fully"}] if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win $op $row $how ;# can take long ::$win restorecursor return 1 } #------------------------------------------------------------------------------ # tablelist::condEditContainingCell |
︙ | ︙ | |||
2680 2681 2682 2683 2684 2685 2686 | doEditCell $win $row $col 0 } } #------------------------------------------------------------------------------ # tablelist::plusMinus # | | | | | > > | | 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 | doEditCell $win $row $col 0 } } #------------------------------------------------------------------------------ # tablelist::plusMinus # # Partially or fully expands or collapses the active row if possible. #------------------------------------------------------------------------------ proc tablelist::plusMinus {win event} { upvar ::tablelist::ns${win}::data data if {$data(isDisabled)} { return "" } set row $data(activeRow) set col $data(treeCol) set key [lindex $data(keyList) $row] set op "" if {[info exists data($key,$col-indent)]} { set indentLabel $data(body).ind_$key,$col set imgName [$indentLabel cget -image] if {[regexp {^tablelist_(.+)_(collapsed|expanded).*Img$} \ $imgName dummy treeStyle mode]} { if {[string match "*plus>" $event] && $mode eq "collapsed"} { set op "expand" } elseif {[string match "*minus>" $event] && $mode eq "expanded"} { set op "collapse" } } } if {$op ne ""} { # # Toggle the state of the expand/collapse control # set how [expr {[string match "<Control-*>" $event] ? "-fully" : "-partly"}] if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win $op $row $how ;# can take long ::$win restorecursor } } #------------------------------------------------------------------------------ # tablelist::nextPrevCell # |
︙ | ︙ | |||
2805 2806 2807 2808 2809 2810 2811 | } } } #------------------------------------------------------------------------------ # tablelist::leftRight # | | | < | | | | | > > > > > | | | | | | | | | | | | | | | | > > > | | 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 | } } } #------------------------------------------------------------------------------ # tablelist::leftRight # # Partially or fully expands or collapses the active row if possible. # Otherwise, the procedure scrolls the widget horizontally by one unit or page, # or moves the active element left or right by one column and changes the # selection if we are in browse or extended selection mode. #------------------------------------------------------------------------------ proc tablelist::leftRight {win event} { upvar ::tablelist::ns${win}::data data set row $data(activeRow) set col $data(treeCol) set key [lindex $data(keyList) $row] set op "" if {[info exists data($key,$col-indent)] && !$data(isDisabled)} { set indentLabel $data(body).ind_$key,$col set imgName [$indentLabel cget -image] if {[regexp {^tablelist_(.+)_(collapsed|expanded).*Img$} \ $imgName dummy treeStyle mode]} { if {[string match "*Right>" $event] && $mode eq "collapsed"} { set op "expand" } elseif {[string match "*Left>" $event] && $mode eq "expanded"} { set op "collapse" } } } if {$op eq ""} { set amount [expr {[string match "*Right>" $event] ? 1 : -1}] if {[string match "<Control-*>" $event]} { ::$win xview scroll $amount pages } else { switch $data(-selecttype) { row { ::$win xview scroll $amount units } cell { if {$data(editRow) >= 0} { return "" } set col $data(activeCol) while 1 { incr col $amount if {$col < 0 || $col > $data(lastCol)} { return "" } elseif {!$data($col-hide)} { condChangeSelection $win $row $col return "" } } } } } } else { # # Toggle the state of the expand/collapse control # set how [expr {[string match "<Control-*>" $event] ? "-fully" : "-partly"}] if {[::$win cget -showbusycursor]} { ::$win setbusycursor } ::$win $op $row $how ;# can take long ::$win restorecursor } } #------------------------------------------------------------------------------ # tablelist::priorNext # |
︙ | ︙ |