Bwidget Source Code
Check-in [6f1b04a125]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:SelectColor widget enhancements: traceable variable, setable background, visual changes [patch75101]
Timelines: family | ancestors | descendants | both | patch-75101
Files: files | file ages | folders
SHA1: 6f1b04a12506b6fb5bbaeed0b8170a8bd151cf1d
User & Date: oehhar 2013-06-21 15:58:44
Context
2013-06-25
12:38
Patch [d439b24425] of ticket [75101bf5ce] localizes strings, adds option -help check-in: 5747b2943a user: oehhar tags: patch-75101
2013-06-21
15:58
SelectColor widget enhancements: traceable variable, setable background, visual changes [patch75101] check-in: 6f1b04a125 user: oehhar tags: patch-75101
15:54
Documentation typos check-in: 85844bb788 user: oehhar tags: bwidget
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to BWman/SelectColor.html.

9
10
11
12
13
14
15

16


17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
37
38
39
40
41
42
43




44
45
46
47
48
49
50
..
53
54
55
56
57
58
59







60
61
62
63
64
65
66
..
95
96
97
98
99
100
101







102
103
104
105
106
107
108
...
147
148
149
150
151
152
153









154
155
156
157
158
159
160
161
162
163
164
<DT><I>CREATION</I></DT>
<DD><A HREF="#descr"><B>SelectColor</B></A> <I>pathName</I> ?<I>option value...</I>?</DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>

<TD>&nbsp;&nbsp;<A HREF="#-color">-color</A></td>


<TD>&nbsp;&nbsp;<A HREF="#-parent">-parent</A></td>

</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-placement">-placement</A></td>
<TD>&nbsp;&nbsp;<A HREF="#-title">-title</A></td>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-type">-type</A></td>
</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
 <I>option</I>
................................................................................
 <I>pathName</I>
 <I>?option value ...?</I>
</DD>
<DD>SelectColor::<A HREF="#menu"><B>menu</B></A>
 <I>pathName</I>
 <I>placement</I>
 <I>?option value ...?</I>




</DD>
<DD>SelectColor::<A HREF="#setcolor"><B>setcolor</B></A>
 <I>index</I>
 <I>color</I>
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
................................................................................

SelectColor provides a simple way to select color. It can be displayed
as a dialog box or as a menubutton.

</P>
<BR><HR WIDTH="50%"><BR>
<B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>







<DL><DT><A NAME="-color"><B>-color</B></A></DT>
<DD>

Specifies the color value of the widget.

</DD>
</DL>
................................................................................
SelectColor::<B>create</B> directly creates the dialog, displays it and
return an empty string if cancel button is pressed or if dialog is destroyed,
and the selected color if ok button is pressed. In all cases, dialog is
destroyed.  <BR>If <B>type</B> option is <I>popup</I>,
SelectColor::<B>create</B> creates a small, popup dialog with a small set of
predefined colors and a button to activate a full color dialog.








</DD>
</DL>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>
................................................................................
<i>placement</i> can be any of <b>at</b>, <b>center</b>, <b>left</b>,
<b>right</b>, <b>above</b>, or <b>below</b>.  If <i>-parent</i> is specified,
placement will be in relation to the parent widget.
</p>

</DD></DL>










</DD></DL>
<DL><DT><A NAME="setcolor">SelectColor::<B>setcolor</B></A>
 <I>index</I>
 <I>color</I>
</DT><DD>

Set the value of user predefined color at index <I>index</I> to <I>color</I>.
<I>index</I> must be between 0 and 10.

</DD></DL>
</BODY></HTML>






>

>
>

>


|
|


|







 







>
>
>
>







 







>
>
>
>
>
>
>







 







>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>











9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<DT><I>CREATION</I></DT>
<DD><A HREF="#descr"><B>SelectColor</B></A> <I>pathName</I> ?<I>option value...</I>?</DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-background">-background</A></td>
<TD>&nbsp;&nbsp;<A HREF="#-color">-color</A></td>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-parent">-parent</A></td>
<TD>&nbsp;&nbsp;<A HREF="#-placement">-placement</A></td>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-title">-title</A></td>
<TD>&nbsp;&nbsp;<A HREF="#-type">-type</A></td>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-variable">-variable</A></td>
</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
 <I>option</I>
................................................................................
 <I>pathName</I>
 <I>?option value ...?</I>
</DD>
<DD>SelectColor::<A HREF="#menu"><B>menu</B></A>
 <I>pathName</I>
 <I>placement</I>
 <I>?option value ...?</I>
</DD>
<DD>SelectColor::<A HREF="#setbasecolor"><B>setbasecolor</B></A>
 <I>index</I>
 <I>color</I>
</DD>
<DD>SelectColor::<A HREF="#setcolor"><B>setcolor</B></A>
 <I>index</I>
 <I>color</I>
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
................................................................................

SelectColor provides a simple way to select color. It can be displayed
as a dialog box or as a menubutton.

</P>
<BR><HR WIDTH="50%"><BR>
<B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>
<DL><DT><A NAME="-background"><B>-background</B></A></DT>
<DD>

Specifies the background color of the widget. 
 
</DD>
</DL>
<DL><DT><A NAME="-color"><B>-color</B></A></DT>
<DD>

Specifies the color value of the widget.

