Unnamed Fossil Project

Check-in [b0ea45cca7]
Login

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

Overview
Comment:a lot of changes including additional paramter recordPtr for all *Element.tcl methods for makeing first treeview example running.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b0ea45cca72314706f8cd53e769cf97df4207010
User & Date: arnulf 2013-09-21 17:08:00
Context
2013-09-21
19:20
fixes mostly for treeview check-in: 8f7ff3a44e user: arnulf tags: trunk
17:08
a lot of changes including additional paramter recordPtr for all *Element.tcl methods for makeing first treeview example running. check-in: b0ea45cca7 user: arnulf tags: trunk
2013-09-20
19:45
fixes for treeview insert and draw check-in: 9156f55936 user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/ntkArrowElement.tcl.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
    protected variable direction

    constructor {args} {}

    public method ArrowSize {height dir widthVar heightVar}
    public method ArrowPoints {box dir color pointsVar}
    public method FillArrow {color box dir}
    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar arrowVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
    set direction arrowUp
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ArrowElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
    return
}

#================================ ArrowSize ============================
#     
#=========================================================================

................................................................................

}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ArrowElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set myWidth [cget -arrowsize]
    lassign $arrowMargins left top right bottom
    set myWidth [expr {$myWidth - ($left + $right)}]
................................................................................
#puts stderr "ArrowElement::ElementSize!$width!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ArrowElement::ElementDraw {box state} {
#puts stderr "ArrowElement::ElementDraw $direction $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    set arrowValue [cget -arrowcolor]







|
|
|







 







|
|
|







 







|







 







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
    protected variable direction

    constructor {args} {}

    public method ArrowSize {height dir widthVar heightVar}
    public method ArrowPoints {box dir color pointsVar}
    public method FillArrow {color box dir}
    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar arrowVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
    set direction arrowUp
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ArrowElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
    return
}

#================================ ArrowSize ============================
#     
#=========================================================================

................................................................................

}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ArrowElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set myWidth [cget -arrowsize]
    lassign $arrowMargins left top right bottom
    set myWidth [expr {$myWidth - ($left + $right)}]
................................................................................
#puts stderr "ArrowElement::ElementSize!$width!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ArrowElement::ElementDraw {recordPtr box state} {
#puts stderr "ArrowElement::ElementDraw $direction $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    set arrowValue [cget -arrowcolor]

Changes to library/ntkBackgroundElement.tcl.

18
19
20
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
61
62
63
64
65

::itcl::extendedclass BackgroundElement {
    inherit baseElement utils

    protected option [list -background Background Background] \
            -default "#d9d9d9"

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body BackgroundElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "BackgroundElement::InitializeOptionValues!$styleName!$tkwin!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
configure
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body BackgroundElement::ElementSize {widthVar heightVar paddingVar} {
        # nothing to do!!
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body BackgroundElement::ElementDraw {box state} {
#puts stderr "BackgroundElement ElementDraw $box $state"
    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
#puts stderr "background CLOPT![info options]![cget -background]!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
#puts stderr "BACKGROUND2!$pos1!$pos2!$pos3!$pos4!"
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
#puts -nonewline stderr "BackgroundElement::ElementDraw >"
    set ch [::ntk::Debug::DebugInput]
}

} ; # end namespace ::ntk::classes







|
|
|






|
|
|







|







|













18
19
20
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
61
62
63
64
65

::itcl::extendedclass BackgroundElement {
    inherit baseElement utils

    protected option [list -background Background Background] \
            -default "#d9d9d9"

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body BackgroundElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "BackgroundElement::InitializeOptionValues!$styleName!$recordPtr!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
configure
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body BackgroundElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
        # nothing to do!!
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body BackgroundElement::ElementDraw {recordPtr box state} {
#puts stderr "BackgroundElement ElementDraw $box $state"
    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
#puts stderr "background CLOPT![info options]![cget -background]!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
#puts stderr "BACKGROUND2!$pos1!$pos2!$pos3!$pos4!"
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
#puts -nonewline stderr "BackgroundElement::ElementDraw >"
    set ch [::ntk::Debug::DebugInput]
}

} ; # end namespace ::ntk::classes

Changes to library/ntkBaseElement.tcl.

21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
    public method InitializeOptionValuesBase {styleName tkwin state}
}

#====================== InitializeOptionValuesBase =======================
#     
#=========================================================================

::itcl::body baseElement::InitializeOptionValuesBase {styleName tkwin state} {

#puts stderr "+++ InitializeOptionValuesBase![lindex [split $this :] end]!$tkwin!$styleName!$state!"
#parray itcl_options
    foreach optionName [array names itcl_options] {
#puts stderr "BASE opt!$optionName!"
        if {$optionName eq ""} {
            continue
        }







|
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    public method InitializeOptionValuesBase {styleName tkwin state}
}

#====================== InitializeOptionValuesBase =======================
#     
#=========================================================================

::itcl::body baseElement::InitializeOptionValuesBase {styleName recordPtr state} {
    set tkwin [dict get $recordPtr tkwin]
#puts stderr "+++ InitializeOptionValuesBase![lindex [split $this :] end]!$tkwin!$styleName!$state!"
#parray itcl_options
    foreach optionName [array names itcl_options] {
#puts stderr "BASE opt!$optionName!"
        if {$optionName eq ""} {
            continue
        }

Changes to library/ntkBorderElement.tcl.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
            -default 2
    protected option [list -depth depth Depth] \
            -default 0
    protected option [list -relief Relief Relief] \
            -default raised

    private method DrawCorner {x y width height corner color}
    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    private method BorderElementDraw {box state}
    public method ElementDraw {box state}

}

#================================ DrawCorner ============================
#     
#=========================================================================

................................................................................
    set z3 1.0
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body BorderElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body BorderElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $paddingVar padding

    set borderWidth $itcl_options(-borderwidth)
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "BORDER SIZE!$this!$paddingVar!$itcl_options(-borderwidth)!"
}

................................................................................
    ::ntk::Debug::DebugInput
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body BorderElement::ElementDraw {box state} {
#puts stderr "BorderElement::ElementDraw!$box!"
#puts stderr "BorderElement ElementDraw $box $state![cget -borderwidth]![cget -relief]!"
#puts stderr "CLOPT border![info options]![cget -relief]![cget -background]![cget -borderwidth]!"
    set borderWidth [cget -borderwidth]
    set depth [cget -depth]
    set relief [cget -relief]
    set backgroundVal [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"







|
|

|







 







|
|







|







 







|

|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
            -default 2
    protected option [list -depth depth Depth] \
            -default 0
    protected option [list -relief Relief Relief] \
            -default raised

    private method DrawCorner {x y width height corner color}
    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    private method BorderElementDraw {box state}
    public method ElementDraw {recordPtr box state}

}

#================================ DrawCorner ============================
#     
#=========================================================================

................................................................................
    set z3 1.0
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body BorderElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body BorderElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $paddingVar padding

    set borderWidth $itcl_options(-borderwidth)
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "BORDER SIZE!$this!$paddingVar!$itcl_options(-borderwidth)!"
}

................................................................................
    ::ntk::Debug::DebugInput
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body BorderElement::ElementDraw {recordPtr box state} {
#puts stderr "BorderElement::ElementDraw!$box!"
#puts stderr "BorderElement ElementDraw $box!$state![cget -borderwidth]![cget -relief]!"
#puts stderr "CLOPT border![info options]![cget -relief]![cget -background]![cget -borderwidth]!"
    set borderWidth [cget -borderwidth]
    set depth [cget -depth]
    set relief [cget -relief]
    set backgroundVal [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"

Changes to library/ntkButtonBorderElement.tcl.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
            -default 2
    protected option [list -relief Relief Relief] \
            -default flat
    protected option [list -default default Default] \
            -default disabled

    private method DrawCorner {x y width height corner color}
    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}

}

#================================ DrawCorner ============================
#     
................................................................................
    set z3 1.0
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "ButtonBorderElement::InitializeOptionValues!"
    InitializeOptionValuesBase $styleName $tkwin $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "ButtonBorderElement::ElementSize!"
    set borderWidth [cget -borderwidth]
    set defaultState [cget -default]
    if {$defaultState ne "disabled"} {
        incr borderWidth 5
................................................................................
#puts stderr "BORDER SIZE!$this!$padding!$borderWidth!$defaultState!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::ElementDraw {box state} {
#puts stderr "ButtonBorderElement ElementDraw $box $state"
#puts stderr "CLOPT border![info options]![cget -relief]![cget -background]![cget -borderwidth]!"
    set borderWidth [cget -borderwidth]
    set borderRelief [cget -relief]
    set backgroundVal [cget -background]
    set defaultState [cget -default]
#puts stderr "POS border!$pos1!$pos2!$pos3!$pos4!"







|







 







|

|







|







 







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
            -default 2
    protected option [list -relief Relief Relief] \
            -default flat
    protected option [list -default default Default] \
            -default disabled

    private method DrawCorner {x y width height corner color}
    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}

}

