Check-in [c631840207]

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

Overview
Comment:Revised API for Dragger/Dropper/Helper Snit objects. Add newlines to some i18n strings, and -justify to their label. Document the Dragger/Dropper/Helper Snit objects. Update version number and names BWidget/Snit in documentation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:c63184020726662ab1bdc04f2906f6157559d8c94688ab978d0f1c13e0a1ab71
User & Date: kjnash 2018-06-25 21:28:50
Context
2018-06-25
23:49
Rename BWman/BWidget.html to BWman/Utilities.html, and sync other HTML pages. Update plain-text help files. check-in: bfcb7fba41 user: kjnash tags: trunk
21:28
Revised API for Dragger/Dropper/Helper Snit objects. Add newlines to some i18n strings, and -justify to their label. Document the Dragger/Dropper/Helper Snit objects. Update version number and names BWidget/Snit in documentation. check-in: c631840207 user: kjnash tags: trunk
2018-06-23
02:07
Bump version to 3.0.1; tagrelease to create tarball and tidy file testing check-in: 60c3d05d74 user: kjnash tags: trunk
Changes

Changes to BWman/BWidget.html.

1
2
3
4
5
6
7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
170
171
172
173
174
175
176
177
178
...
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
<HTML>
<HEAD><TITLE>BWidget</TITLE></HEAD>
<BODY BGCOLOR=white>
<IMG SRC="constr.gif" WIDTH="40" HEIGHT="40"> Under construction ...<BR>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>BWidget</B>
 - Description text

</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>BWidget::<A HREF="#XLFDfont"><B>XLFDfont</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DD>
<DD>BWidget::<A HREF="#assert"><B>assert</B></A>
 <I>exp</I>
 ?<I>msg</I>?
</DD>
<DD>BWidget::<A HREF="#badOptionString"><B>badOptionString</B></A>
 <I>type</I>
 <I>value</I>
 <I>list</I>
</DD>
<DD>BWidget::<A HREF="#bindMouseWheel"><B>bindMouseWheel</B></A>
 <I>widget</I>
</DD>
<DD>BWidget::<A HREF="#classes"><B>classes</B></A>
 <I>class</I>
</DD>
<DD>BWidget::<A HREF="#clonename"><B>clonename</B></A>
 <I>menu</I>
</DD>
<DD>BWidget::<A HREF="#focus"><B>focus</B></A>
 <I>option</I>
 <I>path</I>

</DD>
<DD>BWidget::<A HREF="#get3dcolor"><B>get3dcolor</B></A>
 <I>path</I>
 <I>bgcolor</I>
</DD>
<DD>BWidget::<A HREF="#getname"><B>getname</B></A>
 <I>name</I>
</DD>
<DD>BWidget::<A HREF="#grab"><B>grab</B></A>
 <I>option</I>
 <I>path</I>
</DD>
<DD>BWidget::<A HREF="#inuse"><B>inuse</B></A>
 <I>class</I>
</DD>
<DD>BWidget::<A HREF="#library"><B>library</B></A>
 <I>class</I> ?<i>class ...</i>?
</DD>
<DD>BWidget::<A HREF="#lreorder"><B>lreorder</B></A>
 <I>list</I>
 <I>neworder</I>
</DD>
<DD>BWidget::<A HREF="#parsetext"><B>parsetext</B></A>
 <I>text</I>
</DD>
<DD>BWidget::<A HREF="#place"><B>place</B></A>
 <I>path</I>
 <I>w</I>
 <I>h</I>
 ?<I>arg...</I>?
</DD>
<DD>BWidget::<A HREF="#write"><B>write</B></A>
 <I>filename</I> ?<i>mode</i>?
</DD>
<DD>BWidget::<A HREF="#wrongNumArgsString"><B>wrongNumArgsString</B></A>
 <I>string</I>
</DD>

















</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
Description text
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="XLFDfont">BWidget::<B>XLFDfont</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="assert">BWidget::<B>assert</B></A>
 <I>exp</I>
 ?<I>msg</I>?
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="badOptionString">BWidget::<B>badOptionString</B></A>
 <I>type</I>
 <I>value</I>
 <I>list</I>
</DT><DD>
Return a proper error string for a <i>value</i> of <i>type</i> that doesn't
match <i>list</i>.
</DD></DL>

<DL><DT><A NAME="bindMouseWheel">BWidget::<B>bindMouseWheel</B></A>
 <I>widget</I>
</DT><DD>
    Bind the given <i>widget</i> with the standard mouse wheel bindings.
</DD></DL>

<DL><DT><A NAME="classes">BWidget::<B>classes</B></A>
 <I>class</I>
</DT><DD>
    Returns a list of classes needed by the given <i>class</i>.


</DD></DL>

<DL><DT><A NAME="clonename">BWidget::<B>clonename</B></A>
 <I>menu</I>
</DT><DD>
Description text

</DD></DL>
<DL><DT><A NAME="focus">BWidget::<B>focus</B></A>
 <I>option</I>

 <I>path</I>

</DT><DD>
Description text

</DD></DL>

<DL><DT><A NAME="get3dcolor">BWidget::<B>get3dcolor</B></A>
 <I>path</I>
 <I>bgcolor</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="getname">BWidget::<B>getname</B></A>
 <I>name</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="grab">BWidget::<B>grab</B></A>
 <I>option</I>
 <I>path</I>
</DT><DD>
Description text
</DD></DL>

<DL><DT><A NAME="inuse">BWidget::<B>inuse</B></A>
 <I>class</I>
</DT><DD>
    Returns true or false if the given <i>class</i> is being used by the
    current running program.


</DD></DL>

<DL><DT><A NAME="library">BWidget::<B>library</B></A>
 <I>class</I>
 ?<i>class ...</i>?
</DT><DD>
    Returns a string of code that contains all the libraries needed to
    use the widgets given by <i>class</i>.  Each class's code and the
    code of its dependent classes is appended to the string and returned.
    This is mostly useful for saving BWidgets to another project.

</DD></DL>

<DL><DT><A NAME="lreorder">BWidget::<B>lreorder</B></A>
 <I>list</I>
 <I>neworder</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="parsetext">BWidget::<B>parsetext</B></A>
 <I>text</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="place">BWidget::<B>place</B></A>
 <I>path</I>
 <I>w</I>
 <I>h</I>
 ?<I>arg...</I>?
</DT><DD>
Used to position and resize the widget specified by
<I>path</I>. <I>w</I> and <I>h</I> are used to specify the requested
................................................................................
 specified). If the reference widget's position is such that the newly
 placed window might be obscured then the opposite side will be tried.</DD>

 <DT><B>above</B> <I>?widget?</I></DT>
 <DT><B>below</B> <I>?widget?</I></DT>
 <DD>As for left/right above, this option causes the widget to be
 placed either above or below the reference widget with the opposite
 placement being attempted if the newly placed widget will not be visible.
</DL>
</DL>

<DL><DT><A NAME="write">BWidget::<B>write</B></A>
 <I>filename</I>
 ?<i>mode</i>?
</DT><DD>
    Writes the currently used set of BWidget class code to the given
    <i>filename</i>.  All the code necessary to run the BWidgets
    currently in use is written to the file.  This is mostly useful
    for saving BWidget code to another project as a single file instead
    of the entire BWidget package.

</DD></DL>

<DL>
<DT><A NAME="wrongNumArgsString">BWidget::<B>wrongNumArgsString</B></A>
 <I>string</I>
</DT>
<DD>
    Returns a standard error string for the wrong number of arguments.
    <i>string</i> is appended to the standard string.
</DD>
</DL>



























</BODY></HTML>

|

<

|
<
>



|



|



|




|


|


|


|
|

>

|



|


|
|


|


|


|



|


|





|


|


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




|



|



|

|



|

|








|





|



>
>


|


<
>

|
<
>

>

<
>

>
|



|

|


|

|
|


|


|




>
>


|






|
>


|



|

|


|

|







 







|

|

|



|

|
|
|
>



|








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

1
2
3

4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
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
196
197
198
199
200
201
202
...
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
246
247
248
249
250
251
252
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
<HTML>
<HEAD><TITLE>Utilities</TITLE></HEAD>
<BODY BGCOLOR=white>

<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>Utilities</B>

 - General-purpose utilities that are part of Slab
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>Slab::<A HREF="#XLFDfont"><B>XLFDfont</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DD>
<DD>Slab::<A HREF="#assert"><B>assert</B></A>
 <I>exp</I>
 ?<I>msg</I>?
</DD>
<DD>Slab::<A HREF="#badOptionString"><B>badOptionString</B></A>
 <I>type</I>
 <I>value</I>
 <I>list</I>
</DD>
<DD>Slab::<A HREF="#bindMouseWheel"><B>bindMouseWheel</B></A>
 <I>widget</I>
</DD>
<DD>Slab::<A HREF="#classes"><B>classes</B></A>
 <I>class</I>
</DD>
<DD>Slab::<A HREF="#clonename"><B>clonename</B></A>
 <I>menu</I>
</DD>
<DD>Slab::<A HREF="#focus"><B>focus</B></A>
 <I>set|release</I>
 <I>path</I>
 ?<I>refocus</I>?
</DD>
<DD>Slab::<A HREF="#get3dcolor"><B>get3dcolor</B></A>
 <I>path</I>
 <I>bgcolor</I>
</DD>
<DD>Slab::<A HREF="#getname"><B>getname</B></A>
 <I>name</I>
</DD>
<DD>Slab::<A HREF="#grab"><B>grab</B></A>
 <I>set|global|release</I>
 <I>path</I>
</DD>
<DD>Slab::<A HREF="#inuse"><B>inuse</B></A>
 <I>class</I>
</DD>
<DD>Slab::<A HREF="#library"><B>library</B></A>
 <I>class</I> ?<i>class ...</i>?
</DD>
<DD>Slab::<A HREF="#lreorder"><B>lreorder</B></A>
 <I>list</I>
 <I>neworder</I>
</DD>
<DD>Slab::<A HREF="#parsetext"><B>parsetext</B></A>
 <I>text</I>
</DD>
<DD>Slab::<A HREF="#place"><B>place</B></A>
 <I>path</I>
 <I>w</I>
 <I>h</I>
 ?<I>arg...</I>?
</DD>
<DD>Slab::<A HREF="#write"><B>write</B></A>
 <I>filename</I> ?<i>mode</i>?
</DD>
<DD>Slab::<A HREF="#wrongNumArgsString"><B>wrongNumArgsString</B></A>
 <I>string</I>
</DD>

<DD>Slab::Widget::<A HREF="#focusNext"><B>focusNext</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="#focusOK"><B>focusOK</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="#focusPrev"><B>focusPrev</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="#theme"><B>theme</B></A>
 ?<I>bool</I>?
</DD>
<DD>Slab::Widget::<A HREF="#traverseTo"><B>traverseTo</B></A>
 <I>w</I>
</DD>

</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
General-purpose utilities that are part of Slab.  These commands are used internally by Slab, and might be useful for other purposes.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="XLFDfont">Slab::<B>XLFDfont</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DT><DD>
Command for processing X11 font descriptions in the obsolete X Logical Font Description (XLFD) style.  Most X11 systems now use Fontconfig instead of XLFD.
</DD></DL>
<DL><DT><A NAME="assert">Slab::<B>assert</B></A>
 <I>exp</I>
 ?<I>msg</I>?
</DT><DD>
Use <B>expr</B> to evaluate the expression <I>exp</I> in the context of the caller.  Return with error status if the result is not boolean true.  If <I>msg</I> is supplied, it will be used as the error message.
</DD></DL>
<DL><DT><A NAME="badOptionString">Slab::<B>badOptionString</B></A>
 <I>type</I>
 <I>value</I>
 <I>list</I>
</DT><DD>
Return a proper error string for a <i>value</i> of <i>type</i> that doesn't
match <i>list</i>.
</DD></DL>

<DL><DT><A NAME="bindMouseWheel">Slab::<B>bindMouseWheel</B></A>
 <I>widget</I>
</DT><DD>
    Bind the given <i>widget</i> with the standard mouse wheel bindings.
</DD></DL>

<DL><DT><A NAME="classes">Slab::<B>classes</B></A>
 <I>class</I>
</DT><DD>
    Returns a list of classes needed by the given <i>class</i>.
    This was mostly useful in BWidget for saving BWidgets to another project.
    It has not been adapted for use with Slab.
</DD></DL>

<DL><DT><A NAME="clonename">Slab::<B>clonename</B></A>
 <I>menu</I>
</DT><DD>

Given the Tk window path of a menu, return the name of its clone that is used in a menubar constructed by Tk.
</DD></DL>
<DL><DT><A NAME="focus">Slab::<B>focus</B></A>

 <I>set|release</I>
 <I>path</I>
 ?<I>refocus</I>?
</DT><DD>

Option <I>set</I> - use ::<B>focus</B> <I>-force</I> to set focus on window <I>path</I>, and add <I>path</I> to a stack of focus history.  Option <I>release</I> - remove any occurrences of <I>path</I> and of windows that no longer exist from the top of the stack.  If <I>refocus</I> is true,  use ::<B>focus</B> <I>-force</I> to set focus on the window at the top of the stack.  When coding, take care to distinguish this command from ::<B>focus</B>.
</DD></DL>

<DL><DT><A NAME="get3dcolor">Slab::<B>get3dcolor</B></A>
 <I>path</I>
 <I>bgcolor</I>
</DT><DD>
Return a list of two 48-bit colors, darker and lighter respectively than the argument <I>bgcolor</I>.  The <I>R</I>, <I>G</I> and <I>B</I> values of the darker color are 60% those of <I>bgcolor</I>: those of the lighter color are larger than those of <I>bgcolor</I>, and are constrained to lie between 32767 and 65535.  The colors are useful when shading a widget to give it a 3D appearance.
</DD></DL>
<DL><DT><A NAME="getname">Slab::<B>getname</B></A>
 <I>name</I>
</DT><DD>
Command used to obtain and process i18n text for a "named" widget.  The i18n key is the argument <I>name</I> with the string "Name" appended.  If a translated value can be found, it is returned as a list of two values (plain text and underline position) after parsing through Slab::<B>parsetext</B>.  If no translated value can be found, the argument <I>name</I> itself is parsed through Slab::<B>parsetext</B> (without the suffix "Name").
</DD></DL>
<DL><DT><A NAME="grab">Slab::<B>grab</B></A>
 <I>set|global|release</I>
 <I>path</I>
</DT><DD>
Option <I>set</I> - if a grab has been set on a window, add the window path and grab status (global/non-global) to a stack of grab history; then set a grab on window <I>path</I>.  Option <I>global</I> - the same as option <I>set</I>, but a global grab is applied.  Option <I>release</I> - release the grab on <I>path</I>; then remove any occurrences of <I>path</I> and of windows that no longer exist from the top of the stack.  Consume the next value from the stack, and restore the grab that it records.  When coding, take care to distinguish this command from ::<B>grab</B>.
</DD></DL>

<DL><DT><A NAME="inuse">Slab::<B>inuse</B></A>
 <I>class</I>
</DT><DD>
    Returns true or false if the given <i>class</i> is being used by the
    current running program.
    This was mostly useful in BWidget for saving BWidgets to another project.
    It has not been adapted for use with Slab.
</DD></DL>

<DL><DT><A NAME="library">Slab::<B>library</B></A>
 <I>class</I>
 ?<i>class ...</i>?
</DT><DD>
    Returns a string of code that contains all the libraries needed to
    use the widgets given by <i>class</i>.  Each class's code and the
    code of its dependent classes is appended to the string and returned.
    This was mostly useful in BWidget for saving BWidgets to another project.
    It has not been adapted for use with Slab.
</DD></DL>

<DL><DT><A NAME="lreorder">Slab::<B>lreorder</B></A>
 <I>list</I>
 <I>neworder</I>
</DT><DD>
Used in Slab::Tree and Slab::ListBox for reordering a list.
</DD></DL>
<DL><DT><A NAME="parsetext">Slab::<B>parsetext</B></A>
 <I>text</I>
</DT><DD>
Return a list of two values.  The first value is a mapping of the argument <I>text</I> with all occurrences of the character "&amp;" removed, except that pairs "&amp;&amp;" are mapped as literal "&amp;".  The second value is the position in the first value of the character that was preceded in the argument by the final non-literal "&amp;".  This value is -1 if there is no such character.  The command is used to interpret text strings that have embedded "&amp;" to indicate a character to be underlined, for example, when using the text on a button.
</DD></DL>
<DL><DT><A NAME="place">Slab::<B>place</B></A>
 <I>path</I>
 <I>w</I>
 <I>h</I>
 ?<I>arg...</I>?
</DT><DD>
Used to position and resize the widget specified by
<I>path</I>. <I>w</I> and <I>h</I> are used to specify the requested
................................................................................
 specified). If the reference widget's position is such that the newly
 placed window might be obscured then the opposite side will be tried.</DD>

 <DT><B>above</B> <I>?widget?</I></DT>
 <DT><B>below</B> <I>?widget?</I></DT>
 <DD>As for left/right above, this option causes the widget to be
 placed either above or below the reference widget with the opposite
 placement being attempted if the newly placed widget will not be visible.</DD>