</DD>
</DL>
................................................................................
SelectColor::<B>create</B> directly creates the dialog, displays it and
return an empty string if cancel button is pressed or if dialog is destroyed,
and the selected color if ok button is pressed. In all cases, dialog is
destroyed.  <BR>If <B>type</B> option is <I>popup</I>,
SelectColor::<B>create</B> creates a small, popup dialog with a small set of
predefined colors and a button to activate a full color dialog.

</DD>
</DL>
<DL><DT><A NAME="-variable"><B>-variable</B></A></DT>
<DD>

This is the name of a variable that the caller can trace, to follow the color that the user selects in the dialog (typically to modify a color in the calling GUI).

</DD>
</DL>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>
................................................................................
<i>placement</i> can be any of <b>at</b>, <b>center</b>, <b>left</b>,
<b>right</b>, <b>above</b>, or <b>below</b>.  If <i>-parent</i> is specified,
placement will be in relation to the parent widget.
</p>

</DD></DL>

</DD></DL>
<DL><DT><A NAME="setbasecolor">SelectColor::<B>setbasecolor</B></A>
 <I>index</I>
 <I>color</I>
</DT><DD>

Set the value of user predefined base color at index <I>index</I> to <I>color</I>.
<I>index</I> must be between 0 and 10.

</DD></DL>
<DL><DT><A NAME="setcolor">SelectColor::<B>setcolor</B></A>
 <I>index</I>
 <I>color</I>
</DT><DD>

Set the value of user predefined color at index <I>index</I> to <I>color</I>.
<I>index</I> must be between 0 and 10.

</DD></DL>
</BODY></HTML>

Changes to ChangeLog.

2
3
4
5
6
7
8











9
10
11
12
13
14
15
	* labelentry.tcl: Bug fixed:
	Methods from Tk entry widget restored [Bug 1002844].
	
	* mainframe.tcl: Allow case sensitive accelerators
	by new option -casesensitive.
	Patch by cmard [Patch 1977644]











	
2013-01-09 Harald Oehlmann <[email protected]>

	* widget.tcl: Bug fixed:
	Error 'invalid command name ".#BWidget.#ttk::entry"'
	arises in themed mode when an Entry widget should get
	focus by the tab key.






>
>
>
>
>
>
>
>
>
>
>







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	* labelentry.tcl: Bug fixed:
	Methods from Tk entry widget restored [Bug 1002844].
	
	* mainframe.tcl: Allow case sensitive accelerators
	by new option -casesensitive.
	Patch by cmard [Patch 1977644]
	
	* color.tcl: New option -variable allows to give a
	traceable variable with current user color choice.
	New option -background and command SelectColor for
	window background.
	TitleFrames, Dynamic help and Aqua native buttons used.
	Show current choice by highlighting, not focus, to avoid
	conflict with keyboard traversal.
	Shows entry widget for numerical color input/output.
	
	Patch by K.J.Nash [Patch 75101]
	
2013-01-09 Harald Oehlmann <[email protected]>

	* widget.tcl: Bug fixed:
	Error 'invalid command name ".#BWidget.#ttk::entry"'
	arises in themed mode when an Entry widget should get
	focus by the tab key.

Changes to color.tcl.

1
2
3
4
5

6
7
8
9

10
11
12
13
14
15
16
..
27
28
29
30
31
32
33








34
35
36
37
38
39
40
..
66
67
68
69
70
71
72




73
74
75
76
77
78
79
80








81
82
83
84
85
86
87
...
111
112
113
114
115
116
117








118
119
120
121
122
123
124
...
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
170
171
172
173
174
175
176













177
178
179
180
181
182
183
...
199
200
201
202
203
204
205



206
207
208
209
210
211
212
213




































214
215
216
217
218
219
220
221
222
223



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
...
265
266
267
268
269
270
271
































272
273















































274
275
276
277


278
279



280
281
282
283















284
285
286
287
288
289
290
291
292
293
294



295
296



297
298
299

300
301
302
303

304
305
306
307
308
309
310
...
312
313
314
315
316
317
318




319
320
321
322
323
324
325
326
327

328
329
330




331
332
333
334
335
336
337
...
487
488
489
490
491
492
493





























































































































































































































namespace eval SelectColor {
    Widget::define SelectColor color Dialog

    Widget::declare SelectColor {
        {-title     String     "Select a color" 0}

        {-parent    String     ""               0}
        {-color     TkResource ""               0 {label -background}}
	{-type      Enum       "dialog"         1 {dialog popup}}
	{-placement String     "center"         1}

    }

    variable _baseColors {
        \#0000ff \#00ff00 \#00ffff \#ff0000 \#ff00ff \#ffff00
        \#000099 \#009900 \#009999 \#990000 \#990099 \#999900
        \#000000 \#333333 \#666666 \#999999 \#cccccc \#ffffff
    }
................................................................................
    }

    variable _selectype
    variable _selection
    variable _wcolor
    variable _image
    variable _hsv








}

