Unnamed Fossil Project

Check-in [1e7da3b02d]
Login

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

Overview
Comment:new code for treeview and new class tagset
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1e7da3b02db3be4adcea6c0625bb8758a12b17a9
User & Date: arnulf 2013-09-15 13:58:04
Context
2013-09-15
19:37
new code and fixes for treeview check-in: 36c7c055cc user: arnulf tags: trunk
13:58
new code for treeview and new class tagset check-in: 1e7da3b02d user: arnulf tags: trunk
13:53
initial version check-in: 57098b6804 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PKG_STUB_OBJECTS = 

#========================================================================
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
#========================================================================

PKG_TCL_SOURCES =  library/ntkBaseElement.tcl library/ntkBackgroundElement.tcl library/ntkBorderElement.tcl library/ntkButtonBorderElement.tcl library/ntkFieldElement.tcl library/ntkFillElement.tcl library/ntkFocusElement.tcl library/ntkDiamondIndicatorElement.tcl library/ntkHighlightElement.tcl library/ntkImageElement.tcl library/ntkIndicatorElement.tcl library/ntkLabelElement.tcl library/ntkMenuIndicatorElement.tcl library/ntkPaddingElement.tcl library/ntkSeparatorElement.tcl library/ntkSizegripElement.tcl library/ntkSquareIndicatorElement.tcl library/ntkTextElement.tcl library/ntkTextareaElement.tcl library/ntkArrowElement.tcl library/ntkDownarrowElement.tcl library/ntkUparrowElement.tcl library/ntkLeftarrowElement.tcl library/ntkRightarrowElement.tcl library/ntkTreeitemIndicatorElement.tcl library/ntkTreerowElement.tcl library/ntkTreeareaElement.tcl library/ntkTroughElement.tcl library/ntkThumbElement.tcl library/ntkSashElement.tcl library/ntkSliderElement.tcl library/ntkDebug.tcl library/ntkUtils.tcl library/ntkBorder.tcl library/ntkLayout.tcl library/ntkTButtonBase.tcl library/ntkTButton.tcl library/ntkButton.tcl library/ntkTEntryBase.tcl library/ntkTEntry.tcl library/ntkEntry.tcl library/ntkTScrollbarBase.tcl library/ntkTScrollbar.tcl library/ntkScrollbar.tcl library/ntkScroll.tcl library/ntkTFrameBase.tcl library/ntkTFrame.tcl library/ntkTLabelframe.tcl library/ntkFrame.tcl library/ntkTPanedwindow.tcl library/ntkTTreeview.tcl library/ntkTCombobox.tcl library/ntkTLabel.tcl library/ntkTCheckbutton.tcl library/ntkTRadiobutton.tcl library/ntkTMenubutton.tcl library/ntkWidgetInfo.tcl library/ntkWidget.tcl library/ntkInit.tcl library/ntkManager.tcl library/ntkTheme.tcl library/ntkElements.tcl library/ntkLabel.tcl library/ntkPanedwindow.tcl library/ntkTreeview.tcl library/ntkImage.tcl library/ntkAltTheme.tcl library/ntkClassicTheme.tcl library/ntkClamTheme.tcl library/ntkPack.tcl library/ntkBind.tcl library/ntkFocus.tcl library/ntkButtonBindings.tcl library/ntkGenerateEvent.tcl library/tclIndex themedntk.tcl

#========================================================================
# This is a list of public header files to be installed, if any.
#========================================================================

PKG_HEADERS	= 








|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
PKG_STUB_OBJECTS = 

#========================================================================
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
#========================================================================