</DL>
</DD></DL>

<DL><DT><A NAME="write">Slab::<B>write</B></A>
 <I>filename</I>
 ?<i>mode</i>?
</DT><DD>
    (Obsolete) Writes the currently used set of BWidget class code to the given
    <i>filename</i>.  All the code necessary to run the BWidgets
    currently in use is written to the file.  This was mostly useful
    in BWidget for saving widget code to another project as a single file
    instead of the entire BWidget package.  It has not been adapted for
    use with Slab.
</DD></DL>

<DL>
<DT><A NAME="wrongNumArgsString">Slab::<B>wrongNumArgsString</B></A>
 <I>string</I>
</DT>
<DD>
    Returns a standard error string for the wrong number of arguments.
    <i>string</i> is appended to the standard string.
</DD>
</DL>

<DL><DT><A NAME="focusNext">Slab::Widget::<B>focusNext</B></A>
 <I>w</I>
</DT><DD>
Same as <B>tk_focusNext</B>, except that it uses Slab::Widget::<B>focusOK</B> instead of tk::<B>focusOK</B>.
</DD></DL>
<DL><DT><A NAME="focusOK">Slab::Widget::<B>focusOK</B></A>
 <I>w</I>
</DT><DD>
Same as <B>tk_focusOK</B>, but it takes into account whether window <I>w</I> has an <I>-editable</I> option with value 0, and it looks for <I>Key*</I> bindings in each bindtag of <I>w</I> except <I>all</I> and the bindtag for the toplevel of <I>w</I>.
</DD></DL>
<DL><DT><A NAME="focusPrev">Slab::Widget::<B>focusPrev</B></A>
 <I>w</I>
</DT><DD>
Same as <B>tk_focusPrev</B>, except that it does not traverse from a child to a direct ancestor, and it uses Slab::Widget::<B>focusOK</B> instead of tk::<B>focusOK</B>.
</DD></DL>
<DL><DT><A NAME="theme">Slab::Widget::<B>theme</B></A>
 ?<I>bool</I>?
</DT><DD>
 Get or set whether Slab widgets are themed.
</DD></DL>
<DL><DT><A NAME="traverseTo">Slab::Widget::<B>traverseTo</B></A>
 <I>w</I>
</DT><DD>
If the focus is on a window of this application, generate a <I>&lt;&lt;TraverseOut&gt;&gt;</I> event on that window.  Then move focus to window <I>w</I>, and generate a <I>&lt;&lt;TraverseIn&gt;&gt;</I> event on <I>w</I>.
</DD></DL>

</BODY></HTML>

Changes to BWman/ComboBox.html.

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
    entry that most closely matches the user entry.
    </DD>
</DL>

<DL>
    <DT><A NAME="-bwlistbox"><B>-bwlistbox</B></A></DT>
    <DD>
    Specifies that the combobox should use a BWidget listbox in its drop
    down instead of the standard Tk option.  This option is enabled by
    default if the <b>-images</b> option is not empty.
    </DD>
</DL>

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







|







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
    entry that most closely matches the user entry.
    </DD>
</DL>

<DL>
    <DT><A NAME="-bwlistbox"><B>-bwlistbox</B></A></DT>
    <DD>
    Specifies that the combobox should use a Slab ListBox in its drop
    down instead of the standard Tk option.  This option is enabled by
    default if the <b>-images</b> option is not empty.
    </DD>
</DL>

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

Changes to BWman/DragSite.html.

1
2
3
4
5
6
7
8
9























10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
...
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
<HTML>
<HEAD><TITLE>DragSite</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DragSite</B>
 - Commands set for Drag facilities
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>























<DD>DragSite::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>type</I>
 <I>event</I>
</DD>
<DD>DragSite::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DD>
<DD>DragSite::<A HREF="#setdrag"><B>setdrag</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>initcmd</I>
 <I>endcmd</I>
 ?<I>force</I>?
</DD>
</DL>

<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
Commands of this namespace enable the user to define a BWidget or a Tk widget as a drag site, i.e. as a widget from which something (e.g. text, an image, or a color) can be "dragged" with the pointer, to be "dropped" onto another widget of the same application.
</P>
<P>
Some BWidgets (ComboBox, Entry, Label, LabelEntry, ListBox, SpinBox, and Tree) have DragSite built in, and it is used via the widget options <B>-dragenabled</B>, <B>-dragendcmd</B>, <B>-dragevent</B>, <B>-draginitcmd</B>, and <B>-dragtype</B>.  These BWidgets internally use the commands DragSite::<A HREF="#include"><B>include</B></A> and DragSite::<A HREF="#setdrag"><B>setdrag</B></A> to configure DragSite in this way.


</P>
<P>




































Any other widget can be defined as a drag site by calling the command DragSite::<A HREF="#register"><B>register</B></A>.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="include">DragSite::<B>include</B></A>
 <I>class</I>
 <I>type</I>
 <I>event</I>
</DT><DD>

This command provides a simple way to include options relatives to a drag site into
BWidget resources definition.
It includes the options needed for <B>register</B>: <I>-dragevent</I>, initialized to
<I>event</I>, <I>-draginitcmd</I> and <I>-dragendcmd</I>, initialized to empty string,
and two new options:
<TABLE BORDER=0 CELLSPACING=1>
<TR><TD><I>-dragenabled</I><TD>Specifies wether or not drag is active (initialized to 0)
<TR><TD><I>-dragtype</I><TD>Default or alternate dragged data type (initialized to <I>type</I>)
</TABLE>

</DD></DL>
<DL><DT><A NAME="register">DragSite::<B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DT><DD>

This command is used to declare <I>path</I> as a drag site. Options are:

................................................................................
</UL>
Note that even if <B>copy</B> does not appear in the list of basic
operation, it is considered as an acceptable operation, since
<B>copy</B> semantic does not modify the drag source.

</DD>
</DL>
</DD></DL>

















































































<DL><DT><A NAME="setdrag">DragSite::<B>setdrag</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>initcmd</I>
 <I>endcmd</I>
 ?<I>force</I>?
</DT><DD>

This command provides a simple way to call <B>register</B> during a BWidget creation or
configuration.
<UL>
<LI><I>path</I> is the pathname of the BWidget,
<LI><I>subpath</I> is the pathname of the tk widget where drag event occurs,
<LI><I>initcmd</I> BWidget command for <I>drag-init</I> event,
<LI><I>endcmd</I> BWidget command for <I>drag-end</I> event,
<LI><I>force</I> specifies wether or not to call <B>register</B> whenever no option value has
changed (0 by default - for BWidget configuration, use 1 for BWidget creation).
</UL>
<B>setdrag</B> verifies the modification flag of options <B>dragenabled</B> and
<B>dragevent</B> and calls <B>register</B> if needed according to the options values and
<I>initcmd</I> and <I>endcmd</I> arguments. <B>draginitcmd</B> and <B>dragendcmd</B> are not
taken from options of widget  because they are considered as user command, called by
BWidget implementation of <I>drag-init</I> and <I>drag-end</I> events.

</DD></DL>

</BODY></HTML>





|



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





<
<
<
<








>



|


|
>
>


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



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 








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








|
<



|
|
|
|



|
<
<


>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
...
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
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
246
247
248

249
250
251
252
253
254
255
256
257
258
259


260
261
262
263
<HTML>
<HEAD><TITLE>DragSite</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DragSite</B>
 - Commands for Drag facilities
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>DragSite::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DD>
<DD>DragSite::<A HREF="#dragger"><B>Dragger</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DD>
<DD><I>instance</I> <A HREF="#attach2"><B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
</DD>
<DD><I>instance</I> <A HREF="#cget2"><B>cget</B></A>
 <I>option</I>
</DD>
<DD><I>instance</I> <A HREF="#configure2"><B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DD>
</DL>

<DL>
<DT><I><A HREF="#leg">LEGACY COMMAND</A></I></DT>
<DD>DragSite::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>type</I>
 <I>event</I>
</DD>




<DD>DragSite::<A HREF="#setdrag"><B>setdrag</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>initcmd</I>
 <I>endcmd</I>
 ?<I>force</I>?
</DD>
</DL>

<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
Commands of this namespace enable the user to define a Tk or Slab widget as a drag site, i.e. as a widget from which something (e.g. text, an image, or a color) can be "dragged" with the pointer, to be "dropped" onto another widget of the same application.
</P>
<P>
Some Slab widgets (ComboBox, Entry, Label, LabelEntry, ListBox, SpinBox, and Tree) have DragSite built in, and it is used via the widget options <B>-dragenabled</B>, <B>-dragendcmd</B>, <B>-dragevent</B>, <B>-draginitcmd</B>, and <B>-dragtype</B>.

The widgets that have been ported to Snit and have built-in DragSite delegate to a Snit Abstract Type Slab::DragSite::Dragger, and access DragSite exclusively via this object.  (The Tree widget has built-in DragSite, has not been ported to Snit, and accesses DragSite via the commands DragSite::<A HREF="#include"><B>include</B></A> and DragSite::<A HREF="#setdrag"><B>setdrag</B></A>.)
</P>
<P>
Here is the use of DragSite in the <A HREF="Entry.html">Entry</A> widget:
<BR>
<CENTER>
<TABLE BORDER=2 CELSPACING=2 WIDTH=80%>
<TR><TD><PRE>
snit::widgetadaptor Slab::Entry {

    <FONT COLOR=red><I># Delegate drag-related options and methods.</I></FONT>
    component MyDragger
    delegate option -dragenabled  to MyDragger
    delegate option -dragendcmd   to MyDragger
    delegate option -dragevent    to MyDragger
    delegate option -draginitcmd  to MyDragger
    delegate option -dragtype     to MyDragger
    delegate method  dragsite_for_snit to MyDragger

    constructor {args} {
        installhull using entry

        <FONT COLOR=red><I># Define and configure component MyDragger.</I></FONT>
        install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts \
                -draginitcmd [mymethod _init_drag_cmd] \
                -dragtype    {} \
                -dragevent   3
        $MyDragger attach $win $win

        $self configurelist $args

        <FONT COLOR=red><I># The rest of the constructor ...</I></FONT>
        ...
    }
}</PRE>
</TD></TR>
</TABLE></CENTER>
</P>
<P>
Any other Tk or Slab widget can be defined as a drag site by calling the command DragSite::<A HREF="#register"><B>register</B></A>.  The script must also define the commands whose names are passed as arguments to <B>register</B>, according to the specifications given below.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>

















<DL><DT><A NAME="register">DragSite::<B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DT><DD>

This command is used to declare <I>path</I> as a drag site. Options are:

................................................................................
</UL>
Note that even if <B>copy</B> does not appear in the list of basic
operation, it is considered as an acceptable operation, since
<B>copy</B> semantic does not modify the drag source.

</DD>
</DL>
</DD></DL>

<DL><DT><A NAME="dragger">DragSite::<B>Dragger</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DT><DD>
Constructor for a <B>DragSite::Dragger</B> object.
<P>
<DL><DT><A NAME="Dragger-draginitcmd"><B>-draginitcmd</B></A></DT>
<DD>
    See DragSite::register, option <A HREF="#DragSite-draginitcmd"><B>-draginitcmd</B></A>
</DD>
</DL>

<DL><DT><A NAME="Dragger-dragendcmd"><B>-dragendcmd</B></A></DT>
<DD>
    See DragSite::register, option <A HREF="#DragSite-dragendcmd"><B>-dragendcmd</B></A>
</DD>
</DL>

<DL><DT><A NAME="Dragger-dragevent"><B>-dragevent</B></A></DT>
<DD>
    See DragSite::register, option <A HREF="#DragSite-dragevent"><B>-dragevent</B></A>
</DD>
</DL>

<DL><DT><A NAME="DragSite-dragenabled"><B>-dragenabled</B></A></DT>
<DD>
    Specifies whether or not drag is active
</DD>
</DL>

<DL><DT><A NAME="DragSite-dragtype"><B>-dragtype</B></A></DT>
<DD>
    Default or alternate dragged data type
</DD>
</DL>

</DD></DL>

<DL><DT><A NAME="attach2"><I>instance</I> <B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
</DT><DD>
    Attach the DragSite provided by <I>instance</I> to the widget <I>path</I> (of which this <I>instance</I> is typically a component), and specifically to its subwidget with Tk window path <I>subpath</I>.
</DD></DL>

<DL><DT><A NAME="cget2"><I>instance</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>
    Command to return the value of one of the options <B>-dragenabled</B>, <B>-draginitcmd</B>, <B>-dragendcmd</B>, <B>-dragtype</B>, <B>-dragevent</B>.
</DD></DL>

<DL><DT><A NAME="configure2"><I>instance</I> <B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DT><DD>
    Command to configure the instance via its options <B>-dragenabled</B>, <B>-draginitcmd</B>, <B>-dragendcmd</B>, <B>-dragtype</B>, <B>-dragevent</B>.
</DD></DL>

<B><A NAME="leg">LEGACY COMMAND</A></B><BR>
<DL><DT><A NAME="include">DragSite::<B>include</B></A>
 <I>class</I>
 <I>type</I>
 <I>event</I>
</DT><DD>
Used only by Slab widgets that have not been ported to Snit, and therefore use the BWidget base class "Widget".  The command gives all widgets of a particular BWidget class the options <B>-dragenabled</B>, <B>-draginitcmd</B>, <B>-dragendcmd</B>, <B>-dragtype</B>, <B>-dragevent</B>, by which a DragSite can be requested without calling DragSite::<B>register</B>.  Option <B>-dragevent</B> is initialized to
<I>event</I>, <B>-dragtype</B> is initialized to <I>type</I>, <B>-draginitcmd</B> and <B>-dragendcmd</B> are initialized to the empty string, and option <B>-dragenabled</B> is initialized to 0.

<DL><DT><A NAME="DragSite-dragenabled2"><B>-dragenabled</B></A></DT>
<DD>
    See DragSite::Dragger, option <A HREF="#DragSite-dragenabled"><B>-dragenabled</B></A>
</DD>
</DL>

<DL><DT><A NAME="DragSite-dragtype2"><B>-dragtype</B></A></DT>
<DD>
    See DragSite::Dragger, option <A HREF="#DragSite-dragtype"><B>-dragtype</B></A>
</DD>
</DL>

</DD></DL>
<DL><DT><A NAME="setdrag">DragSite::<B>setdrag</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>initcmd</I>
 <I>endcmd</I>
 ?<I>force</I>?
</DT><DD>

Used only by Slab widgets that have not been ported to Snit, and therefore use the BWidget base class "Widget".  This command provides a simple way to call <B>register</B> during widget creation or configuration.

<UL>
<LI><I>path</I> is the pathname of the BWidget,
<LI><I>subpath</I> is the pathname of the tk widget where drag event occurs,
<LI><I>initcmd</I> command for <I>drag-init</I> event,
<LI><I>endcmd</I> command for <I>drag-end</I> event,
<LI><I>force</I> (boolean) specifies whether or not to call <B>register</B> whenever no option value has
changed (0 by default - for widget configuration, use 1 for widget creation).
</UL>
<B>setdrag</B> verifies the modification flag of options <B>dragenabled</B> and
<B>dragevent</B> and calls <B>register</B> if needed according to the options values and
<I>initcmd</I> and <I>endcmd</I> arguments. <B>draginitcmd</B> and <B>dragendcmd</B> are obtained from command arguments.



</DD></DL>

</BODY></HTML>

Changes to BWman/DropSite.html.

3
4
5
6
7
8
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
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
...
230
231
232
233
234
235
236
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
262
263
264
265
266
267
268
269
270
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DropSite</B>
 - Commands set for Drop facilities
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>DropSite::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>types</I>
</DD>
<DD>DropSite::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DD>
<DD>DropSite::<A HREF="#setcursor"><B>setcursor</B></A>
 <I>cursor</I>




























</DD>
<DD>DropSite::<A HREF="#setdrop"><B>setdrop</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>dropover</I>
 <I>drop</I>
 ?<I>force</I>?
</DD>
<DD>DropSite::<A HREF="#setoperation"><B>setoperation</B></A>
 <I>op</I>
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
Commands of this namespace enable the user to define a BWidget or a Tk widget as a drop site, i.e. as a widget onto which something (e.g. text, an image, or a color), having been "dragged" by the pointer from another widget of the same application, can be "dropped" by releasing the pointer button.
</P>
<P>
A drop site specifies the type(s) of object that can be dropped, the associated operation (move, copy or link), a command called when an object is dragged over the widget, and a command called when the drop occurs.  A drop site must have at least one type of acceptable object and a drop command.
</P>
<P>
Some BWidgets (ComboBox, Entry, Label, LabelEntry, ListBox, SpinBox, and Tree) have DropSite built in, and it is used via the widget options <B>-dropcmd</B>, <B>-dropenabled</B>, <B>-dropovercmd</B>, <B>-dropovermode</B>, and <B>-droptypes</B>.  These BWidgets internally use the commands DropSite::<A HREF="#include"><B>include</B></A> and DropSite::<A HREF="#setdrop"><B>setdrop</B></A> to configure DropSite in this way.


</P>