proc SelectColor::create { path args } {
    Widget::init SelectColor $path $args

    set type [Widget::cget $path -type]

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

proc SelectColor::menu {path placement args} {
    variable _baseColors
    variable _userColors
    variable _wcolor
    variable _selectype
    variable _selection





    Widget::init SelectColor $path $args
    set top [toplevel $path]
    set parent [winfo toplevel [winfo parent $top]]
    wm withdraw  $top
    wm transient $top $parent
    wm overrideredirect $top 1
    catch { wm attributes $top -topmost 1 }









    set frame [frame $top.frame \
                   -highlightthickness 0 \
                   -relief raised -borderwidth 2]
    set col    0
    set row    0
    set count  0
................................................................................
    bind $f <Enter> {focus %W}
    pack $frame

    bind $top <1>      {set SelectColor::_selection -1}
    bind $top <Escape> {set SelectColor::_selection -2}
    bind $top <FocusOut> [subst {if {"%W" == "$top"} \
				     {set SelectColor::_selection -2}}]








    eval [list BWidget::place $top 0 0] $placement

    wm deiconify $top
    raise $top
    if {$::tcl_platform(platform) == "unix"} {
	tkwait visibility $top
	update
................................................................................
		if {![info exists opts($key)]} {
		    set native 0
		    break
		}
		lappend nativecmd $opts($key) $val
	    }
	    if {$native} {

		return [eval $nativecmd]
	    }
	}

	return [eval [list dialog $path] $args]
    } else {




        return [lindex $colors $_selection]






    }
}


proc SelectColor::dialog {path args} {
    variable _baseColors
    variable _userColors
    variable _widget
    variable _selection
    variable _image
    variable _hsv








    Widget::init SelectColor $path:SelectColor $args
    set top   [Dialog::create $path \
                   -title  [Widget::cget $path:SelectColor -title]  \
                   -parent [Widget::cget $path:SelectColor -parent] \
                   -separator 1 -default 0 -cancel 1 -anchor e]
    wm resizable $top 0 0
    set dlgf  [$top getframe]
    set fg    [frame $dlgf.fg]
    set desc  [list \
                   base _baseColors "Base colors" \
                   user _userColors "User colors"]













    set count 0
    foreach {type varcol defTitle} $desc {
        set col   0
        set lin   0
        set title [lindex [BWidget::getname "${type}Colors"] 0]
        if {![string length $title]} {
            set title $defTitle
................................................................................
            bind $fcolor <ButtonPress-1> [list SelectColor::_select_rgb $count]

	    bind $fround <Double-1> \
	    	"SelectColor::_select_rgb [list $count]; [list $top] invoke 0"
	    bind $fcolor <Double-1> \
	    	"SelectColor::_select_rgb [list $count]; [list $top] invoke 0"




            incr count
            if {[incr col] == 6} {
                incr lin
                set  col 0
            }
        }
        pack $titf -anchor w -pady 2
    }




































    set fround [frame $fg.round \
                    -highlightthickness 0 \
                    -relief sunken -borderwidth 2]
    set fcolor [frame $fg.color \
                    -width 50 \
                    -highlightthickness 0 \
                    -relief flat -borderwidth 0]
    pack $fcolor -in $fround -fill y -expand yes
    pack $fround -anchor e -pady 2 -fill y -expand yes




    set fd  [frame $dlgf.fd]
    set f1  [frame $fd.f1 -relief sunken -borderwidth 2]
    set f2  [frame $fd.f2 -relief sunken -borderwidth 2]
    set c1  [canvas $f1.c -width 200 -height 200 -bd 0 -highlightthickness 0]
    set c2  [canvas $f2.c -width 15  -height 200 -bd 0 -highlightthickness 0]

    for {set val 0} {$val < 40} {incr val} {
        $c2 create rectangle 0 [expr {5*$val}] 15 [expr {5*$val+5}] -tags val[expr {39-$val}]
    }
    $c2 create polygon 0 0 10 5 0 10 -fill black -outline white -tags target

    pack $c1 $c2
    pack $f1 $f2 -side left -padx 10 -anchor n

    pack $fg $fd -side left -anchor n -fill y


    bind $c1 <ButtonPress-1> [list SelectColor::_select_hue_sat %x %y]
    bind $c1 <B1-Motion>     [list SelectColor::_select_hue_sat %x %y]

    bind $c2 <ButtonPress-1> [list SelectColor::_select_value %x %y]
    bind $c2 <B1-Motion>     [list SelectColor::_select_value %x %y]

................................................................................
    set _widget(cv)     $c2
    set rgb             [winfo rgb $path [Widget::cget $path:SelectColor -color]]
    set _hsv            [eval rgbToHsv $rgb]
    _set_rgb     [eval [list format "\#%04x%04x%04x"] $rgb]
    _set_hue_sat [lindex $_hsv 0] [lindex $_hsv 1]
    _set_value   [lindex $_hsv 2]

































    $top add -name ok
    $top add -name cancel















































    set res [$top draw]
    if {$res == 0} {
        set color [$fg.color cget -background]
    } else {


        set color ""
    }



    destroy $top
    return $color
}
















proc SelectColor::setcolor { idx color } {
    variable _userColors
    set _userColors [lreplace $_userColors $idx $idx $color]
}

proc SelectColor::_select_rgb {count} {
    variable _baseColors
    variable _userColors
    variable _selection
    variable _widget
    variable _hsv




    set frame $_widget(fcolor)



    if {$_selection >= 0} {
        $frame.round$_selection configure \
            -relief sunken -highlightthickness 1 -borderwidth 2

    }
    $frame.round$count configure \
        -relief flat -highlightthickness 2 -borderwidth 1
    focus $frame.round$count

    set _selection $count
    set bg   [$frame.color$count cget -background]
    set user [expr {$_selection-[llength $_baseColors]}]
    if {$user >= 0 &&
        [string equal \
              [winfo rgb $frame.color$_selection $bg] \
              [winfo rgb $frame.color$_selection white]]} {
................................................................................
        $frame.color$_selection configure -background $bg
        set _userColors [lreplace $_userColors $user $user $bg]
    } else {
        set _hsv [eval rgbToHsv [winfo rgb $frame.color$count $bg]]
        _set_hue_sat [lindex $_hsv 0] [lindex $_hsv 1]
        _set_value   [lindex $_hsv 2]
        $frame.color configure -background $bg




    }
}