PKG_TCL_SOURCES =  library/ntkBaseElement.tcl library/ntkBackgroundElement.tcl library/ntkBorderElement.tcl library/ntkButtonBorderElement.tcl library/ntkFieldElement.tcl library/ntkFillElement.tcl library/ntkFocusElement.tcl library/ntkDiamondIndicatorElement.tcl library/ntkHighlightElement.tcl library/ntkImageElement.tcl library/ntkIndicatorElement.tcl library/ntkLabelElement.tcl library/ntkMenuIndicatorElement.tcl library/ntkPaddingElement.tcl library/ntkSeparatorElement.tcl library/ntkSizegripElement.tcl library/ntkSquareIndicatorElement.tcl library/ntkTextElement.tcl library/ntkTextareaElement.tcl library/ntkArrowElement.tcl library/ntkDownarrowElement.tcl library/ntkUparrowElement.tcl library/ntkLeftarrowElement.tcl library/ntkRightarrowElement.tcl library/ntkTreeitemIndicatorElement.tcl library/ntkTreerowElement.tcl library/ntkTreeareaElement.tcl library/ntkTroughElement.tcl library/ntkThumbElement.tcl library/ntkSashElement.tcl library/ntkSliderElement.tcl library/ntkDebug.tcl library/ntkUtils.tcl library/ntkBorder.tcl library/ntkLayout.tcl library/ntkTButtonBase.tcl library/ntkTButton.tcl library/ntkButton.tcl library/ntkTEntryBase.tcl library/ntkTEntry.tcl library/ntkEntry.tcl library/ntkTScrollbarBase.tcl library/ntkTScrollbar.tcl library/ntkScrollbar.tcl library/ntkScroll.tcl library/ntkTagSet.tcl library/ntkTFrameBase.tcl library/ntkTFrame.tcl library/ntkTLabelframe.tcl library/ntkFrame.tcl library/ntkTPanedwindow.tcl library/ntkTTreeview.tcl library/ntkTCombobox.tcl library/ntkTLabel.tcl library/ntkTCheckbutton.tcl library/ntkTRadiobutton.tcl library/ntkTMenubutton.tcl library/ntkWidgetInfo.tcl library/ntkWidget.tcl library/ntkInit.tcl library/ntkManager.tcl library/ntkTheme.tcl library/ntkElements.tcl library/ntkLabel.tcl library/ntkPanedwindow.tcl library/ntkTreeview.tcl library/ntkImage.tcl library/ntkAltTheme.tcl library/ntkClassicTheme.tcl library/ntkClamTheme.tcl library/ntkPack.tcl library/ntkBind.tcl library/ntkFocus.tcl library/ntkButtonBindings.tcl library/ntkGenerateEvent.tcl library/tclIndex themedntk.tcl

#========================================================================
# This is a list of public header files to be installed, if any.
#========================================================================

PKG_HEADERS	= 

Changes to configure.in.

119
120
121
122
123
124
125

126
127
128
129
130
131
132
library/ntkTEntryBase.tcl
library/ntkTEntry.tcl
library/ntkEntry.tcl
library/ntkTScrollbarBase.tcl
library/ntkTScrollbar.tcl
library/ntkScrollbar.tcl
library/ntkScroll.tcl

library/ntkTFrameBase.tcl
library/ntkTFrame.tcl
library/ntkTLabelframe.tcl
library/ntkFrame.tcl
library/ntkTPanedwindow.tcl
library/ntkTTreeview.tcl
library/ntkTCombobox.tcl







>







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
library/ntkTEntryBase.tcl
library/ntkTEntry.tcl
library/ntkEntry.tcl
library/ntkTScrollbarBase.tcl
library/ntkTScrollbar.tcl
library/ntkScrollbar.tcl
library/ntkScroll.tcl
library/ntkTagSet.tcl
library/ntkTFrameBase.tcl
library/ntkTFrame.tcl
library/ntkTLabelframe.tcl
library/ntkFrame.tcl
library/ntkTPanedwindow.tcl
library/ntkTTreeview.tcl
library/ntkTCombobox.tcl

Changes to library/ntkLayout.tcl.

40
41
42
43
44
45
46

47

48
49
50
51
52
53
54
...
670
671
672
673
674
675
676











677
678
679
680
681
682
683
...
878
879
880
881
882
883
884









885
886
887
888
889
890
891
    public proc ReliefPadding {padding relief n}
    public proc NewTemplateNode {name sticky packInfo}
    public proc NewLayoutNode {name sticky elementClass packInfo child}
    private proc NewLayout {style corde root}
    public proc BuildLayoutTemplate {layoutSpec}
    public proc InstantiateLayout {theme templateNode}
    public proc CreateLayout {theme styleName core}

    public proc CreateSubLayout {theme parentLayout recordPtr baseName optionTable}


    public proc NodeSize {layout node state widthVar heightVar paddingVar}
    private proc NodeListSize {layout node state widthVar heightVar}
    public proc LayoutSize {layout state widthVar heightVar}
    protected proc PlaceNodeList {layoutVar root state cavitiy}
    public proc PlaceLayout {layoutVar state box}
    public proc DrawNodeList {layout node state}