#================================ DrawCorner ============================
#     
................................................................................
    set z3 1.0
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "ButtonBorderElement::InitializeOptionValues!"
    InitializeOptionValuesBase $styleName $recordPtr $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "ButtonBorderElement::ElementSize!"
    set borderWidth [cget -borderwidth]
    set defaultState [cget -default]
    if {$defaultState ne "disabled"} {
        incr borderWidth 5
................................................................................
#puts stderr "BORDER SIZE!$this!$padding!$borderWidth!$defaultState!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ButtonBorderElement::ElementDraw {recordPtr box state} {
#puts stderr "ButtonBorderElement ElementDraw $box $state"
#puts stderr "CLOPT border![info options]![cget -relief]![cget -background]![cget -borderwidth]!"
    set borderWidth [cget -borderwidth]
    set borderRelief [cget -relief]
    set backgroundVal [cget -background]
    set defaultState [cget -default]
#puts stderr "POS border!$pos1!$pos2!$pos3!$pos4!"

Changes to library/ntkDiamondIndicatorElement.tcl.

19
20
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
::itcl::extendedclass DiamondIndicatorElement {
    inherit baseElement utils

    private variable defaultWidth 13
    private variable defaultHeight 13

    protected option [list -background Background Background] \
            -default #d9d9d9 \
            -configuremethod indicatorElementConfigure
    protected option [list -indicatorcolor indicatorColor DiamondIndicatorColor] \
            -default #ffffff \
            -configuremethod indicatorElementConfigure
    protected option [list -lightcolor indicatorColor DiamondIndicatorColor] \
            -default #DDDDDD \
            -configuremethod indicatorElementConfigure
    protected option [list -shadecolor indicatorColor DiamondIndicatorColor] \
            -default #888888 \
            -configuremethod indicatorElementConfigure
    protected option [list -bordercolor indicatorColor DiamondIndicatorColor] \
            -default #000000 \
            -configuremethod indicatorElementConfigure
    protected option [list -indicatorrelief indicatorRelief DiamondIndicatorRelief] \
            -default raised \
            -configuremethod indicatorElementConfigure
    protected option [list -indicatordiameter indicatorDiameter DiamondIndicatorDiameter] \
            -default 9 \
            -configuremethod indicatorElementConfigure
    protected option [list -indicatormargin indicatorMargin DiamondIndicatorMargin] \
            -default [list 0 2 4 2] \
            -configuremethod indicatorElementConfigure
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2 \
            -configuremethod indicatorElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method indicatorElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ indicatorElementConfigure ===================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::indicatorElementConfigure {option value} {
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set height [expr {$diameter + 3 + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::ElementDraw {box state} {
#puts stderr "INDICATOR DIAMOND elementDraw!$box!"
    set diameter [cget -indicatordiameter]
    set indicatorcolor [cget -indicatorcolor]
    set borderColor [cget -background]
    set relief [cget -indicatorrelief]
#puts stderr "icol!$indicatorcolor!bg!$borderColor!re!$relief!"
    set padding [cget -indicatormargin]







|
<

|
<

|
<

|
<

|
<

|
<

|
<

|
<

|
<

|
<
|
|







|
|
<
<
<
<
<
<
<






|







 







|







19
20
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
61
62
63
64
65
66
67
68
69
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
::itcl::extendedclass DiamondIndicatorElement {
    inherit baseElement utils

    private variable defaultWidth 13
    private variable defaultHeight 13

    protected option [list -background Background Background] \
            -default #d9d9d9

    protected option [list -indicatorcolor indicatorColor DiamondIndicatorColor] \
            -default #ffffff

    protected option [list -lightcolor indicatorColor DiamondIndicatorColor] \
            -default #DDDDDD

    protected option [list -shadecolor indicatorColor DiamondIndicatorColor] \
            -default #888888

    protected option [list -bordercolor indicatorColor DiamondIndicatorColor] \
            -default #000000

    protected option [list -indicatorrelief indicatorRelief DiamondIndicatorRelief] \
            -default raised

    protected option [list -indicatordiameter indicatorDiameter DiamondIndicatorDiameter] \
            -default 9

    protected option [list -indicatormargin indicatorMargin DiamondIndicatorMargin] \
            -default [list 0 2 4 2]

    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2


    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set height [expr {$diameter + 3 + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body DiamondIndicatorElement::ElementDraw {recordPtr box state} {
#puts stderr "INDICATOR DIAMOND elementDraw!$box!"
    set diameter [cget -indicatordiameter]
    set indicatorcolor [cget -indicatorcolor]
    set borderColor [cget -background]
    set relief [cget -indicatorrelief]
#puts stderr "icol!$indicatorcolor!bg!$borderColor!re!$relief!"
    set padding [cget -indicatormargin]

Changes to library/ntkFieldElement.tcl.

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    protected option [list -fieldbackground fieldBackground Background] \
            -default white
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2
    protected option [list -depth borderWidth BorderWidth] \
            -default 0

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FieldElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FieldElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "FieldElement::ElementSize!"
    set borderWidth [cget -borderwidth]
    set width 0
................................................................................
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FieldElement::ElementDraw {box state} {
#puts stderr "FieldElement::ElementDraw!"
    set borderWidth [cget -borderwidth]
    set depth [cget -depth]
    set relief sunken
    set backgroundVal [cget -fieldbackground]
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4







|
|
|






|
|






|







 







|
|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    protected option [list -fieldbackground fieldBackground Background] \
            -default white
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2
    protected option [list -depth borderWidth BorderWidth] \
            -default 0

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FieldElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FieldElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "FieldElement::ElementSize!"
    set borderWidth [cget -borderwidth]
    set width 0
................................................................................
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FieldElement::ElementDraw {recordPtr box state} {
#puts stderr "FieldElement::ElementDraw!$box!"
    set borderWidth [cget -borderwidth]
    set depth [cget -depth]
    set relief sunken
    set backgroundVal [cget -fieldbackground]
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4

Changes to library/ntkFillElement.tcl.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass FillElement {
    inherit baseElement utils

    public method InitializeOptionValues {styleName tkwin state}
    public method fillElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FillElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ fillElementConfigure ============================
#     
#=========================================================================

::itcl::body FillElement::fillElementConfigure {option value} {
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FillElement::ElementSize {widthVar heightVar paddingVar} {
    # nothing to do!!
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FillElement::ElementDraw {box state} {
puts stderr "FillElement ElementDraw $box $state"
    set backgroundColor [ColorValue2RGBA [cget -background]]
puts stderr "CLOPT![info options]![cget -background]!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
puts stderr "FILL2!$pos1!$pos2!$pos3!$pos4!"
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
    ::ntk::Debug::DebugInput
}

} ; # end namespace ::nk::classes







|
<
|
|






|
|
<
<
<
<
<
<
<






|







|











15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass FillElement {
    inherit baseElement utils

    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FillElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FillElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    # nothing to do!!
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FillElement::ElementDraw {recordPtr box state} {
puts stderr "FillElement ElementDraw $box $state"
    set backgroundColor [ColorValue2RGBA [cget -background]]
puts stderr "CLOPT![info options]![cget -background]!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
puts stderr "FILL2!$pos1!$pos2!$pos3!$pos4!"
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
    ::ntk::Debug::DebugInput
}

} ; # end namespace ::nk::classes

Changes to library/ntkFocusElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

74
75
76
77
78
79
80
81
82
83
84
85

namespace eval ::ntk::classes {

::itcl::extendedclass FocusElement {
    inherit baseElement utils

    protected option [list -focuscolor focusColor FocusColor] \
            -default black \
            -configuremethod focusElementConfigure
    protected option [list -focusthickness focusThickness FocusThickness] \
            -default 1 \
            -configuremethod focusElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method focusElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
 
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FocusElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
#puts stderr "FOCUS!$this!focusthickness!$itcl_options(-focusthickness)!"
    return
}

#================================ focusElementConfigure ============================
#     
#=========================================================================

::itcl::body FocusElement::focusElementConfigure {option value} {
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FocusElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $paddingVar padding

    set borderWidth $itcl_options(-focusthickness)
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "FOCUS SIZE!$this!$padding!$itcl_options(-focusthickness)!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FocusElement::ElementDraw {box state} {
#puts stderr "FocusElement ElementDraw!$box!$state!"
    if {[lsearch $state focus] >= 0} {
#puts stderr "CLOPT focus![info options]![cget -focuscolor]![cget -focusthickness]!"
        set focusVal [cget -focuscolor]

	set focusThickness [cget -focusthickness]  ; # not used yet
        set focusColor [ColorValue2RGBA $focusVal]
        lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
#puts stderr "POS focus!$pos1!$pos2!$pos3!$pos4!"
        ::gles2::builtin::drawrectangle [list $pos1 $focusColor] [list $pos2 $focusColor] [list $pos3 $focusColor] [list $pos4 $focusColor]
        ::gles2::swapbuffers
    }
    ::ntk::Debug::DebugInput
}

} ; # end namespace ::ntk::classes








|
<

|
<

|
<
|
|







|
|




<
<
<
<
<
<
<




|











|




>












16
17
18
19
20
21
22
23

24
25

26
27

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

namespace eval ::ntk::classes {

::itcl::extendedclass FocusElement {
    inherit baseElement utils

    protected option [list -focuscolor focusColor FocusColor] \
            -default black

    protected option [list -focusthickness focusThickness FocusThickness] \
            -default 1


    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body FocusElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state
#puts stderr "FOCUS!$this!focusthickness!$itcl_options(-focusthickness)!"
    return
}








#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body FocusElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $paddingVar padding

    set borderWidth $itcl_options(-focusthickness)
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "FOCUS SIZE!$this!$padding!$itcl_options(-focusthickness)!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body FocusElement::ElementDraw {recordPtr box state} {
#puts stderr "FocusElement ElementDraw!$box!$state!"
    if {[lsearch $state focus] >= 0} {
#puts stderr "CLOPT focus![info options]![cget -focuscolor]![cget -focusthickness]!"
        set focusVal [cget -focuscolor]
#puts stderr "FocusElement ElementDraw!color!$focusVal!"
	set focusThickness [cget -focusthickness]  ; # not used yet
        set focusColor [ColorValue2RGBA $focusVal]
        lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
#puts stderr "POS focus!$pos1!$pos2!$pos3!$pos4!"
        ::gles2::builtin::drawrectangle [list $pos1 $focusColor] [list $pos2 $focusColor] [list $pos3 $focusColor] [list $pos4 $focusColor]
        ::gles2::swapbuffers
    }
    ::ntk::Debug::DebugInput
}

} ; # end namespace ::ntk::classes

Changes to library/ntkHighlightElement.tcl.

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    set thinShadowColors(sunken) [list DARK LITE]

    protected option [list -highlightcolor highlightColor Color] \
            -default #d9d9d9
    protected option [list -highlightthickness highlightThickness HighlightThickness] \
            -default 0

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    private method HighlightElementDraw {box state}
    private method DrawFocusHighlight {width color}
    public method ElementDraw {box state}

}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body HighlightElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "HighlightElement::InitializeOptionValues!"
    InitializeOptionValuesBase $styleName $tkwin $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body HighlightElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "HighlightElement::Size!"
    set highlightThickness [cget -highlightthickness]
    set padding [list $highlightThickness $highlightThickness $highlightThickness $highlightThickness]
#puts stderr "Highlight SIZE!$this!$paddingVar!$itcl_options(-highlightthickness)!"
}
................................................................................
}
}

#================================ HighlightElementDraw ============================
#     
#=========================================================================

::itcl::body HighlightElement::ElementDraw {box state} {
#puts stderr "HighlightElement HighlightElementDraw $box $state"
#puts stderr "CLOPT border![info options]![cget -highlightcolor]![cget -highlightthickness]!"
    set highlightThickness [cget -highlightthickness]
    set highlightVal [cget -highlightcolor]
    if {$highlightVal ne "" && $highlightThickness > 0} {
        set highlightColor [ColorValue2RGBA $highlightVal]
        lassign [GetElementPositions $box] pos1 pos2 pos3 pos4







|
|


|







|

|







|







 







|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    set thinShadowColors(sunken) [list DARK LITE]

    protected option [list -highlightcolor highlightColor Color] \
            -default #d9d9d9
    protected option [list -highlightthickness highlightThickness HighlightThickness] \
            -default 0

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    private method HighlightElementDraw {box state}
    private method DrawFocusHighlight {width color}
    public method ElementDraw {recordPtr box state}

}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body HighlightElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "HighlightElement::InitializeOptionValues!"
    InitializeOptionValuesBase $styleName $recordPtr $state
#puts stderr "BORDER!$this!borderwidth!$itcl_options(-borderwidth)!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body HighlightElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "HighlightElement::Size!"
    set highlightThickness [cget -highlightthickness]
    set padding [list $highlightThickness $highlightThickness $highlightThickness $highlightThickness]
#puts stderr "Highlight SIZE!$this!$paddingVar!$itcl_options(-highlightthickness)!"
}
................................................................................
}
}

#================================ HighlightElementDraw ============================
#     
#=========================================================================

::itcl::body HighlightElement::ElementDraw {recordPtr box state} {
#puts stderr "HighlightElement HighlightElementDraw $box $state"
#puts stderr "CLOPT border![info options]![cget -highlightcolor]![cget -highlightthickness]!"
    set highlightThickness [cget -highlightthickness]
    set highlightVal [cget -highlightcolor]
    if {$highlightVal ne "" && $highlightThickness > 0} {
        set highlightColor [ColorValue2RGBA $highlightVal]
        lassign [GetElementPositions $box] pos1 pos2 pos3 pos4

Changes to library/ntkImageElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
66
67
68
69
70
71
72
73

74
75
76
77

namespace eval ::ntk::classes {

::itcl::extendedclass ImageElement {
    inherit baseElement utils

    protected option [list -image Image Image] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -stipple Stipple Stipple] \
            -default grey50 \
            -configuremethod labelElementConfigure
    protected option [list -background Background Background] \
            -default "#d9d9d9"  \
            -configuremethod labelElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method imageElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ===================
#     
#=========================================================================

::itcl::body ImageElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "ImageElement INIT"
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ imageElementConfigure ============================
#     
#=========================================================================

::itcl::body ImageElement::imageElementConfigure {option value} {
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ImageElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "ImageElement::ELementSize"
    # FIX ME !!
    set width 0
................................................................................
    set height 0
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ImageElement::ElementDraw {box state} {

    foreach {x y width height} $box break
}

} ; # end namespace ::ntk::classes







|
<

|
<

|
<

|
<
|
|






|

|
<
<
<
<
<
<
<






|







 







|
>




16
17
18
19
20
21
22
23

24
25

26
27

28
29

30
31
32
33
34
35
36
37
38
39
40







41
42
43
44
45
46
47
48
49
50
51
52
53
54
..
55
56
57
58
59
60
61
62
63
64
65
66
67

namespace eval ::ntk::classes {

::itcl::extendedclass ImageElement {
    inherit baseElement utils

    protected option [list -image Image Image] \
            -default ""

    protected option [list -stipple Stipple Stipple] \
            -default grey50

    protected option [list -background Background Background] \
            -default "#d9d9d9"


    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ===================
#     
#=========================================================================

::itcl::body ImageElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "ImageElement INIT"
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ImageElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "ImageElement::ELementSize"
    # FIX ME !!
    set width 0
................................................................................
    set height 0
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ImageElement::ElementDraw {recordPtr box state} {
puts stderr "ImageElement::ElementDraw!$box!$state!"
    foreach {x y width height} $box break
}

} ; # end namespace ::ntk::classes

Changes to library/ntkIndicatorElement.tcl.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    protected option [list -indicatordiameter indicatorDiameter IndicatorDiameter] \
            -default 12
    protected option [list -indicatormargin indicatorMargin IndicatorMargin] \
            -default [list 0 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body IndicatorElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body IndicatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    lassign [cget -indicatormargin] l t r b
    set width [expr {$defaultWidth + $l + $r}]
    set height [expr {$defaultHeight + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body IndicatorElement::ElementDraw {box state} {
puts stderr "INDICATOR elementDraw!$box!"
    set padding [cget -indicatormargin]
puts stderr "padding!$padding!"
    set b [::ntk::classes::layout::PadBox $box $padding]
puts stderr "b!$b!"
    lassign $b x y width height
puts stderr "x!$x!$y!"







|
|
|







|
|






|













|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    protected option [list -indicatordiameter indicatorDiameter IndicatorDiameter] \
            -default 12
    protected option [list -indicatormargin indicatorMargin IndicatorMargin] \
            -default [list 0 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body IndicatorElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body IndicatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    lassign [cget -indicatormargin] l t r b
    set width [expr {$defaultWidth + $l + $r}]
    set height [expr {$defaultHeight + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body IndicatorElement::ElementDraw {recordPtr box state} {
puts stderr "INDICATOR elementDraw!$box!"
    set padding [cget -indicatormargin]
puts stderr "padding!$padding!"
    set b [::ntk::classes::layout::PadBox $box $padding]
puts stderr "b!$b!"
    lassign $b x y width height
puts stderr "x!$x!$y!"

Changes to library/ntkLabelElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337

namespace eval ::ntk::classes {

::itcl::extendedclass LabelElement {
    inherit baseElement utils

    protected option [list -compound Compound Compound] \
            -default none \
            -configuremethod labelElementConfigure
    protected option [list -space Space Space] \
            -default 4 \
            -configuremethod labelElementConfigure
    protected option [list -relief Relief Relief] \
            -default flat \
            -configuremethod labelElementConfigure

    # Text element options keep in sync with ntkTextElement.tcl!!
    protected option [list -text Text Text] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -font Font Font] \
            -default Vera \
            -configuremethod labelElementConfigure
    protected option [list -foreground Foreground Foreground] \
            -default #000000 \
            -configuremethod labelElementConfigure
    protected option [list -underline Underline Underline] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -width Width Width] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -anchor Anchor Anchor] \
            -default w \
            -configuremethod labelElementConfigure
    protected option [list -justify Justify Justify] \
            -default left \
            -configuremethod labelElementConfigure
    protected option [list -wraplength wrapLength WrapLength] \
            -default 0 \
            -configuremethod labelElementConfigure
    protected option [list -embossed Embossed Embossed] \
            -default 0 \
            -configuremethod labelElementConfigure

    
    # Image element options keep in sync with ntkImageElement.tcl!!
    protected option [list -image Image Image] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -stipple Stipple Stipple] \
            -default grey50 \
            -configuremethod labelElementConfigure
    protected option [list -background Background Background] \
            -default "#d9d9d9"  \
            -configuremethod labelElementConfigure

    public option [list -fontsize fontSize FontSize] \
             -default 12
    public option [list -textcolor textColor TextColor] \
             -default [list 10 10 10 255]

    constructor {args} {}
................................................................................
    protected method MAX {a b}
    protected method MIN {a b}
    protected method ImageSetup {imageVar state}
    protected method TextSetup {textVar state}
    protected method TextReqWidth {textBox}
    protected method LabelSetup {state totalBoxVar imageBoxVar textBoxVar}

    public method InitializeOptionValues {styleName tkwin state}
    public method labelElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
    return $compound
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body LabelElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "LabelElement::InitializeOptionValues!"
#puts stderr "[info options]!"
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ labelElementConfigure ============================
#     
#=========================================================================

::itcl::body LabelElement::labelElementConfigure {option value} {
#puts stderr "labelElementConfigure!$option!$value!"
    set itcl_options($option) $value
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body LabelElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "LabelElement::ElementSize!"
    set textReqWidth 0
    set padding [list 0 0 0 0]
................................................................................
#puts stderr "LabelElement::ElementSize END"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body LabelElement::ElementDraw {box state} {
#puts stderr "LabelElement ElementDraw!$box!$state!"
#puts stderr "CLOPT label![info options]!fg![cget -foreground]!bg![cget -background]!w![cget -width]!t![cget -text]!fts![cget -fontsize]!ft![cget -font]!r![cget -relief]!a![cget -anchor]!"
    set compound [cget -compound]

#puts stderr "LABELDRAW"
    set compound [LabelSetup "" totalBox textBox imageBox]
    lassign $totalBox totalWidth totalHeight







|
<

|
<

|
<



|
<

|
<

|
<

|
<

|
<

|
<

|
<

|
<

|
<




|
<

|
<

|
<







 







|
<
|
|







 







|


|
<
<
<
<
<
<
<
<
<






|







 







|







16
17
18
19
20
21
22
23

24
25

26
27

28
29
30
31

32
33

34
35

36
37

38
39

40
41

42
43

44
45

46
47

48
49
50
51
52

53
54

55
56

57
58
59
60
61
62
63
..
65
66
67
68
69
70
71
72

73
74
75
76
77
78
79
80
81
...
237
238
239
240
241
242
243
244
245
246
247









248
249
250
251
252
253
254
255
256
257
258
259
260
261
...
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312

namespace eval ::ntk::classes {

::itcl::extendedclass LabelElement {
    inherit baseElement utils

    protected option [list -compound Compound Compound] \
            -default none

    protected option [list -space Space Space] \
            -default 4

    protected option [list -relief Relief Relief] \
            -default flat


    # Text element options keep in sync with ntkTextElement.tcl!!
    protected option [list -text Text Text] \
            -default ""

    protected option [list -font Font Font] \
            -default Vera

    protected option [list -foreground Foreground Foreground] \
            -default black

    protected option [list -underline Underline Underline] \
            -default -1

    protected option [list -width Width Width] \
            -default -1

    protected option [list -anchor Anchor Anchor] \
            -default w

    protected option [list -justify Justify Justify] \
            -default left

    protected option [list -wraplength wrapLength WrapLength] \
            -default 0

    protected option [list -embossed Embossed Embossed] \
            -default 0


    
    # Image element options keep in sync with ntkImageElement.tcl!!
    protected option [list -image Image Image] \
            -default ""

    protected option [list -stipple Stipple Stipple] \
            -default grey50

    protected option [list -background Background Background] \
            -default "#d9d9d9" 


    public option [list -fontsize fontSize FontSize] \
             -default 12
    public option [list -textcolor textColor TextColor] \
             -default [list 10 10 10 255]

    constructor {args} {}
................................................................................
    protected method MAX {a b}
    protected method MIN {a b}
    protected method ImageSetup {imageVar state}
    protected method TextSetup {textVar state}
    protected method TextReqWidth {textBox}
    protected method LabelSetup {state totalBoxVar imageBoxVar textBoxVar}

    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
    return $compound
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body LabelElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "LabelElement::InitializeOptionValues!"
#puts stderr "[info options]!"
    InitializeOptionValuesBase $styleName $recordPtr $state









}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body LabelElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "LabelElement::ElementSize!"
    set textReqWidth 0
    set padding [list 0 0 0 0]
................................................................................
#puts stderr "LabelElement::ElementSize END"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body LabelElement::ElementDraw {recordPtr box state} {
#puts stderr "LabelElement ElementDraw!$box!$state!"
#puts stderr "CLOPT label![info options]!fg![cget -foreground]!bg![cget -background]!w![cget -width]!t![cget -text]!fts![cget -fontsize]!ft![cget -font]!r![cget -relief]!a![cget -anchor]!"
    set compound [cget -compound]

#puts stderr "LABELDRAW"
    set compound [LabelSetup "" totalBox textBox imageBox]
    lassign $totalBox totalWidth totalHeight

Changes to library/ntkLayout.tcl.

9
10
11
12
13
14
15


16
17
18
19
20
21
22
...
601
602
603
604
605
606
607



608
609
610
611
612
613
614
...
621
622
623
624
625
626
627



628
629
630
631
632
633
634
...
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
# Copyright (c) 2007 by Arnulf P. Wiedemann
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkLayout.tcl
#--------------------------------------------------------------------------



namespace eval ::ntk::classes {

::itcl::extendedclass layout {
    private common node_indent ""
private common doShow 0

................................................................................

::itcl::body layout::BuildLayoutTemplate {layoutSpec} {
#puts stderr "+++ layoutSpec!$layoutSpec!"
    foreach {name info} $layoutSpec {
        set sticky [dict get $info -sticky]
        set pack [dict get $info -pack]
        set node [NewTemplateNode $name $sticky $pack]



        if {[dict exists $info -child]} {
            dict set node -child [BuildLayoutTemplate [dict get $info -child]]
        }
        if {[dict exists $info -next]} {
            dict set node -next [BuildLayoutTemplate [dict get $info -next]]
        }
    }
................................................................................
#=========================================================================

::itcl::body layout::InstantiateLayout {theme templateNode} {
#puts stderr "InstantiateLayout!$templateNode!"
#puts stderr "InstantiateLayout!$theme!$templateNode!"
    set elementClass [::ntk::classes::theme::GetElement $theme [dict get $templateNode -name]]
    set node [NewLayoutNode [dict get $templateNode -name] [dict get $templateNode -sticky] $elementClass [dict get $templateNode -pack] ""]



    set child [dict get $templateNode -child]
    if {$child ne ""} {
        dict set node -child [InstantiateLayout $theme $child]
    }
    set next [dict get $templateNode -next]
    if {$next ne ""} {
        dict set node -next [InstantiateLayout $theme $next]
................................................................................
	} else {
            set unit 0
	}
	set substate $state
	if {$unit} {
            lappend substate [dict get $node -state]
	}
#puts stderr "DN1![dict get $node -child]!$border!"
	set child [dict get $node -child]
#        if {$child ne "" && $border} {
#             DrawNodeList $layout $child $substate
#        }

        set tkwin [dict get $layout -tkwin]
        set elementClassName [dict get $node -elementClass]
        set elementName [dict get $node -name]
        set elementObject [$tkwin GetElementObject $elementName $elementClassName]



        ::ntk::classes::theme::DrawElement $elementObject [dict get $layout -style] "" "" "" [dict get $node -parcel] [concat $state [dict get $node -state]]
#        if {$child ne "" && !$border} {
             DrawNodeList $layout $child $substate
#        }

	set nextNode [dict get $node -next]
set node $nextNode
#        if {$nextNode ne ""} {
#            DrawNodeList $layout $nextNode $state
#        }
#puts stderr "DrawNodeList END!$state![dict get $node -name]!"
    }







>
>







 







>
>
>







 







>
>
>







 







|

|
|
<
>




>
>
>
|
|

<
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
...
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
...
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
# Copyright (c) 2007 by Arnulf P. Wiedemann
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkLayout.tcl
#--------------------------------------------------------------------------

set ::debugDrawElement 0

namespace eval ::ntk::classes {

::itcl::extendedclass layout {
    private common node_indent ""
private common doShow 0

................................................................................

::itcl::body layout::BuildLayoutTemplate {layoutSpec} {
#puts stderr "+++ layoutSpec!$layoutSpec!"
    foreach {name info} $layoutSpec {
        set sticky [dict get $info -sticky]
        set pack [dict get $info -pack]
        set node [NewTemplateNode $name $sticky $pack]
        if {[dict exists $info -border]} {
            dict set node -border [dict get $info -border]
	}
        if {[dict exists $info -child]} {
            dict set node -child [BuildLayoutTemplate [dict get $info -child]]
        }
        if {[dict exists $info -next]} {
            dict set node -next [BuildLayoutTemplate [dict get $info -next]]
        }
    }
................................................................................
#=========================================================================

::itcl::body layout::InstantiateLayout {theme templateNode} {
#puts stderr "InstantiateLayout!$templateNode!"
#puts stderr "InstantiateLayout!$theme!$templateNode!"
    set elementClass [::ntk::classes::theme::GetElement $theme [dict get $templateNode -name]]
    set node [NewLayoutNode [dict get $templateNode -name] [dict get $templateNode -sticky] $elementClass [dict get $templateNode -pack] ""]
    if {[dict exists $templateNode -border]} {
        dict set node -border [dict get $templateNode -border]
    }
    set child [dict get $templateNode -child]
    if {$child ne ""} {
        dict set node -child [InstantiateLayout $theme $child]
    }
    set next [dict get $templateNode -next]
    if {$next ne ""} {
        dict set node -next [InstantiateLayout $theme $next]
................................................................................
	} else {
            set unit 0
	}
	set substate $state
	if {$unit} {
            lappend substate [dict get $node -state]
	}
#puts stderr "DN1!$border!"
	set child [dict get $node -child]
        if {$child ne "" && $border} {
             DrawNodeList $layout $child $substate

        }
        set tkwin [dict get $layout -tkwin]
        set elementClassName [dict get $node -elementClass]
        set elementName [dict get $node -name]
        set elementObject [$tkwin GetElementObject $elementName $elementClassName]
if {$::debugDrawElement} {
puts stderr "call DrawElement2!$elementName![dict get $node -parcel]!"
}
        ::ntk::classes::theme::DrawElement $elementObject [dict get $layout -style] [dict get $layout -recordPtr] "" "" [dict get $node -parcel] [concat $state [dict get $node -state]]
        if {$child ne "" && !$border} {
             DrawNodeList $layout $child $substate

        }
	set nextNode [dict get $node -next]
set node $nextNode
#        if {$nextNode ne ""} {
#            DrawNodeList $layout $nextNode $state
#        }
#puts stderr "DrawNodeList END!$state![dict get $node -name]!"
    }

Changes to library/ntkMenuIndicatorElement.tcl.

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    protected option [list -indicatorheight indicatorDiameter MenuIndicatorDiameter] \
            -default "1.7m"
    protected option [list -indicatormargin indicatorMargin MenuIndicatorMargin] \
            -default [list 5 0]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName tkwin state}
    public method indicatorElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ indicatorElementConfigure ===================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::indicatorElementConfigure {option value} {
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set padding [list $l $t $r $b]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::ElementDraw {box state} {
#puts stderr "INDICATOR MENU elementDraw!$box!"
    set background [cget -background]
    set indicatorcolor $background
    set borderWidth [cget -borderwidth]
    set relief [cget -indicatorrelief]
    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding







|
<
|
|







|
|
<
<
<
<
<
<
<






|







 







|







31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49







50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    protected option [list -indicatorheight indicatorDiameter MenuIndicatorDiameter] \
            -default "1.7m"
    protected option [list -indicatormargin indicatorMargin MenuIndicatorMargin] \
            -default [list 5 0]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set padding [list $l $t $r $b]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body MenuIndicatorElement::ElementDraw {recordPtr box state} {
#puts stderr "INDICATOR MENU elementDraw!$box!"
    set background [cget -background]
    set indicatorcolor $background
    set borderWidth [cget -borderwidth]
    set relief [cget -indicatorrelief]
    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding

Changes to library/ntkPaddingElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

namespace eval ::ntk::classes {

::itcl::extendedclass PaddingElement {
    inherit baseElement utils

    protected option [list -padding Padding Padding] \
            -default 0 \
            -configuremethod paddingElementConfigure
    protected option [list -relief Relief Relief] \
            -default flat \
            -configuremethod paddingElementConfigure
    protected option [list -shiftrelief shiftRelief Relief] \
            -default 0 \
            -configuremethod paddingElementConfigure

    public method paddingElementConfigure {option value}
    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
 
}

#================================ paddingElementConfigure ============================
#     
#=========================================================================

::itcl::body PaddingElement::paddingElementConfigure {option value} {
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body PaddingElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
#puts stderr "PADDING!$this!relief!$itcl_options(-relief)!"
#puts stderr "PADDING!$this!padding!$itcl_options(-padding)!"
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body PaddingElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "PADDING relief!$itcl_options(-relief)!shiftRelief!$itcl_options(-shiftrelief)!pad!$itcl_options(-padding)!"
    set myPadding [cget -padding]
    set padding [::ntk::classes::layout::ReliefPadding $myPadding [cget -relief] [cget -shiftrelief]]
#puts stderr "PADDING SIZE!$this!$padding![cget -padding]!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body PaddingElement::ElementDraw {box state} {
#puts stderr "PaddingElement ElementDraw $box $state"
#puts stderr "CLOPT padding![info options]![cget -padding]![cget -relief]![cget -shiftrelief]!"
    ::ntk::Debug::DebugInput
}

} ; # end namepsace ::ntk::classes







|
<

|
<

|
<

<
|
|
|



<
<
<
<
<
<
<




|
|
|









|












|






16
17
18
19
20
21
22
23

24
25

26
27

28

29
30
31
32
33
34







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

namespace eval ::ntk::classes {

::itcl::extendedclass PaddingElement {
    inherit baseElement utils

    protected option [list -padding Padding Padding] \
            -default 0

    protected option [list -relief Relief Relief] \
            -default flat

    protected option [list -shiftrelief shiftRelief Relief] \
            -default 0



    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
 
}








#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body PaddingElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
#puts stderr "PADDING!$this!relief!$itcl_options(-relief)!"
#puts stderr "PADDING!$this!padding!$itcl_options(-padding)!"
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body PaddingElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $paddingVar padding

#puts stderr "PADDING relief!$itcl_options(-relief)!shiftRelief!$itcl_options(-shiftrelief)!pad!$itcl_options(-padding)!"
    set myPadding [cget -padding]
    set padding [::ntk::classes::layout::ReliefPadding $myPadding [cget -relief] [cget -shiftrelief]]
#puts stderr "PADDING SIZE!$this!$padding![cget -padding]!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body PaddingElement::ElementDraw {recordPtr box state} {
#puts stderr "PaddingElement ElementDraw $box $state"
#puts stderr "CLOPT padding![info options]![cget -padding]![cget -relief]![cget -shiftrelief]!"
    ::ntk::Debug::DebugInput
}

} ; # end namepsace ::ntk::classes

Changes to library/ntkSashElement.tcl.

18
19
20
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
..
51
52
53
54
55
56
57
58
59
60
61
62

::itcl::extendedclass SashElement {
    inherit baseElement utils

    protected option [list -sashthickness sashThickness Thickness] \
            -default 5

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SashElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SashElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "SashElement::ElementSize!"
    set thickness [cget -sashthickness]
    set width $thickness
................................................................................
#puts stderr "SashElement::ElementSize END!$width!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SashElement::ElementDraw {box state} {
#puts stderr "SashElement::ElementDraw!"
}

} ; # end namespace ::ntk::classes







|
|
|






|
|






|







 







|




18
19
20
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
..
51
52
53
54
55
56
57
58
59
60
61
62

::itcl::extendedclass SashElement {
    inherit baseElement utils

    protected option [list -sashthickness sashThickness Thickness] \
            -default 5

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SashElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SashElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

#puts stderr "SashElement::ElementSize!"
    set thickness [cget -sashthickness]
    set width $thickness
................................................................................
#puts stderr "SashElement::ElementSize END!$width!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SashElement::ElementDraw {recordPtr box state} {
#puts stderr "SashElement::ElementDraw!"
}

} ; # end namespace ::ntk::classes

Changes to library/ntkScroll.tcl.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57
58
59
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# @(#) $Id: ntkScroll.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass scroll {
   public proc CreateScrollHandle {corePtr scrollVar}
   public proc Scrolled {handle first last total}
}

#================================ CreateScrollHandle ============================
#     
#=========================================================================

::itcl::body scroll::CreateScrollHandle {corePtr scrollVar} {
................................................................................
}

#================================ Scrolled ============================
# Scrolled --
#     Update scroll info, schedule scrollbar update.
#=========================================================================

::itcl::body scroll::Scrolled {handle first last total} {

#puts stderr "scroll::Scrolled!"
    set scrollable [dict get $handle scrollPtr]

    # Sanity-check inputs:
 
    if {$total <= 0} {
        set first 0
        set last  1
        set total 1
    }
................................................................................
    }

    if {[dict get $scrollable first] != $first ||
        [dict get $scrollable last] != $last ||
        [dict get $scrollable total] != $total ||
        ([lsearch [dict get $handle flags] scrollUpdateRequired] >= 0)} {
        dict set scrollable first $first
        dict set $scrollable last $last
        dict set $scrollable total $total

        if {[lsearch [dict get $handle flags] scrollUpdatePending] >= 0} {
            # DoWhenIdle UpdateScrollbarBG $handle
	    dict lappend handle flags scrollUpdatePending
	}
    }
}

} ; # end namespace ::ntk::classes








|







 







|
>

<
<







 







|
|










14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
42
43
44
45
46
47
48
49
50
51


52
53
54
55
56
57
58
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# @(#) $Id: ntkScroll.tcl
#--------------------------------------------------------------------------

namespace eval ::ntk::classes {

::itcl::extendedclass scroll {
   public proc CreateScrollHandle {corePtr scrollVar}
   public proc Scrolled {scrollableVar handle first last total}
}

#================================ CreateScrollHandle ============================
#     
#=========================================================================

::itcl::body scroll::CreateScrollHandle {corePtr scrollVar} {
................................................................................
}

#================================ Scrolled ============================
# Scrolled --
#     Update scroll info, schedule scrollbar update.
#=========================================================================

::itcl::body scroll::Scrolled {scrollableVar handle first last total} {
    upvar $scrollableVar scrollable
#puts stderr "scroll::Scrolled!"


    # Sanity-check inputs:
 
    if {$total <= 0} {
        set first 0
        set last  1
        set total 1
    }
................................................................................
    }

    if {[dict get $scrollable first] != $first ||
        [dict get $scrollable last] != $last ||
        [dict get $scrollable total] != $total ||
        ([lsearch [dict get $handle flags] scrollUpdateRequired] >= 0)} {
        dict set scrollable first $first
        dict set scrollable last $last
        dict set scrollable total $total

        if {[lsearch [dict get $handle flags] scrollUpdatePending] >= 0} {
            # DoWhenIdle UpdateScrollbarBG $handle
	    dict lappend handle flags scrollUpdatePending
	}
    }
}

} ; # end namespace ::ntk::classes

Changes to library/ntkSeparatorElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

namespace eval ::ntk::classes {

::itcl::extendedclass SeparatorElement {
    inherit baseElement utils

    protected option [list -orient Orient Orient] \
            -default horizontal \
            -configuremethod separatorElementConfigure
    protected option [list -background Background Background] \
            -default [list 157 157 157 0] \
            -configuremethod separatorElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method separatorElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body SeparatorElement::InitializeOptionValues {style tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ separatorElementConfigure ============================
#     
#=========================================================================

::itcl::body SeparatorElement::separatorElementConfigure {option value} {
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SeparatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SeparatorElement::ElementDraw {box state} {
    foreach {x y width height} $box break
}

} ; # end namespae ::ntk::classes







|
<

|
<

|
<
|
|






|
|
<
<
<
<
<
<
<






|









|




16
17
18
19
20
21
22
23

24
25

26
27

28
29
30
31
32
33
34
35
36
37







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

namespace eval ::ntk::classes {

::itcl::extendedclass SeparatorElement {
    inherit baseElement utils

    protected option [list -orient Orient Orient] \
            -default horizontal

    protected option [list -background Background Background] \
            -default [list 157 157 157 0]


    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body SeparatorElement::InitializeOptionValues {style recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SeparatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SeparatorElement::ElementDraw {recordPtr box state} {
    foreach {x y width height} $box break
}

} ; # end namespae ::ntk::classes

Changes to library/ntkSizegripElement.tcl.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

namespace eval ::ntk::classes {

::itcl::extendedclass SizegripElement {
    inherit baseElement utils

    protected option [list -background Background Background] \
            -default [list 157 157 157 0] \
            -configuremethod sizegripElementConfigure

    public method InitializeOptionValues {styleName tkwin state}
    public method SizegripElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}

#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body SeparatorElement::InitializeOptionValues {style tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ SizegripElementConfigure ==================
#     
#=========================================================================

::itcl::body SizegripElement::SizegripElementConfigure {option value} {
}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body SizegripElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body SizegripElement::ElementDraw {box state} {
    foreach {x y width height} $box break
}

} ; # end namespace ::ntk::classes







|
<

|
<
|
|






|
|
<
<
<
<
<
<
<






|









|




16
17
18
19
20
21
22
23

24
25

26
27
28
29
30
31
32
33
34
35







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

namespace eval ::ntk::classes {

::itcl::extendedclass SizegripElement {
    inherit baseElement utils

    protected option [list -background Background Background] \
            -default [list 157 157 157 0]


    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}

#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body SeparatorElement::InitializeOptionValues {style recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body SizegripElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body SizegripElement::ElementDraw {recordPtr box state} {
    foreach {x y width height} $box break
}

} ; # end namespace ::ntk::classes

Changes to library/ntkSliderElement.tcl.

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
    protected option [list -orient orient Orient] \
            -default vertical
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar sliderVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ SliderElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SliderElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SliderElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set thickness [cget -sliderthickness]
    set orient [cget -orient]
    set length [cget -sliderlength]
................................................................................
    puts stderr "SliderElement::ElementSize!t!$thickness!o!$orient!l!$length!w!$width!h!$height!ip!$padding!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SliderElement::ElementDraw {box state} {
#puts stderr "SliderElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set orient [cget -orient]
    set relief [cget -sliderrelief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]







|
|
|







 







|
|
|







|







 







|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
    protected option [list -orient orient Orient] \
            -default vertical
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar sliderVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ SliderElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SliderElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body SliderElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set thickness [cget -sliderthickness]
    set orient [cget -orient]
    set length [cget -sliderlength]
................................................................................
    puts stderr "SliderElement::ElementSize!t!$thickness!o!$orient!l!$length!w!$width!h!$height!ip!$padding!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body SliderElement::ElementDraw {recordPtr box state} {
#puts stderr "SliderElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set orient [cget -orient]
    set relief [cget -sliderrelief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]

Changes to library/ntkSquareIndicatorElement.tcl.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    protected option [list -indicatordiameter indicatorDiameter SquareIndicatorDiameter] \
            -default 9
    protected option [list -indicatormargin indicatorMargin SquareIndicatorMargin] \
            -default [list 0 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "SQUARE!InitializeOptionValues!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set height [expr {$diameter + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::ElementDraw {box state} {
#puts stderr "INDICATOR SQUARE elementDraw!$box!$state!"
    set diameter [cget -indicatordiameter]
    set indicatorcolor [cget -indicatorcolor]
    set borderColor [cget -background]
    set relief [cget -indicatorrelief]
#puts stderr "icol!$indicatorcolor!bg!$borderColor!re!$relief!"
    set padding [cget -indicatormargin]







|
|
|







|

|






|







 







|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    protected option [list -indicatordiameter indicatorDiameter SquareIndicatorDiameter] \
            -default 9
    protected option [list -indicatormargin indicatorMargin SquareIndicatorMargin] \
            -default [list 0 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "SQUARE!InitializeOptionValues!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargin]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
................................................................................
    set height [expr {$diameter + $t + $b}]
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body SquareIndicatorElement::ElementDraw {recordPtr box state} {
#puts stderr "INDICATOR SQUARE elementDraw!$box!$state!"
    set diameter [cget -indicatordiameter]
    set indicatorcolor [cget -indicatorcolor]
    set borderColor [cget -background]
    set relief [cget -indicatorrelief]
#puts stderr "icol!$indicatorcolor!bg!$borderColor!re!$relief!"
    set padding [cget -indicatormargin]

Changes to library/ntkTTreeview.tcl.

10
11
12
13
14
15
16


17
18
19
20
21
22
23
...
301
302
303
304
305
306
307

308
309
310
311
312
313
314
...
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
...
748
749
750
751
752
753
754
755
756
757


758
759
760
761

762
763
764


765
766
767
768
769
770
771
...
792
793
794
795
796
797
798

799

800
801
802
803
804
805
806
...
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
...
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
...
962
963
964
965
966
967
968
969
970

971
972
973
974


975

976
977
978
979
980
981
982
983
984
985
986
987
988
989

990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008



1009
1010
1011



1012
1013
1014
1015
1016

1017


1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042

1043





1044

1045
1046
1047
1048
1049
1050
1051
....
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063

1064
1065

1066
1067
1068
1069
1070
1071
1072
1073
1074
1075


1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086



1087




1088
1089
1090
1091
1092
1093
1094
....
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
....
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
....
1479
1480
1481
1482
1483
1484
1485

1486

1487

1488
1489

1490
1491
1492
1493
1494
1495
1496
....
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------



namespace eval ::ntk {

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

    protected variable item_id 0
    protected variable tree
................................................................................
    dict set tree endPtr ""

    # Create root item "":

    dict set tree root [NewItem]
#    Tk_InitOptions(interp, (ClientData)tv->tree.root, tv->tree.itemOptionTable, tv->core.tkwin);
    dict set tree root tagset [list]

    dict set tree items "" [dict get $tree root]
    dict set tree root entryPtr ""

    # Scroll handles:

    dict set tree xscrollHandle [CreateScrollHandle $core xscroll]
    dict set tree xscrollHandle xscroll $xscroll
................................................................................
    dict set tree treeArea width 0
    dict set tree treeArea height 0
    dict set tree headingArea x 0
    dict set tree headingArea y 0
    dict set tree headingArea width 0
    dict set tree headingArea height 0
    dict set tree slack 0

}

#================================ TreeviewCleanup ============================
#     Cleanup hooks.
#=========================================================================

::itcl::body treeview::TreeviewCleanup {recordPtr} {
................................................................................
        return 0
    }
    dict set tree headingLayout $headingLayout
    set rowLayout [dict get $tree rowLayout]
    if {[GetSublayout $theme $treeLayout ".Row" $tagOptionTable rowLayout] eq ""} {
        return 0
    }
puts stderr "rowLayout"
    dict set tree rowLayout $rowLayout
    # Compute heading height.
#    ::ntk::classes::layout::RebindSubLayout headingLayout [dict get $tree column0]
    ::ntk::classes::layout::RebindSubLayout headingLayout $core
    dict set tree headingLayout $headingLayout
    ::ntk::classes::layout::LayoutSize $headingLayout 0 unused [dict get $tree headingHeight]

................................................................................

#================================ CountRows ============================
# CountRows --
#     Returns the number of viewable rows rooted at item
#=========================================================================

::itcl::body treeview::CountRows {item} {
#puts stderr "CountRows!"
    set rows 1



    if {[lsearch [dict get $item state] stateOpen] >= 0} {
        set child [dict get $item children]
        while {$child ne ""} {
            set rows [expr {$rows + [CountRows $child]}]

            set child [dict get $child next]
        }
    }


    return $rows
}

#================================ TreeviewDoLayout ============================
# TreeviewDoLayout --
#     DoLayout() widget hook.  Computes widget layout.
# 
................................................................................
    dict set tree treeArea height $height

    ResizeColumns [dict get $tree treeArea width]
    # ASSERT: SLACKINVARIANT

    set start [dict get $tree xscrollHandle xscroll first]
    set end [expr {[dict get $tree xscrollHandle xscroll first] + [dict get $tree treeArea width]}]

    Scrolled [dict get $tree xscrollHandle] $start $end [TreeWidth]


    if {[lsearch [dict get $tree showFlags] headings] >= 0} {
        set box [list [dict get $tree treeArea x] [dict get $tree treeArea y] [dict get $tree treeArea width] [dict get $tree treeArea height] ]
        set headBox [::ntk::classes::layout::PackBox box 1 [dict get $tree headingHeight] side_top]
#puts stderr "headArea!$headBox![dict get $tree headingHeight]!"
        lassign $headBox x y width height
        dict set tree headingArea x $x
................................................................................
        dict set tree headingArea height 0
    }
    set visibleRows [expr {[dict get $tree treeArea height] / [dict get $tree rowHeight]}]
#puts stderr "visibleRows!$visibleRows!"
    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!$box!"
    ::ntk::classes::layout::RebindSubLayout layout $core
    ::ntk::classes::layout::PlaceLayout layout $state $box
#puts stderr "layout!$layout!"
#::ntk::classes::layout::printDict $layout

    ::ntk::classes::layout::DrawLayout $layout $state
}

#================================ DrawHeadings ============================
# DrawHeadings --
#     Draw tree headings.
#=========================================================================
................................................................................
    set x0 [expr {[dict get $tree headingArea x] - [dict get $tree xscrollHandle xscroll first]}]
    set y0 [dict get $tree headingArea y]
    set h0 [dict get $tree headingArea height]
    set i [FirstColumn]
    set x 0
# FIXME !!! temporary ??? eventually ned to figure out how GC is used ???
set coreHeight [dict get $core height]
set y0 [expr {$y0 + $coreHeight - $h0}]
#puts stderr "DrawHeadings0![dict get $tree xscrollHandle xscroll first]! $x0!$y0!$h0!"

    while {$i < [dict get $tree nDisplayColumns]} {
        set column [lindex [dict get $tree displayColumns] $i]
        set parcel [list [expr {$x0 + $x}] $y0 [dict get $column width] $h0]
#puts stderr "DrawHeadings!col!$i!$parcel!"
        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

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

    set itemInfo [dict get $tree items $item]
    TagSetValues [dict get $tree tagTable] [dict get $itemInfo 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!$item!"
    set state [dict get $core state]
    set itemInfo [dict get $tree items $item]
    lappend state [dict get $itemInfo state]

    if {[dict get $itemInfo children] ne ""} {
        lappend state stateLeaf
    }
    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!$item!$x!$y!"
    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 ""

    set itemInfo [dict get $tree items $item]
puts stderr "VAL![dict get $itemInfo valuesObj]!"
    if {[dict get $itemInfo valuesObj] eq ""} {
        return
    }

    set values [dict get $itemInfo valuesObj]
    set nValues [llength $values]
    set i 0
................................................................................

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

::itcl::body treeview::DrawItem {item depth row} {
puts stderr "DrawItem!$item!"
    set state [ItemState $item]

    set rowHeight [dict get $tree rowHeight]
    set x [expr {[dict get $tree treeArea x] - [dict get $tree xscrollHandle xscroll first]}]
puts stderr "X!$x![dict get $tree treeArea x]![dict get $tree xscrollHandle xscroll first]!"
    set y [expr {[dict get $tree treeArea y] + $rowHeight * ($row - [dict get $tree yscrollHandle yscroll first])}]




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

    set displayItem ""
    PrepareItem $item displayItem

    # Draw row background:

    set rowBox [list $x $y [TreeWidth] $rowHeight]
    set rowLayout [dict get $tree rowLayout]
#puts stderr "displayItem!$displayItem!"
puts stderr "rowBox!$rowBox!$state!"
    DisplayLayout rowLayout displayItem $state $rowBox


    # Draw tree label:
puts stderr "Draw tree label![dict get $tree showFlags]!"

    if {[lsearch [dict get $tree showFlags] tree] >= 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]
puts stderr "parcel!$parcel!$item!"
	set itemInfo [dict get $tree items $item]
        if {[dict get $itemInfo textObj] ne ""} {
            dict set displayItem textObj [dict get $itemInfo textObj]
        }
        if {[dict get $itemInfo imageObj] ne ""} {
            dict set displayItem imageObj [dict get $itemInfo imageObj]
        }
set optionsTable [dict get $itemInfo optionsTable]
if {[dict exists $optionsTable -text]} {
dict set displayItem -text [dict get $optionsTable -text]



}
if {[dict exists $optionsTable -image]} {
dict set displayItem -image [dict get $optionsTable -image]



}
        # ??? displayItem.anchorObj = 0; <<NOTE-ANCHOR>>
	set itemLayout [dict get $tree itemLayout]
puts stderr "displayItem!$displayItem!"
        DisplayLayout itemLayout displayItem $state $parcel

        set x [expr {$x + $colwidth}]


    }

    # Draw data cells:
puts stderr "Draw data cells!$x!$y!$colwidth!"
 
    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!$item!$depth!$row![dict get $tree yscrollHandle yscroll first]!"
    if {$row >= [dict get $tree yscrollHandle yscroll first]} {
        DrawItem $item $depth $row
    }

    set itemInfo [dict get $tree items $item]
    set isOpen [lsearch [dict get $itemInfo state] stateOpen]
# FIXME!!! temporary

set isOpen 1





    if {$isOpen} {

        return [DrawForest [dict get $itemInfo children] [expr {$depth + 1}] [expr {$row + 1}]]
    } else {
        return [expr {$row + 1}]
    }
}

#================================ 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!$item!$depth!$row![dict get $tree yscrollHandle yscroll last]!"
    while {$item ne "" && $row <= [dict get $tree yscrollHandle yscroll last]} {
	set itemInfo [dict get $tree items $item]
        set row [DrawSubtree $item $depth $row]

        set item [dict get $itemInfo 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] headings] >= 0 } {
        DrawHeadings
    }
#::ntk::classes::layout::printDict [dict get $tree items ""]
foreach key [dict keys [dict get $tree items]] {
#puts stderr "KEY!$key![dict get $tree items $key]!"
#::ntk::classes::layout::printDict [dict get $tree items $key]
}
    set start [dict get $tree root entryPtr]
    set top [dict get $tree items $start]



    DrawForest [dict get $top children] 0 0




}

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

::itcl::body treeview::TreeviewBBoxCommand {args} {
................................................................................
    set newImageSpec ""
    set newTagSet ""
    set mask ""

    set savedOptions [dict create]
    SetOptions item $args savedOptions mask

puts stderr "OPTTAB![dict get $item optionsTable]!"
    # Make sure that -values is a valid list:
 
    if {[dict get $item valuesObj] ne ""} {
#        if (Tcl_ListObjLength(interp, item->valuesObj, &unused) != TCL_OK)
#            goto error;
    }

................................................................................
}

#================================ TreeviewInsertCommand ============================
#     
#=========================================================================

::itcl::body treeview::TreeviewInsertCommand {args} {
puts stderr "TreeviewInsertCommand!$args!"
    # Get parent node:

    set parentItem [FindItem [lindex $args 0]]

    # Locate previous sibling based on $index:
    if {[lindex $args 1] eq "end"} {
        set sibling [EndPosition $parentItem]
................................................................................
    # Store in hash table, link into tree:
 
    dict set tree items $itemName $newItem
    dict set newItem entryPtr $itemName
    InsertItem parentItem sibling newItem
#puts stderr "sibling!$sibling!"
    dict set tree items $itemName $newItem

    set entryPtr [dict get $parentItem entryPtr]

    dict set tree items $entryPtr $parentItem

    RedisplayWidget ""


    return [ItemName $newItem]
}

#================================ TreeviewItemCommand ============================
#     
#=========================================================================

................................................................................
}

#================================ insert ============================
#     
#=========================================================================

::itcl::body treeview::insert {args} {
puts stderr "insert!$args!"
    TreeviewInsertCommand {*}$args
}

} ; # end namespace ::ntk::classes







>
>







 







>







 







<







 







|







 







|


>
>
|
|


>
|

<
>
>







 







>
|
>







 







>
>
>
|
>
>
>











|




>







 







|












>











|













|


|
>
|








>











|








<







 







|

>


<

>
>

>












|

>


|





|










>
>
>



>
>
>



|
|
>

>
>



|













|





<

>
|
>
>
>
>
>
|
>







 







|

<

>


>









|
>
>










|
>
>
>
|
>
>
>
>







 







<







 







|







 







>

>

>


>







 







|




10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
...
325
326
327
328
329
330
331

332
333
334
335
336
337
338
...
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
...
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
...
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
...
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
...
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
944

945
946
947
948
949
950
951
...
979
980
981
982
983
984
985
986
987
988
989
990

991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070

1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
....
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
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
....
1316
1317
1318
1319
1320
1321
1322

1323
1324
1325
1326
1327
1328
1329
....
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
....
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
....
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: ntkTTreeview.tcl
#--------------------------------------------------------------------------

set ::debugDrawElement 0

namespace eval ::ntk {

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

    protected variable item_id 0
    protected variable tree
................................................................................
    dict set tree endPtr ""

    # Create root item "":

    dict set tree root [NewItem]
#    Tk_InitOptions(interp, (ClientData)tv->tree.root, tv->tree.itemOptionTable, tv->core.tkwin);
    dict set tree root tagset [list]
    dict set root state stateOpen
    dict set tree items "" [dict get $tree root]
    dict set tree root entryPtr ""

    # Scroll handles:

    dict set tree xscrollHandle [CreateScrollHandle $core xscroll]
    dict set tree xscrollHandle xscroll $xscroll
................................................................................
    dict set tree treeArea width 0
    dict set tree treeArea height 0
    dict set tree headingArea x 0
    dict set tree headingArea y 0
    dict set tree headingArea width 0
    dict set tree headingArea height 0
    dict set tree slack 0

}

#================================ TreeviewCleanup ============================
#     Cleanup hooks.
#=========================================================================

::itcl::body treeview::TreeviewCleanup {recordPtr} {
................................................................................
        return 0
    }
    dict set tree headingLayout $headingLayout
    set rowLayout [dict get $tree rowLayout]
    if {[GetSublayout $theme $treeLayout ".Row" $tagOptionTable rowLayout] eq ""} {
        return 0
    }
#puts stderr "rowLayout"
    dict set tree rowLayout $rowLayout
    # Compute heading height.
#    ::ntk::classes::layout::RebindSubLayout headingLayout [dict get $tree column0]
    ::ntk::classes::layout::RebindSubLayout headingLayout $core
    dict set tree headingLayout $headingLayout
    ::ntk::classes::layout::LayoutSize $headingLayout 0 unused [dict get $tree headingHeight]

................................................................................

#================================ CountRows ============================
# CountRows --
#     Returns the number of viewable rows rooted at item
#=========================================================================

::itcl::body treeview::CountRows {item} {
#puts stderr "=== CountRows!$item!"
    set rows 1

    set itemInfo [dict get $tree items $item]
# FIXME!! temporary
#    if {[lsearch [dict get $item state] stateOpen] >= 0} {
        set child [dict get $itemInfo children]
        while {$child ne ""} {
            set rows [expr {$rows + [CountRows $child]}]
            set childInfo [dict get $tree items $child]
            set child [dict get $childInfo next]
        }

#    }
#puts stderr "=== CountRows end!$item!$rows!"
    return $rows
}

#================================ TreeviewDoLayout ============================
# TreeviewDoLayout --
#     DoLayout() widget hook.  Computes widget layout.
# 
................................................................................
    dict set tree treeArea height $height

    ResizeColumns [dict get $tree treeArea width]
    # ASSERT: SLACKINVARIANT

    set start [dict get $tree xscrollHandle xscroll first]
    set end [expr {[dict get $tree xscrollHandle xscroll first] + [dict get $tree treeArea width]}]
    set xscroll [dict get $tree xscrollHandle xscroll]
    Scrolled xscroll [dict get $tree xscrollHandle] $start $end [TreeWidth]
    dict set tree xscrollHandle xscroll [dict get $tree xscrollHandle] $xscroll

    if {[lsearch [dict get $tree showFlags] headings] >= 0} {
        set box [list [dict get $tree treeArea x] [dict get $tree treeArea y] [dict get $tree treeArea width] [dict get $tree treeArea height] ]
        set headBox [::ntk::classes::layout::PackBox box 1 [dict get $tree headingHeight] side_top]
#puts stderr "headArea!$headBox![dict get $tree headingHeight]!"
        lassign $headBox x y width height
        dict set tree headingArea x $x
................................................................................
        dict set tree headingArea height 0
    }
    set visibleRows [expr {[dict get $tree treeArea height] / [dict get $tree rowHeight]}]
#puts stderr "visibleRows!$visibleRows!"
    dict lappend tree root state stateOpen
    set start [dict get $tree yscrollHandle yscroll first]
    set end [expr {[dict get $tree yscrollHandle yscroll first] + $visibleRows}]
    set yscroll [dict get $tree yscrollHandle yscroll]
    set itemInfo [dict get $tree items ""]
#puts stderr "itemInfo!$itemInfo!"
    Scrolled yscroll [dict get $tree yscrollHandle] $start $end [expr {[CountRows ""] - 1}]
#puts stderr "yscrollHandle!$yscroll!"
    dict set tree yscrollHandle yscroll $yscroll


}

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

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

#puts stderr "DisplayLayout!$box!"
    ::ntk::classes::layout::RebindSubLayout layout $core
    ::ntk::classes::layout::PlaceLayout layout $state $box
#puts stderr "layout!$layout!"
#::ntk::classes::layout::printDict $layout
dict set layout -recordPtr $core
    ::ntk::classes::layout::DrawLayout $layout $state
}

#================================ DrawHeadings ============================
# DrawHeadings --
#     Draw tree headings.
#=========================================================================
................................................................................
    set x0 [expr {[dict get $tree headingArea x] - [dict get $tree xscrollHandle xscroll first]}]
    set y0 [dict get $tree headingArea y]
    set h0 [dict get $tree headingArea height]
    set i [FirstColumn]
    set x 0
# FIXME !!! temporary ??? eventually ned to figure out how GC is used ???
set coreHeight [dict get $core height]
set y0 [expr {$y0 + $coreHeight - $h0 - 2}]
#puts stderr "DrawHeadings0![dict get $tree xscrollHandle xscroll first]! $x0!$y0!$h0!"

    while {$i < [dict get $tree nDisplayColumns]} {
        set column [lindex [dict get $tree displayColumns] $i]
        set parcel [list [expr {$x0 + $x}] $y0 [dict get $column width] $h0]
#puts stderr "DrawHeadings!col!$i!$parcel!"
        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
    }
#puts stderr "DrawHeadings done!"
}

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

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

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

    set itemInfo [dict get $tree items $item]
    TagSetValues [dict get $tree tagTable] [dict get $itemInfo 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!$item!"
    set state [dict get $core state]
    set itemInfo [dict get $tree items $item]
    set state [concat [dict get $itemInfo state] $state]
#puts stderr "+++ ItemState2!$itemInfo!"
    if {[dict get $itemInfo children] eq ""} {
        lappend state stateLeaf
    }
    if {$item ne [dict get $tree focus]} {
        set idx [lsearch $state stateFocus]
        if {$idx >= 0} {
            set state [lreplace $state $idx $idx]
        }
    }
#puts stderr "+++ ItemState end!$item!$state!"
    return $state
}

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

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

#puts stderr "DrawCells!$item!$x!$y!"
    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 ""

    set itemInfo [dict get $tree items $item]

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

    set values [dict get $itemInfo valuesObj]
    set nValues [llength $values]
    set i 0
................................................................................

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

::itcl::body treeview::DrawItem {item depth row} {
#puts stderr "DrawItem!$item!depth!$depth!row!$row!"
    set state [ItemState $item]
#puts stderr "state!$state!"
    set rowHeight [dict get $tree rowHeight]
    set x [expr {[dict get $tree treeArea x] - [dict get $tree xscrollHandle xscroll first]}]

    set y [expr {[dict get $tree treeArea y] + $rowHeight * ($row - [dict get $tree yscrollHandle yscroll first])}]
# FIXME!!! temporary!!
set y [expr {200 - ($row + 1) * $rowHeight}]

#puts stderr "x!$x!y!$y!rowHeight!$rowHeight!xscollfirst![dict get $tree xscrollHandle xscroll first]!"
    if {$row % 2} {
        lappend state stateAlternate
    }

    set displayItem ""
    PrepareItem $item displayItem

    # Draw row background:

    set rowBox [list $x $y [TreeWidth] $rowHeight]
    set rowLayout [dict get $tree rowLayout]
#puts stderr "displayItem!$displayItem!"
#puts stderr "rowBox!$rowBox!$state!"
    DisplayLayout rowLayout displayItem $state $rowBox
#    DisplayLayout rowLayout core $state $rowBox

    # Draw tree label:
#puts stderr "Draw tree label![dict get $tree showFlags]!"

    if {[lsearch [dict get $tree showFlags] tree] >= 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]
#puts stderr "parcel!$parcel!$item!"
	set itemInfo [dict get $tree items $item]
        if {[dict get $itemInfo textObj] ne ""} {
            dict set displayItem textObj [dict get $itemInfo textObj]
        }
        if {[dict get $itemInfo imageObj] ne ""} {
            dict set displayItem imageObj [dict get $itemInfo imageObj]
        }
set optionsTable [dict get $itemInfo optionsTable]
if {[dict exists $optionsTable -text]} {
dict set displayItem -text [dict get $optionsTable -text]
dict set core TextElement -text [dict get $optionsTable -text]
} else {
dict set core TextElement -text ""
}
if {[dict exists $optionsTable -image]} {
dict set displayItem -image [dict get $optionsTable -image]
dict set core ImageElement -image [dict get $optionsTable -image]
} else {
dict set core ImageElement -image ""
}
        # ??? displayItem.anchorObj = 0; <<NOTE-ANCHOR>>
	set itemLayout [dict get $tree itemLayout]
#puts stderr "displayItem!$displayItem!"
#        DisplayLayout itemLayout displayItem $state $parcel
        DisplayLayout itemLayout core $state $parcel
        set x [expr {$x + $colwidth}]
dict set core TextElement -text ""
dict set core ImageElement -image ""
    }

    # Draw data cells:
#puts stderr "Draw data cells!$x!$y!$colwidth!"
 
    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!$item!depth!$depth!row!$row!yscrollfirst![dict get $tree yscrollHandle yscroll first]!"
    if {$row >= [dict get $tree yscrollHandle yscroll first]} {
        DrawItem $item $depth $row
    }

    set itemInfo [dict get $tree items $item]

# FIXME!!! temporary
#puts stderr "== STATE!$item![dict get $itemInfo state]!"
if {[lsearch [dict get $itemInfo state] stateOpen] < 0} {
    dict lappend itemInfo state stateOpen
    dict set tree items $item $itemInfo
#puts stderr "=== itemInfo!$itemInfo!"
}
    set isOpen [lsearch [dict get $itemInfo state] stateOpen]
    if {$isOpen >= 0} {
#puts stderr "++++ isOpen!"
        return [DrawForest [dict get $itemInfo children] [expr {$depth + 1}] [expr {$row + 1}]]
    } else {
        return [expr {$row + 1}]
    }
}

#================================ 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!$item!depth!$depth!row!$row!yscrolllast![dict get $tree yscrollHandle yscroll last]!"
    while {$item ne "" && $row <= [dict get $tree yscrollHandle yscroll last]} {

        set row [DrawSubtree $item $depth $row]
	set itemInfo [dict get $tree items $item]
        set item [dict get $itemInfo next]
    }
#puts stderr "DrawForest end!row!$row!"
    return $row;
}

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

::itcl::body treeview::TreeviewDisplay {} {
#puts stderr "TreeviewDisplay![dict get $core x]![dict get $core y]![dict get $core width]![dict get $core height]!"
set startX [dict get $core x]
set startY [dict get $core y]
    ::ntk::classes::layout::DrawLayout [dict get $core layout] [dict get $core state]
    if {[lsearch [dict get $tree showFlags] headings] >= 0 } {
        DrawHeadings
    }
#::ntk::classes::layout::printDict [dict get $tree items ""]
foreach key [dict keys [dict get $tree items]] {
#puts stderr "KEY!$key![dict get $tree items $key]!"
#::ntk::classes::layout::printDict [dict get $tree items $key]
}
    set start [dict get $tree root entryPtr]
    set topInfo [dict get $tree items $start]
#puts stderr "start!$start!$topInfo!"
#puts stderr "start keys!$start![dict keys [dict get $tree items]]!"
#puts stderr "start children![dict get $topInfo children]!"
    DrawForest [dict get $topInfo children] 0 0
#puts stderr "TreeviewDisplay end!"
# FIXME !!! temporary
dict set core x $startX
dict set core y $startY
}

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

::itcl::body treeview::TreeviewBBoxCommand {args} {
................................................................................
    set newImageSpec ""
    set newTagSet ""
    set mask ""

    set savedOptions [dict create]
    SetOptions item $args savedOptions mask


    # Make sure that -values is a valid list:
 
    if {[dict get $item valuesObj] ne ""} {
#        if (Tcl_ListObjLength(interp, item->valuesObj, &unused) != TCL_OK)
#            goto error;
    }

................................................................................
}

#================================ TreeviewInsertCommand ============================
#     
#=========================================================================

::itcl::body treeview::TreeviewInsertCommand {args} {
#puts stderr "TreeviewInsertCommand!$args!"
    # Get parent node:

    set parentItem [FindItem [lindex $args 0]]

    # Locate previous sibling based on $index:
    if {[lindex $args 1] eq "end"} {
        set sibling [EndPosition $parentItem]
................................................................................
    # Store in hash table, link into tree:
 
    dict set tree items $itemName $newItem
    dict set newItem entryPtr $itemName
    InsertItem parentItem sibling newItem
#puts stderr "sibling!$sibling!"
    dict set tree items $itemName $newItem
#puts stderr "ITEM!$itemName!$newItem!"
    set entryPtr [dict get $parentItem entryPtr]
#puts stderr "PARENT!$entryPtr!$parentItem!"
    dict set tree items $entryPtr $parentItem
#puts stderr "TreeviewInsertCommand!RedisplayWidget!"
    RedisplayWidget ""

#puts stderr "TreeviewInsertCommand end"
    return [ItemName $newItem]
}

#================================ TreeviewItemCommand ============================
#     
#=========================================================================

................................................................................
}

#================================ insert ============================
#     
#=========================================================================

::itcl::body treeview::insert {args} {
#puts stderr "insert!$args!"
    TreeviewInsertCommand {*}$args
}

} ; # end namespace ::ntk::classes

Changes to library/ntkTextElement.tcl.

16
17
18
19
20
21
22
23
24
25
26

27
28
29
30

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61
62
63
64



65
66

67
68
69
70
71






















72
73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93







94


95











































96

namespace eval ::ntk::classes {

::itcl::extendedclass TextElement {
    inherit baseElement utils

    protected option [list -text Text Text] \
            -default "" \
            -configuremethod labelElementConfigure
    protected option [list -font Font Font] \
            -default Vera \

            -configuremethod labelElementConfigure
    protected option [list -foreground Foreground Foreground] \
            -default #000000 \
            -configuremethod labelElementConfigure

    protected option [list -underline Underline Underline] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -width Width Width] \
            -default -1 \
            -configuremethod labelElementConfigure
    protected option [list -anchor Anchor Anchor] \
            -default w \
            -configuremethod labelElementConfigure
    protected option [list -justify Justify Justify] \
            -default left \
            -configuremethod labelElementConfigure
    protected option [list -wraplength wrapLength WrapLength] \
            -default 0 \
            -configuremethod labelElementConfigure
    protected option [list -embossed Embossed Embossed] \
            -default 0 \
            -configuremethod labelElementConfigure


    public method InitializeOptionValues {styleName tkwin state}
    public method textElementConfigure {option value}

    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body TextElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "TextElement INIT"
    InitializeOptionValuesBase $styleName $tkwin $state



}


#================================ textElementConfigure ==================
#     
#=========================================================================

::itcl::body TextElement::textElementConfigure {option value} {






















}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body TextElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
#puts stderr "TextElement::Size!"

    set width 72
    set height 16

}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body TextElement::ElementDraw {box state} {
    foreach {x y width height} $box break







}














































} ; # end namespace ::ntk::classes







|
<

|
>
|

|
|
>

|
<

|
<

|
<

|
<

|
<

|
<


|
<
>
|
|







|
|
|
>
>
>
|
|
>
|



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






|





|
|
>






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

16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
32
33

34
35

36
37

38
39

40
41

42
43

44
45
46

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169

namespace eval ::ntk::classes {

::itcl::extendedclass TextElement {
    inherit baseElement utils

    protected option [list -text Text Text] \
            -default ""

    protected option [list -font Font Font] \
            -default Vera
    protected option [list -fontsize FontSize FontSize] \
            -default 12
    protected option [list -foreground Foreground Foreground] \
            -default black
    protected option [list -background Background Background] \
            -default #d9d9d9
    protected option [list -underline Underline Underline] \
            -default -1

    protected option [list -width Width Width] \
            -default -1

    protected option [list -anchor Anchor Anchor] \
            -default w

    protected option [list -justify Justify Justify] \
            -default left

    protected option [list -wraplength wrapLength WrapLength] \
            -default 0

    protected option [list -embossed Embossed Embossed] \
            -default 0



    public method InitializeOptionValues {styleName recordPtr state}

    private method TextSetup {recordPtr textBoxVar}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body TextElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "TextElement INIT![dict get $recordPtr tkwin]!"
    InitializeOptionValuesBase $styleName $recordPtr $state
    if {[dict exists $recordPtr TextElement]} {
        set text [dict get $recordPtr TextElement -text]
#puts stderr "INITTEXT!$text!"
    }
}

#================================ TextSetup ============================
#     
#=========================================================================

::itcl::body TextElement::TextSetup {recordPtr textBoxVar} {
    upvar $textBoxVar textBox

#puts stderr "LabelElement TextSetup!$textBox!"
    set textBox [list 0 0]
    set font [cget -font]
    set fontSize [cget -fontsize]
    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
    set text ""
    if {[dict exists $recordPtr TextElement]} {
        set text [dict get $recordPtr TextElement -text]
#puts stderr "TEXTSIZE!$text!"
    }
    if {$text eq ""} {
        set textBox [list 0 18]
        return
    }
#puts stderr "TEXT!$text!$font!$fontSize!$backgroundColor!"
#puts stderr "BACKGROUND!$background!$backgroundColor!"
    set textBox [::gles2::builtin::getfontinfo $text $font $fontSize $backgroundColor $backgroundColor -1 -1 1]
#puts stderr "+++ TextSetup!$textBox!"
    return 1;
}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body TextElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
#puts stderr "TextElement::Size!"

    TextSetup $recordPtr textBox
    lassign $textBox width height
#puts stderr "TextElement::Size!$width!$height!"
}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body TextElement::ElementDraw {recordPtr box state} {

#puts stderr "TextElement::ElementDraw!box!$box!state!$state!text!"
    lassign $box b_x b_y b_width b_height
    set t_width $b_width
    set t_height $b_height
if {0} {
    if {$t_width > $b_width} {
        set t_width $b_width 
    }
    if {$t_height > $b_height} {
        set t_height $b_height 
    }
    set x_offset [expr {($b_width - $t_width) / 2}]
    set y_offset [expr {($b_height - $t_height) / 2}]
    set t_x [expr {$b_x + $x_offset}]
    set t_y [expr {$b_y + $y_offset}]
    set t_width [expr {$t_width - $x_offset * 2}]
    set t_height [expr {$t_height - $y_offset * 2}]
}
#puts stderr "W!bw!$b_width!xo!$x_offset!tw!$t_width!bh!$b_height!yo!$y_offset!th!$t_height!"
set box [list $b_x $b_y $b_width $b_height]
#puts stderr "BOX!$box!"

    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
    set foreground [cget -foreground]
    set foregroundColor [ColorValue2RGBA $foreground]
#puts stderr "BG!$background!FG!$foreground!"
    set text ""
    if {[dict exists $recordPtr TextElement]} {
        set text [dict get $recordPtr TextElement -text]
#puts stderr "TEXTDRAW!$text!"
    }
    if {$text eq ""} {
        if {[dict exists $recordPtr -recordPtr]} {
            set recordPtr [dict get $recordPtr -recordPtr]
        }
        if {[dict exists $recordPtr TextElement]} {
            set text [dict get $recordPtr TextElement -text]
#puts stderr "TEXTDRAW2!$text!"
        }
    }
    if {$text eq ""} {
        return
    }
    ::gles2::builtin::maketexttexture $text [cget -font] [cget -fontsize] $backgroundColor $foregroundColor $b_width $b_height
    ::gles2::builtin::compileshaders texture
    lassign [GetElementPositions $box] t_pos1 t_pos2 t_pos3 t_pos4
    ::gles2::builtin::filltexturerectangle [list $t_pos1 $backgroundColor] [list $t_pos2 $backgroundColor] [list $t_pos3 $backgroundColor] [list $t_pos4 $backgroundColor]
#puts stderr "TEXTDRAW3!$text!$box!"
    ::gles2::swapbuffers
    ::ntk::Debug::DebugInput
    ::gles2::builtin::compileshaders notexture
}

} ; # end namespace ::ntk::classes

Changes to library/ntkTextareaElement.tcl.

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
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    protected option [list -font Font Font] \
            -default Vera
    protected option [list -fontsize Font Font] \
            -default 12
    protected option [list -width Width Width] \
            -default 20

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body TextareaElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "TextareaElement INIT"
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body TextareaElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
#puts stderr "TextareaElement::ElementSize!"

    set prefWidth [cget -width]
    set font [cget -font]
................................................................................
    set padding [list 0 0 0 0]
}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body TextareaElement::ElementDraw {box state} {
#puts stderr "TextareaElement::ElementDraw!$box!"
if {0} {
    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
    set foreground [cget -foreground]
    set foregroundColor [ColorValue2RGBA $foreground]
#puts stderr "BG!$background!FG!$foreground!"







|
|
|







|

|






|







 







|







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
..
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    protected option [list -font Font Font] \
            -default Vera
    protected option [list -fontsize Font Font] \
            -default 12
    protected option [list -width Width Width] \
            -default 20

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ InitializeOptionValues ==================
#     
#=========================================================================

::itcl::body TextareaElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "TextareaElement INIT"
    InitializeOptionValuesBase $styleName $recordPtr $state
}

#================================ ElementSize ==================
#     
#=========================================================================

::itcl::body TextareaElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding
#puts stderr "TextareaElement::ElementSize!"

    set prefWidth [cget -width]
    set font [cget -font]
................................................................................
    set padding [list 0 0 0 0]
}

#================================ ElementDraw ==================
#     
#=========================================================================

::itcl::body TextareaElement::ElementDraw {recordPtr box state} {
#puts stderr "TextareaElement::ElementDraw!$box!"
if {0} {
    set background [cget -background]
    set backgroundColor [ColorValue2RGBA $background]
    set foreground [cget -foreground]
    set foregroundColor [ColorValue2RGBA $foreground]
#puts stderr "BG!$background!FG!$foreground!"

Changes to library/ntkTheme.tcl.

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        return
    }
#   if (!InitializeElementRecord(
#       eclass, style, recordPtr, optionTable, tkwin,  state))
#   {
#       return;
#   }
    $elementObject ElementDraw $parcel $state
}

#================================ ShowPkg ============================
#     Dump pkg dict (for debugging)
#=========================================================================

::itcl::body theme::ShowPkg {} {
................................................................................
#puts stderr "ElementSize!$elementObject!"
    set width 0
    set height 0
    set padding [list 0 0 0 0]
    # InitializeElementRecord ....

#puts stderr "theme::ElementSize![dict get $core tkwin]!$style!"
    $elementObject InitializeOptionValues [dict get $style styleName] [dict get $core tkwin] $state
    $elementObject ElementSize width height padding
#puts stderr "ElementSize END!$width!$height!$padding!"

}

#================================ NewStyle ============================
#     
#=========================================================================







|







 







|
|







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
        return
    }
#   if (!InitializeElementRecord(
#       eclass, style, recordPtr, optionTable, tkwin,  state))
#   {
#       return;
#   }
    $elementObject ElementDraw $recordPtr $parcel $state
}

#================================ ShowPkg ============================
#     Dump pkg dict (for debugging)
#=========================================================================

::itcl::body theme::ShowPkg {} {
................................................................................
#puts stderr "ElementSize!$elementObject!"
    set width 0
    set height 0
    set padding [list 0 0 0 0]
    # InitializeElementRecord ....

#puts stderr "theme::ElementSize![dict get $core tkwin]!$style!"
    $elementObject InitializeOptionValues [dict get $style styleName] $core $state
    $elementObject ElementSize $core width height padding
#puts stderr "ElementSize END!$width!$height!$padding!"

}

#================================ NewStyle ============================
#     
#=========================================================================

Changes to library/ntkThumbElement.tcl.

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    protected option [list -borderwidth borderwidth Borderwidth] \
            -default 2
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar thumbVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ ThumbElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ThumbElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ThumbElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set thickness [cget -width]
    set orient [cget -orient]
    set min_thumb_size 10
................................................................................
#puts stderr "ThumbElement::ElementSize!t!$thickness!w!$width!h!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ThumbElement::ElementDraw {box state} {
#puts stderr "ThumbElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4







|
|
|







 







|
|
|







|







 







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    protected option [list -borderwidth borderwidth Borderwidth] \
            -default 2
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar thumbVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ ThumbElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body ThumbElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body ThumbElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set thickness [cget -width]
    set orient [cget -orient]
    set min_thumb_size 10
................................................................................
#puts stderr "ThumbElement::ElementSize!t!$thickness!w!$width!h!$height!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body ThumbElement::ElementDraw {recordPtr box state} {
#puts stderr "ThumbElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4

Changes to library/ntkTreeareaElement.tcl.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

::itcl::extendedclass TreeareaElement {
    inherit baseElement utils


    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar treeareaVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TreeareaElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreeareaElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TreeareaElement::ElementSize {widthVar heightVar paddingVar} {
#puts stderr "TreeareaElement::ElementSize!!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TreeareaElement::ElementDraw {box state} {
puts stderr "TreeareaElement::ElementDraw!$box!"
}

} ; # end namepsace ::ntk::classes







|
|
|







 







|
|






|







|
|



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

::itcl::extendedclass TreeareaElement {
    inherit baseElement utils


    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar treeareaVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TreeareaElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreeareaElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TreeareaElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
#puts stderr "TreeareaElement::ElementSize!!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TreeareaElement::ElementDraw {recordPtr box state} {
#puts stderr "TreeareaElement::ElementDraw!$box!"
}

} ; # end namepsace ::ntk::classes

Changes to library/ntkTreeitemIndicatorElement.tcl.

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95



96
97
98
99
100
101
102
    protected option [list -indicatormargins indicatorMargins IndicatorMargins] \
            -default [list 2 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method indicatorElementConfigure {option value}
    public method ElementSize {widthVar heightVar paddingVar}
    public method ElementDraw {box state}
}


#================================ constructor ============================
#     
#=========================================================================

................................................................................
    set direction arrowRight
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::InitializeOptionValues {styleName tkwin state} {
    InitializeOptionValuesBase $styleName $tkwin $state
}

#================================ indicatorElementConfigure ===================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::indicatorElementConfigure {option value} {
}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargins]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
    set size [cget -indicatorsize]
    set width [expr {$size + $l + $r}]
    set height [expr {$size + $t + $b}]
    set padding [list $l $t $r $b]
puts stderr "TreeitemIndicatorElement::ElementSize!$width!$height!$padding!"
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::ElementDraw {box state} {
puts stderr "INDICATOR Treeitem elementDraw!$box!$state!"
    if {[lsearch $state stateOpen] >= 0} {
        set direction arrowDown
    } else {
        set direction arrowRight



    }
    set arrowMargins [cget -indicatormargins]
    set foreground [cget -foreground]
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]







|
<
|
|







 







|
|
<
<
<
<
<
<
<






|











|






|
|

|


>
>
>







29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
..
48
49
50
51
52
53
54
55
56







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    protected option [list -indicatormargins indicatorMargins IndicatorMargins] \
            -default [list 2 2 4 2]
    protected option [list -borderwidth borderWidth BorderWidth] \
            -default 2

    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}

    public method ElementSize {recordPtr widthVar heightVar paddingVar}
    public method ElementDraw {recordPtr box state}
}


#================================ constructor ============================
#     
#=========================================================================

................................................................................
    set direction arrowRight
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::InitializeOptionValues {styleName recordPtr state} {
    InitializeOptionValuesBase $styleName $recordPtr $state







}

#================================ ElementSize ===================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set padding [cget -indicatormargins]
    ::ntk::classes::layout::InitPadding $padding padding
    lassign $padding l t r b
    set size [cget -indicatorsize]
    set width [expr {$size + $l + $r}]
    set height [expr {$size + $t + $b}]
    set padding [list $l $t $r $b]
#puts stderr "TreeitemIndicatorElement::ElementSize!$width!$height!$padding!"
}

#================================ ElementDraw ===================
#     
#=========================================================================

::itcl::body TreeitemIndicatorElement::ElementDraw {recordPtr box state} {
#puts stderr "INDICATOR Treeitem elementDraw!$box!$state!"
    if {[lsearch $state stateOpen] >= 0} {
        set direction arrowUp
    } else {
        set direction arrowRight
    }
    if {[lsearch $state stateLeaf] >= 0} { ; # don't draw anything
        return
    }
    set arrowMargins [cget -indicatormargins]
    set foreground [cget -foreground]
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -relief]
    set backgroundValue [cget -background]

Changes to library/ntkTreerowElement.tcl.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    protected option [list -background background Background] \
            -default #f9f9f9
    protected option [list -rownumber rowNumber RowNumber] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar treeareaVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TreerowElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreerowElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TreerowElement::ElementSize {widthVar heightVar paddingVar} {
#puts stderr "TreerowElement::ElementSize!!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TreerowElement::ElementDraw {box state} {
puts stderr "TreerowElement::ElementDraw!$box!"
    set backgroundVal [cget -background]
set backgroundVal #d9d9d9
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
}

} ; # end namepsace ::ntk::classes







|
|
|







 







|
|






|







|
|










22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    protected option [list -background background Background] \
            -default #f9f9f9
    protected option [list -rownumber rowNumber RowNumber] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar treeareaVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TreerowElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TreerowElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TreerowElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
#puts stderr "TreerowElement::ElementSize!!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TreerowElement::ElementDraw {recordPtr box state} {
#puts stderr "TreerowElement::ElementDraw!$box!"
    set backgroundVal [cget -background]
set backgroundVal #d9d9d9
    set backgroundColor [ColorValue2RGBA $backgroundVal]
#puts stderr "backgroundColor!$backgroundColor!"
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4
    ::gles2::builtin::fillrectangle [list $pos1 $backgroundColor] [list $pos2 $backgroundColor] [list $pos3 $backgroundColor] [list $pos4 $backgroundColor]
    ::gles2::swapbuffers
}

} ; # end namepsace ::ntk::classes

Changes to library/ntkTroughElement.tcl.

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    protected option [list -troughrelief troughRelief TroughRelief] \
            -default sunken
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName tkwin state}
    public method ElementSize {widthVar heightVar troughVar}
    public method ElementDraw {box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TroughElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TroughElement::InitializeOptionValues {styleName tkwin state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$tkwin!s!$state!"
    InitializeOptionValuesBase $styleName $tkwin $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TroughElement::ElementSize {widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set borderWidth [cget -borderwidth]
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "TroughElement::ElementSize!bw!$borderWidth!w!$width!h!$height!p!$padding!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TroughElement::ElementDraw {box state} {
#puts stderr "TroughElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -troughrelief]
    set backgroundValue [cget -troughcolor]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4







|
|
|







 







|
|
|







|













|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    protected option [list -troughrelief troughRelief TroughRelief] \
            -default sunken
    protected option [list -depth depth Depth] \
            -default 0

    constructor {args} {}

    public method InitializeOptionValues {styleName recordPtr state}
    public method ElementSize {recordPtr widthVar heightVar troughVar}
    public method ElementDraw {recordPtr box state}
 
}

#================================ constructor ============================
#     
#=========================================================================

................................................................................
#puts stderr "++++ TroughElement::constructor!$args!"
}

#================================ InitializeOptionValues ============================
#     
#=========================================================================

::itcl::body TroughElement::InitializeOptionValues {styleName recordPtr state} {
#puts stderr "++++ InitializeOptionValues!sN!$styleName!t!$recordPtr!s!$state!"
    InitializeOptionValuesBase $styleName $recordPtr $state
    return
}

#================================ ElementSize ============================
#     
#=========================================================================

::itcl::body TroughElement::ElementSize {recordPtr widthVar heightVar paddingVar} {
    upvar $widthVar width
    upvar $heightVar height
    upvar $paddingVar padding

    set borderWidth [cget -borderwidth]
    set padding [list $borderWidth $borderWidth $borderWidth $borderWidth]
#puts stderr "TroughElement::ElementSize!bw!$borderWidth!w!$width!h!$height!p!$padding!"
}

#================================ ElementDraw ============================
#     
#=========================================================================

::itcl::body TroughElement::ElementDraw {recordPtr box state} {
#puts stderr "TroughElement ElementDraw $box $state"
    set depth [cget -depth]
    set borderWidth [cget -borderwidth]
    set relief [cget -troughrelief]
    set backgroundValue [cget -troughcolor]
    set backgroundColor [ColorValue2RGBA $backgroundValue]
    lassign [GetElementPositions $box] pos1 pos2 pos3 pos4

Changes to nt1.tcl.

61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
76
77
78
#$::tpw1 add .l2
#$::tpw1 add .l3
#$::tpw1 UpdateLayout
#$::tpw1 SizeChanged "" width height
#::ntk::classes::place::place $::tpw1 30 0

set ::ttv1 [::ntk::treeview .ttv1 -columns [list a b c]]

$::ttv1 insert {} end -id newnode -text "New node"
$::ttv1 insert newnode 0 -id newnode.n1 -text "Foo1"
$::ttv1 insert newnode 0 -id newnode.n2 -text "Foo2"
::ntk::classes::place::place $::ttv1 30 0

set ch [read stdin 1]
#$::te1 insert insert "abc"
#$::tcb1 insert insert "abc"
#set ch [read stdin 1]
#$::te1 insert insert "def"
#$::tcb1 insert insert "abc"







>



<







61
62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
#$::tpw1 add .l2
#$::tpw1 add .l3
#$::tpw1 UpdateLayout
#$::tpw1 SizeChanged "" width height
#::ntk::classes::place::place $::tpw1 30 0

set ::ttv1 [::ntk::treeview .ttv1 -columns [list a b c]]
::ntk::classes::place::place $::ttv1 30 0
$::ttv1 insert {} end -id newnode -text "New node"
$::ttv1 insert newnode 0 -id newnode.n1 -text "Foo1"
$::ttv1 insert newnode 0 -id newnode.n2 -text "Foo2"


set ch [read stdin 1]
#$::te1 insert insert "abc"
#$::tcb1 insert insert "abc"
#set ch [read stdin 1]
#$::te1 insert insert "def"
#$::tcb1 insert insert "abc"