proc SelectColor::_set_rgb {rgb} {
    variable _selection
    variable _baseColors
    variable _userColors
    variable _widget


    set frame $_widget(fcolor)
    $frame.color configure -background $rgb




    set user [expr {$_selection-[llength $_baseColors]}]
    if {$user >= 0} {
        $frame.color$_selection configure -background $rgb
        set _userColors [lreplace $_userColors $user $user $rgb]
    }
}

................................................................................
	if {$hue < 0.0} {
	    set hue [expr {$hue + 1.0}]
	}
    }
    return [list $hue $sat [expr {$max/65535}]]
}

































































































































































































































|
>
|
|
|
|
>







 







>
>
>
>
>
>
>
>







 







>
>
>
>








>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>







 







>



>


>
>
>
>
|
>
>
>
>
>
>











>
>
>
>
>
>
>












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







 







>
>
>








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








|

>
>
>
|













|
>







 







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




>
>


>
>
>




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











>
>
>


>
>
>


|
>


|
<
>







 







>
>
>
>









>



>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
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
...
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
...
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513

514
515
516
517
518
519
520
521
...
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
...
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
namespace eval SelectColor {
    Widget::define SelectColor color Dialog

    Widget::declare SelectColor {
        {-title      String     "Select a color" 0}
        {-parent     String     ""               0}
        {-variable   String     ""               1}
        {-color      TkResource ""               0 {label -background}}
	{-type       Enum       "dialog"         1 {dialog popup}}
	{-placement  String     "center"         1}
        {-background TkResource ""               0 {label -background}}
    }

    variable _baseColors {
        \#0000ff \#00ff00 \#00ffff \#ff0000 \#ff00ff \#ffff00
        \#000099 \#009900 \#009999 \#990000 \#990099 \#999900
        \#000000 \#333333 \#666666 \#999999 \#cccccc \#ffffff
    }
................................................................................
    }

    variable _selectype
    variable _selection
    variable _wcolor
    variable _image
    variable _hsv

    variable _varName
    variable _unsavedSelection
    variable _oldColor
    variable _entryColor
    variable _bgColor
    variable _fgColor
    variable _rounds
}

proc SelectColor::create { path args } {
    Widget::init SelectColor $path $args

    set type [Widget::cget $path -type]

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

proc SelectColor::menu {path placement args} {
    variable _baseColors
    variable _userColors
    variable _wcolor
    variable _selectype
    variable _selection
    variable _varName
    variable _unsavedSelection
    variable _bgColor
    variable _rounds

    Widget::init SelectColor $path $args
    set top [toplevel $path]
    set parent [winfo toplevel [winfo parent $top]]
    wm withdraw  $top
    wm transient $top $parent
    wm overrideredirect $top 1
    catch { wm attributes $top -topmost 1 }

    set _varName [Widget::cget $path -variable]
    if {[string range $_varName 0 1] ne {::}} {
        set _varName ::SelectColor::_unsavedSelection
    }

    set _bgColor  [Widget::cget $path -background]
    set _rounds   {}

    set frame [frame $top.frame \
                   -highlightthickness 0 \
                   -relief raised -borderwidth 2]
    set col    0
    set row    0
    set count  0
................................................................................
    bind $f <Enter> {focus %W}
    pack $frame

    bind $top <1>      {set SelectColor::_selection -1}
    bind $top <Escape> {set SelectColor::_selection -2}
    bind $top <FocusOut> [subst {if {"%W" == "$top"} \
				     {set SelectColor::_selection -2}}]

    # set background color for menu
    $f     configure -bg $_bgColor
    $frame configure -bg $_bgColor
    foreach w [winfo children $frame] {
        $w configure -highlightcolor $_bgColor -highlightbackground $_bgColor
    }

    eval [list BWidget::place $top 0 0] $placement

    wm deiconify $top
    raise $top
    if {$::tcl_platform(platform) == "unix"} {
	tkwait visibility $top
	update
................................................................................
		if {![info exists opts($key)]} {
		    set native 0
		    break
		}
		lappend nativecmd $opts($key) $val
	    }
	    if {$native} {
		# Call native dialog
		return [eval $nativecmd]
	    }
	}
	# Call BWidget dialog
	return [eval [list dialog $path] $args]
    } else {
	# The user has either selected one of the palette colors, or has
	# cancelled.  The full BWidget/native dialog was not called.
	# Unless the user has cancelled, record the selected
	# color in $_varName which may be traced by the caller.
	set tmpCol [lindex $colors $_selection]
	if {$tmpCol eq {}} {
	    # User has cancelled - no need to set $_varName
	} else {
	    set $_varName $tmpCol
	}
	return $tmpCol
    }
}