................................................................................
    set layoutTemplate [::ntk::classes::theme::FindLayoutTemplate $theme $styleName]
    if {$layoutTemplate eq ""} {
        return -code error "Layout $styleName not found"
    }
    set node [InstantiateLayout $theme $layoutTemplate]
    return [NewLayout $style $recordPtr $node]
}












#================================ NodeSize ============================
#    Compute requested size of a layout.
#=========================================================================

::itcl::body layout::NodeSize {layout node state widthVar heightVar paddingVar} {
    upvar $widthVar width
................................................................................
set node $nextNode
#        if {$nextNode ne ""} {
#            DrawNodeList $layout $nextNode $state
#        }
#puts stderr "DrawNodeList END!$state![dict get $node -name]!"
    }
}










#================================ DrawLayout ============================
#    DrawLayout --
#        Draw a layout tree.
#=========================================================================

::itcl::body layout::DrawLayout {layout state} {







>

>







 







>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
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
...
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
    public proc ReliefPadding {padding relief n}
    public proc NewTemplateNode {name sticky packInfo}
    public proc NewLayoutNode {name sticky elementClass packInfo child}
    private proc NewLayout {style corde root}
    public proc BuildLayoutTemplate {layoutSpec}
    public proc InstantiateLayout {theme templateNode}
    public proc CreateLayout {theme styleName core}
    public proc LayoutStyle {layout}
    public proc CreateSubLayout {theme parentLayout recordPtr baseName optionTable}
    public proc RebindSubLayout {layoutVar recordPtr}

    public proc NodeSize {layout node state widthVar heightVar paddingVar}
    private proc NodeListSize {layout node state widthVar heightVar}
    public proc LayoutSize {layout state widthVar heightVar}
    protected proc PlaceNodeList {layoutVar root state cavitiy}
    public proc PlaceLayout {layoutVar state box}
    public proc DrawNodeList {layout node state}
................................................................................
    set layoutTemplate [::ntk::classes::theme::FindLayoutTemplate $theme $styleName]
    if {$layoutTemplate eq ""} {
        return -code error "Layout $styleName not found"
    }
    set node [InstantiateLayout $theme $layoutTemplate]
    return [NewLayout $style $recordPtr $node]
}

#================================ RebindSubLayout ============================
# RebindSublayout --
#     Bind sublayout to new data source.
#=========================================================================

::itcl::body layout::RebindSubLayout {layoutVar recordPtr} {
    upvar $layoutVar layout

    dict set layout recordPtr $recordPtr
}

#================================ NodeSize ============================
#    Compute requested size of a layout.
#=========================================================================

::itcl::body layout::NodeSize {layout node state widthVar heightVar paddingVar} {
    upvar $widthVar width
................................................................................
set node $nextNode
#        if {$nextNode ne ""} {
#            DrawNodeList $layout $nextNode $state
#        }
#puts stderr "DrawNodeList END!$state![dict get $node -name]!"
    }
}

#================================ LayoutStyle ============================
# LayoutStyle --
#     Extract Style from Layout.
#=========================================================================

::itcl::body layout::LayoutStyle {layout} {
    return [dict get $layout -style]
}

#================================ DrawLayout ============================
#    DrawLayout --
#        Draw a layout tree.
#=========================================================================