<P>








































Any other widget can be defined as a drop site by calling the command DropSite::<A HREF="#register"><B>register</B></A>.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="include">DropSite::<B>include</B></A>
 <I>class</I>
 <I>types</I>
</DT><DD>

This command provides a simple way to include options relatives to a drop site into
BWidget resources definition.
It includes the options needed for <B>register</B>, <I>-dropovercmd</I> and <I>-dropcmd</I>,
initialized to empty string, and <I>-droptypes</I>, initialized to <I>types</I>,
and one new option:
<TABLE BORDER=0 CELLSPACING=1>
<TR><TD><I>-dropenabled</I><TD>Specifies wether or not drop is active (initialized to 0)
</TABLE>

</DD></DL>
<DL><DT><A NAME="register">DropSite::<B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DT><DD>

This command is used to declare <I>path</I> as a drop site. Options are:

................................................................................
</DD>
</DL>
</DD></DL>
<DL><DT><A NAME="setcursor">DropSite::<B>setcursor</B></A>
 <I>cursor</I>
</DT><DD>

This command can be used within the script <B>dragovercmd</B>. It is usefull to provide
visual effect about the state of the drag.
</DD></DL>




















































































<DL><DT><A NAME="setdrop">DropSite::<B>setdrop</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>dropover</I>
 <I>drop</I>
 ?<I>force</I>?
</DT><DD>


This command provides a simple way to call <B>register</B> during a BWidget creation or
configuration.
<UL>
<LI><I>path</I> is the pathname of the BWidget,
<LI><I>subpath</I> is the pathname of the tk widget where drag event occurs,
<LI><I>dropover</I> is a command for <I>drag-over</I> event,
<LI><I>drop</I> is a command for <I>drop</I> event,
<LI><I>force</I> specifies wether or not to call <B>register</B> whenever no option value
has changed (0 by default - for BWidget configuration, use 1 for BWidget creation).
</UL>
<B>setdrop</B> verifies the modification flag of options <B>dropenabled</B> and
<B>droptypes</B> and calls <B>register</B> if needed according to the options values and
<I>dropover</I> and <I>drop</I> arguments. <B>dropovercmd</B> and <B>dropcmd</B> are not
taken from options of widget because they are considered as user command, called by
BWidget implementation of <I>drag-over</I> and <I>drop</I> events.

</DD></DL>
<DL><DT><A NAME="setoperation">DropSite::<B>setoperation</B></A>
 <I>op</I>
</DT><DD>
Description text
</DD></DL>
</BODY></HTML>







<
<
<
<






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








<
<
<




|





|
>
>

>

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



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|


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







<
>



|




|



|
<
<
<

<
<
<
<
<

3
4
5
6
7
8
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
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
...
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
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
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DropSite</B>
 - Commands set for Drop facilities
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>




<DD>DropSite::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DD>
<DD>DropSite::<A HREF="#setcursor"><B>setcursor</B></A>
 <I>cursor</I>
</DD>
<DD>DropSite::<A HREF="#setoperation"><B>setoperation</B></A>
 <I>op</I>
</DD>


<DD>DropSite::<A HREF="#dropper"><B>Dropper</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DD>
<DD><I>instance</I> <A HREF="#attach2"><B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
</DD>
<DD><I>instance</I> <A HREF="#cget2"><B>cget</B></A>
 <I>option</I>
</DD>
<DD><I>instance</I> <A HREF="#configure2"><B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DD>
</DL>

<DL>
<DT><I><A HREF="#leg">LEGACY COMMAND</A></I></DT>
<DD>DropSite::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>types</I>
</DD>
<DD>DropSite::<A HREF="#setdrop"><B>setdrop</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>dropover</I>
 <I>drop</I>
 ?<I>force</I>?
</DD>



</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
Commands of this namespace enable the user to define a Tk or Slab widget as a drop site, i.e. as a widget onto which something (e.g. text, an image, or a color), having been "dragged" by the pointer from another widget of the same application, can be "dropped" by releasing the pointer button.
</P>
<P>
A drop site specifies the type(s) of object that can be dropped, the associated operation (move, copy or link), a command called when an object is dragged over the widget, and a command called when the drop occurs.  A drop site must have at least one type of acceptable object and a drop command.
</P>
<P>
Some Slab widgets (ComboBox, Entry, Label, LabelEntry, ListBox, SpinBox, and Tree) have DropSite built in, and it is used via the widget options <B>-dropcmd</B>, <B>-dropenabled</B>, <B>-dropovercmd</B>, and <B>-droptypes</B>.

The widgets that have been ported to Snit and have built-in DropSite delegate to a Snit Abstract Type Slab::DropSite::Dropper, and access DropSite both via this object, and via DropSite::<A HREF="#setcursor"><B>setcursor</B></A> and DropSite::<A HREF="#setoperation"><B>setoperation</B></A>.  (The Tree widget has built-in DropSite, has not been ported to Snit, and accesses DropSite via the commands DropSite::<A HREF="#include"><B>include</B></A>, DropSite::<A HREF="#setdrop"><B>setdrop</B></A>, and DropSite::<A HREF="#setcursor"><B>setcursor</B></A>.)
</P>

<P>
Here is the use of DropSite in the <A HREF="Entry.html">Entry</A> widget:
<BR>
<CENTER>
<TABLE BORDER=2 CELSPACING=2 WIDTH=80%>
<TR><TD><PRE>
snit::widgetadaptor Slab::Entry {

    <FONT COLOR=red><I># Delegate drop-related options and methods.</I></FONT>
    component MyDropper
    delegate option -dropcmd      to MyDropper
    delegate option -dropenabled  to MyDropper
    delegate option -dropovercmd  to MyDropper
    delegate option -droptypes    to MyDropper
    delegate method  dropsite_for_snit to MyDropper

    constructor {args} {
        installhull using entry

        <FONT COLOR=red><I># Define and configure component MyDropper.</I></FONT>
        install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts \  
                -dropovercmd [mymethod _over_cmd] \
                -dropcmd     [mymethod _drop_cmd] \
                -droptypes   {
                                  TEXT    {move {}}
                                  FGCOLOR {move {}}
                                  BGCOLOR {move {}}
                                  COLOR   {move {}}
                             }
        $MyDropper attach $win $win

        $self configurelist $args

        <FONT COLOR=red><I># The rest of the constructor ...</I></FONT>
        ...
    }
}</PRE>
</TD></TR>
</TABLE></CENTER>
</P>
<P>
Any other Tk or Slab widget can be defined as a drop site by calling the command DropSite::<A HREF="#register"><B>register</B></A>.  The script must also define the commands whose names are passed as arguments to <B>register</B>, according to the specifications given below.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>















<DL><DT><A NAME="register">DropSite::<B>register</B></A>
 <I>path</I>
 ?<I>option value...</I>?
</DT><DD>

This command is used to declare <I>path</I> as a drop site. Options are:

................................................................................
</DD>
</DL>
</DD></DL>
<DL><DT><A NAME="setcursor">DropSite::<B>setcursor</B></A>
 <I>cursor</I>
</DT><DD>

This command can be used within the script <B>dragovercmd</B>. It is useful to provide
visual effect about the state of the drag.
</DD></DL>
<DL><DT><A NAME="setoperation">DropSite::<B>setoperation</B></A>
 <I>op</I>
</DT><DD>
Description text
</DD></DL>



<DL><DT><A NAME="dropper">DropSite::<B>Dropper</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DT><DD>
Constructor for a <B>DropSite::Dropper</B> object.
<P>
<DL><DT><A NAME="Dropper-dropcmd"><B>-dropcmd</B></A></DT>
<DD>
    See DropSite::register, option <A HREF="#DropSite-dropcmd"><B>-dropcmd</B></A>
</DD>
</DL>

<DL><DT><A NAME="Dropper-dropovercmd"><B>-dropovercmd</B></A></DT>
<DD>
    See DropSite::register, option <A HREF="#DropSite-dropovercmd"><B>-dropovercmd</B></A>
</DD>
</DL>

<DL><DT><A NAME="Dropper-dropenabled"><B>-dropenabled</B></A></DT>
<DD>
    Specifies whether or not drop is active
</DD>
</DL>

<DL><DT><A NAME="Dropper-droptypes"><B>-droptypes</B></A></DT>
<DD>
    See DropSite::register, option <A HREF="#DropSite-droptypes"><B>-droptypes</B></A>
</DD>
</DL>

</DD></DL>

<DL><DT><A NAME="attach2"><I>instance</I> <B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
</DT><DD>
    Attach the DropSite provided by <I>instance</I> to the widget <I>path</I> (of which this <I>instance</I> is typically a component), and specifically to its subwidget with Tk window path <I>subpath</I>.
</DD></DL>

<DL><DT><A NAME="cget2"><I>instance</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>
    Command to return the value of one of the options <B>-dropcmd</B>, <B>-dropovercmd</B>, <B>-dropenabled</B>, <B>-droptypes</B>.
</DD></DL>

<DL><DT><A NAME="configure2"><I>instance</I> <B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DT><DD>
    Command to configure the instance via its options <B>-dropcmd</B>, <B>-dropovercmd</B>, <B>-dropenabled</B>, <B>-droptypes</B>.
</DD></DL>

<B><A NAME="leg">LEGACY COMMAND</A></B><BR>
<DL><DT><A NAME="include">DropSite::<B>include</B></A>
 <I>class</I>
 <I>types</I>
</DT><DD>
Used only by Slab widgets that have not been ported to Snit, and therefore use the BWidget base class "Widget".
This command provides a simple way to include options related to a drop site into
a BWidget resources definition.
It includes the options needed for <B>register</B>, <I>-dropovercmd</I> and <I>-dropcmd</I>,
initialized to empty string, and <I>-droptypes</I>, initialized to <I>types</I>,
and one new option:
<TABLE BORDER=0 CELLSPACING=1>
<TR><TD><I>-dropenabled</I><TD>Specifies whether or not drop is active (initialized to 0)
</TABLE>


<DL><DT><A NAME="DropSite-dropenabled"><B>-dropenabled</B></A></DT>
<DD>
    See DropSite::Dropper, option <A HREF="#Dropper-dropenabled"><B>-dropenabled</B></A>
</DD>
</DL>


</DD></DL>
<DL><DT><A NAME="setdrop">DropSite::<B>setdrop</B></A>
 <I>path</I>
 <I>subpath</I>
 <I>dropover</I>
 <I>drop</I>
 ?<I>force</I>?
</DT><DD>

Used only by Slab widgets that have not been ported to Snit, and therefore use the BWidget base class "Widget".
This command provides a simple way to call <B>register</B> during a BWidget creation or
configuration.
<UL>
<LI><I>path</I> is the pathname of the widget,
<LI><I>subpath</I> is the pathname of the tk widget where drag event occurs,
<LI><I>dropover</I> is a command for <I>drag-over</I> event,
<LI><I>drop</I> is a command for <I>drop</I> event,
<LI><I>force</I> specifies wether or not to call <B>register</B> whenever no option value
has changed (0 by default - for widget configuration, use 1 for widget creation).
</UL>
<B>setdrop</B> verifies the modification flag of options <B>dropenabled</B> and
<B>droptypes</B> and calls <B>register</B> if needed according to the options values and
<I>dropover</I> and <I>drop</I> arguments. <B>dropovercmd</B> and <B>dropcmd</B> are obtained from command arguments.



</DD></DL>





</BODY></HTML>

Changes to BWman/DynamicHelp.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18



















19
20
21
22
23
24
25
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
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
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
...
243
244
245
246
247
248
249

250
251
252
253
254
255
256


257
<HTML>
<HEAD><TITLE>DynamicHelp</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DynamicHelp</B>
 - Provide help to Tk widget or BWidget
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>DynamicHelp::<A HREF="#add"><B>add</B></A>
<i>widget</i> ?<I>option value ...</I>?
</DD>
<DD>DynamicHelp::<A HREF="#configure"><B>configure</B></A>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DD>
<DD>DynamicHelp::<A HREF="#delete"><B>delete</B></A>
<i>widget</i>
</DD>



















<DD>DynamicHelp::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>type</I>
</DD>
<DD>DynamicHelp::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 <I>type</I>
 ?<I>arg...</I>?
</DD>

<DD>DynamicHelp::<A HREF="#sethelp"><B>sethelp</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>force</I>?
</DD>

</DL>


<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
When the user allows the pointer to hover over a widget, DynamicHelp can provide help in two forms - either "balloon help" or "variable help".  In balloon help, a window is posted that displays help text until the pointer is moved.  In variable help, the help string is written to a variable, which is typically the <B>-textvariable</B> for a label or other widget.
</P>
<P>
Some BWidgets (ArrowButton, Button, ComboBox, Entry, Label, LabelEntry, LabelFrame, ListBox items, MainFrame menus, NoteBook pages, SpinBox, and Tree) have DynamicHelp built in, and it is used via the widget options <B>-helptext</B>, <B>-helptype</B>, and <B>-helpvar</B>.  These BWidgets internally use the commands DynamicHelp::<A HREF="#include"><B>include</B></A> and DynamicHelp::<A HREF="#sethelp"><B>sethelp</B></A> to configure help in this way.
</P>
<P>

































DynamicHelp can be added to any other widget by the command DynamicHelp::<A HREF="#add"><B>add</B></A>.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>

<DL><DT><A NAME="add">DynamicHelp::<B>add</B></A> <I>widget</I>
 ?<I>option value ...</I>?
</DT><DD>
................................................................................
    DynamicHelp::add .m.file -type menu -index 1 -text "Open a file"
    DynamicHelp::add .m.file -type menu -index 2 -text "Exit demo"
    </PRE></TD></TR></TABLE></CENTER>

</DL>

<DL><DT><A NAME="configure">DynamicHelp::<B>configure</B></A>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DT><DD>
This command configure the ballon help.
<P>
<DL><DT><A NAME="DynamicHelp-borderwidth"><B>-borderwidth</B> or <B>-bd</B></A></DT>
<DD>
Width of the black border around the balloon.
</DD>
</DL>
<DL><DT><A NAME="DynamicHelp-delay"><B>-delay</B></A></DT>
................................................................................
</DD></DL>

<DL><DT><A NAME="delete">DynamicHelp::<B>delete</B></A>
 <I>widget</I>
</DT><DD>
    Delete all dynamic help for the given <i>widget</i>.
</DD></DL>
























































<DL><DT><A NAME="include">DynamicHelp::<B>include</B></A>
 <I>class</I>
 <I>type</I>
</DT><DD>
Used internally by BWidget to give all widgets of a particular class the options <B>-helptext</B>, <B>-helptype</B>, and <B>-helpvar</B>, by which DynamicHelp can be requested without calling DynamicHelp::<B>add</B>.

</DD></DL>
<DL><DT><A NAME="register">DynamicHelp::<B>register</B></A>
 <I>path</I>
 <I>type</I>
 ?<I>arg...</I>?
</DT><DD>
<p>
<b>Its use is deprecated.  Use <i>DynamicHelp::add</i> instead.</b>
</p>

Register a help text to the widget <I>path</I>.
<I>type</I> determines the type of the help or the type of the widget.
Depending on <I>type</I>, other options must be provided.
<BR>
<TABLE CELLSPACING=5 CELLPADDING=0 BORDER=0>
<TR><TD><B>    type      </B></TD><TD><B>     options      </B></TD></TR>
<TR><TD><B><I> balloon   </I></B></TD><TD><I> ?tagOrItem? text </I></TD></TR>
<TR><TD><B><I> variable  </I></B></TD><TD><I> ?tagOrItem? varName text </I></TD></TR>
<TR><TD><B><I> menu      </I></B></TD><TD><I> varName      </I></TD></TR>
................................................................................
</PRE></TD></TR></TABLE></CENTER>
<BR>
<BR>Notice that if popup menu is owned by a menubar, you must associate first the menubar
to its toplevel. In this case, when you create a menu popup, its clone window is also
created, and DynamicHelp::register detects the exitence of the clone window and maps
events to it.
</DD></DL>

<DL><DT><A NAME="sethelp">DynamicHelp::<B>sethelp</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>force</I>?
</DT><DD>
Used internally by BWidget classes that have been given DynamicHelp options by the command DynamicHelp::<B>include</B>.
</DD></DL>


</BODY></HTML>





|







|




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









>





>

>
>






|


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







 







|

|







 








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




<
>







|



|







 







>





|

>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
...
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
...
230
231
232
233
234
235
236
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
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
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<HTML>
<HEAD><TITLE>DynamicHelp</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>DynamicHelp</B>
 - Provide help to Tk or Slab widget
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>DynamicHelp::<A HREF="#add"><B>add</B></A>
<i>widget</i> ?<I>option value ...</I>?
</DD>
<DD>DynamicHelp::<A HREF="#configure"><B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DD>
<DD>DynamicHelp::<A HREF="#delete"><B>delete</B></A>
<i>widget</i>
</DD>
<DD>DynamicHelp::<A HREF="#helper"><B>Helper</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DD>
<DD><I>instance</I> <A HREF="#attach2"><B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>tagOrItem</I>?
</DD>
<DD><I>instance</I> <A HREF="#cget2"><B>cget</B></A>
 <I>option</I>