proc SelectColor::dialog {path args} {
    variable _baseColors
    variable _userColors
    variable _widget
    variable _selection
    variable _image
    variable _hsv
    variable _varName
    variable _unsavedSelection
    variable _oldColor
    variable _entryColor
    variable _bgColor
    variable _fgColor
    variable _rounds

    Widget::init SelectColor $path:SelectColor $args
    set top   [Dialog::create $path \
                   -title  [Widget::cget $path:SelectColor -title]  \
                   -parent [Widget::cget $path:SelectColor -parent] \
                   -separator 1 -default 0 -cancel 1 -anchor e]
    wm resizable $top 0 0
    set dlgf  [$top getframe]
    set fg    [frame $dlgf.fg]
    set desc  [list \
                   base _baseColors "Base colors" \
                   user _userColors "User colors"]

    # Initialize _varName
    # The initial value of [$w cget -variable] is ignored and is
    # overwritten with [$w cget -color].
    set _varName [Widget::cget $path:SelectColor -variable]
    if {[string range $_varName 0 1] ne {::}} {
        set _varName ::SelectColor::_unsavedSelection
    }

    # Initialize _bgColor and _rounds
    set _bgColor [Widget::cget $path:SelectColor -background]
    set _rounds  {}

    set count 0
    foreach {type varcol defTitle} $desc {
        set col   0
        set lin   0
        set title [lindex [BWidget::getname "${type}Colors"] 0]
        if {![string length $title]} {
            set title $defTitle
................................................................................
            bind $fcolor <ButtonPress-1> [list SelectColor::_select_rgb $count]

	    bind $fround <Double-1> \
	    	"SelectColor::_select_rgb [list $count]; [list $top] invoke 0"
	    bind $fcolor <Double-1> \
	    	"SelectColor::_select_rgb [list $count]; [list $top] invoke 0"

	    # Record list of $fround values in _rounds
	    lappend _rounds $fround

            incr count
            if {[incr col] == 6} {
                incr lin
                set  col 0
            }
        }
        pack $titf -anchor w -pady 2
    }

    # Record these colors for use later
    set _fgColor [$fg.round0 cget -highlightcolor]

    # Add a TitleFrame $titf to wrap $fg.round and $fg.value
    set titf  [TitleFrame $fg.choice -text {Your Selection}]
    set subf  [$titf getframe]
    pack $titf -anchor w -pady 2 -expand yes -fill both

    # Add an entry widget $fg.value for the #RRGGBB value
    if {$::tk_version > 8.4} {
	set fixedFont TkFixedFont
    } else {
	set fixedFont Courier
    }
    set subf2 $fg.vround
    frame $subf2 -highlightthickness 0 -relief sunken -borderwidth 2
    entry $fg.value -width 8 -relief sunken -bd 0 -highlightthickness 0 \
	-bg white -textvariable ::SelectColor::_entryColor -font $fixedFont
    pack  $subf2    -in $subf  -anchor w -side left
    pack  $fg.value -in $subf2 -anchor w -side left

    # Remove focus from the entry widget by clicking anywhere...
    bind $top <1> [list ::SelectColor::_CheckFocus %W]

    # ... or by pressing Return/Escape.
    bind $fg.value <Return> [list ::SelectColor::_CheckFocus .]
    bind $fg.value <Escape> [list ::SelectColor::_CheckFocus .]
    bind $fg.value <Return> {+break}
    bind $fg.value <Escape> {+break}
    # Break so that the bindings to these events on the toplevel are not
    # executed.

    # MODS - record the Tk window path for the entry widget.
    set _widget(en) $fg.value

    set fround [frame $fg.round \
                    -highlightthickness 0 \
                    -relief sunken -borderwidth 2]
    set fcolor [frame $fg.color \
                    -width 50 \
                    -highlightthickness 0 \
                    -relief flat -borderwidth 0]
    pack $fcolor -in $fround -fill y -expand yes
    pack $fround -in $subf -side right -anchor e -pady 2 -fill y -expand yes

    # Add a TitleFrame $dlgf.fd to wrap the canvas selectors.  The
    # labels are referenced by the DynamicHelp tooltip.
    set fd0 [TitleFrame $dlgf.fd -text {Color Selectors}]
    set fd  [$fd0 getframe]
    set f1  [frame $fd.f1 -relief sunken -borderwidth 2]
    set f2  [frame $fd.f2 -relief sunken -borderwidth 2]
    set c1  [canvas $f1.c -width 200 -height 200 -bd 0 -highlightthickness 0]
    set c2  [canvas $f2.c -width 15  -height 200 -bd 0 -highlightthickness 0]

    for {set val 0} {$val < 40} {incr val} {
        $c2 create rectangle 0 [expr {5*$val}] 15 [expr {5*$val+5}] -tags val[expr {39-$val}]
    }
    $c2 create polygon 0 0 10 5 0 10 -fill black -outline white -tags target

    pack $c1 $c2
    pack $f1 $f2 -side left -padx 10 -anchor n

    pack $fg $fd0 -side left -anchor n -fill y
    pack configure $fd0 -pady 2 -padx {4 0}

    bind $c1 <ButtonPress-1> [list SelectColor::_select_hue_sat %x %y]
    bind $c1 <B1-Motion>     [list SelectColor::_select_hue_sat %x %y]

    bind $c2 <ButtonPress-1> [list SelectColor::_select_value %x %y]
    bind $c2 <B1-Motion>     [list SelectColor::_select_value %x %y]

................................................................................
    set _widget(cv)     $c2
    set rgb             [winfo rgb $path [Widget::cget $path:SelectColor -color]]
    set _hsv            [eval rgbToHsv $rgb]
    _set_rgb     [eval [list format "\#%04x%04x%04x"] $rgb]
    _set_hue_sat [lindex $_hsv 0] [lindex $_hsv 1]
    _set_value   [lindex $_hsv 2]

    # Initialize _oldColor which is used to reset the traced -variable
    # if the user cancels.
    set _oldColor [set $_varName]
    set tmp24     [::SelectColor::_24BitRgb $_oldColor]
    if {[_ValidateColorEntry forced $tmp24]} {
        set ::SelectColor::_entryColor $tmp24
    } else {
        # Value $tmp24 does not pass entry widget validation and if used
        # would disable validation.  Use this default instead.
        set _entryColor #
    }

    # Validate input to the entry field.
    # To avoid conflict with the entry -variable (_entryColor), do not set the
    # latter directly (because a failed validation will switch off subsequent
    # validations).  Either call _SetEntryValue, or set $_varName which triggers
    # the trace.

    $fg.value configure -validate all -validatecommand \
            [list SelectColor::_ValidateColorEntry %V %P]

    # Trace $_varName
    # Subsequent modifications to $_varName will update the entry widget, if the
    # value is valid.
    # From now on, this is the only way that:
    # (1) ::SelectColor::_SetEntryValue is called
    # (2) ::SelectColor::_entryColor is modified (except by the user typing in
    #     the entry widget)

    trace add variable $_varName write ::SelectColor::_SetEntryValue

    # Change case on button text
    $top add -text OK
    $top add -text Cancel

    # Add labels to offer DynamicHelp
    set blurb {Hover for help with color selection by:}
    frame $top.help
    label $top.help.0 -text $blurb       -relief flat   -bd 2
    label $top.help.1 -text { Mouse }    -relief groove -bd 2
    label $top.help.2 -text { Keyboard } -relief groove -bd 2
    pack  $top.help.0 $top.help.1 $top.help.2 \
            -anchor center -pady 4 -side left -padx 5
    DynamicHelp::add $top.help.1 -text [string map {{        } {}} \
        {Click or drag the mouse in the Color Selectors to choose a color.
        If the selected color remains black, regardless of what you
        do in the left-hand Color Selector (for hue and saturation), check
        the position of the pointer in the right-hand Color Selector
        (for brightness).

        Click one of the "Base colors" to read a value from this palette.

        Click one of the "User colors" to read a value from this palette,
        or to write to the palette if the color is blank.  If you then
        use the Color Selectors to change the color, your choice will be
        written to this (User) palette color until you select another
        (Base or User) palette color.}]
    DynamicHelp::add $top.help.2 -text [string map {{        } {}} \
        {Click in the text entry window in the left of the "Your
        Selection" area.

        Type the color that you want in hexadecimal RGB format.
        Whenever the number of hexadecimal digits is a multiple
        of 3, the color value is valid and will be copied to the
        other parts of the Color Selector.

        Leave the text entry window by clicking anywhere else,
        or by pressing the "Escape" or "Return" key.  The text
        entry window will then display the color in 24-bit RGB
        format, although internally the Color Selector uses
        48-bit colors.

        When the text entry widget does not have keyboard focus
        (i.e. does not show a cursor), the "Return" and "Escape"
        keys do the same as the "OK" and "Cancel" buttons,
        respectively.}]
    after idle [list pack $top.help]

    # Override background color
    ReColor $path $_bgColor

    set res [$top draw]
    if {$res == 0} {
        set color [$fg.color cget -background]
    } else {
        # User has cancelled - reset $_varName in case it is being traced
        set $_varName $_oldColor
        set color ""
    }

    trace remove variable $_varName write ::SelectColor::_SetEntryValue

    destroy $top
    return $color
}