::itcl::body layout::DrawLayout {layout state} {

Changes to library/ntkTTreeview.tcl.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
51
52
53
54
55
56
57








58
59
60
61
62
63
64
...
684
685
686
687
688
689
690
691





















































692




693
























































































































































694
695
696
697





698
699
700
701
702
703
704
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk {

::itcl::extendedclass treeview {
    inherit classes::widget classes::utils classes::scroll

    protected variable tree

    public option [list -columns columns Columns] -default ""
    public option [list -displaycolumns displayColumns DisplayColumns] -default "#all"
    public option [list -show show Show] -default "tree headings"
    public option [list -selectmode selectMode SelectMode] -default "extended"
................................................................................
    private method DistributeWidth {newWidth}
    private method PickupSlack {extra}
    private method DepositSlack {extra}
    private method ResizeColumns {newWidth}
    private method TreeWidth {}
    private method CountRows {item}
    public method TreeviewDoLayout {recordPtr}








    public method TreeviewDisplay {}

    public method TreeviewBBoxCommand {args} 
    public method TreeviewChildrenCommand {args} 
    public method TreeviewColumnCommand {args} 
    public method TreeviewDeleteCommand {args} 
    public method TreeviewDetachCommand {args} 
................................................................................
    set visibleRows [expr {[dict get $tree treeArea height] / [dict get $tree rowHeight]}]
    dict lappend tree root state stateOpen
    set start [dict get $tree yscrollHandle yscroll first]
    set end [expr {[dict get $tree yscrollHandle yscroll first] + $visibleRows}]
    Scrolled [dict get $tree yscrollHandle] $start $end [expr {[CountRows [dict get $tree root]] - 1}]

}






















































#================================ TreeviewDisplay ============================




#     
























































































































































#=========================================================================

::itcl::body treeview::TreeviewDisplay {} {
puts stderr "TreeviewDisplay!"





}

#================================ TreeviewBBoxCommand ============================
#     
#=========================================================================

::itcl::body treeview::TreeviewBBoxCommand {args} {







|







 







>
>
>
>
>
>
>
>







 








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




>
>
>
>
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
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
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
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk {

::itcl::extendedclass treeview {
    inherit classes::widget classes::utils classes::scroll classes::tagset

    protected variable tree

    public option [list -columns columns Columns] -default ""
    public option [list -displaycolumns displayColumns DisplayColumns] -default "#all"
    public option [list -show show Show] -default "tree headings"
    public option [list -selectmode selectMode SelectMode] -default "extended"
................................................................................
    private method DistributeWidth {newWidth}
    private method PickupSlack {extra}
    private method DepositSlack {extra}
    private method ResizeColumns {newWidth}
    private method TreeWidth {}
    private method CountRows {item}
    public method TreeviewDoLayout {recordPtr}
    private method PrepareItem {item displayItemVar}
    private method ItemState {item}
    private method DrawCells {item displayItemVar x y}
    private method DrawItem {item depth row}
    private method DrawSubtree {item depth row}
    private method DrawForest {item depth row}
    private method DisplayLayout {layoutVar recordPtr state box}
    private method DrawHeadings {}
    public method TreeviewDisplay {}

    public method TreeviewBBoxCommand {args} 
    public method TreeviewChildrenCommand {args} 
    public method TreeviewColumnCommand {args} 
    public method TreeviewDeleteCommand {args} 
    public method TreeviewDetachCommand {args} 
................................................................................
    set visibleRows [expr {[dict get $tree treeArea height] / [dict get $tree rowHeight]}]
    dict lappend tree root state stateOpen
    set start [dict get $tree yscrollHandle yscroll first]
    set end [expr {[dict get $tree yscrollHandle yscroll first] + $visibleRows}]
    Scrolled [dict get $tree yscrollHandle] $start $end [expr {[CountRows [dict get $tree root]] - 1}]

}

#================================ DisplayLayout ============================
# DisplayLayout --
#     Rebind, place, and draw a layout + object combination.
#=========================================================================

::itcl::body treeview::DisplayLayout {layoutVar recordPtr state box} {
    upvar $layoutVar layout

puts stderr "DisplayLayout!"
    ::ntk::classes::layout::RebindSubLayout layout $recordPtr
    ::ntk::classes::layout::PlaceLayout layout $state $box
    ::ntk::classes::layout::DrawLayout $layout $state
}

#================================ DrawHeadings ============================
# DrawHeadings --
#     Draw tree headings.
#=========================================================================

::itcl::body treeview::DrawHeadings {} {
puts stderr "DrawHeadings!"
    set x0 [expr {[dict get $tree headingArea x] - [dict get $tree xscroll first]}]
    set y0 [dict get $tree headingArea y]
    set h0 [dict get $tree headingArea height]
    set i [FirstColumn]
    set x 0

    while {$i < [dict get $tree nDisplayColumns]} {
        set column [lindex [dict get $tree displayColumns] $i]
        parcel [list [expr {$x0 + $x}] $y, [dict get $column width] $h0]
        set headingLayout [dict get $tree headingLayout]
        DisplayLayout headingLayout $column [dict get $column headingState] $parcel
        dict set tree headingLayout $headingLayout
        set x [expr {$x + [dict get $column width]}]
        incr i
    }
}

#================================ PrepareItem ============================
# PrepareItem --
#=========================================================================

::itcl::body treeview::PrepareItem {item displayItemVar} {
    upvar $displayItemVar displayItem

puts stderr "PrepareItem!"
    set style [::ntk::classes::layout::LayoutStyle [dict get $core layout]]
    set state [ItemState $item]

    TagSetValues [dict get $tree tagTable] [dict get $item tagset] $displayItem
    TagSetApplyStyle [dict get $tree tagTable] $style $state $displayItem
}

#================================ ItemState ============================
# ItemState --
#     Returns the state of the specified item, based
#     on widget state, item state, and other information.
#=========================================================================

::itcl::body treeview::ItemState {item} {
puts stderr "ItemState!"
    set state [dict get $core state]
    lappend state [dict get $item state]
    if {[dict get $item children] ne ""} {
        lappend state stateLea
    }
    if {$item ne [dict get $tree focus]} {
        set idx [lsearch $state stateFocus]
        if {$idx >= 0} {
            set state [lreplace $state $idx $idx]
        }
    }
    return $state
}

#================================ DrawCells ============================
# DrawCells --
#    Draw data cells for specified item.
#=========================================================================

::itcl::body treeview::DrawCells {item displayItemVar x y} {
    upvar $displayItemVar displayItem

puts stderr "DrawCells!"
    set layout [dict get $tree cellLayout]
    set state [ItemState $item]
    set cellPadding [list 4 0 4 0]
    set rowHeight [dict get $tree rowHeight]
    set nValues 0
    set values ""

    if {[dict get $item valuesObj] eq ""} {
        return
    }

    set values [dict get $item valuesObj]
    set nValues [llength $values]
    set i 0
    while {$i <  [dict get $tree nColumns]} {
        set columns [dict get $tree columns]
        set coli [lindex $comlumns $i]
        if {$i < $nValues} {
            dict set coli data [lindex $values $i]
        } else {
            dict set coli data ""
        }
        set columns [lreplace $columns $i $i $coli]
        dict set tree columns $columns
        incr i
    }

    set i 1
    while {$i < [dict get $tree nDisplayColumns]} {
        set column [lindex [dict get $tree displayColumns] $i]
        set parcel [::ntk::classes::layout::PadBox [list $x $y [dict get $column width] $rowHeight] $cellPadding]

        dict set displayItem textObj [dict get $column data]
        dict set displayItem anchorObj [dict get $column anchorObj] ; # <<NOTE-ANCHOR>> 

        DisplayLayout $layout $displayItem $state $parcel
        set x [rexpr {$x + [dict get $column width]}]
        incr i
    }
}

#================================ DrawItem ============================
# DrawItem --
#     Draw an item (row background, tree label, and cells).
#=========================================================================

::itcl::body treeview::DrawItem {item depth row} {
puts stderr "DrawItem!"
    set state [ItemState $item]
    set rowHeight [dict get $ree rowHeight]
    set x [expr {[dict get $tree treeArea x] - [dict get $tree xscroll first]}]
    set y = [expr {[dict get $tree treeArea y] + $rowHeight * ($row - [dict get $tree yscroll first])}]

    if {$row % 2} {
        lappend state stateAlternate
    }

    PrepareItem $item displayItem

    # Draw row background:

    set rowBox [lst $x $y [TreeWidth] $rowHeight]
    DisplayLayout [dict get $tree rowLayout] displayItem $state $rowBox

    # Draw tree label:

    if {[lsearch [dict get $tree showFlags] showTree] >= 0} {
        set indent [expr {$depth * [dict get $tree indent]}]
        set colwidth [dict get $tree column0 width]
        set parcel [list [expr {$x+$indent}] $y [expr {$colwidth-$indent}] $rowHeight]
        if {[dict get $item textObj] ne ""} {
            dict set displayItem textObj [dict get $item textObj]
        }
        if {[dict get $item imageObj] ne ""} {
            dict set displayItem imageObj [dict get $item imageObj]
        }
        # ??? displayItem.anchorObj = 0; <<NOTE-ANCHOR>>
        DisplayLayout [dict get $tree itemLayout] displayItem $state $parcel
        set x i[expr {$x + $colwidth}]
    }

    # Draw data cells:
 
    DrawCells $item displayItem $x $y
}

#================================ DrawSubtree ============================
# DrawSubtree --
#     Draw an item and all of its (viewable) descendants.
#
# Returns:
#     Row number of the last item drawn.
#=========================================================================

::itcl::body treeview::DrawSubtree {item depth row} {
puts stderr "DrawSubtree!"
    if {$row >= [dict get $tree yscroll first]} {
        DrawItem $item $depth $row
    }

    if {[lsearch [dict get $item state] stateOpen] >= 0} {
        return [DrawForest [dict get $item children] [expr {$depth + 1}] [expr {$row + 1}]]
    } else {
        return [expr {$row + 1}]
    }
}

#================================ DrawForest ============================
# DrawForest --
#     Draw a sequence of items and their visible descendants.

# Returns:
#     Row number of the last item drawn.
#=========================================================================

::itcl::body treeview::DrawForest {item depth row} {
puts stderr "DrawForest!"
    while {$item ne "" && $row <= [dict get $tree yscroll last]} {
        set row [DrawSubtree $item $depth $row]
        set item [dict get $item next]
    }
    return $row;
}

#================================ TreeviewDisplay ============================
# TreeviewDisplay --
#     Display() widget hook.  Draw the widget contents.
#=========================================================================

::itcl::body treeview::TreeviewDisplay {} {
puts stderr "TreeviewDisplay!"
    ::ntk::classes::layout::DrawLayout [dict get $core layout] [dict get $core state]
    if {[lsearch [dict get $tree showFlags] showHeadings] >= 0 } {
        DrawHeadings
    }
    DrawForest [dict get $tree root children] 0 0
}

#================================ TreeviewBBoxCommand ============================
#     
#=========================================================================

::itcl::body treeview::TreeviewBBoxCommand {args} {

Changes to library/ntkTagSet.tcl.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# @(#) $Id: ntkTagSet.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass tagset {
   public proc TagSetValues {corePtr tagsetVar}
   public proc TagSetApplyStyle {handle first last total}
}

#================================ TagSetValues ============================
# Tag values
#=========================================================================

::itcl::body tagset::TagSetValues {tagTableVar tagSet record} {







|
|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# @(#) $Id: ntkTagSet.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass tagset {
   public proc TagSetValues {tagTableVar tagsetVar record}
   public proc TagSetApplyStyle {tagTable style state record}
}

#================================ TagSetValues ============================
# Tag values
#=========================================================================

::itcl::body tagset::TagSetValues {tagTableVar tagSet record} {

Changes to library/tclIndex.

84
85
86
87
88
89
90









91
92
93
94
95
96
97
...
318
319
320
321
322
323
324

325

326
327
328
329
330
331
332
...
357
358
359
360
361
362
363

364
365
366
367
368
369

370
371
372
373
374
375
376
...
583
584
585
586
587
588
589





590
591
592
593
594
595
596
set auto_index(::ntk::treeview::DistributeWidth) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::PickupSlack) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DepositSlack) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::ResizeColumns) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeWidth) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::CountRows) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDoLayout) [list source [file join $dir ntkTTreeview.tcl]]