</DD>
<DD><I>instance</I> <A HREF="#configure2"><B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DD>
</DL>
<DL>
<DT><I><A HREF="#leg">LEGACY COMMAND</A></I></DT>
<DD>DynamicHelp::<A HREF="#include"><B>include</B></A>
 <I>class</I>
 <I>type</I>
</DD>
<DD>DynamicHelp::<A HREF="#register"><B>register</B></A>
 <I>path</I>
 <I>type</I>
 ?<I>arg...</I>?
</DD>
<!-- Deprecated.
<DD>DynamicHelp::<A HREF="#sethelp"><B>sethelp</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>force</I>?
</DD>
-->
</DL>


<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>
When the user allows the pointer to hover over a widget, DynamicHelp can provide help in two forms - either "balloon help" or "variable help".  In balloon help, a window is posted that displays help text until the pointer is moved.  In variable help, the help string is written to a variable, which is typically the <B>-textvariable</B> for a label or other widget.
</P>
<P>
Some Slab widgets (ArrowButton, Button, ComboBox, Entry, Label, LabelEntry, ListBox items, MainFrame menus, NoteBook pages, SpinBox, and Tree) have DynamicHelp built in, and it is used via the widget options <B>-helpcmd</B>, <B>-helptext</B>, <B>-helptype</B>, and <B>-helpvar</B>.  The widgets that have been ported to Snit and have built-in DynamicHelp delegate to a Snit Abstract Type Slab::DynamicHelp::Helper, and access DynamicHelp exclusively via this object, except that the command DynamicHelp::configure can be used to configure the properties of the help balloon.  (The Tree widget has built-in DynamicHelp, has not been ported to Snit, and accesses DynamicHelp via the commands DynamicHelp::add and DynamicHelp::include.)
</P>
<P>
Here is the use of DynamicHelp in the <A HREF="Entry.html">Entry</A> widget:
<BR>
<CENTER>
<TABLE BORDER=2 CELSPACING=2 WIDTH=80%>
<TR><TD><PRE>
snit::widgetadaptor Slab::Entry {

    <FONT COLOR=red><I># Delegate help-related options and methods.</I></FONT>
    component MyDynamicHelper
    delegate option -helptext to MyDynamicHelper
    delegate option -helpvar  to MyDynamicHelper
    delegate option -helpcmd  to MyDynamicHelper
    delegate option -helptype to MyDynamicHelper
    delegate method  dynamichelp_for_snit to MyDynamicHelper

    constructor {args} {
        installhull using entry

        <FONT COLOR=red><I># Define and configure component MyDynamicHelper.</I></FONT>
        install MyDynamicHelper using Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
                -helptype balloon
        $MyDynamicHelper attach $win $win

        $self configurelist $args

        <FONT COLOR=red><I># The rest of the constructor ...</I></FONT>
        ...
    }
}</PRE>
</TD></TR>
</TABLE></CENTER>
</P>
<P>
DynamicHelp can be added to any other Tk or Slab widget by the command DynamicHelp::<A HREF="#add"><B>add</B></A>.
</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>

<DL><DT><A NAME="add">DynamicHelp::<B>add</B></A> <I>widget</I>
 ?<I>option value ...</I>?
</DT><DD>
................................................................................
    DynamicHelp::add .m.file -type menu -index 1 -text "Open a file"
    DynamicHelp::add .m.file -type menu -index 2 -text "Exit demo"
    </PRE></TD></TR></TABLE></CENTER>

</DL>

<DL><DT><A NAME="configure">DynamicHelp::<B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DT><DD>
This command configures the balloon help.  These balloon properties apply to all cases of balloon help, and are independent of the target widget or the way the balloon help was added to it.
<P>
<DL><DT><A NAME="DynamicHelp-borderwidth"><B>-borderwidth</B> or <B>-bd</B></A></DT>
<DD>
Width of the black border around the balloon.
</DD>
</DL>
<DL><DT><A NAME="DynamicHelp-delay"><B>-delay</B></A></DT>
................................................................................
</DD></DL>

<DL><DT><A NAME="delete">DynamicHelp::<B>delete</B></A>
 <I>widget</I>
</DT><DD>
    Delete all dynamic help for the given <i>widget</i>.
</DD></DL>

<DL><DT><A NAME="helper">DynamicHelp::<B>Helper</B></A>
 ?<I>create</I>?
 <I>instance</I>
 ?<I>option value ...</I>?
</DT><DD>
Constructor for a <B>DynamicHelp::Helper</B> object.
<P>
<DL><DT><A NAME="Helper-helpcmd"><B>-helpcmd</B></A></DT>
<DD>
(unused)
</DD>
</DL>

<DL><DT><A NAME="Helper-helptext"><B>-helptext</B></A></DT>
<DD>
The text to be displayed as dynamic help.
</DD>
</DL>

<DL><DT><A NAME="Helper-helptype"><B>-helptype</B></A></DT>
<DD>
Value is either "balloon" (help text is written to a popup window) or "variable" (help text is written to a specified variable).
</DD>
</DL>

<DL><DT><A NAME="Helper-helpvar"><B>-helpvar</B></A></DT>
<DD>
The name of the variable that will be used when the dynamic help has -helptype variable.
</DD>
</DL>

</DD></DL>

<DL><DT><A NAME="attach2"><I>instance</I> <B>attach</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>tagOrItem</I>?
</DT><DD>
    Attach the dynamic help provided by <I>instance</I> to the widget <I>path</I> (of which this <I>instance</I> is typically a component), and specifically to its subwidget with Tk window path <I>subpath</I>.  The argument <I>tagOrItem</I> is required if the help is attached to a specific tag in a text widget or item in a canvas widget.
</DD></DL>

<DL><DT><A NAME="cget2"><I>instance</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>
    Command to return the value of one of the options <B>-helpcmd</B>, <B>-helptext</B>, <B>-helptype</B>, or <B>-helpvar</B>.
</DD></DL>

<DL><DT><A NAME="configure2"><I>instance</I> <B>configure</B></A>
 ?<I>option</I> ?<I>value</I> ?<I>option</I> <I>value</I> ...???
</DT><DD>
    Command to configure the instance via its options <B>-helpcmd</B>, <B>-helptext</B>, <B>-helptype</B>, or <B>-helpvar</B>.
</DD></DL>

<B><A NAME="leg">LEGACY COMMAND</A></B><BR>

<DL><DT><A NAME="include">DynamicHelp::<B>include</B></A>
 <I>class</I>
 <I>type</I>
</DT><DD>

Used only by Slab widgets that have not been ported to Snit, and therefore use the BWidget base class "Widget".  The command gives all widgets of a particular BWidget class the options <B>-helpcmd</B>, <B>-helptext</B>, <B>-helptype</B>, and <B>-helpvar</B>, by which DynamicHelp can be requested without calling DynamicHelp::<B>add</B>.
</DD></DL>
<DL><DT><A NAME="register">DynamicHelp::<B>register</B></A>
 <I>path</I>
 <I>type</I>
 ?<I>arg...</I>?
</DT><DD>
<p>
<b>This command is deprecated.  Use <i>DynamicHelp::add</i> instead.</b>
</p>

Register a help text to the widget <I>path</I>.
<I>type</I> determines the type of the help.
Depending on <I>type</I>, other options must be provided.
<BR>
<TABLE CELLSPACING=5 CELLPADDING=0 BORDER=0>
<TR><TD><B>    type      </B></TD><TD><B>     options      </B></TD></TR>
<TR><TD><B><I> balloon   </I></B></TD><TD><I> ?tagOrItem? text </I></TD></TR>
<TR><TD><B><I> variable  </I></B></TD><TD><I> ?tagOrItem? varName text </I></TD></TR>
<TR><TD><B><I> menu      </I></B></TD><TD><I> varName      </I></TD></TR>
................................................................................
</PRE></TD></TR></TABLE></CENTER>
<BR>
<BR>Notice that if popup menu is owned by a menubar, you must associate first the menubar
to its toplevel. In this case, when you create a menu popup, its clone window is also
created, and DynamicHelp::register detects the exitence of the clone window and maps
events to it.
</DD></DL>
<!-- Deprecated.
<DL><DT><A NAME="sethelp">DynamicHelp::<B>sethelp</B></A>
 <I>path</I>
 <I>subpath</I>
 ?<I>force</I>?
</DT><DD>
Deprecated.
</DD></DL>
-->

</BODY></HTML>

Changes to BWman/Widget.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
170
...
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
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
...
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
...
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
...
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
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
...
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
<HTML>
<HEAD><TITLE>Widget</TITLE></HEAD>
<BODY BGCOLOR=white>
<IMG SRC="constr.gif" WIDTH="40" HEIGHT="40"> Under construction ...<BR>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>Widget</B>
 - The Widget base class
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>Widget::<A HREF="#addmap"><B>addmap</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DD>
<DD>Widget::<A HREF="#bwinclude"><B>bwinclude</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DD>
<DD>Widget::<A HREF="#cget"><B>cget</B></A>
 <I>path</I>
 <I>option</I>
</DD>
<DD>Widget::<A HREF="#configure"><B>configure</B></A>
 <I>path</I>
 <I>options</I>
</DD>
<DD>Widget::<A HREF="#create"><B>create</B></A>
 <I>class</I>
 <I>path</I>
 ?<I>rename</I>?
</DD>
<DD>Widget::<A HREF="#declare"><B>declare</B></A>
 <I>class</I>
 <I>optlist</I>
</DD>
<DD>Widget::<A HREF="#define"><B>define</B></A>
 <I>class</I>
 <I>filename</I>
 ?<I>class ...</I>?
</DD>
<DD>Widget::<A HREF="#destroy"><B>destroy</B></A>
 <I>path</I>
</DD>
<DD>Widget::<A HREF="#focusNext"><B>focusNext</B></A>
 <I>w</I>
</DD>
<DD>Widget::<A HREF="#focusOK"><B>focusOK</B></A>
 <I>w</I>
</DD>
<DD>Widget::<A HREF="#focusPrev"><B>focusPrev</B></A>
 <I>w</I>
</DD>
<DD>Widget::<A HREF="#generate-doc"><B>generate-doc</B></A>
 <I>dir</I>
 <I>widgetlist</I>
</DD>
<DD>Widget::<A HREF="#generate-widget-doc"><B>generate-widget-doc</B></A>
 <I>class</I>
 <I>iscmd</I>
 <I>file</I>
</DD>
<DD>Widget::<A HREF="#getoption"><B>getoption</B></A>
 <I>path</I>
 <I>option</I>
</DD>
<DD>Widget::<A HREF="#getVariable"><B>getVariable</B></A>
 <I>path</I>
 <I>varName</I>
 <I>?myVarName?</I>
</DD>
<DD>Widget::<A HREF="#hasChanged"><B>hasChanged</B></A>
 <I>path</I>
 <I>option</I>
 <I>pvalue</I>
</DD>
<DD>Widget::<A HREF="#init"><B>init</B></A>
 <I>class</I>
 <I>path</I>
 <I>options</I>
</DD>
<DD>Widget::<A HREF="#setoption"><B>setoption</B></A>
 <I>path</I>
 <I>option</I>
 <I>value</I>
</DD>
<DD>Widget::<A HREF="#subcget"><B>subcget</B></A>
 <I>path</I>
 <I>subwidget</I>
</DD>
<DD>Widget::<A HREF="#syncoptions"><B>syncoptions</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DD>
<DD>Widget::<A HREF="#tkinclude"><B>tkinclude</B></A>
 <I>class</I>
 <I>tkwidget</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DD>
</DL>


















<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>

The <B>Widget</B> namespace handle data associated to all BWidget and provide commands
to easily define BWidget.


<BR>For commands can be used to define a BWidget:
<B>tkinclude</B>, <B>bwinclude</B>, <B>declare</B>, <B>addmap</B> and <B>syncoptions</B>.
Here is the definition of <A HREF="ComboBox.html">ComboBox</A> widget:
<BR><BR>
<CENTER>
<TABLE BORDER=2 CELSPACING=2 WIDTH=80%>
<TR><TD><PRE>
namespace eval ComboBox {
    <FONT COLOR=red><I># We're using ArrowButton, Entry and LabelFrame</I></FONT>
    ArrowButton::use
    Entry::use
    LabelFrame::use

    <FONT COLOR=red><I># Include resources of LabelFrame</I></FONT>
    Widget::bwinclude ComboBox LabelFrame .labf \ 
        rename     {-text -label} \ 
        remove     {-focus} \ 
        prefix     {label -justify -width -anchor -height -font} \ 
        initialize {-relief sunken -borderwidth 2}

    <FONT COLOR=red><I># Include resources of Entry</I></FONT>
    Widget::bwinclude ComboBox Entry .e \ 
        remove {-relief -bd -borderwidth -bg -fg} \ 
        rename {-foreground -entryfg -background -entrybg}

    <FONT COLOR=red><I># Declare new resources</I></FONT>
    Widget::declare ComboBox {
        {-height      TkResource 0  0 listbox}
        {-values      String     "" 0}
        {-modifycmd   String     "" 0}
        {-postcommand String     "" 0}
    }

    <FONT COLOR=red><I># Map resources to subwidget</I></FONT>
    Widget::addmap ComboBox "" :cmd {-background {}}
    Widget::addmap ComboBox ArrowButton .a \ 
        {-foreground {} -background {} -disabledforeground {} -state {}}

    <FONT COLOR=red><I># Synchronize subwidget options</I></FONT>
    Widget::syncoptions ComboBox Entry .e {-text {}}
    Widget::syncoptions ComboBox LabelFrame .labf {-label -text -underline {}}

    proc use {} {}
}</PRE>
</TD></TR>
</TABLE></CENTER>

</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="addmap">Widget::<B>addmap</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DT><DD>

This command map some resources to subwidget.
................................................................................
<UL>
<LI><I>class</I> is the class of the new BWidget
<LI><I>subclass</I> is the class the subwidget (BWidget class, e.g Entry, or empty for Tk widget)
<LI><I>subpath</I> is the path of the subwidget
<LI><I>options</I> is the list <I>{option realres ...}</I> of options to map to subwidget
</UL>
</DD></DL>
<DL><DT><A NAME="bwinclude">Widget::<B>bwinclude</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DT><DD>

This command includes into a new BWidget the resources of another BWidget.
................................................................................
<BR>pefix all <I>option</I> by <I>prefix</I>
<LI><I><B>initialize</B> {option value option value ...}</I>
<BR>default value of options
<LI><I><B>readonly</B> {option value option value ...}</I>
<BR>new readonly flag
</UL></UL>
</DD></DL>
<DL><DT><A NAME="cget">Widget::<B>cget</B></A>
 <I>path</I>
 <I>option</I>
</DT><DD>

Returns the value of <I>option</I> of BWidget <I>path</I>. <B>cget</B> tests the option
existence and takes care of synchronization with subwidget.
Typically called by the BWidget <B>cget</B> command.

</DD></DL>
<DL><DT><A NAME="configure">Widget::<B>configure</B></A>
 <I>path</I>
 <I>options</I>
</DT><DD>
Description text
</DD></DL>

<DL><DT><A NAME="create">Widget::<B>create</B></A>
 <I>class</I>
 <I>path</I>
 ?<I>rename</I>?
</DT><DD>
    The standard method for creating a BWidget.  The real widget path
    is renamed to $path:cmd, and a new proc is created to replace the
    path which points to the BWidget's commands.
................................................................................

    <p>
    The command returns the widget path.  This command is usually the
    last command executed in the ::create command for the widget.
    </p>
</DD></DL>

<DL><DT><A NAME="declare">Widget::<B>declare</B></A>
 <I>class</I>
 <I>optlist</I>
</DT><DD>

This command declare new resources for a BWidget.
<UL>
<LI><I>class</I> is class of the new widget
................................................................................
<I>[expr $option &gt; $min] && [expr $option &lt; $max]</I> so
if args is <I>{0 10}</I>, value must be beetween 0 and 10 exclude,
if <I>args</I> is <I>{=0 =10}</I> , value must be beetween 0 and 10 include.
</DD>

<DT><B>Boolean</B></DT>
<DD><I>value</I> of <I>option</I> is a boolean. True values can be <B>1</B>, <B>true</B> or <B>yes</B>.
False values can be <B>0</B>, <B>false</B> or <B>no</B>. <B>Widget::cget</B> always return
0 or 1.
</DD>

<DT><B>Enum</B></DT>
<DD>
<I>value</I> of <I>option</I> is a element of a enumeration. <I>args</I> must be the list
of enumeration, e.g. <I>{top left bottom right}</I>.
................................................................................
<DT><B>Synonym</B></DT>
<DD>
<DD><I>option</I> is a synonym of option <I>args</I>. <I>value</I> has no effect here.
</DD>
</DL>
</DD></DL>

<DL><DT><A NAME="define">Widget::<B>define</B></A>
 <I>class</I>
 <I>filename</I>
 ?<I>class ...</I>?
</DT><DD>

    <p>
    This command is used to define a new BWidget class.  It is