# ----------------------------------------------------------------------------
# Command SelectColor::setbasecolor
# ----------------------------------------------------------------------------
# Exported command, to allow the caller to set the base colors of the palette.

proc SelectColor::setbasecolor { idx color } {
    variable _baseColors
    set _baseColors [lreplace $_baseColors $idx $idx $color]
}

# ----------------------------------------------------------------------------
# Command SelectColor::setcolor
# ----------------------------------------------------------------------------

proc SelectColor::setcolor { idx color } {
    variable _userColors
    set _userColors [lreplace $_userColors $idx $idx $color]
}

proc SelectColor::_select_rgb {count} {
    variable _baseColors
    variable _userColors
    variable _selection
    variable _widget
    variable _hsv
    variable _varName
    variable _bgColor
    variable _fgColor

    set frame $_widget(fcolor)

    # Use highlight color instead of focus to identify the selected
    # palette color. Tab traversal of focus now works correctly.
    if {$_selection >= 0} {
        $frame.round$_selection configure \
            -relief sunken -highlightthickness 1 -borderwidth 2 \
            -highlightbackground $_bgColor
    }
    $frame.round$count configure \
        -relief flat -highlightthickness 2 -borderwidth 1 \

        -highlightbackground $_fgColor
    set _selection $count
    set bg   [$frame.color$count cget -background]
    set user [expr {$_selection-[llength $_baseColors]}]
    if {$user >= 0 &&
        [string equal \
              [winfo rgb $frame.color$_selection $bg] \
              [winfo rgb $frame.color$_selection white]]} {
................................................................................
        $frame.color$_selection configure -background $bg
        set _userColors [lreplace $_userColors $user $user $bg]
    } else {
        set _hsv [eval rgbToHsv [winfo rgb $frame.color$count $bg]]
        _set_hue_sat [lindex $_hsv 0] [lindex $_hsv 1]
        _set_value   [lindex $_hsv 2]
        $frame.color configure -background $bg

        # Display selected color in entry widget, and notify
        # caller (if the variable is being traced).
        set $_varName $bg
    }
}