set auto_index(::ntk::treeview::TreeviewDisplay) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewBBoxCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewChildrenCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewColumnCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDeleteCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDetachCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDragCommand) [list source [file join $dir ntkTTreeview.tcl]]
................................................................................
set auto_index(::ntk::classes::layout::ReliefPadding) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewTemplateNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayoutNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::BuildLayoutTemplate) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::InstantiateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateLayout) [list source [file join $dir ntkLayout.tcl]]

set auto_index(::ntk::classes::layout::CreateSubLayout) [list source [file join $dir ntkLayout.tcl]]

set auto_index(::ntk::classes::layout::NodeSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeListSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawLayout) [list source [file join $dir ntkLayout.tcl]]
................................................................................
set auto_index(::ntk::classes::layout::NewTemplateNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayoutNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::BuildLayoutTemplate) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::InstantiateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateSubLayout) [list source [file join $dir ntkLayout.tcl]]

set auto_index(::ntk::classes::layout::NodeSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeListSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawNodeList) [list source [file join $dir ntkLayout.tcl]]

set auto_index(::ntk::classes::layout::DrawLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutNodeInternalPadding) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutNodeInternalParcel) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::FindNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceElement) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::FindElement) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::ClientRegion) [list source [file join $dir ntkLayout.tcl]]
................................................................................
set auto_index(::ntk::combobox::get) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::icursor) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::index) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::insert) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::selection) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::classes::RightarrowElement) [list source [file join $dir ntkRightarrowElement.tcl]]
set auto_index(::ntk::classes::RightarrowElement::constructor) [list source [file join $dir ntkRightarrowElement.tcl]]