................................................................................

    <p>
    If <i>-classonly</i> option is not given this command does several things to
    setup the new class.  First, it creates an alias in the global namespace for
    the name of the class that points to the class's ::create subcommand.
    Second, it defines a ::use subcommand for the class which other classes can
    use to load this class on the fly.  Lastly, it creates a default binding to
    the &lt;Destroy&gt; event for the class that calls Widget::destroy on the
    path.  This is the default setup for almost all widgets in the BWidget
    package.
    </p>

</DD></DL>

<DL><DT><A NAME="destroy">Widget::<B>destroy</B></A>
 <I>path</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="focusNext">Widget::<B>focusNext</B></A>
 <I>w</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="focusOK">Widget::<B>focusOK</B></A>
 <I>w</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="focusPrev">Widget::<B>focusPrev</B></A>
 <I>w</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="generate-doc">Widget::<B>generate-doc</B></A>
 <I>dir</I>
 <I>widgetlist</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="generate-widget-doc">Widget::<B>generate-widget-doc</B></A>
 <I>class</I>
 <I>iscmd</I>
 <I>file</I>
</DT><DD>
Description text
</DD></DL>

<DL><DT><A NAME="getoption">Widget::<B>getoption</B></A>
 <I>path</I>
 <I>option</I>
</DT><DD>

Returns the value of <I>option</I> of BWidget <I>path</I>. This command does not test
option existence, does not handle synonym and does not take care of synchronization with
subwidget.

</DD></DL>
<DL><DT><A NAME="getVariable">Widget::<B>getVariable</B></A>
 <I>path</I>
 <I>varName</I>
 <I>?myVarName?</I>
</DT><DD>

<p>
Make the variable <i>varName</i> relational to <i>path</i> accessible in
................................................................................

<p>
If <i>myVarName</i> is specified, the variable will be accessible in the
current procedure as that name.
</p>

</DD></DL>
<DL><DT><A NAME="hasChanged">Widget::<B>hasChanged</B></A>
 <I>path</I>
 <I>option</I>
 <I>pvalue</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="init">Widget::<B>init</B></A>
 <I>class</I>
 <I>path</I>
 <I>options</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="setoption">Widget::<B>setoption</B></A>
 <I>path</I>
 <I>option</I>
 <I>value</I>
</DT><DD>

Set the value of <I>option</I> of BWidget <I>path</I> without option test, subwidget mapping,
synonym handling and does not set the modification flag.

</DD></DL>
<DL><DT><A NAME="subcget">Widget::<B>subcget</B></A>
 <I>path</I>
 <I>subwidget</I>
</DT><DD>

Returns the list of all option/value of BWidget <I>path</I> that are mapped to <I>subwidget</I>.

</DD></DL>
<DL><DT><A NAME="syncoptions">Widget::<B>syncoptions</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DT><DD>

This command synchronize options value of a subwidget.
Used when an option of a subwidget is modified out of the BWidget <B>configure</B> command.
<UL>
<LI><I>class</I> is the class of the new BWidget
<LI><I>subclass</I> is the class the subwidget (BWidget class, e.g Entry, or empty for Tk widget)
<LI><I>subpath</I> is the path of the subwidget
<LI><I>options</I> is the list <I>{option realres ...}</I> of options to synchronize 
with subwidget
</UL>
</DD></DL>
<DL><DT><A NAME="tkinclude">Widget::<B>tkinclude</B></A>
 <I>class</I>
 <I>tkwidget</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DT><DD>

This command includes into a new BWidget the resources of a Tk widget.



|


|



|





|





|



|



|




|



|




|


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|



|




|




|




|




|



<
<
<
<
<
<
|






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




|
|
>
>
|
|












|






|




|







|
|


<
<
<
<








|







 







|







 







|









|






|







 







|







 







|







 







|







 







|






|




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









|







 







|






|






|









|







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
...
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
...
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
...
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
...
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
...
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
...
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360




























361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
...
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
<HTML>
<HEAD><TITLE>Widget</TITLE></HEAD>
<BODY BGCOLOR=white>
Under construction ...<BR>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>Widget</B>
 - The Widget base class for BWidgets
</DD></DL>
<DL>
<DT><I><A HREF="#wc">COMMAND</A></I></DT>
<DD>Slab::Widget::<A HREF="#addmap"><B>addmap</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DD>
<DD>Slab::Widget::<A HREF="#bwinclude"><B>bwinclude</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DD>
<DD>Slab::Widget::<A HREF="#cget"><B>cget</B></A>
 <I>path</I>
 <I>option</I>
</DD>
<DD>Slab::Widget::<A HREF="#configure"><B>configure</B></A>
 <I>path</I>
 <I>options</I>
</DD>
<DD>Slab::Widget::<A HREF="#create"><B>create</B></A>
 <I>class</I>
 <I>path</I>
 ?<I>rename</I>?
</DD>
<DD>Slab::Widget::<A HREF="#declare"><B>declare</B></A>
 <I>class</I>
 <I>optlist</I>
</DD>
<DD>Slab::Widget::<A HREF="#define"><B>define</B></A>
 <I>class</I>
 <I>filename</I>
 ?<I>class ...</I>?
</DD>
<DD>Slab::Widget::<A HREF="#destroy"><B>destroy</B></A>
 <I>path</I>
</DD>


















<DD>Slab::Widget::<A HREF="#getoption"><B>getoption</B></A>
 <I>path</I>
 <I>option</I>
</DD>
<DD>Slab::Widget::<A HREF="#getVariable"><B>getVariable</B></A>
 <I>path</I>
 <I>varName</I>
 <I>?myVarName?</I>
</DD>
<DD>Slab::Widget::<A HREF="#hasChanged"><B>hasChanged</B></A>
 <I>path</I>
 <I>option</I>
 <I>pvalue</I>
</DD>
<DD>Slab::Widget::<A HREF="#init"><B>init</B></A>
 <I>class</I>
 <I>path</I>
 <I>options</I>
</DD>
<DD>Slab::Widget::<A HREF="#setoption"><B>setoption</B></A>
 <I>path</I>
 <I>option</I>
 <I>value</I>
</DD>
<DD>Slab::Widget::<A HREF="#subcget"><B>subcget</B></A>
 <I>path</I>
 <I>subwidget</I>
</DD>






<DD>Slab::Widget::<A HREF="#tkinclude"><B>tkinclude</B></A>
 <I>class</I>
 <I>tkwidget</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DD>
</DL>
<DL>
<DT><I><A HREF="#other">OTHER COMMAND</A></I> in the Slab::Widget namespace, documented on the <A HREF="BWidget.html">Utilities</A> page.</DT>
<DD>Slab::Widget::<A HREF="BWidget.html#focusNext"><B>focusNext</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="BWidget.html#focusOK"><B>focusOK</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="BWidget.html#focusPrev"><B>focusPrev</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="BWidget.html#traverseTo"><B>traverseTo</B></A>
 <I>w</I>
</DD>
<DD>Slab::Widget::<A HREF="BWidget.html#theme"><B>theme</B></A>
 ?<I>bool</I>?
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>

The <B>Slab::Widget</B> namespace handles data associated to all BWidgets
and provides commands to easily define a BWidget.  It is retained in Slab for
use by the widgets that have not yet been ported to Snit.  It also includes
general-purpose <A HREF="BWidget.html"><B>Utilities</B></A> that are used by Slab widgets that have been ported to Snit.
<BR>Four commands can be used to define a BWidget:
<B>tkinclude</B>, <B>bwinclude</B>, <B>declare</B>, and <B>addmap</B>.
Here is the definition of <A HREF="ComboBox.html">ComboBox</A> widget:
<BR><BR>
<CENTER>
<TABLE BORDER=2 CELSPACING=2 WIDTH=80%>
<TR><TD><PRE>
namespace eval ComboBox {
    <FONT COLOR=red><I># We're using ArrowButton, Entry and LabelFrame</I></FONT>
    ArrowButton::use
    Entry::use
    LabelFrame::use

    <FONT COLOR=red><I># Include resources of LabelFrame</I></FONT>
    Slab::Widget::bwinclude ComboBox LabelFrame .labf \ 
        rename     {-text -label} \ 
        remove     {-focus} \ 
        prefix     {label -justify -width -anchor -height -font} \ 
        initialize {-relief sunken -borderwidth 2}

    <FONT COLOR=red><I># Include resources of Entry</I></FONT>
    Slab::Widget::bwinclude ComboBox Entry .e \ 
        remove {-relief -bd -borderwidth -bg -fg} \ 
        rename {-foreground -entryfg -background -entrybg}

    <FONT COLOR=red><I># Declare new resources</I></FONT>
    Slab::Widget::declare ComboBox {
        {-height      TkResource 0  0 listbox}
        {-values      String     "" 0}
        {-modifycmd   String     "" 0}
        {-postcommand String     "" 0}
    }

    <FONT COLOR=red><I># Map resources to subwidget</I></FONT>
    Slab::Widget::addmap ComboBox "" :cmd {-background {}}
    Slab::Widget::addmap ComboBox ArrowButton .a \ 
        {-foreground {} -background {} -disabledforeground {} -state {}}





    proc use {} {}
}</PRE>
</TD></TR>
</TABLE></CENTER>

</P>
<HR WIDTH="50%"><BR>
<B><A NAME="wc">COMMAND</A></B><BR>
<DL><DT><A NAME="addmap">Slab::Widget::<B>addmap</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 <I>options</I>
</DT><DD>

This command map some resources to subwidget.
................................................................................
<UL>
<LI><I>class</I> is the class of the new BWidget
<LI><I>subclass</I> is the class the subwidget (BWidget class, e.g Entry, or empty for Tk widget)
<LI><I>subpath</I> is the path of the subwidget
<LI><I>options</I> is the list <I>{option realres ...}</I> of options to map to subwidget
</UL>
</DD></DL>
<DL><DT><A NAME="bwinclude">Slab::Widget::<B>bwinclude</B></A>
 <I>class</I>
 <I>subclass</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DT><DD>

This command includes into a new BWidget the resources of another BWidget.
................................................................................
<BR>pefix all <I>option</I> by <I>prefix</I>
<LI><I><B>initialize</B> {option value option value ...}</I>
<BR>default value of options
<LI><I><B>readonly</B> {option value option value ...}</I>
<BR>new readonly flag
</UL></UL>
</DD></DL>
<DL><DT><A NAME="cget">Slab::Widget::<B>cget</B></A>
 <I>path</I>
 <I>option</I>
</DT><DD>

Returns the value of <I>option</I> of BWidget <I>path</I>. <B>cget</B> tests the option
existence and takes care of synchronization with subwidget.
Typically called by the BWidget <B>cget</B> command.

</DD></DL>
<DL><DT><A NAME="configure">Slab::Widget::<B>configure</B></A>
 <I>path</I>
 <I>options</I>
</DT><DD>
Description text
</DD></DL>

<DL><DT><A NAME="create">Slab::Widget::<B>create</B></A>
 <I>class</I>
 <I>path</I>
 ?<I>rename</I>?
</DT><DD>
    The standard method for creating a BWidget.  The real widget path
    is renamed to $path:cmd, and a new proc is created to replace the
    path which points to the BWidget's commands.
................................................................................

    <p>
    The command returns the widget path.  This command is usually the
    last command executed in the ::create command for the widget.
    </p>
</DD></DL>

<DL><DT><A NAME="declare">Slab::Widget::<B>declare</B></A>
 <I>class</I>
 <I>optlist</I>
</DT><DD>

This command declare new resources for a BWidget.
<UL>
<LI><I>class</I> is class of the new widget
................................................................................
<I>[expr $option &gt; $min] && [expr $option &lt; $max]</I> so
if args is <I>{0 10}</I>, value must be beetween 0 and 10 exclude,
if <I>args</I> is <I>{=0 =10}</I> , value must be beetween 0 and 10 include.
</DD>

<DT><B>Boolean</B></DT>
<DD><I>value</I> of <I>option</I> is a boolean. True values can be <B>1</B>, <B>true</B> or <B>yes</B>.
False values can be <B>0</B>, <B>false</B> or <B>no</B>. <B>Slab::Widget::cget</B> always return
0 or 1.
</DD>

<DT><B>Enum</B></DT>
<DD>
<I>value</I> of <I>option</I> is a element of a enumeration. <I>args</I> must be the list
of enumeration, e.g. <I>{top left bottom right}</I>.
................................................................................
<DT><B>Synonym</B></DT>
<DD>
<DD><I>option</I> is a synonym of option <I>args</I>. <I>value</I> has no effect here.
</DD>
</DL>
</DD></DL>

<DL><DT><A NAME="define">Slab::Widget::<B>define</B></A>
 <I>class</I>
 <I>filename</I>
 ?<I>class ...</I>?
</DT><DD>

    <p>
    This command is used to define a new BWidget class.  It is
................................................................................

    <p>
    If <i>-classonly</i> option is not given this command does several things to
    setup the new class.  First, it creates an alias in the global namespace for
    the name of the class that points to the class's ::create subcommand.
    Second, it defines a ::use subcommand for the class which other classes can
    use to load this class on the fly.  Lastly, it creates a default binding to
    the &lt;Destroy&gt; event for the class that calls Slab::Widget::destroy on the
    path.  This is the default setup for almost all widgets in the BWidget
    package.
    </p>

</DD></DL>

<DL><DT><A NAME="destroy">Slab::Widget::<B>destroy</B></A>
 <I>path</I>
</DT><DD>
Description text
</DD></DL>





























<DL><DT><A NAME="getoption">Slab::Widget::<B>getoption</B></A>
 <I>path</I>
 <I>option</I>
</DT><DD>

Returns the value of <I>option</I> of BWidget <I>path</I>. This command does not test
option existence, does not handle synonym and does not take care of synchronization with
subwidget.

</DD></DL>
<DL><DT><A NAME="getVariable">Slab::Widget::<B>getVariable</B></A>
 <I>path</I>
 <I>varName</I>
 <I>?myVarName?</I>
</DT><DD>

<p>
Make the variable <i>varName</i> relational to <i>path</i> accessible in
................................................................................

<p>
If <i>myVarName</i> is specified, the variable will be accessible in the
current procedure as that name.
</p>

</DD></DL>
<DL><DT><A NAME="hasChanged">Slab::Widget::<B>hasChanged</B></A>
 <I>path</I>
 <I>option</I>
 <I>pvalue</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="init">Slab::Widget::<B>init</B></A>
 <I>class</I>
 <I>path</I>
 <I>options</I>
</DT><DD>
Description text
</DD></DL>
<DL><DT><A NAME="setoption">Slab::Widget::<B>setoption</B></A>
 <I>path</I>
 <I>option</I>
 <I>value</I>
</DT><DD>

Set the value of <I>option</I> of BWidget <I>path</I> without option test, subwidget mapping,
synonym handling and does not set the modification flag.

</DD></DL>
<DL><DT><A NAME="subcget">Slab::Widget::<B>subcget</B></A>
 <I>path</I>
 <I>subwidget</I>
</DT><DD>

Returns the list of all option/value of BWidget <I>path</I> that are mapped to <I>subwidget</I>.

</DD></DL>

















<DL><DT><A NAME="tkinclude">Slab::Widget::<B>tkinclude</B></A>
 <I>class</I>
 <I>tkwidget</I>
 <I>subpath</I>
 ?<I>arg...</I>?
</DT><DD>

This command includes into a new BWidget the resources of a Tk widget.

Changes to BWman/contents.html.

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<TD>Color selection widget</TD></TR>
</TABLE>
<BR><B>Commands Classes</B>
<TABLE BORDER=0 CELLSPACING=0>
<TR><TD><A HREF="Widget.html">Widget</A></TD>
<TD>The Widget base class</TD></TR>
<TR><TD><A HREF="DynamicHelp.html">DynamicHelp</A></TD>
<TD>Provide help to Tk widget or BWidget</TD></TR>
<TR><TD><A HREF="DragSite.html">DragSite</A></TD>
<TD>Commands set for Drag facilities</TD></TR>
<TR><TD><A HREF="DropSite.html">DropSite</A></TD>
<TD>Commands set for Drop facilities</TD></TR>
<TR><TD><A HREF="BWidget.html">BWidget</A></TD>
<TD>Description text</TD></TR>
</TABLE>

<BR><HR><BR><B>Loading Slab</B><BR>

<pre>
package require Slab <I>?1.9.11?</I>
</pre>
</BODY></HTML>







|




|
|





|


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<TD>Color selection widget</TD></TR>
</TABLE>
<BR><B>Commands Classes</B>
<TABLE BORDER=0 CELLSPACING=0>
<TR><TD><A HREF="Widget.html">Widget</A></TD>
<TD>The Widget base class</TD></TR>
<TR><TD><A HREF="DynamicHelp.html">DynamicHelp</A></TD>
<TD>Provide help to Tk or Slab widget</TD></TR>
<TR><TD><A HREF="DragSite.html">DragSite</A></TD>
<TD>Commands set for Drag facilities</TD></TR>
<TR><TD><A HREF="DropSite.html">DropSite</A></TD>
<TD>Commands set for Drop facilities</TD></TR>
<TR><TD><A HREF="BWidget.html">Utilities</A></TD>
<TD>General-purpose Utilities</TD></TR>
</TABLE>