proc SelectColor::_set_rgb {rgb} {
    variable _selection
    variable _baseColors
    variable _userColors
    variable _widget
    variable _varName

    set frame $_widget(fcolor)
    $frame.color configure -background $rgb

    # Display selected color in entry widget, and notify
    # aller (if the variable is being traced).
    set $_varName $rgb
    set user [expr {$_selection-[llength $_baseColors]}]
    if {$user >= 0} {
        $frame.color$_selection configure -background $rgb
        set _userColors [lreplace $_userColors $user $user $rgb]
    }
}

................................................................................
	if {$hue < 0.0} {
	    set hue [expr {$hue + 1.0}]
	}
    }
    return [list $hue $sat [expr {$max/65535}]]
}

# ------------------------------------------------------------------------------
#  Command SelectColor::ReColor
# ------------------------------------------------------------------------------
# Command to change the background color for the dialog.
#
# FIXME Ideally this would be called by "$w configure -background $value".
# Currently a "configure -background" command is passed to Dialog and Widget
# but does not change SelectColor.
# ------------------------------------------------------------------------------

proc SelectColor::ReColor {path newColor} {
    variable _bgColor
    variable _rounds

    set _bgColor $newColor

    $path:cmd configure -bg $_bgColor

    foreach child {
        .sep           .help           .frame          .bbox
        .help.0        .help.1         .help.2
        .frame.fd      .frame.fd.f.f1  .frame.fd.f.f2
        .frame.fg      .frame.fg.base  .frame.fg.choice
        .frame.fg.user .frame.fg.round .frame.fg.vround
    } {
        $path$child configure -bg $_bgColor
    }

    # Special treatment for Aqua native buttons.
    # FIXME implement a general fix for BWidget Button/ButtonBox/Dialog
    if {[tk windowingsystem] eq "aqua"} {
        foreach child {
            .bbox.b0
            .bbox.b1
        } {
            $path$child configure \
                    -highlightbackground $_bgColor \
                    -highlightthickness  0
        }
    }

    foreach fround $_rounds {
        $fround configure -highlightbackground $_bgColor -bg $_bgColor
    }
    
    return
}


# ------------------------------------------------------------------------------
# Command SelectColor::_24BitRgb
# ------------------------------------------------------------------------------
# Command to convert a hex 12n-bit RGB color to 24-bit, n > 0.
# Convert anything else to {}.
# Used to process the display in the entry widget.
# ------------------------------------------------------------------------------