set auto_index(::ntk::classes::SizegripElement) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SeparatorElement::InitializeOptionValues) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::SizegripElementConfigure) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::ElementSize) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::ElementDraw) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::DiamondIndicatorElement) [list source [file join $dir ntkDiamondIndicatorElement.tcl]]
set auto_index(::ntk::classes::DiamondIndicatorElement::InitializeOptionValues) [list source [file join $dir ntkDiamondIndicatorElement.tcl]]







>
>
>
>
>
>
>
>
>







 







>

>







 







>






>







 







>
>
>
>
>







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
...
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
...
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
set auto_index(::ntk::treeview::DistributeWidth) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::PickupSlack) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DepositSlack) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::ResizeColumns) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeWidth) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::CountRows) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDoLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DisplayLayout) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DrawHeadings) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TagSetApplyStyle) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::PrepareItem) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::ItemState) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DrawCells) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DrawItem) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DrawSubtree) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::DrawForest) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDisplay) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewBBoxCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewChildrenCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewColumnCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDeleteCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDetachCommand) [list source [file join $dir ntkTTreeview.tcl]]
set auto_index(::ntk::treeview::TreeviewDragCommand) [list source [file join $dir ntkTTreeview.tcl]]
................................................................................
set auto_index(::ntk::classes::layout::ReliefPadding) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewTemplateNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayoutNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::BuildLayoutTemplate) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::InstantiateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutStyle) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateSubLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::RebindSubLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeListSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawLayout) [list source [file join $dir ntkLayout.tcl]]
................................................................................
set auto_index(::ntk::classes::layout::NewTemplateNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayoutNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NewLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::BuildLayoutTemplate) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::InstantiateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::CreateSubLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::RebindSubLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::NodeListSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutSize) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawNodeList) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutStyle) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::DrawLayout) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutNodeInternalPadding) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::LayoutNodeInternalParcel) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::FindNode) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::PlaceElement) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::FindElement) [list source [file join $dir ntkLayout.tcl]]
set auto_index(::ntk::classes::layout::ClientRegion) [list source [file join $dir ntkLayout.tcl]]
................................................................................
set auto_index(::ntk::combobox::get) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::icursor) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::index) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::insert) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::combobox::selection) [list source [file join $dir ntkTCombobox.tcl]]
set auto_index(::ntk::classes::RightarrowElement) [list source [file join $dir ntkRightarrowElement.tcl]]
set auto_index(::ntk::classes::RightarrowElement::constructor) [list source [file join $dir ntkRightarrowElement.tcl]]
set auto_index(::ntk::classes::tagset) [list source [file join $dir ntkTagSet.tcl]]
set auto_index(::ntk::classes::tagset::TagSetValues) [list source [file join $dir ntkTagSet.tcl]]
set auto_index(::ntk::classes::tagset::TagSetApplyStyle) [list source [file join $dir ntkTagSet.tcl]]
set auto_index(::ntk::classes::tagset::TagSetValues) [list source [file join $dir ntkTagSet.tcl]]
set auto_index(::ntk::classes::tagset::TagSetApplyStyle) [list source [file join $dir ntkTagSet.tcl]]
set auto_index(::ntk::classes::SizegripElement) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SeparatorElement::InitializeOptionValues) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::SizegripElementConfigure) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::ElementSize) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::SizegripElement::ElementDraw) [list source [file join $dir ntkSizegripElement.tcl]]
set auto_index(::ntk::classes::DiamondIndicatorElement) [list source [file join $dir ntkDiamondIndicatorElement.tcl]]
set auto_index(::ntk::classes::DiamondIndicatorElement::InitializeOptionValues) [list source [file join $dir ntkDiamondIndicatorElement.tcl]]