<BR><HR><BR><B>Loading Slab</B><BR>

<pre>
package require Slab <I>?3.0.0?</I>
</pre>
</BODY></HTML>

Changes to BWman/index.html.

1
2
3
4
5
6
7
<HTML>
<HEAD><TITLE>BWidget Manual Pages</TITLE></HEAD>
  <FRAMESET COLS="180,*" BORDER=0>
    <FRAME SRC=navtree.html NAME="Menu" SCROLLING=AUTO>
      <FRAME SRC=contents.html NAME="Manual" SCROLLING=AUTO>
  </FRAMESET>
</HTML>

|





1
2
3
4
5
6
7
<HTML>
<HEAD><TITLE>Slab Manual Pages</TITLE></HEAD>
  <FRAMESET COLS="180,*" BORDER=0>
    <FRAME SRC=navtree.html NAME="Menu" SCROLLING=AUTO>
      <FRAME SRC=contents.html NAME="Manual" SCROLLING=AUTO>
  </FRAMESET>
</HTML>

Changes to BWman/navtree.html.

36
37
38
39
40
41
42
43
44
&nbsp;&nbsp;<FONT SIZE=1><A HREF="SelectFont.html" TARGET=Manual>SelectFont</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="SelectColor.html" TARGET=Manual>SelectColor</A></FONT><BR>
<FONT SIZE=1><STRONG>Commands Classes</STRONG></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="Widget.html" TARGET=Manual>Widget</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DynamicHelp.html" TARGET=Manual>DynamicHelp</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DragSite.html" TARGET=Manual>DragSite</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DropSite.html" TARGET=Manual>DropSite</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="BWidget.html" TARGET=Manual>BWidget</A></FONT><BR>
</BODY></HTML>







|

36
37
38
39
40
41
42
43
44
&nbsp;&nbsp;<FONT SIZE=1><A HREF="SelectFont.html" TARGET=Manual>SelectFont</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="SelectColor.html" TARGET=Manual>SelectColor</A></FONT><BR>
<FONT SIZE=1><STRONG>Commands Classes</STRONG></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="Widget.html" TARGET=Manual>Widget</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DynamicHelp.html" TARGET=Manual>DynamicHelp</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DragSite.html" TARGET=Manual>DragSite</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="DropSite.html" TARGET=Manual>DropSite</A></FONT><BR>
&nbsp;&nbsp;<FONT SIZE=1><A HREF="BWidget.html" TARGET=Manual>Utilities</A></FONT><BR>
</BODY></HTML>

Changes to BWman/slab.html.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<HTML>
<HEAD><TITLE>Slab and BWidget</TITLE></HEAD>
<BODY BGCOLOR=white>

<P><B><A NAME="a"></A>The Slab Library</B><BR></P>
<P>
<B>Slab</B> (<I>Snit Library, Almost BWidget</I>) is a port of most of <B>BWidget</B> to Snit.<BR>
<BR>
The <B>BWidget</B> code is mature and well written, and has been retained wherever possible, with conversion of obsolete idioms to Tcl 8.5+.<BR>
<BR>
The following widgets, and all their dependencies, have been ported to Snit:
<UL>
<LI><A HREF="ArrowButton.html" TARGET=Manual>ArrowButton</A></LI>
<LI><A HREF="Button.html" TARGET=Manual>Button</A></LI>






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
<HTML>
<HEAD><TITLE>Slab and BWidget</TITLE></HEAD>
<BODY BGCOLOR=white>

<P><B><A NAME="a"></A>The Slab Library</B><BR></P>
<P>
<B>Slab</B> (<I>Snit Library, Almost BWidget</I>) is a port of most of <B>BWidget</B> to Snit. Unported parts are retained in their <B>BWidget</B> form.<BR>
<BR>
The <B>BWidget</B> code is mature and well written, and has been retained wherever possible, with conversion of obsolete idioms to Tcl 8.5+.<BR>
<BR>
The following widgets, and all their dependencies, have been ported to Snit:
<UL>
<LI><A HREF="ArrowButton.html" TARGET=Manual>ArrowButton</A></LI>
<LI><A HREF="Button.html" TARGET=Manual>Button</A></LI>

Changes to Slab/ArrowButton-999.tm.

171
172
173
174
175
176
177

178

179
180
181
182
183
184
185
186
187
    set _my_theme [Slab::Widget::theme]

    $hull configure -borderwidth 0 -highlightthickness 0

    # Create the canvas with the initial options
    install MyCanvas using canvas $win.c -borderwidth 1 -highlightthickness 1 -relief raised -highlightbackground #ffffff


    install MyDynamicHelper using Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts

    $MyDynamicHelper attach  $win $win.c
    $MyDynamicHelper include balloon

    $self configurelist $args
    $win.c configure -relief [$self cget -relief]

    # Compute the width and height of the canvas from the width/height
    # of the ArrowButton and the borderwidth/hightlightthickness.
    set w   [$self cget -width]







>
|
>

<







171
172
173
174
175
176
177
178
179
180
181

182
183
184
185
186
187
188
    set _my_theme [Slab::Widget::theme]

    $hull configure -borderwidth 0 -highlightthickness 0

    # Create the canvas with the initial options
    install MyCanvas using canvas $win.c -borderwidth 1 -highlightthickness 1 -relief raised -highlightbackground #ffffff

    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $win $win.c


    $self configurelist $args
    $win.c configure -relief [$self cget -relief]

    # Compute the width and height of the canvas from the width/height
    # of the ArrowButton and the borderwidth/hightlightthickness.
    set w   [$self cget -width]

Changes to Slab/Bitmap/BuiltIn-999.tm.

1
2
3
4
5
6
7
8
9
# ------------------------------------------------------------------------------
#  BuiltIn-1.9.11.tm
#  This file is part of Unifix BWidget Toolkit
#  Converted from files in the "images" directory.
# ------------------------------------------------------------------------------
#  Index of commands:
#  Photo Images:
#     - ::Slab::Bitmap::BuiltIn::bold
#     - ::Slab::Bitmap::BuiltIn::copy

|







1
2
3
4
5
6
7
8
9
# ------------------------------------------------------------------------------
#  BuiltIn-*.tm
#  This file is part of Unifix BWidget Toolkit
#  Converted from files in the "images" directory.
# ------------------------------------------------------------------------------
#  Index of commands:
#  Photo Images:
#     - ::Slab::Bitmap::BuiltIn::bold
#     - ::Slab::Bitmap::BuiltIn::copy

Changes to Slab/Button-999.tm.

158
159
160
161
162
163
164

165

166
167
168
169
170
171
172
173
174
        ::Slab::replaceBindtag $win TButton BwButton
    } else {
        installhull using button
        set hullIfTk $hull
        ::Slab::replaceBindtag $win Button BwButton
    }


    install MyDynamicHelper using Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts

    $MyDynamicHelper attach  $win $win
    $MyDynamicHelper include balloon

    $self configurelist $args

    # Configure the hull.
    $self _set_option -state        [$self cget -state]        1
    $self _set_option -textvariable [$self cget -textvariable] 1








>
|
>

<







158
159
160
161
162
163
164
165
166
167
168

169
170
171
172
173
174
175
        ::Slab::replaceBindtag $win TButton BwButton
    } else {
        installhull using button
        set hullIfTk $hull
        ::Slab::replaceBindtag $win Button BwButton
    }

    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $win $win


    $self configurelist $args

    # Configure the hull.
    $self _set_option -state        [$self cget -state]        1
    $self _set_option -textvariable [$self cget -textvariable] 1