proc SelectColor::_24BitRgb {col} {
    set  lenny [string length $col]
    incr lenny -1

    if {    ($lenny % 3)
         || ($lenny == 0)
         || (![regexp {^#[a-fA-F0-9]*$} $col])
    } {
        # Not a multiple of 3, or not leading #, or nothing after #,
        # or non-HEX digits.
        return {}
    } elseif {$lenny == 3} {
        # 12-bit, pad to 24-bit
        set val $col
        set val [string replace $val 3 3 "[string index $val 3]0"]
        set val [string replace $val 2 2 "[string index $val 2]0"]
        set val [string replace $val 1 1 "[string index $val 1]0"]
        return $val
    } elseif {$lenny == 6} {
        # 24-bit, return unchanged
        return $col
    } else {
        # Truncate to 24-bit
        set delta  [expr {$lenny / 3}]
        set delta2 [expr {$delta * 2}]
        set result #
        append result [string range $col 1 2]
        append result [string range $col $delta+1  $delta+2]
        append result [string range $col $delta2+1 $delta2+2]
        return $result
    }
}


# ------------------------------------------------------------------------------
# Command SelectColor::_SetEntryValue
# ------------------------------------------------------------------------------
# Command to update the (hexadecimal color displayed in the) entry widget
# when there is a change in the color currently selected in the GUI, which is
# stored in $::SelectColor::_varName.
#
# This command is called by a write trace on $::SelectColor::_varName; if the
# value of this variable is a valid color (i.e. "#" followed by 3N hex digits),
# this command converts the value to 24 bits and sets ::SelectColor::_entryColor
# to the result, thereby displaying it in the entry widget.  Therefore,
# when the user chooses a color by means other than the entry widget, this
# command updates the entry widget.
#
# This command does not update the GUI when the user changes the value in the
# entry widget: that is done instead by the -vcmd of the entry widget, which
# is SelectColor::_ValidateColorEntry.  When the user chooses a color by typing
# in the entry widget, the command _ValidateColorEntry copies the value to
# $_varName if a keystroke in the widget makes its contents 3N hex digits long.
# ------------------------------------------------------------------------------

proc SelectColor::_SetEntryValue {argVarName var2 op} {
    variable _entryColor
    variable _varName

    if {0} {
    } elseif {$argVarName eq $_varName && $var2 eq {} && $op eq "write"} {
        # OK
    } else {
        # Unexpected call
        return -code error "Unexpected trace of variable\
                \"$argVarName\", \"$var2\", \"$op\""
    }

    set col24bit [::SelectColor::_24BitRgb [set $argVarName]]

    if {[_ValidateColorEntry forced $col24bit]} {
        set ::SelectColor::_entryColor $col24bit
    } else {
        # Value is invalid, and if written to _entryColor this would disable
        # validation.
    }

    return
}


# ------------------------------------------------------------------------------
# Command SelectColor::_CheckFocus
# ------------------------------------------------------------------------------
# This command is called with argument %W as a binding to <1> on the toplevel.
# It is also called with argument {.}, by bindings on the entry widget to
# <Escape>, <Return>.
#
# The command does something only if the entry widget has focus, and the
# argument (the clicked window) is the Tk window path of somewhere else.  Then,
# the command removes focus from the entry widget to the default button.
# ------------------------------------------------------------------------------

proc SelectColor::_CheckFocus {w} {
    variable _widget

    if {($w ne $_widget(en)) && ([focus] eq $_widget(en))} {
        set top [winfo toplevel $_widget(en)]
        $top setfocus default
    }

    return
}


# ------------------------------------------------------------------------------
# Command SelectColor::_ValidateColorEntry
# ------------------------------------------------------------------------------
# This command is the "-validate all -vcmd" of the entry widget.
# It is also called by SelectColor::dialog and SelectColor::_SetEntryValue to
# check values assigned to _entryColor.
#
# When the user chooses a color by typing in the entry widget, this command
# copies the value to $_varName if a keystroke in the widget makes its contents
# 3N hex digits long.
# ------------------------------------------------------------------------------

proc SelectColor::_ValidateColorEntry {percentV percentP} {
    variable _varName

    set result [regexp -- {^#[0-9a-fA-F]*$} $percentP]
    set lenny  [string length $percentP]

    if {$result} {
        if {$percentV eq "forced"} {
            # Validation only.  Don't want a loop.
        } elseif {($percentV eq "key")} {
            # Copy to GUI if a valid color.
            if {($lenny - 1) % 3 || $lenny == 1} {
                # Not a valid color, which needs 3n+1 characters, n > 0
            } else {
                after idle [list SelectColor::_SetWithoutTrace $percentP]
            }
        } elseif {($percentV eq "focusout")} {
            # If the color is valid it will already have been copied to the GUI
            # by the "key" validation above.
            #
            # The code below only needs to reset the value in the entry widget.
            # Remove an invalid value, convert a valid one to 24-bit.
            # Ignore $percentP, just fire the trace on $_varName.
            after idle [list set $_varName [set $_varName]]
        }
    }

    return $result
}


# ------------------------------------------------------------------------------
# Command SelectColor::_SetWithoutTrace
# ------------------------------------------------------------------------------
# This command sets $_varName (using _set_rgb) without firing the trace that
# copies the value to _entryColor.
# The command is called by SelectColor::_ValidateColorEntry to avoid a loop.
# ------------------------------------------------------------------------------

proc SelectColor::_SetWithoutTrace {value} {
    variable _varName

    trace remove variable $_varName write ::SelectColor::_SetEntryValue
    _set_rgb $value
    trace add variable $_varName write ::SelectColor::_SetEntryValue
    return
}

Changes to pkgIndex.tcl.

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{separator.tcl source {Separator Separator::create Separator::use}}
{spinbox.tcl source {SpinBox SpinBox::create SpinBox::use}}
{statusbar.tcl source {StatusBar StatusBar::create StatusBar::use}}
{titleframe.tcl source {TitleFrame TitleFrame::create TitleFrame::use}}
{mainframe.tcl source {MainFrame MainFrame::create MainFrame::use}}
{listbox.tcl source {ListBox ListBox::create ListBox::use}}
{tree.tcl source {Tree Tree::create Tree::use}}
{color.tcl source {SelectColor SelectColor::menu SelectColor::dialog SelectColor::setcolor}}
{dynhelp.tcl source {DynamicHelp::configure DynamicHelp::use DynamicHelp::register DynamicHelp::include DynamicHelp::add DynamicHelp::delete}}
{dialog.tcl source {Dialog Dialog::create Dialog::use}}
{messagedlg.tcl source {MessageDlg MessageDlg::create MessageDlg::use}}
{font.tcl source {SelectFont SelectFont::create SelectFont::use SelectFont::loadfont}}
{widgetdoc.tcl source {Widget::generate-doc Widget::generate-widget-doc}}
{wizard.tcl source {Wizard Wizard::create Wizard::use SimpleWizard ClassicWizard}}
{xpm2image.tcl source {xpm-to-image}}






|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{separator.tcl source {Separator Separator::create Separator::use}}
{spinbox.tcl source {SpinBox SpinBox::create SpinBox::use}}
{statusbar.tcl source {StatusBar StatusBar::create StatusBar::use}}
{titleframe.tcl source {TitleFrame TitleFrame::create TitleFrame::use}}
{mainframe.tcl source {MainFrame MainFrame::create MainFrame::use}}
{listbox.tcl source {ListBox ListBox::create ListBox::use}}
{tree.tcl source {Tree Tree::create Tree::use}}
{color.tcl source {SelectColor SelectColor::menu SelectColor::dialog SelectColor::setcolor SelectColor::setbasecolor}}
{dynhelp.tcl source {DynamicHelp::configure DynamicHelp::use DynamicHelp::register DynamicHelp::include DynamicHelp::add DynamicHelp::delete}}
{dialog.tcl source {Dialog Dialog::create Dialog::use}}
{messagedlg.tcl source {MessageDlg MessageDlg::create MessageDlg::use}}
{font.tcl source {SelectFont SelectFont::create SelectFont::use SelectFont::loadfont}}
{widgetdoc.tcl source {Widget::generate-doc Widget::generate-widget-doc}}
{wizard.tcl source {Wizard Wizard::create Wizard::use SimpleWizard ClassicWizard}}
{xpm2image.tcl source {xpm-to-image}}