Changes to Slab/DragSite-999.tm.

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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
...
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
#  Object Slab::DragSite::Dragger
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DragSite::Dragger {

    method include {kind event} {
        set MyChanged 1
        $self configure -dragtype  $kind
        $self configure -dragevent $event
        return
    }

    method attach {path subpath initcmd} {
        set My(path)     $path
        set My(subpath)  $subpath
        set My(initcmd)  $initcmd
        $self _drag_changed
        $self _setdrag
        return
    }

    variable My -array {}
    # Elements:
    #    path
    #    subpath
    #    initcmd

    option -dragenabled  -default 0   -type snit::boolean                 -configuremethod _set_option
    option -draginitcmd  -default {}
    option -dragendcmd   -default {}                                      -configuremethod _set_option
    option -dragtype     -default {}
    option -dragevent    -default 1   -type {snit::enum -values {1 2 3}}  -configuremethod _set_option

    variable MyChanged 1

    constructor {args} {

        return SET_BY_SNIT
    }

    method _set_option {opt val} {
        if {$opt ni {-dragenabled -dragevent -dragendcmd}} {
            return -code error "bad option \"$opt\" in method _set_option"
        }

        set OldVal $options($opt)

        if {$opt eq {-dragenabled}} {
            # Record Boolean values as 0 or 1
            set val [expr {$val && $val}]
        }

        if {($opt in {-dragenabled -dragevent -dragendcmd}) && ($OldVal ne $val)} {
            set MyChanged 1
        }

        set options($opt) $val

        if {[info exists [myvar My(path)]] && [$self _drag_changed]} {
            $self _setdrag
................................................................................
    # classes.
    # The caller, which is in this object, does the testing itself and calls
    # only when change is needed.
    # --------------------------------------------------------------------------

    method _setdrag {} {
        if {[$self cget -dragenabled]} {
            Slab::DragSite::register $My(subpath)  \
                -draginitcmd $My(initcmd)             \
                -dragendcmd  [$self cget -dragendcmd] \
                -dragevent   [$self cget -dragevent]
        } else {
            Slab::DragSite::register $My(subpath)
        }
        return
    }








<
<
<
<
<
<
<
|


<









<


|

|





>




<
<
<
<







|







 







|
|
|







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
351
352
353
...
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
#  Object Slab::DragSite::Dragger
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DragSite::Dragger {








    method attach {path subpath} {
        set My(path)     $path
        set My(subpath)  $subpath

        $self _drag_changed
        $self _setdrag
        return
    }

    variable My -array {}
    # Elements:
    #    path
    #    subpath


    option -dragenabled  -default 0   -type snit::boolean                 -configuremethod _set_option
    option -draginitcmd  -default {}                                      -configuremethod _set_option
    option -dragendcmd   -default {}                                      -configuremethod _set_option
    option -dragtype     -default {}                                      -configuremethod _set_option
    option -dragevent    -default 1   -type {snit::enum -values {1 2 3}}  -configuremethod _set_option

    variable MyChanged 1

    constructor {args} {
        $self configurelist $args
        return SET_BY_SNIT
    }

    method _set_option {opt val} {




        set OldVal $options($opt)

        if {$opt eq {-dragenabled}} {
            # Record Boolean values as 0 or 1
            set val [expr {$val && $val}]
        }

        if {$OldVal ne $val} {
            set MyChanged 1
        }

        set options($opt) $val

        if {[info exists [myvar My(path)]] && [$self _drag_changed]} {
            $self _setdrag
................................................................................
    # classes.
    # The caller, which is in this object, does the testing itself and calls
    # only when change is needed.
    # --------------------------------------------------------------------------

    method _setdrag {} {
        if {[$self cget -dragenabled]} {
            Slab::DragSite::register $My(subpath)      \
                -draginitcmd [$self cget -draginitcmd] \
                -dragendcmd  [$self cget -dragendcmd]  \
                -dragevent   [$self cget -dragevent]
        } else {
            Slab::DragSite::register $My(subpath)
        }
        return
    }

Changes to Slab/DropSite-999.tm.

538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575

576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
...
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
#  Object Slab::DropSite::Dropper
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DropSite::Dropper {

    method include {types} {
        set MyChanged 1
        $self configure -droptypes  $types
        return
    }

    method attach {path subpath overcmd dropcmd} {
        set My(path)     $path
        set My(subpath)  $subpath
        set My(overcmd)  $overcmd
        set My(dropcmd)  $dropcmd
        $self _drop_changed
        $self _setdrop
        return
    }

    variable My -array {}
    # Elements:
    #    path
    #    subpath
    #    overcmd
    #    dropcmd

    option -dropenabled  -default 0   -type snit::boolean -configuremethod _set_option
    option -dropovercmd  -default {}
    option -dropcmd      -default {}
    option -droptypes    -default {}                      -configuremethod _set_option

    variable MyChanged 1

    constructor {args} {

        return SET_BY_SNIT
    }

    method _set_option {opt val} {
        if {$opt ni {-dropenabled -droptypes}} {
            return -code error "bad option \"$opt\" in method _set_option"
        }

        set OldVal $options($opt)

        if {$opt eq {-dropenabled}} {
            # Record Boolean values as 0 or 1
            set val [expr {$val && $val}]
        }

        if {($opt in {-dropenabled -droptypes}) && ($OldVal ne $val)} {
            set MyChanged 1
        }

        set options($opt) $val

        if {[info exists [myvar My(path)]] && [$self _drop_changed]} {
            $self _setdrop
................................................................................
    # Old args: method _setdrop {path subpath dropover drop}
    # --------------------------------------------------------------------------

    method _setdrop {} {
        if {[$self cget -dropenabled]} {
            Slab::DropSite::register $My(subpath) \
                    -droptypes   [$self cget -droptypes] \
                    -dropcmd     $My(dropcmd)  \
                    -dropovercmd $My(overcmd)
        } else {
            Slab::DropSite::register $My(subpath)
        }
        return
    }

    method dropsite_for_snit {} {







|
<
<
<
<
<
|


<
<









<
<


|
|





>




<
<
<
<







|







 







|
|







538
539
540
541
542
543
544
545





546
547
548


549
550
551
552
553
554
555
556
557


558
559
560
561
562
563
564
565
566
567
568
569
570
571




572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
...
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
#  Object Slab::DropSite::Dropper
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DropSite::Dropper {

    # Set path and subpath this way, not as options -path -subpath.





    method attach {path subpath} {
        set My(path)     $path
        set My(subpath)  $subpath


        $self _drop_changed
        $self _setdrop
        return
    }

    variable My -array {}
    # Elements:
    #    path
    #    subpath



    option -dropenabled  -default 0   -type snit::boolean -configuremethod _set_option
    option -dropovercmd  -default {}                      -configuremethod _set_option
    option -dropcmd      -default {}                      -configuremethod _set_option
    option -droptypes    -default {}                      -configuremethod _set_option

    variable MyChanged 1

    constructor {args} {
        $self configurelist $args
        return SET_BY_SNIT
    }

    method _set_option {opt val} {




        set OldVal $options($opt)

        if {$opt eq {-dropenabled}} {
            # Record Boolean values as 0 or 1
            set val [expr {$val && $val}]
        }

        if {$OldVal ne $val} {
            set MyChanged 1
        }

        set options($opt) $val

        if {[info exists [myvar My(path)]] && [$self _drop_changed]} {
            $self _setdrop
................................................................................
    # Old args: method _setdrop {path subpath dropover drop}
    # --------------------------------------------------------------------------

    method _setdrop {} {
        if {[$self cget -dropenabled]} {
            Slab::DropSite::register $My(subpath) \
                    -droptypes   [$self cget -droptypes] \
                    -dropcmd     [$self cget -dropcmd]   \
                    -dropovercmd [$self cget -dropovercmd]
        } else {
            Slab::DropSite::register $My(subpath)
        }
        return
    }

    method dropsite_for_snit {} {

Changes to Slab/DynamicHelp-999.tm.

1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
....
1231
1232
1233
1234
1235
1236
1237

1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
....
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DynamicHelp::Helper {
    option -helptext -default "" -configuremethod _set_option
    option -helpvar  -default "" -configuremethod _set_option
    option -helpcmd  -default ""
    option -helptype -default balloon -type {snit::enum -values {balloon variable}} -configuremethod _set_option

    variable MyChanged 1

    method include {kind} {
        set MyChanged 1
        $self configure -helptype $kind
        return
    }

    method attach {path subpath args} {
        set My(path)    $path
        set My(subpath) $subpath
        set My(extras)  $args
        $self _help_changed
        $self _sethelp
        return
................................................................................
    variable My -array {}
    # Elements:
    #    path
    #    subpath
    #    extras

    constructor {args} {

        return SET_BY_SNIT
    }

    method _set_option {opt val} {
        if {$opt ni {-helptext -helpvar -helptype}} {
            return -code error "bad option \"$opt\" in method _set_option"
        }

        set OldVal $options($opt)

        if {$OldVal ne $val} {
            set MyChanged 1
        }

        set options($opt) $val
................................................................................
    # --------------------------------------------------------------------------
    #  Method _sethelp
    # --------------------------------------------------------------------------
    # Replacement for command Slab::DynamicHelp::sethelp used by unconverted
    # BWidget classes.
    # Caller (in this object) does the testing itself and calls only when change
    # is needed.
    # Old args: method _sethelp {path subpath}
    # --------------------------------------------------------------------------

    method _sethelp {} {
        switch [$self cget -helptype] {
            balloon {
                return [Slab::DynamicHelp::register $My(subpath) balloon \
                        {*}$My(extras) \







|




<
<
<
<
<
<







 







>




<
<
<
<







 







<







1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215






1216
1217
1218
1219
1220
1221
1222
....
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236




1237
1238
1239
1240
1241
1242
1243
....
1256
1257
1258
1259
1260
1261
1262

1263
1264
1265
1266
1267
1268
1269
# ------------------------------------------------------------------------------

package require snit

snit::type Slab::DynamicHelp::Helper {
    option -helptext -default "" -configuremethod _set_option
    option -helpvar  -default "" -configuremethod _set_option
    option -helpcmd  -default "" -configuremethod _set_option
    option -helptype -default balloon -type {snit::enum -values {balloon variable}} -configuremethod _set_option

    variable MyChanged 1







    method attach {path subpath args} {
        set My(path)    $path
        set My(subpath) $subpath
        set My(extras)  $args
        $self _help_changed
        $self _sethelp
        return
................................................................................
    variable My -array {}
    # Elements:
    #    path
    #    subpath
    #    extras

    constructor {args} {
        $self configurelist $args
        return SET_BY_SNIT
    }

    method _set_option {opt val} {




        set OldVal $options($opt)

        if {$OldVal ne $val} {
            set MyChanged 1
        }

        set options($opt) $val
................................................................................
    # --------------------------------------------------------------------------
    #  Method _sethelp
    # --------------------------------------------------------------------------
    # Replacement for command Slab::DynamicHelp::sethelp used by unconverted
    # BWidget classes.
    # Caller (in this object) does the testing itself and calls only when change
    # is needed.

    # --------------------------------------------------------------------------

    method _sethelp {} {
        switch [$self cget -helptype] {
            balloon {
                return [Slab::DynamicHelp::register $My(subpath) balloon \
                        {*}$My(extras) \

Changes to Slab/Entry-999.tm.

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
...
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
...
494
495
496
497
498
499
500
501


502
503
504
505
506
507
508
509
510
511
512
513
514
515
...
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
...
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
        installhull using ttk::entry
        install hullIfTk using Slab::Entry::NoOption ${selfns}::NoOpt
    }  else  {
        installhull using entry
        set hullIfTk $hull
    }

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts
    $MyDragger attach  $win $win [mymethod _init_drag_cmd]


    $MyDragger include "" 3
    # This calls MyDragger's _setdrag method, the Snit replacement for Slab::DragSite::setdrag.


    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts
    $MyDropper attach $win $win [mymethod _over_cmd] [mymethod _drop_cmd]
    $MyDropper include {


        TEXT    {move {}}
        FGCOLOR {move {}}
        BGCOLOR {move {}}
        COLOR   {move {}}
    }



    install MyDynamicHelper using Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts

    $MyDynamicHelper attach  $win $win
    $MyDynamicHelper include balloon

#    $self configure -draginitcmd [mymethod _init_drag_cmd] -dragendcmd [mymethod _end_drag_cmd]
#    $self configure -dropovercmd [mymethod _over_cmd]      -dropcmd    [mymethod _drop_cmd]
#>ok    Slab::DragSite::setdrag $win $win Slab::Entry::_init_drag_cmd Slab::Entry::_end_drag_cmd 1
#>ok    Slab::DropSite::setdrop $win $win Slab::Entry::_over_cmd Slab::Entry::_drop_cmd 1
#>ok    Slab::DynamicHelp::sethelp $win $win 1

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


# ------------------------------------------------------------------------------
#  Method _init_drag_cmd
# ------------------------------------------------------------------------------

method _init_drag_cmd {path X Y top } {
    set cmd [$self cget -draginitcmd]
    if {$cmd ne {}} {
        return [uplevel \#0 $cmd [list $win $X $Y $top]]
    }
    set kind [$self cget -dragtype]
    if { $kind eq "" } {
        set kind "TEXT"
    }
    set drag [$hull get]
    if { $drag ne "" } {
        if { [$hull selection present] } {
................................................................................
            }
        }
    }
}


# ------------------------------------------------------------------------------
#  Method _end_drag_cmd


# ------------------------------------------------------------------------------

method _end_drag_cmd {path target op kind dnddata result} {
    set cmd [$self cget -dragendcmd]
    if {$cmd ne {}} {
        return [uplevel \#0 $cmd [list $win $target $op $kind $dnddata $result]]
    }
    if { $result && $op eq "move" && $win ne $target } {
        $hull delete $_my(dragstart) $_my(dragend)
    }
}


# ------------------------------------------------------------------------------
................................................................................
# ------------------------------------------------------------------------------

method _drop_cmd {path source X Y op kind dnddata} {
    if { $_my(afterid) ne "" } {
        after cancel $_my(afterid)
        set _my(afterid) ""
    }
    set cmd [$self cget -dropcmd]
    if {$cmd ne {}} {
        set idx [$hull index @[expr {$X-[winfo rootx $win]}]]
        return [uplevel \#0 $cmd [list $win $source $idx $op $kind $dnddata]]
    }
    if { $kind in {COLOR FGCOLOR} } {
        $self configure -foreground $dnddata
    } elseif { $kind eq "BGCOLOR" } {
        $self configure -background $dnddata
    } else {
        $hull icursor @[expr {$X-[winfo rootx $win]}]
        if { $op eq "move" && $win eq $source } {
................................................................................
            after cancel $_my(afterid)
            set _my(afterid) ""
        }
    } elseif { [$self _auto_scroll $x] } {
        return 2
    }

    set cmd [$self cget -dropovercmd]
    if {$cmd ne {}} {
        set x   [expr {$X-[winfo rootx $win]}]
        set idx [$hull index @$x]
        set res [uplevel \#0 $cmd [list $win $source $event $idx $op $kind $dnddata]]
        return $res
    }

    if {$kind in {COLOR FGCOLOR BGCOLOR}} {
        Slab::DropSite::setcursor based_arrow_down
        return 1
    }
    if {    ([$self cget -editable])
         && ([$self cget -state] eq "normal")
         && ($event ne "leave")







|
|
>
>
|
<
>

|
|
<
>
>
|
|
|
|
|
>

>
|
>

<







 







<
<
<
<







 







|
>
>



<
<
<
<







 







<
<
<
<
<







 







<
<
<
<
<
<
<
<







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
...
459
460
461
462
463
464
465




466
467
468
469
470
471
472
...
495
496
497
498
499
500
501
502
503
504
505
506
507




508
509
510
511
512
513
514
...
516
517
518
519
520
521
522





523
524
525
526
527
528
529
...
549
550
551
552
553
554
555








556
557
558
559
560
561
562
        installhull using ttk::entry
        install hullIfTk using Slab::Entry::NoOption ${selfns}::NoOpt
    }  else  {
        installhull using entry
        set hullIfTk $hull
    }

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts \
            -draginitcmd [mymethod _init_drag_cmd] \
            -dragtype    {} \
            -dragevent   3
    $MyDragger attach  $win $win

    # Unused: option -dragendcmd [mymethod _end_drag_cmd]

    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts \
            -dropovercmd [mymethod _over_cmd] \

            -dropcmd     [mymethod _drop_cmd] \
            -droptypes   {
                             TEXT    {move {}}
                             FGCOLOR {move {}}
                             BGCOLOR {move {}}
                             COLOR   {move {}}
                         }
    $MyDropper attach $win $win

    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $win $win


#    $self configure -draginitcmd [mymethod _init_drag_cmd] -dragendcmd [mymethod _end_drag_cmd]
#    $self configure -dropovercmd [mymethod _over_cmd]      -dropcmd    [mymethod _drop_cmd]
#>ok    Slab::DragSite::setdrag $win $win Slab::Entry::_init_drag_cmd Slab::Entry::_end_drag_cmd 1
#>ok    Slab::DropSite::setdrop $win $win Slab::Entry::_over_cmd Slab::Entry::_drop_cmd 1
#>ok    Slab::DynamicHelp::sethelp $win $win 1

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


# ------------------------------------------------------------------------------
#  Method _init_drag_cmd
# ------------------------------------------------------------------------------

method _init_drag_cmd {path X Y top } {




    set kind [$self cget -dragtype]
    if { $kind eq "" } {
        set kind "TEXT"
    }
    set drag [$hull get]
    if { $drag ne "" } {
        if { [$hull selection present] } {
................................................................................
            }
        }
    }
}


# ------------------------------------------------------------------------------
#  Method _end_drag_cmd (UNUSED)
# ------------------------------------------------------------------------------
# Defined only for Slab::Entry (and, by delegation, for Slab::LabelEntry).
# ------------------------------------------------------------------------------

method _end_drag_cmd {path target op kind dnddata result} {




    if { $result && $op eq "move" && $win ne $target } {
        $hull delete $_my(dragstart) $_my(dragend)
    }
}


# ------------------------------------------------------------------------------
................................................................................
# ------------------------------------------------------------------------------

method _drop_cmd {path source X Y op kind dnddata} {
    if { $_my(afterid) ne "" } {
        after cancel $_my(afterid)
        set _my(afterid) ""
    }





    if { $kind in {COLOR FGCOLOR} } {
        $self configure -foreground $dnddata
    } elseif { $kind eq "BGCOLOR" } {
        $self configure -background $dnddata
    } else {
        $hull icursor @[expr {$X-[winfo rootx $win]}]
        if { $op eq "move" && $win eq $source } {
................................................................................
            after cancel $_my(afterid)
            set _my(afterid) ""
        }
    } elseif { [$self _auto_scroll $x] } {
        return 2
    }









    if {$kind in {COLOR FGCOLOR BGCOLOR}} {
        Slab::DropSite::setcursor based_arrow_down
        return 1
    }
    if {    ([$self cget -editable])
         && ([$self cget -state] eq "normal")
         && ($event ne "leave")

Changes to Slab/Label-999.tm.

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
184
185
186
187
188
...
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
...
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
...
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
    }

    # Set the bindtags before calling methods of components that may
    # add to them.
    bindtags $win   [list BwLabel [winfo toplevel $win] all]
    bindtags $win.l [list $win.l $win Label [winfo toplevel $win] all]

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts
    $MyDragger attach  $win $win.l [mytypemethod _init_drag_cmd]


    $MyDragger include {} 1
    # This calls MyDragger's _setdrag method, the Snit replacement for Slab::DragSite::setdrag.

    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts
    $MyDropper attach $win $win.l [mytypemethod _over_cmd] [mytypemethod _drop_cmd]
    $MyDropper include {


        TEXT    {move {}}
        IMAGE   {move {}}
        BITMAP  {move {}}
        FGCOLOR {move {}}
        BGCOLOR {move {}}
        COLOR   {move {}}
    }



    install MyDynamicHelper using Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts -helptype balloon

    $MyDynamicHelper attach  $win $win.l
    $MyDynamicHelper include balloon

    $self configurelist $args

    if {$_my_theme} {
        if {[$self cget -state] ne "normal"} {
            $win.l state disabled
        } else {
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _init_drag_cmd
# ------------------------------------------------------------------------------

typemethod _init_drag_cmd {path X Y top} {
    set path [winfo parent $path]
    if {[set cmd [$path cget -draginitcmd]] ne ""} {
        return [uplevel \#0 $cmd [list $path $X $Y $top]]
    }
    if {[set data [$path.l cget -image]] ne ""} {
        set kind "IMAGE"
        pack [label $top.l -image $data]
    } elseif {(![catch {$path.l cget -bitmap} data]) && ($data ne "")} {
        set kind "BITMAP"
        pack [label $top.l -bitmap $data]
    } else {
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _drop_cmd
# ------------------------------------------------------------------------------

typemethod _drop_cmd {path source X Y op kind data} {
    set path [winfo parent $path]
    if {[set cmd [$path cget -dropcmd]] ne ""} {
        return [uplevel \#0 $cmd [list $path $source $X $Y $op $kind $data]]
    }
    if {$kind eq "COLOR" || $kind eq "FGCOLOR"} {
        configure $path -foreground $data
    } elseif {$kind eq "BGCOLOR"} {
        configure $path -background $data
    } else {
        set text   ""
        set image  ""
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _over_cmd
# ------------------------------------------------------------------------------

typemethod _over_cmd {path source event X Y op kind data} {
    set path [winfo parent $path]
    if {[set cmd [$path cget -dropovercmd]] ne ""} {
        return [uplevel \#0 $cmd [list $path $source $event $X $Y $op $kind $data]]
    }
    if {[$path cget -state] eq "normal" ||
         $kind eq "COLOR" || $kind eq "FGCOLOR" || $kind eq "BGCOLOR"} {
        Slab::DropSite::setcursor based_arrow_down
        return 1
    }
    Slab::DropSite::setcursor dot
    return 0







|
|
>
>
|
<

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

>
|
>

<







 







<
<
<







 







<
<
<







 







<
<
<







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
184
185

186
187
188
189
190
191
192
...
384
385
386
387
388
389
390



391
392
393
394
395
396
397
...
408
409
410
411
412
413
414



415
416
417
418
419
420
421
...
442
443
444
445
446
447
448



449
450
451
452
453
454
455
    }

    # Set the bindtags before calling methods of components that may
    # add to them.
    bindtags $win   [list BwLabel [winfo toplevel $win] all]
    bindtags $win.l [list $win.l $win Label [winfo toplevel $win] all]

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts \
            -draginitcmd [mytypemethod _init_drag_cmd] \
            -dragtype    {} \
            -dragevent   1
    $MyDragger attach  $win $win.l


    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts \
            -dropovercmd [mytypemethod _over_cmd] \

            -dropcmd     [mytypemethod _drop_cmd] \
            -droptypes   {
                             TEXT    {move {}}
                             IMAGE   {move {}}
                             BITMAP  {move {}}
                             FGCOLOR {move {}}
                             BGCOLOR {move {}}
                             COLOR   {move {}}
                         }
    $MyDropper attach $win $win.l

    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $win $win.l


    $self configurelist $args

    if {$_my_theme} {
        if {[$self cget -state] ne "normal"} {
            $win.l state disabled
        } else {
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _init_drag_cmd
# ------------------------------------------------------------------------------

typemethod _init_drag_cmd {path X Y top} {
    set path [winfo parent $path]



    if {[set data [$path.l cget -image]] ne ""} {
        set kind "IMAGE"
        pack [label $top.l -image $data]
    } elseif {(![catch {$path.l cget -bitmap} data]) && ($data ne "")} {
        set kind "BITMAP"
        pack [label $top.l -bitmap $data]
    } else {
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _drop_cmd
# ------------------------------------------------------------------------------

typemethod _drop_cmd {path source X Y op kind data} {
    set path [winfo parent $path]



    if {$kind eq "COLOR" || $kind eq "FGCOLOR"} {
        configure $path -foreground $data
    } elseif {$kind eq "BGCOLOR"} {
        configure $path -background $data
    } else {
        set text   ""
        set image  ""
................................................................................

# ------------------------------------------------------------------------------
#  Typemethod _over_cmd
# ------------------------------------------------------------------------------

typemethod _over_cmd {path source event X Y op kind data} {
    set path [winfo parent $path]



    if {[$path cget -state] eq "normal" ||
         $kind eq "COLOR" || $kind eq "FGCOLOR" || $kind eq "BGCOLOR"} {
        Slab::DropSite::setcursor based_arrow_down
        return 1
    }
    Slab::DropSite::setcursor dot
    return 0

Changes to Slab/ListBox-999.tm.

158
159
160
161
162
163
164
165

166
167
168
169
170
171
172
173
174
...
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
....
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
....
1570
1571
1572
1573
1574
1575
1576







1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
....
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
        return -code error {option -mainitem must not be empty}
    }

    # Use tag H:$item to replace 4 separate helpers and registrations.
    # Tag items with BwHelpBalloon also, because item creation may occur
    # after DynamicHelp registration.
    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts

    $MyDynamicHelper attach  $MyMainWin $MyMainWin.c H:$MyMainItem
    $MyDynamicHelper include balloon

    # -helptext, if supplied, is applied here:
    $self configurelist $args
    return SET_BY_SNIT
}


................................................................................
    set _my(dnd,afterid)  ""
    set _my(dnd,item)     ""

    install _MyCanvas using canvas $win.c -xscrollincrement 8 \
            -relief sunken -borderwidth 2 -takefocus 1 \
            -highlightthickness 1 -width 200

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts
    $MyDragger attach  $win $win.c [mytypemethod _init_drag_cmd]
    $MyDragger include LISTBOX_ITEM 1
    # This calls MyDragger's _setdrag method, the Snit replacement for Slab::DragSite::setdrag


    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts
    $MyDropper attach $win $win.c [mytypemethod _over_cmd] [mytypemethod _drop_cmd]
    $MyDropper include {


        LISTBOX_ITEM {copy {} move {}}
    }
    # This calls MyDropper's _setdrop method, the Snit replacement for Slab::DragSite::setdrop


    # Initialise widgets to default values.
    $hull  configure -background       $options(-background)
    $win.c configure -background       $options(-background)
    $win.c itemconfigure box -fill     $options(-background)
    $win.c configure -selectbackground $options(-selectbackground)
    $win.c configure -selectforeground $options(-selectforeground)
    $win.c configure -height           [expr {$options(-height) * $options(-deltay)}]
    $win.c configure -yscrollincrement $options(-deltay)
    $win.c configure -width            [expr {$options(-width) * 8}]
    $self _redraw_idle 0

    $self configure -dropcmd [mymethod _drag_and_drop]


    $self configurelist $args

    pack $win.c -expand yes -fill both

    set w [$self cget -width]
    set h [$self cget -height]
    set dy [$self cget -deltay]
................................................................................

typemethod _init_drag_cmd {dragPath X Y top} {
    set path [winfo parent $dragPath]
    set ltags [$path.c gettags current]
    set item  [lindex $ltags 0]
    if {$item in {item img win}} {
        set item [$path _get_node_name]
        if {[set cmd [$path cget -draginitcmd]] ne {}} {
            return [uplevel \#0 $cmd [list $path $item $top]]
        }
        if {[set kind [$path cget -dragtype]] eq ""} {
            set kind "LISTBOX_ITEM"
        }
        if {[set img [$path.$item cget -image]] ne ""} {
            pack [label $top.l -image $img -padx 0 -pady 0]
        }
        return [list $kind {copy move link} $item]
................................................................................
    $path _widget_drop_cmd $source $X $Y $op $kind $dnddata
}


# ------------------------------------------------------------------------------
#  Method _widget_drop_cmd
# ------------------------------------------------------------------------------








method _widget_drop_cmd {source X Y op kind dnddata} {
    if {$_my(dnd,afterid) ne {}} {
        after cancel $_my(dnd,afterid)
        set _my(dnd,afterid) ""
    }
    $win.c delete drop
    set _my(dnd,scroll) ""
    if {($_my(dnd,item) ne {}) || ($_my(items) eq {})} {
        if {[set cmd [$self cget -dropcmd]] ne {}} {
            return [uplevel \#0 $cmd [list $win $source $_my(dnd,item) $op $kind $dnddata]]
        }
    }
    return 0
}


# ------------------------------------------------------------------------------
#  Typemethod _over_cmd
................................................................................
                lappend target "position"
            } else {
                lappend target "item"
            }
        }
    }

    if {$vmode && ([set cmd [$self cget -dropovercmd]] ne {})} {
        # user-defined dropover command
        set res   [uplevel \#0 $cmd [list $source $target $op $kind $dnddata]]
        set code  [lindex $res 0]
        set vmode 0
        if {$code & 1} {
            # update vmode
            switch -exact -- [lindex $res 1] {
                item     {set vmode 1}
                position {set vmode 2}
                widget   {set vmode 4}
            }
        }
    } else {
        if {($vmode & 3) == 3} {
            # result have both item and position
            # we choose the preferred method
            if {[lindex $target 3] eq "position"} {
                set vmode [expr {$vmode & ~1}]
            } else {
                set vmode [expr {$vmode & ~2}]







|
>

<







 







|
|
|
|
>

|
|
<
>
>
|
|
<
>












|
>
>







 







<
<
<







 







>
>
>
>
>
>
>









<
|
<







 







|
<
<
<
<
<
<
<
<
<
<
<
<
<







158
159
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
...
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
....
1546
1547
1548
1549
1550
1551
1552



1553
1554
1555
1556
1557
1558
1559
....
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593

1594

1595
1596
1597
1598
1599
1600
1601
....
1721
1722
1723
1724
1725
1726
1727
1728













1729
1730
1731
1732
1733
1734
1735
        return -code error {option -mainitem must not be empty}
    }

    # Use tag H:$item to replace 4 separate helpers and registrations.
    # Tag items with BwHelpBalloon also, because item creation may occur
    # after DynamicHelp registration.
    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $MyMainWin $MyMainWin.c H:$MyMainItem


    # -helptext, if supplied, is applied here:
    $self configurelist $args
    return SET_BY_SNIT
}


................................................................................
    set _my(dnd,afterid)  ""
    set _my(dnd,item)     ""

    install _MyCanvas using canvas $win.c -xscrollincrement 8 \
            -relief sunken -borderwidth 2 -takefocus 1 \
            -highlightthickness 1 -width 200

    install MyDragger using Slab::DragSite::Dragger ${selfns}::keepDragOpts \
            -draginitcmd [mytypemethod _init_drag_cmd] \
            -dragtype    LISTBOX_ITEM \
            -dragevent   1
    $MyDragger attach  $win $win.c

    install MyDropper using Slab::DropSite::Dropper ${selfns}::keepDropOpts \
            -dropovercmd [mytypemethod _over_cmd] \

            -dropcmd     [mytypemethod _drop_cmd] \
            -droptypes   {
                             LISTBOX_ITEM {copy {} move {}}
                         }

    $MyDropper attach $win $win.c

    # Initialise widgets to default values.
    $hull  configure -background       $options(-background)
    $win.c configure -background       $options(-background)
    $win.c itemconfigure box -fill     $options(-background)
    $win.c configure -selectbackground $options(-selectbackground)
    $win.c configure -selectforeground $options(-selectforeground)
    $win.c configure -height           [expr {$options(-height) * $options(-deltay)}]
    $win.c configure -yscrollincrement $options(-deltay)
    $win.c configure -width            [expr {$options(-width) * 8}]
    $self _redraw_idle 0

    # $self configure -dropcmd [mymethod _drag_and_drop]
    # Wrong API for -dropcmd.  See comments in _widget_drop_cmd.

    $self configurelist $args

    pack $win.c -expand yes -fill both

    set w [$self cget -width]
    set h [$self cget -height]
    set dy [$self cget -deltay]
................................................................................

typemethod _init_drag_cmd {dragPath X Y top} {
    set path [winfo parent $dragPath]
    set ltags [$path.c gettags current]
    set item  [lindex $ltags 0]
    if {$item in {item img win}} {
        set item [$path _get_node_name]



        if {[set kind [$path cget -dragtype]] eq ""} {
            set kind "LISTBOX_ITEM"
        }
        if {[set img [$path.$item cget -image]] ne ""} {
            pack [label $top.l -image $img -padx 0 -pady 0]
        }
        return [list $kind {copy move link} $item]
................................................................................
    $path _widget_drop_cmd $source $X $Y $op $kind $dnddata
}


# ------------------------------------------------------------------------------
#  Method _widget_drop_cmd
# ------------------------------------------------------------------------------
# The default "drop command" was once configured in the constructor with
#     $self configure -dropcmd [mymethod _drag_and_drop]
# This is now hardcoded here, because this is not
# the common meaning of -dropcmd.  If flexibility is needed, must either
# set -dropcmd to an alternative to [mytypemethod _drop_cmd], or define
# another option (e.g. -dndcmd) to set an alternative to method _drag_and_drop.
# ------------------------------------------------------------------------------

method _widget_drop_cmd {source X Y op kind dnddata} {
    if {$_my(dnd,afterid) ne {}} {
        after cancel $_my(dnd,afterid)
        set _my(dnd,afterid) ""
    }
    $win.c delete drop
    set _my(dnd,scroll) ""
    if {($_my(dnd,item) ne {}) || ($_my(items) eq {})} {

        return [uplevel \#0 [list $self _drag_and_drop $win $source $_my(dnd,item) $op $kind $dnddata]]

    }
    return 0
}


# ------------------------------------------------------------------------------
#  Typemethod _over_cmd
................................................................................
                lappend target "position"
            } else {
                lappend target "item"
            }
        }
    }

    if 1 {













        if {($vmode & 3) == 3} {
            # result have both item and position
            # we choose the preferred method
            if {[lindex $target 3] eq "position"} {
                set vmode [expr {$vmode & ~1}]
            } else {
                set vmode [expr {$vmode & ~2}]

Changes to Slab/NoteBook-999.tm.

224
225
226
227
228
229
230
231

232
233
234
235
236
237
238
239
240

    # My $win is the NoteBook's $win.f$page
    set fpage [lindex [split $win .] end]
    set page  [string range $fpage 1 end]

    set nb        [::Slab::winfoParent $win]
    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts -helptype balloon

    $MyDynamicHelper attach  $nb $nb.c p:$page
    $MyDynamicHelper include balloon

    $self configurelist $args
    return SET_BY_SNIT
}


method hullConfigure {args} {







|
>

<







224
225
226
227
228
229
230
231
232
233

234
235
236
237
238
239
240

    # My $win is the NoteBook's $win.f$page
    set fpage [lindex [split $win .] end]
    set page  [string range $fpage 1 end]

    set nb        [::Slab::winfoParent $win]
    install MyDynamicHelper using \
            Slab::DynamicHelp::Helper ${selfns}::keepDynHelpOpts \
            -helptype balloon
    $MyDynamicHelper attach  $nb $nb.c p:$page


    $self configurelist $args
    return SET_BY_SNIT
}


method hullConfigure {args} {

Changes to Slab/SelectColor-999.tm.

584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
        set helpWords         [lindex [Slab::SelectColor::_getname {Hover For Help:}] 0]
        set mouseWord       " [lindex [Slab::SelectColor::_getname {Mouse Help}] 0] "
        set keyboardWord    " [lindex [Slab::SelectColor::_getname {Keyboard Help}] 0] "
        set mouseHelpText     [lindex [Slab::SelectColor::_getname {Mouse Help Text}] 0]
        set keyboardHelpText  [lindex [Slab::SelectColor::_getname {Keyboard Help Text}] 0]

        frame $win.help
        label $win.help.0 -text $helpWords    -relief flat   -bd 2
        label $win.help.1 -text $mouseWord    -relief groove -bd 2
        label $win.help.2 -text $keyboardWord -relief groove -bd 2
        pack  $win.help.0 $win.help.1 $win.help.2 \
                -anchor center -pady 4 -side left -padx 5
        Slab::DynamicHelp::add $win.help.1 -text $mouseHelpText
        Slab::DynamicHelp::add $win.help.2 -text $keyboardHelpText
    }







|







584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
        set helpWords         [lindex [Slab::SelectColor::_getname {Hover For Help:}] 0]
        set mouseWord       " [lindex [Slab::SelectColor::_getname {Mouse Help}] 0] "
        set keyboardWord    " [lindex [Slab::SelectColor::_getname {Keyboard Help}] 0] "
        set mouseHelpText     [lindex [Slab::SelectColor::_getname {Mouse Help Text}] 0]
        set keyboardHelpText  [lindex [Slab::SelectColor::_getname {Keyboard Help Text}] 0]

        frame $win.help
        label $win.help.0 -text $helpWords    -relief flat   -bd 2 -justify left
        label $win.help.1 -text $mouseWord    -relief groove -bd 2
        label $win.help.2 -text $keyboardWord -relief groove -bd 2
        pack  $win.help.0 $win.help.1 $win.help.2 \
                -anchor center -pady 4 -side left -padx 5
        Slab::DynamicHelp::add $win.help.1 -text $mouseHelpText
        Slab::DynamicHelp::add $win.help.2 -text $keyboardHelpText
    }

Changes to Slab/Utils-999.tm.

752
753
754
755
756
757
758









759
760
761
762
763
764
765
# ----------------------------------------------------------------------------
#  Command Slab::Widget::focusOK
#  Same as tk_focusOK, but handles -editable option and whole tags list.
# ----------------------------------------------------------------------------
# The tk_focusOK command is now obsolete, but options(n) for -takefocus
# describes how it is used by the Tk traversal algorithm, and it is similar to
# this.









# ----------------------------------------------------------------------------

proc Slab::Widget::focusOK { w } {
    set code [catch {$w cget -takefocus} value]
    if { $code == 1 } {
        return 0
    }







>
>
>
>
>
>
>
>
>







752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
# ----------------------------------------------------------------------------
#  Command Slab::Widget::focusOK
#  Same as tk_focusOK, but handles -editable option and whole tags list.
# ----------------------------------------------------------------------------
# The tk_focusOK command is now obsolete, but options(n) for -takefocus
# describes how it is used by the Tk traversal algorithm, and it is similar to
# this.
# IF     (option -takefocus exists)
#    AND (-takefocus has value {}, OR the value is a command that returns {});
#    AND (the window is viewable);
#    AND (option -state exists AND the value is NOT "disabled");
# THEN do the following:
#    IF (option -editable exists AND has value 0) THEN return 0;
#    ELSEIF (a bindtag other than all or the toplevel has a binding to any
#          Key) THEN return 1;
#    ELSE return 0.
# ----------------------------------------------------------------------------

proc Slab::Widget::focusOK { w } {
    set code [catch {$w cget -takefocus} value]
    if { $code == 1 } {
        return 0
    }

Changes to Slab/lang/es-999.tm.

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
namespace eval SelectColor {
    ::msgcat::mcset es {Base Colors}      {Colores base}
    ::msgcat::mcset es {User Colors}      {Colores de usuario}

    ::msgcat::mcset es {Select a Color}   {Select a Color}
    ::msgcat::mcset es {Your Selection}   {Su selección}
    ::msgcat::mcset es {Color Selectors}  {Selectores de color}
    ::msgcat::mcset es {Hover For Help:}  {Pase el ratón por encima para obtener ayuda
con la selección de color mediante:}
    ::msgcat::mcset es {Mouse Help}        Ratón
    ::msgcat::mcset es {Keyboard Help}     Teclado

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset es {Mouse Help Text}  [string trim [string map {{    } {}} {







<
|







61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
namespace eval SelectColor {
    ::msgcat::mcset es {Base Colors}      {Colores base}
    ::msgcat::mcset es {User Colors}      {Colores de usuario}

    ::msgcat::mcset es {Select a Color}   {Select a Color}
    ::msgcat::mcset es {Your Selection}   {Su selección}
    ::msgcat::mcset es {Color Selectors}  {Selectores de color}

    ::msgcat::mcset es {Hover For Help:}  "Pase el ratón por encima para obtener\nayuda con la selección de color mediante:"
    ::msgcat::mcset es {Mouse Help}        Ratón
    ::msgcat::mcset es {Keyboard Help}     Teclado

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset es {Mouse Help Text}  [string trim [string map {{    } {}} {

Changes to Slab/lang/fr-999.tm.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace eval SelectColor {
    ::msgcat::mcset fr {Base Colors}      {Couleurs de Base}
    ::msgcat::mcset fr {User Colors}      {Couleurs utilisateur}

    ::msgcat::mcset fr {Select a Color}   {Sélectionnez une Couleur}
    ::msgcat::mcset fr {Your Selection}   {Votre Sélection}
    ::msgcat::mcset fr {Color Selectors}  {Sélecteurs de Couleurs}
    ::msgcat::mcset fr {Hover For Help:}  {Passez la souris sur les boutons pour afficher l'aide à l'utilisation:}
    ::msgcat::mcset fr {Mouse Help}       {Souris}
    ::msgcat::mcset fr {Keyboard Help}    {Clavier}

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset fr {Mouse Help Text}  [string trim [string map {{    } {}} {







|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace eval SelectColor {
    ::msgcat::mcset fr {Base Colors}      {Couleurs de Base}
    ::msgcat::mcset fr {User Colors}      {Couleurs utilisateur}

    ::msgcat::mcset fr {Select a Color}   {Sélectionnez une Couleur}
    ::msgcat::mcset fr {Your Selection}   {Votre Sélection}
    ::msgcat::mcset fr {Color Selectors}  {Sélecteurs de Couleurs}
    ::msgcat::mcset fr {Hover For Help:}  "Passez la souris sur les boutons pour\nafficher l'aide à l'utilisation:"
    ::msgcat::mcset fr {Mouse Help}       {Souris}
    ::msgcat::mcset fr {Keyboard Help}    {Clavier}

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset fr {Mouse Help Text}  [string trim [string map {{    } {}} {

Changes to Slab/lang/nl-999.tm.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace eval SelectColor {
    ::msgcat::mcset nl {Base Colors}      {Basiskleuren}
    ::msgcat::mcset nl {User Colors}      {Aangepaste kleuren}

    ::msgcat::mcset nl {Select a Color}   {Select a Color}
    ::msgcat::mcset nl {Your Selection}   {Uw selectie}
    ::msgcat::mcset nl {Color Selectors}  {Selecteren kleuren}
    ::msgcat::mcset nl {Hover For Help:}  {Houd de muis erboven voor informatie over kleurselectie met:}
    ::msgcat::mcset nl {Mouse Help}        Muis
    ::msgcat::mcset nl {Keyboard Help}     Toetsenbord

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset nl {Mouse Help Text}  [string trim [string map {{    } {}} {







|







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
namespace eval SelectColor {
    ::msgcat::mcset nl {Base Colors}      {Basiskleuren}
    ::msgcat::mcset nl {User Colors}      {Aangepaste kleuren}

    ::msgcat::mcset nl {Select a Color}   {Select a Color}
    ::msgcat::mcset nl {Your Selection}   {Uw selectie}
    ::msgcat::mcset nl {Color Selectors}  {Selecteren kleuren}
    ::msgcat::mcset nl {Hover For Help:}  "Houd de muis erboven voor informatie\nover kleurselectie met:"
    ::msgcat::mcset nl {Mouse Help}        Muis
    ::msgcat::mcset nl {Keyboard Help}     Toetsenbord

    # --- dynamic help text for SelectColor dialog.
    # --- Lines 75 chars max after removal of leading spaces.

    ::msgcat::mcset nl {Mouse Help Text}  [string trim [string map {{    } {}} {