author | Claus Gittinger <cg@exept.de> |
Wed, 27 Oct 2010 11:36:26 +0200 | |
changeset 4182 | 46fec1281cbc |
parent 4134 | 3dae6c1fce63 |
child 4195 | 3a80e7b60d37 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
2258 | 12 |
"{ Package: 'stx:libwidg' }" |
13 |
||
0 | 14 |
SelectionInListView subclass:#MenuView |
2498 | 15 |
instanceVariableNames:'selectors args receiver enableFlags disabledFgColor |
16 |
disabledEtchedFgColor onOffFlags subMenus subMenuShown superMenu |
|
17 |
checkColor lineLevel lineInset masterView needResize |
|
18 |
hideOnRelease sizeFixed shortKeys maxShortKeyStringLen actions |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
19 |
checkOnImage checkOffImage blockOfSubMenuShown' |
405
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
20 |
classVariableNames:'DefaultCheckColor DefaultViewBackground DefaultForegroundColor |
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
21 |
DefaultBackgroundColor DefaultDisabledForegroundColor |
2498 | 22 |
DefaultDisabledEtchedForegroundColor |
405
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
23 |
DefaultHilightForegroundColor DefaultHilightBackgroundColor |
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
24 |
DefaultHilightLevel DefaultHilightStyle DefaultHilightFrameColor |
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
25 |
DefaultLineLevel DefaultLineInset DefaultShadowColor |
1532 | 26 |
DefaultLightColor ShowAcceleratorKeys DefaultCheckOnImage |
27 |
DefaultCheckOffImage' |
|
269 | 28 |
poolDictionaries:'' |
29 |
category:'Views-Menus' |
|
0 | 30 |
! |
31 |
||
878 | 32 |
!MenuView class methodsFor:'documentation'! |
3 | 33 |
|
38 | 34 |
copyright |
35 |
" |
|
36 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
59 | 37 |
All Rights Reserved |
38 | 38 |
|
39 |
This software is furnished under a license and may be used |
|
40 |
only in accordance with the terms of that license and with the |
|
41 |
inclusion of the above copyright notice. This software may not |
|
42 |
be provided or otherwise made available to, or used by, any |
|
43 |
other person. No title to or ownership of the software is |
|
44 |
hereby transferred. |
|
45 |
" |
|
46 |
! |
|
47 |
||
3 | 48 |
documentation |
49 |
" |
|
1532 | 50 |
Notice: |
2498 | 51 |
MenuView is going to be obsoleted - use Menu & MenuItem, |
52 |
and display them in a MenuPanel for new applications. |
|
1532 | 53 |
|
63 | 54 |
a menu view used for both pull-down-menus and pop-up-menus (and also, |
831
8af010be0a02
Rename Launcher-->OldLauncher, NewLauncher-->Launcher.
Stefan Vogel <sv@exept.de>
parents:
799
diff
changeset
|
55 |
for nonModal menus, such as the OldLaunchers click-menu). |
38 | 56 |
the action to be performed can be defined either as: |
0 | 57 |
|
38 | 58 |
1) action:aBlockWithOneArg |
59 |
which defines a block to be called with the line number (1..n) |
|
60 |
of the selected line. |
|
0 | 61 |
|
119 | 62 |
2) selectors:selectorArray [args: argArray] [receiver:anObject] |
63 |
which defines the messages to be sent to the model or |
|
64 |
receiver. Giving an explicit receiver overrides the model. |
|
0 | 65 |
|
38 | 66 |
It is also possible to define both actionBlock and selectorArray. |
0 | 67 |
|
63 | 68 |
The wellknown popups are created by wrapping a MenuView into an instance of |
69 |
PopUpMenu (read the description of popupmenu). |
|
70 |
||
38 | 71 |
menu entries starting with '\c' are check-entries. |
131 | 72 |
menu entries starting with '\b' are checkBox-entries. |
73 |
menu entries starting with '\t' are thumbUp/Down-entries. |
|
38 | 74 |
menu entries conisting of '-' alone, are separating lines. |
63 | 75 |
menu entries conisting of '=' alone, are double separating lines. |
130 | 76 |
|
77 |
||
78 |
StyleSheet defaults: |
|
79 |
||
1532 | 80 |
menuFont font to use for menus |
81 |
||
82 |
menuViewBackground view background (should be same as menuBackgroundColor) |
|
83 |
menuForegroundColor foreground color |
|
84 |
menuBackgroundColor background color |
|
85 |
||
86 |
menuShadowColor shadow color for 3D effects |
|
87 |
menuLightColor lightColor for 3D effects |
|
88 |
menuHilightForegroundColor hilighted items foregroundColor |
|
89 |
menuHilightBackgroundColor hilighted items backgroundColor |
|
90 |
||
91 |
menuHilightFrameColor frame arounf hilighted items (or nil, if none) |
|
92 |
defaults to selectionHilightFrameColor |
|
93 |
menuHilightLevel 3D level of selected items |
|
94 |
menuHilightStyle #openwin or nil (special kludge) |
|
95 |
menuSeparatingLineLevel 3D level of sep. lines |
|
96 |
menuSeparatingLineInset left/right inset of sep. lines |
|
97 |
menuDisabledForegroundColor foreground color of disabled items |
|
98 |
menuCheckColor color to use for check marks |
|
99 |
menuFont font to use |
|
130 | 100 |
|
101 |
other values and some defaults are inherited via SelectionInListViews |
|
102 |
styles (i.e. look for selectionForegroundColor ...) |
|
586 | 103 |
|
104 |
[author:] |
|
1532 | 105 |
Claus Gittinger |
593 | 106 |
|
107 |
[see also:] |
|
1532 | 108 |
PopUpMenu PullDownMenu |
109 |
ClickMenuView |
|
110 |
LineMenu PatternMenu |
|
63 | 111 |
" |
112 |
! |
|
21 | 113 |
|
63 | 114 |
examples |
115 |
" |
|
405
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
116 |
See real examples in PopUpMenu & PullDownMenu |
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
117 |
|
45 | 118 |
Examples: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
119 |
Notice: normally, menuviews are wrapped into either a popup- |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
120 |
menu or pulldown-menu. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
121 |
But they can also be used stand-alone as in the following examples: |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
122 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
123 |
[exBegin] |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
124 |
|m| |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
125 |
m := MenuView |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
126 |
labels:#('foo' |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
127 |
'bar' |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
128 |
'baz') |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
129 |
selectors:#( |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
130 |
#foo |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
131 |
#bar |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
132 |
#baz) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
133 |
receiver:nil. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
134 |
m open |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
135 |
[exEnd] |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
136 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
137 |
[exBegin] |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
138 |
|m| |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
139 |
m := MenuView |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
140 |
labels:#('foo' |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
141 |
'bar' |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
142 |
'baz') |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
143 |
selectors:#foo: |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
144 |
args:#(1 2 3) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
145 |
receiver:nil. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
146 |
m open |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
147 |
[exEnd] |
3 | 148 |
" |
202 | 149 |
! ! |
150 |
||
878 | 151 |
!MenuView class methodsFor:'instance creation'! |
202 | 152 |
|
748 | 153 |
forMenu:aTopMenu |
154 |
"create and return a new menuView, which will be contained in |
|
155 |
aTopMenus superView" |
|
156 |
||
157 |
aTopMenu isNil ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
158 |
^ self new |
748 | 159 |
]. |
160 |
^ self in:(aTopMenu superView). |
|
161 |
||
162 |
"Created: 5.6.1996 / 11:29:27 / cg" |
|
163 |
! |
|
164 |
||
202 | 165 |
labels:labels |
166 |
"create and return a new MenuView. The parent view, |
|
167 |
selectors and receiver should be set later." |
|
168 |
||
169 |
^ self labels:labels selectors:nil args:nil receiver:nil |
|
170 |
! |
|
171 |
||
172 |
labels:labels selector:aSelector args:argArray receiver:anObject for:aTopMenu |
|
173 |
"create and return a new MenuView |
|
174 |
- receiverObject gets message aSelector with argument from |
|
175 |
argArray for ALL entries" |
|
176 |
||
177 |
"OBSOLETE protocol: labels:selectors:args:receiver: knows how to handle a |
|
178 |
single symbol-arg for selectors ..." |
|
179 |
||
180 |
^ self labels:labels selectors:aSelector args:argArray receiver:anObject in:(aTopMenu superView) |
|
181 |
! |
|
182 |
||
183 |
labels:labels selector:aSelector args:argArray receiver:anObject in:aTopMenu |
|
184 |
"create and return a new MenuView |
|
185 |
- receiverObject gets message aSelector with argument from |
|
186 |
argArray for all entries" |
|
187 |
||
188 |
"OBSOLETE protocol: labels:selectors:args:receiver: knows how to handle a |
|
189 |
single symbol-arg for selectors ..." |
|
190 |
||
191 |
^ self labels:labels selectors:aSelector args:argArray receiver:anObject in:aTopMenu |
|
192 |
! |
|
193 |
||
194 |
labels:labels selectors:selArray |
|
195 |
"create and return a new MenuView. The parent veiw |
|
196 |
and receiver should be set later." |
|
197 |
||
198 |
^ self labels:labels selectors:selArray args:nil receiver:nil |
|
199 |
! |
|
200 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
201 |
labels:labels selectors:selArray accelerators:shorties |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
202 |
"create and return a new MenuView. The parent veiw |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
203 |
and receiver should be set later." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
204 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
205 |
^ self labels:labels selectors:selArray accelerators:shorties args:nil receiver:nil |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
206 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
207 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
208 |
labels:labels selectors:selArray accelerators:shorties args:argArray receiver:anObject |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
209 |
"create and return a new MenuView. The parent view |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
210 |
should be set later." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
211 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
212 |
^ (self new) |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
213 |
labels:labels |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
214 |
selectors:selArray |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
215 |
accelerators:shorties |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
216 |
args:argArray |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
217 |
receiver:anObject |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
218 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
219 |
|
750 | 220 |
labels:labels selectors:selArray accelerators:shorties args:argArray receiver:anObject for:aTopMenu |
221 |
"create and return a new MenuView for a topMenu" |
|
222 |
||
223 |
^ self labels:labels selectors:selArray accelerators:shorties args:argArray receiver:anObject in:(aTopMenu superView) |
|
224 |
||
225 |
"Created: 5.6.1996 / 16:51:46 / cg" |
|
226 |
! |
|
227 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
228 |
labels:labels selectors:selArray accelerators:shorties args:argArray receiver:anObject in:aView |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
229 |
"create and return a new MenuView in aView |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
230 |
- receiverObject gets message from selectorArray with argument |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
231 |
from argArray" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
232 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
233 |
^ (self in:aView) |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
234 |
labels:labels |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
235 |
selectors:selArray |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
236 |
accelerators:shorties |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
237 |
args:argArray |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
238 |
receiver:anObject |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
239 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
240 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
241 |
labels:labels selectors:selArray accelerators:shorties receiver:anObject |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
242 |
"create and return a new MenuView. The parent view |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
243 |
should be set later." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
244 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
245 |
^ self labels:labels selectors:selArray accelerators:shorties args:nil receiver:anObject |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
246 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
247 |
|
202 | 248 |
labels:labels selectors:selArray args:argArray |
249 |
"create and return a new MenuView. The parent view |
|
250 |
should be set later." |
|
251 |
||
252 |
^ self labels:labels selectors:selArray args:argArray |
|
253 |
! |
|
254 |
||
255 |
labels:labels selectors:selArray args:argArray receiver:anObject |
|
256 |
"create and return a new MenuView. The parent view |
|
257 |
should be set later." |
|
258 |
||
259 |
^ (self new) |
|
260 |
labels:labels |
|
261 |
selectors:selArray |
|
262 |
args:argArray |
|
263 |
receiver:anObject |
|
264 |
! |
|
265 |
||
266 |
labels:labels selectors:selArray args:argArray receiver:anObject for:aTopMenu |
|
267 |
"create and return a new MenuView for a topMenu" |
|
268 |
||
269 |
^ self labels:labels selectors:selArray args:argArray receiver:anObject in:(aTopMenu superView) |
|
270 |
! |
|
271 |
||
272 |
labels:labels selectors:selArray args:argArray receiver:anObject in:aView |
|
273 |
"create and return a new MenuView in aView |
|
274 |
- receiverObject gets message from selectorArray with argument |
|
275 |
from argArray" |
|
276 |
||
277 |
^ (self in:aView) |
|
278 |
labels:labels |
|
279 |
selectors:selArray |
|
280 |
args:argArray |
|
281 |
receiver:anObject |
|
282 |
! |
|
283 |
||
284 |
labels:labels selectors:selArray receiver:anObject |
|
285 |
"create and return a new MenuView. The parent view |
|
286 |
should be set later." |
|
287 |
||
288 |
^ self labels:labels selectors:selArray args:nil receiver:anObject |
|
289 |
! |
|
290 |
||
291 |
labels:labels selectors:selArray receiver:anObject for:aTopMenu |
|
292 |
^ self labels:labels selectors:selArray args:nil receiver:anObject for:aTopMenu |
|
293 |
! |
|
294 |
||
295 |
labels:labels selectors:selArray receiver:anObject in:aView |
|
296 |
"create and return a new MenuView in aView |
|
297 |
- receiverObject gets message from selectorArray without argument" |
|
298 |
||
299 |
^ self labels:labels selectors:selArray args:nil receiver:anObject in:aView |
|
3 | 300 |
! ! |
0 | 301 |
|
878 | 302 |
!MenuView class methodsFor:'defaults'! |
59 | 303 |
|
461
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
304 |
showAcceleratorKeys |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
305 |
^ ShowAcceleratorKeys ~~ false |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
306 |
|
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
307 |
"Created: 2.3.1996 / 14:52:34 / cg" |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
308 |
"Modified: 2.3.1996 / 14:54:58 / cg" |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
309 |
! |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
310 |
|
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
311 |
showAcceleratorKeys:aBoolean |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
312 |
ShowAcceleratorKeys := aBoolean |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
313 |
|
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
314 |
"Created: 2.3.1996 / 14:52:43 / cg" |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
315 |
! |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
316 |
|
59 | 317 |
updateStyleCache |
445
f4c4d5c1be6b
parse style-resource directive
Claus Gittinger <cg@exept.de>
parents:
435
diff
changeset
|
318 |
"extract values from the styleSheet and cache them in class variables" |
f4c4d5c1be6b
parse style-resource directive
Claus Gittinger <cg@exept.de>
parents:
435
diff
changeset
|
319 |
|
2584
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
320 |
<resource: #style (#'menu.foregroundColor' #'menu.backgroundColor' |
1532 | 321 |
#'menu.viewBackground' |
2584
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
322 |
#'menu.shadowColor' #'menu.lightColor' |
1532 | 323 |
#'menu.hilightForegroundColor' #'menu.hilightBackgroundColor' |
2584
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
324 |
#'menu.hilightFrameColor' #'selection.hilightFrameColor' |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
325 |
#'menu.hilightLevel' #'menu.hilightStyle' |
1532 | 326 |
#'menu.separatingLineLevel' #'menu.separatingLineInset' |
327 |
#'menu.disabledForegroundColor' |
|
328 |
#'menu.checkColor' #'menu.checkOnImage' #'menu.checkOffImage' |
|
329 |
#'menu.font' #'menu.showAccelerators')> |
|
1356 | 330 |
|
1870 | 331 |
DefaultViewBackground := StyleSheet colorAt:#'menu.viewBackground'. |
332 |
DefaultForegroundColor := StyleSheet colorAt:#'menu.foregroundColor'. |
|
333 |
DefaultBackgroundColor := StyleSheet colorAt:#'menu.backgroundColor'. |
|
334 |
DefaultShadowColor := StyleSheet colorAt:#'menu.shadowColor'. |
|
335 |
DefaultLightColor := StyleSheet colorAt:#'menu.lightColor'. |
|
336 |
DefaultHilightForegroundColor := StyleSheet colorAt:#'menu.hilightForegroundColor'. |
|
337 |
DefaultHilightBackgroundColor := StyleSheet colorAt:#'menu.hilightBackgroundColor'. |
|
338 |
DefaultHilightFrameColor := StyleSheet colorAt:#'menu.hilightFrameColor' |
|
339 |
default:(StyleSheet colorAt:#'selection.hilightFrameColor'). |
|
340 |
DefaultHilightLevel := StyleSheet at:#'menu.hilightLevel'. |
|
341 |
DefaultHilightStyle := StyleSheet at:#'menu.hilightStyle'. |
|
342 |
DefaultLineLevel := StyleSheet at:#'menu.separatingLineLevel'. |
|
343 |
DefaultLineInset := StyleSheet at:#'menu.separatingLineInset'. |
|
2584
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
344 |
DefaultDisabledForegroundColor := StyleSheet colorAt:#'menu.disabledForegroundColor' default:nil. |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
345 |
DefaultDisabledForegroundColor isNil ifTrue:[ |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
346 |
DefaultDisabledForegroundColor := StyleSheet colorAt:#'selection.disabledForegroundColor' default:Color darkGray. |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
347 |
DefaultDisabledForegroundColor isNil ifTrue:[ |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
348 |
DefaultDisabledForegroundColor := StyleSheet colorAt:#'button.disabledForegroundColor' default:Color darkGray. |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
349 |
] |
60387225f33c
disabledBGColor-from styleSheet fix
Claus Gittinger <cg@exept.de>
parents:
2575
diff
changeset
|
350 |
]. |
2498 | 351 |
DefaultDisabledEtchedForegroundColor := StyleSheet colorAt:#'menu.disabledEtchedForegroundColor'. |
352 |
DefaultDisabledEtchedForegroundColor isNil ifTrue:[ |
|
353 |
DefaultDisabledEtchedForegroundColor := StyleSheet colorAt:#'button.disabledEtchedForegroundColor'. |
|
354 |
]. |
|
1870 | 355 |
DefaultCheckColor := StyleSheet colorAt:#'menu.checkColor'. |
356 |
DefaultCheckOnImage := StyleSheet at:#'menu.checkOnImage'. |
|
357 |
DefaultCheckOffImage := StyleSheet at:#'menu.checkOffImage'. |
|
358 |
DefaultFont := StyleSheet fontAt:#'menu.font'. |
|
359 |
ShowAcceleratorKeys := StyleSheet at:#'menu.showAccelerators' default:true. |
|
1356 | 360 |
|
1375 | 361 |
" |
362 |
self updateStyleCache |
|
363 |
" |
|
364 |
||
1532 | 365 |
"Modified: / 19.5.1998 / 22:02:30 / cg" |
0 | 366 |
! ! |
367 |
||
136 | 368 |
!MenuView methodsFor:'accessing-behavior'! |
369 |
||
687 | 370 |
action |
371 |
^ actionBlock |
|
372 |
||
373 |
"Created: 25.5.1996 / 15:11:51 / cg" |
|
374 |
! |
|
375 |
||
136 | 376 |
disable:indexOrName |
377 |
"disable an entry" |
|
378 |
||
379 |
self setEnable:indexOrName to:false |
|
380 |
! |
|
381 |
||
269 | 382 |
disableAll |
383 |
"disable all entries" |
|
384 |
||
385 |
self disableAll:selectors |
|
386 |
||
387 |
"Created: 23.12.1995 / 16:56:05 / cg" |
|
388 |
! |
|
389 |
||
136 | 390 |
disableAll:collectionOfIndicesOrNames |
391 |
"disable an collection of entries" |
|
392 |
||
393 |
collectionOfIndicesOrNames do:[:entry | |
|
394 |
self disable:entry |
|
395 |
] |
|
396 |
! |
|
397 |
||
202 | 398 |
enable:indexOrName |
399 |
"enable an entry" |
|
400 |
||
401 |
self setEnable:indexOrName to:true |
|
402 |
! |
|
403 |
||
136 | 404 |
enableAll:collectionOfIndicesOrNames |
405 |
"enable an collection of entries" |
|
406 |
||
407 |
collectionOfIndicesOrNames do:[:entry | |
|
408 |
self enable:entry |
|
409 |
] |
|
410 |
! |
|
411 |
||
202 | 412 |
hideOnRelease:aBoolean |
413 |
hideOnRelease := aBoolean |
|
414 |
! |
|
415 |
||
136 | 416 |
isEnabled:indexOrName |
1033 | 417 |
"return true, if the item at anIndexOrName is enabled" |
418 |
||
136 | 419 |
|index| |
420 |
||
421 |
index := self indexOf:indexOrName. |
|
422 |
index ~~ 0 ifTrue:[ |
|
2433 | 423 |
enableFlags isNil ifTrue:[^ true]. |
424 |
^ enableFlags at:index |
|
136 | 425 |
]. |
426 |
"ask submenus for convenience" |
|
427 |
(indexOrName isNumber not and:[subMenus notNil]) ifTrue:[ |
|
2433 | 428 |
subMenus do:[:m | |
429 |
m notNil ifTrue:[ |
|
430 |
(m isEnabled:indexOrName) ifTrue:[^ true]. |
|
431 |
] |
|
432 |
] |
|
433 |
]. |
|
434 |
^ false |
|
136 | 435 |
! |
436 |
||
437 |
setEnable:indexOrName to:aBoolean |
|
438 |
"enable/disable an entry" |
|
439 |
||
440 |
|index| |
|
441 |
||
442 |
index := self indexOf:indexOrName. |
|
443 |
index ~~ 0 ifTrue:[ |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
444 |
(enableFlags at:index) ~~ aBoolean ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
445 |
enableFlags at:index put:aBoolean. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
446 |
shown ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
447 |
self redrawLine:index |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
448 |
] |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
449 |
] |
136 | 450 |
] ifFalse:[ |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
451 |
"try submenus for convenience" |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
452 |
(indexOrName isNumber not and:[subMenus notNil]) ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
453 |
subMenus do:[:m | |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
454 |
(m notNil and:[m isBlock not]) ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
455 |
m setEnable:indexOrName to:aBoolean |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
456 |
] |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
457 |
] |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
458 |
] |
136 | 459 |
] |
460 |
! ! |
|
461 |
||
462 |
!MenuView methodsFor:'accessing-items'! |
|
7 | 463 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
464 |
accelerators:collectionOfShortKeys |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
465 |
"set the accelerator keys collection. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
466 |
You should pass translated symbolic keys - the menu will automatically |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
467 |
show the untranslated original key sequences." |
0 | 468 |
|
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
469 |
shortKeys := collectionOfShortKeys copy. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
470 |
maxShortKeyStringLen := nil. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
471 |
shown ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
472 |
self resize |
0 | 473 |
] ifFalse:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
474 |
needResize := true |
0 | 475 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
476 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
477 |
"Created: 28.2.1996 / 17:15:31 / cg" |
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
478 |
"Modified: 30.4.1996 / 15:55:14 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
479 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
480 |
|
517
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
481 |
actionAt:indexOrName |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
482 |
"return an individual action" |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
483 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
484 |
|i| |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
485 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
486 |
i := self indexOf:indexOrName. |
878 | 487 |
(actions notNil and:[i ~~ 0]) ifTrue:[^ actions at:i ifAbsent:nil]. |
517
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
488 |
^ nil |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
489 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
490 |
"Created: 24.3.1996 / 17:17:22 / cg" |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
491 |
! |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
492 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
493 |
actionAt:indexOrName put:aBlock |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
494 |
"set an individual action" |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
495 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
496 |
|i| |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
497 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
498 |
i := self indexOf:indexOrName. |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
499 |
i ~~ 0 ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
500 |
actions isNil ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
501 |
actions := OrderedCollection new. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
502 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
503 |
i > actions size ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
504 |
actions grow:i |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
505 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
506 |
actions at:i put:aBlock |
517
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
507 |
] |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
508 |
|
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
509 |
"Created: 24.3.1996 / 17:18:15 / cg" |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
510 |
! |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
511 |
|
3966 | 512 |
actions |
513 |
^ actions |
|
514 |
! |
|
515 |
||
774 | 516 |
actions:aCollectionOfActionBlocks |
517 |
"set all actions" |
|
518 |
||
519 |
actions := aCollectionOfActionBlocks |
|
520 |
||
521 |
"Created: 5.7.1996 / 11:33:09 / cg" |
|
522 |
! |
|
523 |
||
2868 | 524 |
addItemList:list after:itemNameOrSelector |
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
525 |
self addItemList:list resources:nil after:itemNameOrSelector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
526 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
527 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
528 |
addItemList:list resources:resources after:itemNameOrSelector |
2868 | 529 |
self |
530 |
addLabels:(list collect:[:row | row at:1]) |
|
531 |
selectors:(list collect:[:row | row at:2 ifAbsent:nil]) |
|
532 |
accelerators:(list collect:[:row | row at:3 ifAbsent:nil]) |
|
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
533 |
resources:resources |
2868 | 534 |
after:itemNameOrSelector |
535 |
! |
|
536 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
537 |
addLabel:aLabel selector:aSelector |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
538 |
"add another label/selector pair at the end" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
539 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
540 |
self addLabel:aLabel selector:aSelector after:nil |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
541 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
542 |
"Modified: 28.2.1996 / 17:54:11 / cg" |
0 | 543 |
! |
544 |
||
38 | 545 |
addLabel:aLabel selector:aSelector after:aLabelOrSelectorOrNumber |
546 |
"insert another label/selector pair at some place. |
|
547 |
Being very friendly here, allowing label-string, selector or numeric |
|
95 | 548 |
index for the argument aLabelOrSelectorOrNumber. |
549 |
||
550 |
To be independent of the entries label, we recommend you use the selector |
|
551 |
as index; in systems which translate strings for national variants, |
|
552 |
this makes your code easier to maintain." |
|
553 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
554 |
self |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
555 |
addLabels:(Array with:aLabel) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
556 |
selectors:(Array with:aSelector) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
557 |
after:aLabelOrSelectorOrNumber |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
558 |
|
95 | 559 |
" |
560 |
|v1 v2 v3 v4| |
|
561 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
562 |
v1 := CodeView new open. |
95 | 563 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
564 |
v2 := CodeView new open. |
119 | 565 |
v2 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
566 |
(v2 editMenu addLabel:'new entry' selector:#foo after:#pasteSelection; yourself). |
95 | 567 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
568 |
v3 := CodeView new open. |
119 | 569 |
v3 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
570 |
(v3 editMenu addLabel:'new entry' selector:#foo after:#others; yourself). |
95 | 571 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
572 |
v4 := CodeView new open. |
119 | 573 |
v4 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
574 |
(v4 editMenu addLabel:'new entry' selector:#foo after:1; yourself). |
119 | 575 |
" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
576 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
577 |
"Modified: 28.2.1996 / 18:04:35 / cg" |
119 | 578 |
! |
579 |
||
202 | 580 |
addLabel:aLabel selector:aSelector arg:anArg |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
581 |
"add another label/selector/argument trio. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
582 |
OBSOLETE" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
583 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
584 |
|idx| |
202 | 585 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
586 |
idx := list size + 1. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
587 |
self addLabel:aLabel selector:aSelector. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
588 |
args at:idx put:anArg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
589 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
590 |
"Modified: 28.2.1996 / 18:08:39 / cg" |
202 | 591 |
! |
592 |
||
593 |
addLabel:aLabel selector:aSelector before:aLabelOrSelectorOrNumber |
|
594 |
"insert another label/selector pair at some place. |
|
595 |
Being very friendly here, allowing label-string, selector or numeric |
|
596 |
index for the argument aLabelOrSelectorOrNumber. |
|
597 |
||
598 |
To be independent of the entries label, we recommend you use the selector |
|
599 |
as index; in systems which translate strings for national variants, |
|
600 |
this makes your code easier to maintain." |
|
601 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
602 |
self |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
603 |
addLabels:(Array with:aLabel) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
604 |
selectors:(Array with:aSelector) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
605 |
before:aLabelOrSelectorOrNumber |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
606 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
607 |
" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
608 |
|v1 v2 v3 v4 v5| |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
609 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
610 |
v1 := CodeView new open. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
611 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
612 |
v2 := CodeView new open. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
613 |
v2 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
614 |
(v2 editMenu addLabel:'new entry' selector:#foo before:'paste'; yourself). |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
615 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
616 |
v3 := CodeView new open. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
617 |
v3 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
618 |
(v3 editMenu addLabel:'new entry' selector:#foo before:#pasteOrReplace; yourself). |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
619 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
620 |
v4 := CodeView new open. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
621 |
v4 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
622 |
(v4 editMenu addLabel:'new entry' selector:#foo before:#again; yourself). |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
623 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
624 |
v5 := CodeView new open. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
625 |
v5 middleButtonMenu: |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
626 |
(v5 editMenu addLabel:'new entry' selector:#foo before:1; yourself). |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
627 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
628 |
Notice: v2 above is an example on how NOT to do it - it will not work with nationalized menus |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
629 |
" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
630 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
631 |
"Modified: 28.2.1996 / 18:04:00 / cg" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
632 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
633 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
634 |
addLabels:moreLabels selectors:moreSelectors |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
635 |
"add more labels and selectors at the END" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
636 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
637 |
self addLabels:moreLabels selectors:moreSelectors after:nil |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
638 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
639 |
"Modified: 28.2.1996 / 17:46:50 / cg" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
640 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
641 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
642 |
addLabels:moreLabels selectors:moreSelectors accelerators:shorties |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
643 |
"add more labels and selectors at the END" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
644 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
645 |
self addLabels:moreLabels selectors:moreSelectors accelerators:shorties after:nil |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
646 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
647 |
"Modified: 28.2.1996 / 17:46:50 / cg" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
648 |
"Created: 28.2.1996 / 17:47:17 / cg" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
649 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
650 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
651 |
addLabels:moreLabels selectors:moreSelectors accelerators:shorties after:aLabelOrSelectorOrNumber |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
652 |
"insert more labels/selectors at some place. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
653 |
Being very friendly here, allowing label-string, selector or numeric |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
654 |
index for the argument aLabelOrSelectorOrNumber. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
655 |
If such an item is not found, insert the new items at the END. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
656 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
657 |
To be independent of the entries label, we recommend you use the selector |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
658 |
as index; in systems which translate strings for national variants, |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
659 |
this makes your code easier to maintain." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
660 |
|
202 | 661 |
|idx| |
662 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
663 |
aLabelOrSelectorOrNumber isNil ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
664 |
idx := list size + 1 |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
665 |
] ifFalse:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
666 |
idx := (self indexOf:aLabelOrSelectorOrNumber) + 1. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
667 |
idx == 1 ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
668 |
idx := list size + 1 |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
669 |
] |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
670 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
671 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
672 |
^ self |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
673 |
addLabels:moreLabels |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
674 |
selectors:moreSelectors |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
675 |
accelerators:shorties |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
676 |
before:idx |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
677 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
678 |
"Created: 28.2.1996 / 17:48:24 / cg" |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
679 |
"Modified: 4.3.1996 / 23:26:02 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
680 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
681 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
682 |
addLabels:moreLabels selectors:moreSelectors accelerators:shorties before:aLabelOrSelectorOrNumber |
3294
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
683 |
self |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
684 |
addLabels:moreLabels |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
685 |
selectors:moreSelectors |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
686 |
accelerators:shorties |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
687 |
resources:nil |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
688 |
before:aLabelOrSelectorOrNumber |
131 | 689 |
! |
690 |
||
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
691 |
addLabels:moreLabels selectors:moreSelectors accelerators:shorties resources:resources after:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
692 |
"insert more labels/selectors at some place. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
693 |
Being very friendly here, allowing label-string, selector or numeric |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
694 |
index for the argument aLabelOrSelectorOrNumber. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
695 |
If such an item is not found, insert the new items at the END. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
696 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
697 |
To be independent of the entries label, we recommend you use the selector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
698 |
as index; in systems which translate strings for national variants, |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
699 |
this makes your code easier to maintain." |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
700 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
701 |
|idx| |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
702 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
703 |
aLabelOrSelectorOrNumber isNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
704 |
idx := list size + 1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
705 |
] ifFalse:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
706 |
idx := (self indexOf:aLabelOrSelectorOrNumber) + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
707 |
idx == 1 ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
708 |
idx := list size + 1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
709 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
710 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
711 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
712 |
^ self |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
713 |
addLabels:moreLabels |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
714 |
selectors:moreSelectors |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
715 |
accelerators:shorties |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
716 |
resources:resources |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
717 |
before:idx |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
718 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
719 |
"Created: 28.2.1996 / 17:48:24 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
720 |
"Modified: 4.3.1996 / 23:26:02 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
721 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
722 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
723 |
addLabels:moreLabels selectors:moreSelectors accelerators:shorties resources:resources before:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
724 |
"insert more labels/selectors at some place. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
725 |
Being very friendly here, allowing label-string, selector or numeric |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
726 |
index for the argument aLabelOrSelectorOrNumber. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
727 |
If such an item is not found, insert the new items at the beginning. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
728 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
729 |
To be independent of the entries label, we recommend you use the selector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
730 |
as index; in systems which translate strings for national variants, |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
731 |
this makes your code easier to maintain." |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
732 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
733 |
|idx oldSize |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
734 |
i "{ Class: SmallInteger }" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
735 |
nMore "{ Class: SmallInteger }"| |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
736 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
737 |
list isNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
738 |
^ self addLabels:moreLabels selectors:moreSelectors resources:resources |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
739 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
740 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
741 |
be user friendly - allow both label or selector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
742 |
to be passed |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
743 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
744 |
aLabelOrSelectorOrNumber isNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
745 |
idx := 1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
746 |
] ifFalse:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
747 |
idx := self indexOf:aLabelOrSelectorOrNumber. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
748 |
(idx between:2 and:(list size + 1)) ifFalse:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
749 |
"add to beginning" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
750 |
idx := 1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
751 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
752 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
753 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
754 |
nMore := moreLabels size. |
3294
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
755 |
self assert:moreSelectors size == nMore. |
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
756 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
757 |
oldSize := list size. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
758 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
759 |
list := list asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
760 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
761 |
moreLabels do:[:aLabel | |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
762 |
|l| |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
763 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
764 |
resources notNil |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
765 |
ifTrue:[l := resources string:aLabel] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
766 |
ifFalse:[l := aLabel]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
767 |
|
2973 | 768 |
l := self labelWithoutDoubleAmpersands:l. |
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
769 |
list add:l beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
770 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
771 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
772 |
selectors := (selectors ? #()) asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
773 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
774 |
moreSelectors do:[:sel | |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
775 |
selectors add:sel beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
776 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
777 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
778 |
enableFlags := (enableFlags ? #()) asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
779 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
780 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
781 |
enableFlags add:true beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
782 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
783 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
784 |
subMenus notNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
785 |
subMenus := subMenus asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
786 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
787 |
i >= subMenus size ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
788 |
subMenus grow:i-1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
789 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
790 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
791 |
subMenus add:nil beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
792 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
793 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
794 |
args notNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
795 |
args := args asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
796 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
797 |
i >= args size ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
798 |
args grow:i-1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
799 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
800 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
801 |
args add:nil beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
802 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
803 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
804 |
actions notNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
805 |
actions := actions asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
806 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
807 |
i >= actions size ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
808 |
actions grow:i-1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
809 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
810 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
811 |
actions add:nil beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
812 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
813 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
814 |
onOffFlags notNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
815 |
onOffFlags := onOffFlags asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
816 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
817 |
i >= onOffFlags size ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
818 |
onOffFlags grow:i-1 |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
819 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
820 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
821 |
onOffFlags add:nil beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
822 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
823 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
824 |
shortKeys isNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
825 |
shortKeys := OrderedCollection new:oldSize. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
826 |
shortKeys grow:oldSize |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
827 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
828 |
shortKeys := shortKeys asOrderedCollection. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
829 |
i := idx. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
830 |
shorties isNil ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
831 |
nMore timesRepeat:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
832 |
shortKeys add:nil beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
833 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
834 |
] ifFalse:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
835 |
maxShortKeyStringLen := nil. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
836 |
shorties do:[:sel | |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
837 |
shortKeys add:sel beforeIndex:i. i := i + 1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
838 |
] |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
839 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
840 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
841 |
shown ifTrue:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
842 |
self resize |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
843 |
] ifFalse:[ |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
844 |
needResize := true |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
845 |
]. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
846 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
847 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
848 |
|v1 v2 v3 v4 v5 m| |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
849 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
850 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
851 |
v1 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
852 |
v1 contents:'original menu'. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
853 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
854 |
v2 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
855 |
v2 contents:'before copy'. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
856 |
m := v2 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
857 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
858 |
addLabels:#('new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
859 |
selectors:#(foo bar) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
860 |
before:#copySelection |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
861 |
accelerators:#(Copy Cut Paste). |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
862 |
v2 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
863 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
864 |
v3 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
865 |
v3 contents:'before again '. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
866 |
m := v3 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
867 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
868 |
addLabels:#('new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
869 |
selectors:#(foo bar) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
870 |
before:#again. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
871 |
v3 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
872 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
873 |
v4 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
874 |
v4 contents:'at beginning '. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
875 |
m := v4 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
876 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
877 |
addLabels:#('new entry1' 'new entry2' '-') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
878 |
selectors:#(foo bar nil) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
879 |
before:1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
880 |
v4 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
881 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
882 |
v5 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
883 |
v5 contents:'at end '. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
884 |
m := v5 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
885 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
886 |
addLabels:#('-' 'new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
887 |
selectors:#(nil foo bar). |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
888 |
v5 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
889 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
890 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
891 |
"Created: 28.2.1996 / 17:49:44 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
892 |
"Modified: 24.3.1996 / 17:12:23 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
893 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
894 |
|
119 | 895 |
addLabels:moreLabels selectors:moreSelectors after:aLabelOrSelectorOrNumber |
896 |
"insert more labels/selectors at some place. |
|
897 |
Being very friendly here, allowing label-string, selector or numeric |
|
898 |
index for the argument aLabelOrSelectorOrNumber. |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
899 |
If such an item is not found, insert the new items at the END. |
119 | 900 |
|
901 |
To be independent of the entries label, we recommend you use the selector |
|
902 |
as index; in systems which translate strings for national variants, |
|
903 |
this makes your code easier to maintain." |
|
904 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
905 |
^ self |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
906 |
addLabels:moreLabels |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
907 |
selectors:moreSelectors |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
908 |
accelerators:nil |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
909 |
after:aLabelOrSelectorOrNumber |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
910 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
911 |
"Modified: 28.2.1996 / 17:47:52 / cg" |
119 | 912 |
! |
913 |
||
914 |
addLabels:moreLabels selectors:moreSelectors before:aLabelOrSelectorOrNumber |
|
915 |
"insert more labels/selectors at some place. |
|
916 |
Being very friendly here, allowing label-string, selector or numeric |
|
917 |
index for the argument aLabelOrSelectorOrNumber. |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
918 |
If such an item is not found, insert the new items at the beginning. |
119 | 919 |
|
920 |
To be independent of the entries label, we recommend you use the selector |
|
921 |
as index; in systems which translate strings for national variants, |
|
922 |
this makes your code easier to maintain." |
|
923 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
924 |
self |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
925 |
addLabels:moreLabels |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
926 |
selectors:moreSelectors |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
927 |
accelerators:nil |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
928 |
before:aLabelOrSelectorOrNumber |
119 | 929 |
|
930 |
" |
|
931 |
|v1 v2 v3 v4 m| |
|
932 |
||
933 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
934 |
v1 := CodeView new open. |
119 | 935 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
936 |
v2 := CodeView new open. |
119 | 937 |
m := v2 editMenu. |
938 |
m |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
939 |
addLabels:#('new entry1' 'new entry2') |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
940 |
selectors:#(foo bar) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
941 |
before:'paste'. |
119 | 942 |
v2 middleButtonMenu:m. |
943 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
944 |
v3 := CodeView new open. |
119 | 945 |
m := v3 editMenu. |
946 |
m |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
947 |
addLabels:#('new entry1' 'new entry2') |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
948 |
selectors:#(foo bar) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
949 |
before:#again. |
119 | 950 |
v3 middleButtonMenu:m. |
951 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
952 |
v4 := CodeView new open. |
119 | 953 |
m := v4 editMenu. |
954 |
m |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
955 |
addLabels:#('new entry1' 'new entry2') |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
956 |
selectors:#(foo bar) |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
957 |
before:1. |
119 | 958 |
v4 middleButtonMenu:m. |
95 | 959 |
" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
960 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
961 |
"Modified: 28.2.1996 / 17:49:30 / cg" |
95 | 962 |
! |
963 |
||
2923
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
964 |
addLabels:moreLabels selectors:moreSelectors resources:resources |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
965 |
"add more labels and selectors at the END" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
966 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
967 |
self addLabels:moreLabels selectors:moreSelectors resources:resources after:nil |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
968 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
969 |
"Modified: 28.2.1996 / 17:46:50 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
970 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
971 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
972 |
addLabels:moreLabels selectors:moreSelectors resources:resources accelerators:shorties |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
973 |
"add more labels and selectors at the END" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
974 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
975 |
self addLabels:moreLabels selectors:moreSelectors accelerators:shorties resources:resources after:nil |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
976 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
977 |
"Modified: 28.2.1996 / 17:46:50 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
978 |
"Created: 28.2.1996 / 17:47:17 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
979 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
980 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
981 |
addLabels:moreLabels selectors:moreSelectors resources:resources after:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
982 |
"insert more labels/selectors at some place. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
983 |
Being very friendly here, allowing label-string, selector or numeric |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
984 |
index for the argument aLabelOrSelectorOrNumber. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
985 |
If such an item is not found, insert the new items at the END. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
986 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
987 |
To be independent of the entries label, we recommend you use the selector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
988 |
as index; in systems which translate strings for national variants, |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
989 |
this makes your code easier to maintain." |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
990 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
991 |
^ self |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
992 |
addLabels:moreLabels |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
993 |
selectors:moreSelectors |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
994 |
accelerators:nil |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
995 |
resources:resources |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
996 |
after:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
997 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
998 |
"Modified: 28.2.1996 / 17:47:52 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
999 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1000 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1001 |
addLabels:moreLabels selectors:moreSelectors resources:resources before:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1002 |
"insert more labels/selectors at some place. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1003 |
Being very friendly here, allowing label-string, selector or numeric |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1004 |
index for the argument aLabelOrSelectorOrNumber. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1005 |
If such an item is not found, insert the new items at the beginning. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1006 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1007 |
To be independent of the entries label, we recommend you use the selector |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1008 |
as index; in systems which translate strings for national variants, |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1009 |
this makes your code easier to maintain." |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1010 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1011 |
self |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1012 |
addLabels:moreLabels |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1013 |
selectors:moreSelectors |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1014 |
accelerators:nil |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1015 |
resources:resources |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1016 |
before:aLabelOrSelectorOrNumber |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1017 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1018 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1019 |
|v1 v2 v3 v4 m| |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1020 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1021 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1022 |
v1 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1023 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1024 |
v2 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1025 |
m := v2 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1026 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1027 |
addLabels:#('new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1028 |
selectors:#(foo bar) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1029 |
before:'paste'. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1030 |
v2 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1031 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1032 |
v3 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1033 |
m := v3 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1034 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1035 |
addLabels:#('new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1036 |
selectors:#(foo bar) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1037 |
before:#again. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1038 |
v3 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1039 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1040 |
v4 := CodeView new open. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1041 |
m := v4 editMenu. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1042 |
m |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1043 |
addLabels:#('new entry1' 'new entry2') |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1044 |
selectors:#(foo bar) |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1045 |
before:1. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1046 |
v4 middleButtonMenu:m. |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1047 |
" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1048 |
|
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1049 |
"Modified: 28.2.1996 / 17:49:30 / cg" |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1050 |
! |
1eaa937f0568
added protocol to add an itemList with resource-translation
Claus Gittinger <cg@exept.de>
parents:
2920
diff
changeset
|
1051 |
|
202 | 1052 |
addSeparatingLine |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1053 |
"add a separating line at the END" |
60 | 1054 |
|
202 | 1055 |
self addLabel:'-' selector:nil |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1056 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1057 |
"Modified: 28.2.1996 / 17:50:08 / cg" |
60 | 1058 |
! |
1059 |
||
202 | 1060 |
addSeparatingLineAfter:aLabelOrSelectorOrNumber |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1061 |
"add a separating line after an item" |
133 | 1062 |
|
202 | 1063 |
self addLabel:'-' selector:nil after:aLabelOrSelectorOrNumber |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1064 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1065 |
"Modified: 28.2.1996 / 17:50:14 / cg" |
0 | 1066 |
! |
1067 |
||
1068 |
args |
|
1069 |
"return the argument array" |
|
1070 |
||
1071 |
^ args |
|
1072 |
! |
|
1073 |
||
1074 |
args:anArray |
|
1075 |
"set the argument array" |
|
1076 |
||
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1077 |
args := anArray copy |
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1078 |
|
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1079 |
"Modified: 30.4.1996 / 15:55:03 / cg" |
0 | 1080 |
! |
1081 |
||
1082 |
argsAt:indexOrName put:something |
|
1083 |
"set an individual selector" |
|
1084 |
||
3 | 1085 |
|i| |
1086 |
||
1087 |
i := self indexOf:indexOrName. |
|
1088 |
i ~~ 0 ifTrue:[args at:i put:something] |
|
0 | 1089 |
! |
1090 |
||
202 | 1091 |
checkFlags |
1092 |
"return an array filled with the check-mark flags. |
|
1093 |
Non check-menu items have a nil entry in this array." |
|
0 | 1094 |
|
202 | 1095 |
^ onOffFlags |
0 | 1096 |
! |
1097 |
||
3966 | 1098 |
checkFlags:aCollectionOfBooleansOrNils |
1099 |
onOffFlags := aCollectionOfBooleansOrNils |
|
1100 |
! |
|
1101 |
||
0 | 1102 |
checkToggleAt:indexOrName |
569
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1103 |
"return a check-toggles boolean state. |
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1104 |
If the item is not a check-item, return nil." |
0 | 1105 |
|
1106 |
|index| |
|
1107 |
||
1108 |
index := self indexOf:indexOrName. |
|
569
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1109 |
index == 0 ifTrue:[^ nil]. |
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
onOffFlags isNil ifTrue:[^ nil]. |
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1111 |
index > onOffFlags size ifTrue:[^ nil]. |
0 | 1112 |
^ onOffFlags at:index |
569
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1113 |
|
8c460366645e
checkToggleAt returns nil for non-check entries
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1114 |
"Modified: 22.4.1996 / 10:51:54 / cg" |
0 | 1115 |
! |
1116 |
||
1117 |
checkToggleAt:indexOrName put:aBoolean |
|
1118 |
"set/clear a check-toggle" |
|
1119 |
||
1120 |
|index| |
|
1121 |
||
1122 |
index := self indexOf:indexOrName. |
|
475
ce306c6c6bc4
care for toggles when adding labels
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
1123 |
index == 0 ifTrue:[ |
481 | 1124 |
"/ 'no item: ' print. indexOrName printNL. |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1125 |
^ self |
475
ce306c6c6bc4
care for toggles when adding labels
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
1126 |
]. |
65 | 1127 |
|
1128 |
onOffFlags isNil ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1129 |
onOffFlags := Array new:(list size) |
65 | 1130 |
]. |
0 | 1131 |
onOffFlags at:index put:aBoolean. |
1132 |
shown ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1133 |
self redrawLine:index |
0 | 1134 |
] |
475
ce306c6c6bc4
care for toggles when adding labels
Claus Gittinger <cg@exept.de>
parents:
465
diff
changeset
|
1135 |
|
481 | 1136 |
"Modified: 6.3.1996 / 16:31:43 / cg" |
202 | 1137 |
! |
1138 |
||
1139 |
indexOf:indexOrName |
|
1140 |
"return the index of the label named:aName or , if its a symbol |
|
593 | 1141 |
the index in the selector list. |
1142 |
If indexOrName is not a valid item, return 0." |
|
202 | 1143 |
|
1144 |
indexOrName isSymbol ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1145 |
^ selectors indexOf:indexOrName |
202 | 1146 |
]. |
1147 |
indexOrName isString ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1148 |
^ list indexOf:indexOrName |
202 | 1149 |
]. |
1150 |
indexOrName isNil ifTrue:[^ 0]. |
|
593 | 1151 |
|
1152 |
(indexOrName respondsTo:#string) ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1153 |
^ list indexOf:indexOrName asString |
593 | 1154 |
]. |
202 | 1155 |
^ indexOrName |
593 | 1156 |
|
1157 |
"Modified: 27.4.1996 / 15:25:16 / cg" |
|
202 | 1158 |
! |
1159 |
||
1160 |
labelAt:indexOrName put:aString |
|
1161 |
"change the label at index to be aString" |
|
1162 |
||
1163 |
|i nItems| |
|
1164 |
||
1165 |
i := self indexOf:indexOrName. |
|
1166 |
i == 0 ifTrue:[^ self]. |
|
1167 |
list at:i put:aString. |
|
1168 |
||
1169 |
"create onOff flags, if this label has a check-mark" |
|
1170 |
(self isCheckItem:aString) ifTrue:[ |
|
1171 |
nItems := list size. |
|
1172 |
onOffFlags isNil ifTrue:[ |
|
1173 |
onOffFlags := Array new:nItems |
|
1174 |
] ifFalse:[ |
|
1175 |
[onOffFlags size < nItems] whileTrue:[ |
|
1176 |
onOffFlags := onOffFlags copyWith:nil |
|
1177 |
] |
|
1178 |
]. |
|
1179 |
onOffFlags at:i put:false |
|
1180 |
]. |
|
1181 |
shown ifTrue:[ |
|
1182 |
self resize |
|
1183 |
] ifFalse:[ |
|
1184 |
needResize := true |
|
1185 |
] |
|
1186 |
! |
|
1187 |
||
1188 |
labels |
|
1189 |
"return the menu-labels" |
|
1190 |
||
1191 |
^ list |
|
1192 |
! |
|
1193 |
||
1194 |
labels:text |
|
1195 |
"set the labels to the argument, text" |
|
1196 |
||
908 | 1197 |
|l nItems| |
202 | 1198 |
|
1199 |
(text isString) ifTrue:[ |
|
2953 | 1200 |
l := text asStringCollection |
202 | 1201 |
] ifFalse:[ |
2953 | 1202 |
l := text copy |
202 | 1203 |
]. |
2973 | 1204 |
l := l collect:[:s | self labelWithoutDoubleAmpersands:s]. |
202 | 1205 |
"/ self list:l |
1206 |
self setList:l expandTabs:false. |
|
908 | 1207 |
nItems := list size. |
1208 |
enableFlags := Array new:nItems withAll:true. |
|
1209 |
onOffFlags := Array new:nItems. |
|
1048 | 1210 |
|
1211 |
text notNil ifTrue:[ |
|
2953 | 1212 |
text keysAndValuesDo:[:index :line | |
1213 |
(self isCheckItem:line) ifTrue:[ |
|
1214 |
onOffFlags at:index put:false |
|
1215 |
]. |
|
1216 |
]. |
|
202 | 1217 |
]. |
1218 |
shown ifTrue:[ |
|
2953 | 1219 |
self resize |
202 | 1220 |
] ifFalse:[ |
2953 | 1221 |
needResize := true |
202 | 1222 |
] |
603
9760b8c7f5de
create a copy of the labels (in case someone changes it later)
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1223 |
|
908 | 1224 |
"Modified: 2.1.1997 / 17:30:41 / cg" |
202 | 1225 |
! |
1226 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1227 |
labels:text selectors:selArray accelerators:shorties args:argArray receiver:anObject |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1228 |
"set all relevant stuff" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1229 |
|
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1230 |
self labels:text selectors:selArray args:argArray receiver:anObject. |
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1231 |
shortKeys := shorties copy. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1232 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1233 |
"Created: 28.2.1996 / 18:56:38 / cg" |
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1234 |
"Modified: 30.4.1996 / 15:54:48 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1235 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1236 |
|
202 | 1237 |
labels:text selectors:selArray args:argArray receiver:anObject |
1238 |
"set all relevant stuff" |
|
1239 |
||
1240 |
self labels:text. |
|
642 | 1241 |
selArray isSymbol ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1242 |
selectors := Array new:(text size) withAll:selArray |
642 | 1243 |
] ifFalse:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1244 |
selectors := selArray copy. |
642 | 1245 |
]. |
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1246 |
args := argArray copy. |
202 | 1247 |
receiver := anObject |
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1248 |
|
642 | 1249 |
"Modified: 14.5.1996 / 15:30:10 / cg" |
202 | 1250 |
! |
1251 |
||
963 | 1252 |
menuPerformer:someone |
1253 |
"set the menuPerformer of the message. |
|
1254 |
This also sets the menuPerformer in all subMenus." |
|
1255 |
||
1256 |
menuPerformer := someone. |
|
1257 |
subMenus notNil ifTrue:[ |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1258 |
subMenus do:[:aMenu | |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1259 |
(aMenu notNil and:[aMenu isBlock not]) ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1260 |
aMenu menuPerformer:someone |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1261 |
] |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1262 |
] |
963 | 1263 |
] |
1264 |
||
1265 |
"Created: 21.1.1997 / 15:42:00 / cg" |
|
1266 |
! |
|
1267 |
||
202 | 1268 |
receiver |
1269 |
"return the receiver of the message" |
|
1270 |
||
1271 |
^ receiver |
|
1272 |
! |
|
1273 |
||
1274 |
receiver:anObject |
|
963 | 1275 |
"set the receiver of the message. |
1276 |
This also sets the receiver in all subMenus." |
|
202 | 1277 |
|
1278 |
receiver := anObject. |
|
1279 |
subMenus notNil ifTrue:[ |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1280 |
subMenus do:[:aMenu | |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1281 |
(aMenu notNil and:[aMenu isBlock not]) ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1282 |
aMenu receiver:anObject |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1283 |
] |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1284 |
] |
202 | 1285 |
] |
963 | 1286 |
|
1287 |
"Modified: 21.1.1997 / 15:41:32 / cg" |
|
202 | 1288 |
! |
1289 |
||
1290 |
remove:indexOrName |
|
1291 |
"remove the label at index" |
|
1292 |
||
1293 |
|i| |
|
1294 |
||
1295 |
i := self indexOf:indexOrName. |
|
1296 |
i == 0 ifTrue:[^ self]. |
|
1297 |
list := list asOrderedCollection removeIndex:i. |
|
1298 |
selectors := selectors asOrderedCollection removeIndex:i. |
|
1299 |
enableFlags := enableFlags asOrderedCollection removeIndex:i. |
|
1300 |
subMenus notNil ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1301 |
subMenus := subMenus asOrderedCollection removeIndex:i. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1302 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1303 |
shortKeys notNil ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1304 |
shortKeys := shortKeys asOrderedCollection removeIndex:i. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1305 |
maxShortKeyStringLen := nil. |
202 | 1306 |
]. |
1307 |
shown ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1308 |
self resize |
202 | 1309 |
] ifFalse:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1310 |
needResize := true |
202 | 1311 |
] |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1312 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1313 |
"Modified: 28.2.1996 / 18:27:57 / cg" |
202 | 1314 |
! |
1315 |
||
1316 |
selectorAt:indexOrName |
|
1317 |
"return an individual selector" |
|
1318 |
||
1319 |
|i| |
|
1320 |
||
1321 |
i := self indexOf:indexOrName. |
|
1322 |
i ~~ 0 ifTrue:[^ selectors at:i]. |
|
1323 |
^ nil |
|
1324 |
! |
|
1325 |
||
1326 |
selectorAt:indexOrName put:aSelector |
|
1327 |
"set an individual selector" |
|
1328 |
||
1329 |
|i| |
|
1330 |
||
1331 |
i := self indexOf:indexOrName. |
|
1332 |
i ~~ 0 ifTrue:[selectors at:i put:aSelector] |
|
1333 |
! |
|
1334 |
||
1335 |
selectors |
|
1336 |
"return the selector array" |
|
1337 |
||
1338 |
^ selectors |
|
1339 |
! |
|
1340 |
||
1341 |
selectors:anArray |
|
1342 |
"set the selector array" |
|
1343 |
||
604
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1344 |
selectors := anArray copy |
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1345 |
|
04f04206a2fc
also copy selectors, args & shortKeys
Claus Gittinger <cg@exept.de>
parents:
603
diff
changeset
|
1346 |
"Modified: 30.4.1996 / 15:54:07 / cg" |
202 | 1347 |
! |
1348 |
||
1349 |
someMenuItemLabeled:aLabel |
|
1350 |
"find a menu item. |
|
1351 |
Currently, in ST/X, instances of MenuItem are only created as dummy" |
|
1352 |
||
1353 |
|idx| |
|
1354 |
||
1355 |
idx := self indexOf:aLabel. |
|
1356 |
idx ~~ 0 ifTrue:[ |
|
1357 |
^ MenuItem new menu:self index:idx |
|
1358 |
]. |
|
1359 |
subMenus notNil ifTrue:[ |
|
1360 |
subMenus do:[:aMenu | |
|
1361 |
|item| |
|
1362 |
||
1363 |
aMenu notNil ifTrue:[ |
|
1364 |
(item := aMenu someMenuItemLabeled:aLabel) notNil ifTrue:[ |
|
1365 |
^ item |
|
1366 |
] |
|
1367 |
] |
|
1368 |
]. |
|
1369 |
]. |
|
1370 |
^ nil |
|
1371 |
! ! |
|
1372 |
||
1373 |
!MenuView methodsFor:'accessing-look'! |
|
1374 |
||
1375 |
font:aFont |
|
665 | 1376 |
"adjust size for new font. |
1377 |
CAVEAT: with the addition of Text objects, |
|
1989 | 1378 |
this method is going to be obsoleted by a textStyle |
1379 |
method, which allows specific control over |
|
1380 |
normalFont/boldFont/italicFont parameters." |
|
1381 |
||
1382 |
super font:(aFont onDevice:device). |
|
1232 | 1383 |
preferredExtent := nil. |
202 | 1384 |
shown ifTrue:[ |
1989 | 1385 |
self resize |
202 | 1386 |
] ifFalse:[ |
1989 | 1387 |
needResize := true |
202 | 1388 |
] |
665 | 1389 |
|
1390 |
"Modified: 22.5.1996 / 12:36:37 / cg" |
|
202 | 1391 |
! ! |
1392 |
||
1393 |
!MenuView methodsFor:'accessing-misc'! |
|
1394 |
||
1395 |
masterView |
|
1396 |
"return the popup-masterview I am contained in." |
|
1397 |
||
1398 |
^ masterView |
|
1399 |
! |
|
1400 |
||
1401 |
masterView:aPopUpView |
|
1402 |
"set the popup-masterview I am contained in." |
|
1403 |
||
1404 |
masterView := aPopUpView |
|
1405 |
! |
|
1406 |
||
1407 |
selection:index |
|
1408 |
|sel line| |
|
1409 |
||
1410 |
sel := index. |
|
1411 |
sel notNil ifTrue:[ |
|
1412 |
line := self listAt:index. |
|
1413 |
(self isGraphicItem:line) ifTrue:[ |
|
1414 |
" |
|
1415 |
not really selectable, but a separating line |
|
1416 |
" |
|
1417 |
sel := nil |
|
1418 |
] |
|
1419 |
]. |
|
1420 |
super selection:sel |
|
1421 |
! |
|
1422 |
||
683 | 1423 |
setSelection:index |
1424 |
|sel line| |
|
1425 |
||
1426 |
sel := index. |
|
1427 |
sel notNil ifTrue:[ |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1428 |
line := self listAt:index. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1429 |
(self isGraphicItem:line) ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1430 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1431 |
not really selectable, but a separating line |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1432 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1433 |
sel := nil |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1434 |
] |
683 | 1435 |
]. |
1436 |
super setSelection:sel |
|
1437 |
||
1438 |
"Created: 25.5.1996 / 12:27:33 / cg" |
|
1439 |
! |
|
1440 |
||
334 | 1441 |
sizeFixed:aBoolean |
1442 |
sizeFixed := aBoolean |
|
1443 |
||
1444 |
"Created: 9.2.1996 / 01:12:40 / cg" |
|
1445 |
! |
|
1446 |
||
202 | 1447 |
superMenu |
1448 |
"ret the menu I am contained in |
|
1449 |
- need this to hide main menus when a submenu performed its action" |
|
1450 |
||
1451 |
^ superMenu |
|
1452 |
! |
|
1453 |
||
1454 |
superMenu:aMenu |
|
1455 |
"set the menu I am contained in |
|
1456 |
- need this to hide main menus when a submenu performed its action" |
|
1457 |
||
1458 |
superMenu := aMenu |
|
136 | 1459 |
! ! |
1460 |
||
1461 |
!MenuView methodsFor:'accessing-submenus'! |
|
1462 |
||
0 | 1463 |
subMenuAt:indexOrName |
1464 |
"return a submenu, or nil" |
|
1465 |
||
3 | 1466 |
|i| |
1467 |
||
0 | 1468 |
subMenus isNil ifTrue:[^ nil]. |
3 | 1469 |
i := self indexOf:indexOrName. |
1470 |
i == 0 ifTrue:[^ nil]. |
|
1471 |
^ subMenus at:i |
|
0 | 1472 |
! |
1473 |
||
1474 |
subMenuAt:indexOrName put:aPopUpMenu |
|
1475 |
"define a submenu" |
|
1476 |
||
59 | 1477 |
|i newSubMenus| |
3 | 1478 |
|
1479 |
i := self indexOf:indexOrName. |
|
2920 | 1480 |
i == 0 ifTrue:[ |
1481 |
'MenuView [warning]: no submenu with for index: ' infoPrint. indexOrName infoPrintCR. |
|
1482 |
^ nil |
|
1483 |
]. |
|
497 | 1484 |
|
59 | 1485 |
subMenus size < i ifTrue:[ |
2399
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1486 |
newSubMenus := Array new:(list size max:i). |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1487 |
subMenus notNil ifTrue:[ |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1488 |
newSubMenus replaceFrom:1 with:subMenus. |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1489 |
]. |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1490 |
subMenus := newSubMenus. |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1491 |
shown ifTrue:[ |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1492 |
self resize |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1493 |
] ifFalse:[ |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1494 |
needResize := true |
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1495 |
] |
0 | 1496 |
]. |
2683 | 1497 |
|
497 | 1498 |
subMenus at:i put:aPopUpMenu. |
2399
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1499 |
aPopUpMenu notNil ifTrue:[ |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1500 |
aPopUpMenu isBlock ifFalse:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1501 |
aPopUpMenu device:device. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1502 |
(receiver notNil and:[aPopUpMenu receiver isNil]) ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1503 |
aPopUpMenu receiver:receiver |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
1504 |
] |
2399
550e5ab64b82
care for nil arg in #subMenuAt:put:
Claus Gittinger <cg@exept.de>
parents:
2311
diff
changeset
|
1505 |
]. |
497 | 1506 |
]. |
1507 |
||
956 | 1508 |
"Modified: 17.1.1997 / 01:03:55 / cg" |
202 | 1509 |
! |
1510 |
||
1511 |
subMenuShown |
|
1512 |
"return the currently visible submenu - or nil if there is none" |
|
1513 |
||
1514 |
^ subMenuShown |
|
1515 |
! ! |
|
1516 |
||
1517 |
!MenuView methodsFor:'disabled scrolling'! |
|
1518 |
||
1519 |
makeSelectionVisible |
|
1520 |
^ self |
|
1521 |
! ! |
|
1522 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1523 |
!MenuView methodsFor:'drawing'! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1524 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1525 |
drawAccelerator:aSymbolicKey inVisibleLine:visLineNr with:fg and:bg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1526 |
"draw the accelerator at the right." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1527 |
|
462
d66445011d3e
if there are both a short-key AND a submenu, indent differently
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
1528 |
|s x l isSubMenuEntry| |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1529 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1530 |
"/ this is somewhat complicated: we have the symbolic key at hand, |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1531 |
"/ but want to show the untranslated (inverse keyBoardMapped) key & modifier |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1532 |
"/ |
3323
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1533 |
s := device shortKeyStringFor:aSymbolicKey. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1534 |
s isNil ifTrue:[^ self]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1535 |
|
462
d66445011d3e
if there are both a short-key AND a submenu, indent differently
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
1536 |
l := self visibleLineToAbsoluteLine:visLineNr. |
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1537 |
|
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1538 |
disabledEtchedFgColor notNil ifTrue:[ |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1539 |
(self isInSelection:l) ifFalse:[ |
2575
a0381bf78464
oops - redraw bug with etched color fixed
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1540 |
(self isEnabled:l) ifFalse:[ |
a0381bf78464
oops - redraw bug with etched color fixed
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1541 |
s := s asText emphasisAllAdd:(#etchColor -> disabledEtchedFgColor) |
a0381bf78464
oops - redraw bug with etched color fixed
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1542 |
] |
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1543 |
] |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1544 |
]. |
462
d66445011d3e
if there are both a short-key AND a submenu, indent differently
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
1545 |
isSubMenuEntry := (subMenus notNil and:[(subMenus at:l) notNil]). |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1546 |
|
462
d66445011d3e
if there are both a short-key AND a submenu, indent differently
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
1547 |
isSubMenuEntry ifFalse:[ |
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1548 |
"/ this aligns them along their left |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1549 |
x := width - textStartLeft - self shortKeyInset. |
462
d66445011d3e
if there are both a short-key AND a submenu, indent differently
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
1550 |
] ifTrue:[ |
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1551 |
"/ this aligns them at the right |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1552 |
x := width - leftMargin - (font widthOf:s). |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1553 |
x := x - 16 "/ should query for the arrow size here ... |
461
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
1554 |
]. |
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
1555 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1556 |
hilightStyle == #openwin ifTrue:[ |
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
1557 |
x := x - 2 "/ inset of rounded rectangle |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1558 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1559 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1560 |
self drawLine:s fromX:x inVisible:visLineNr with:fg and:bg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1561 |
|
3323
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1562 |
"Created: / 28-02-1996 / 18:48:05 / cg" |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1563 |
"Modified: / 08-08-2006 / 15:47:11 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1564 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1565 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1566 |
drawCheckLine:line inVisibleLine:visLineNr with:fg and:bg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1567 |
"draw an on/off-mark (or the space for it). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1568 |
Supported checkmark types: |
1532 | 1569 |
\c simple mark; space if off |
1570 |
\b box mark |
|
1571 |
\t thumbsUp/thumbsDown mark |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1572 |
" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1573 |
|
1649
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1574 |
|w h y x l check xR yB form markIndex i2 markType found| |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1575 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1576 |
l := self visibleLineToListLine:visLineNr. |
1532 | 1577 |
onOffFlags isNil ifTrue:[^ false]. "/ not a check-item line |
1578 |
check := onOffFlags at:l ifAbsent:nil. |
|
1579 |
check isNil ifTrue:[^ false]. "/ not a check-item line |
|
1580 |
check := check value. |
|
1581 |
||
1582 |
markIndex := 1. |
|
1649
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1583 |
found := false. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1584 |
[markIndex ~~ 0 and:[found not]] whileTrue:[ |
1532 | 1585 |
markIndex := line indexOf:$\ startingAt:markIndex. |
1649
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1586 |
markIndex ~~ 0 ifTrue:[ |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1587 |
i2 := markIndex + 1. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1588 |
found := 'cbt' includes:(line at:i2). |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1589 |
found ifFalse:[ |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1590 |
markIndex := i2 + 1. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1591 |
]. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1592 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1593 |
]. |
1649
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1594 |
markIndex == 0ifTrue:[ |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1595 |
^ super drawVisibleLine:visLineNr from:1 to:line size with:fg and:bg. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1596 |
]. |
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1597 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1598 |
markType := line at:i2. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1599 |
|
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2399
diff
changeset
|
1600 |
x := (self xOfCol:markIndex inVisibleLine:visLineNr) - viewOrigin x. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1601 |
y := (self yOfVisibleLine:visLineNr) - (lineSpacing//2). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1602 |
|
1219
ae43e68449c2
Fix printing of checkmark lines.
Stefan Vogel <sv@exept.de>
parents:
1059
diff
changeset
|
1603 |
self paint:bg. |
ae43e68449c2
Fix printing of checkmark lines.
Stefan Vogel <sv@exept.de>
parents:
1059
diff
changeset
|
1604 |
self fillRectangleX:margin y:y width:(width-(margin*2)) height:fontHeight. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1605 |
markIndex ~~ 1 ifTrue:[ |
1532 | 1606 |
super drawVisibleLine:visLineNr from:1 to:(markIndex-1) with:fg and:bg. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1607 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1608 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1609 |
(markType == $c) ifTrue:[ |
1532 | 1610 |
w := font widthOf:'V'. |
1611 |
check ifTrue:[ |
|
1612 |
form := checkOnImage. |
|
1613 |
] ifFalse:[ |
|
1614 |
form := checkOffImage. |
|
1615 |
] |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1616 |
] ifFalse:[ |
1532 | 1617 |
(markType == $b) ifTrue:[ |
1618 |
w := font maxWidth. "/ font widthOf:' '. |
|
1619 |
] ifFalse:[ |
|
1620 |
(markType == $t) ifTrue:[ |
|
1621 |
check ifTrue:[form := Cursor thumbsUp sourceForm] |
|
1622 |
ifFalse:[form := Cursor thumbsDown sourceForm] |
|
1623 |
] |
|
1624 |
] |
|
1625 |
]. |
|
1626 |
||
1627 |
form notNil ifTrue:[ |
|
1628 |
w := form width. |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1629 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1630 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1631 |
self drawLine:(line copyFrom:markIndex+2) fromX:x+w inVisible:visLineNr with:fg and:bg. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1632 |
self paint:(check ifTrue:[checkColor == bg ifTrue:[fg] ifFalse:[checkColor]] ifFalse:[fg]). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1633 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1634 |
h := font ascent. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1635 |
y := y + (font height - h // 2). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1636 |
yB := y + h - 1. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1637 |
|
1532 | 1638 |
form notNil ifTrue:[ |
1639 |
self displayForm:form x:x y:y |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1640 |
] ifFalse:[ |
1532 | 1641 |
(markType == $c) ifTrue:[ |
1642 |
check ifTrue:[ |
|
1643 |
xR := x + (w // 3). |
|
1644 |
self displayLineFromX:x y:(y + (h // 2)) toX:xR y:yB. |
|
1645 |
self displayLineFromX:xR y:yB toX:(x + w - 1) y:y |
|
1646 |
] |
|
1647 |
] ifFalse:[ |
|
1648 |
(markType == $b) ifTrue:[ |
|
1649 |
check ifTrue:[ |
|
1650 |
xR := x + w - 2. |
|
1651 |
self displayLineFromX:x y:y toX:xR y:yB. |
|
1652 |
self displayLineFromX:xR y:y toX:x y:yB. |
|
1653 |
]. |
|
1654 |
self paint:fg. |
|
1655 |
self displayRectangleX:x y:y width:h height:h. |
|
1656 |
] |
|
1657 |
]. |
|
1658 |
]. |
|
1659 |
^ true |
|
1660 |
||
1661 |
"Modified: / 6.5.1997 / 18:04:38 / stefan" |
|
1649
e0deb9ce1e08
fixed checkItem (\c) detection
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
1662 |
"Modified: / 17.8.1998 / 10:25:01 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1663 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1664 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1665 |
drawVisibleLine:visLineNr with:fg and:bg |
2113 | 1666 |
|lNr lineString xLatedLine isSpecial key| |
1667 |
||
1668 |
lNr := self visibleLineToListLine:visLineNr. |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1669 |
lineString := self visibleAt:visLineNr. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1670 |
|
2960 | 1671 |
isSpecial := lineString notNil and:[lineString asString string includes:$\]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1672 |
isSpecial ifFalse:[ |
1532 | 1673 |
" |
1674 |
a normal entry |
|
1675 |
" |
|
1676 |
super drawVisibleLine:visLineNr with:fg and:bg |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1677 |
] ifTrue:[ |
1532 | 1678 |
" |
1679 |
some speciality in this line; try checkMark |
|
1680 |
" |
|
1681 |
((self isCheckItem:lineString) |
|
1682 |
and:[self drawCheckLine:lineString inVisibleLine:visLineNr with:fg and:bg]) |
|
1683 |
ifFalse:[ |
|
2113 | 1684 |
xLatedLine := lineString replString:'\\' withString:'\'. |
1685 |
super drawLine:xLatedLine inVisible:visLineNr with:fg and:bg. |
|
1532 | 1686 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1687 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1688 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1689 |
"/ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1690 |
"/ is there a shortKey ? |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1691 |
"/ |
461
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
1692 |
((ShowAcceleratorKeys ~~ false) |
433
5e7847297ef8
allow turning off display of shortKeys (via style-sheet)
Claus Gittinger <cg@exept.de>
parents:
426
diff
changeset
|
1693 |
and:[shortKeys notNil |
2113 | 1694 |
and:[(key := shortKeys at:lNr ifAbsent:nil) notNil]]) ifTrue:[ |
1532 | 1695 |
self drawAccelerator:key inVisibleLine:visLineNr with:fg and:bg |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1696 |
] |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1697 |
|
1919
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
1698 |
"Modified: / 31.5.1999 / 12:35:48 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1699 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1700 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1701 |
drawVisibleLineSelected:visLineNr with:fg and:bg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1702 |
"redraw a single line as selected." |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1703 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1704 |
|listLine |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1705 |
y "{ Class: SmallInteger }" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1706 |
y2 "{ Class: SmallInteger }" |
727 | 1707 |
r2 rI lI radius topLeftColor botRightColor | |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1708 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1709 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1710 |
hilightStyle ~~ #openwin ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1711 |
^ super drawVisibleLineSelected:visLineNr with:fg and:bg. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1712 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1713 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1714 |
" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1715 |
openwin draws selections in a menu as (edged) rounded rectangles |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1716 |
" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1717 |
listLine := self visibleLineToListLine:visLineNr. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1718 |
listLine notNil ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1719 |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1720 |
self drawVisibleLine:visLineNr with:fg and:bg. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1721 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1722 |
y := (self yOfVisibleLine:visLineNr) - (lineSpacing//2). |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1723 |
y2 := y + fontHeight - 1. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1724 |
r2 := fontHeight. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1725 |
radius := r2 // 2. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1726 |
rI := 0. "/ 2. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1727 |
lI := 1. "/ 2. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1728 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1729 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1730 |
refill with normal bg, where arcs will be drawn below |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1731 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1732 |
self paint:bgColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1733 |
self fillRectangleX:margin y:y width:radius height:fontHeight. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1734 |
self fillRectangleX:width-radius-margin y:y width:radius height:fontHeight. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1735 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1736 |
fill the arcs |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1737 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1738 |
self paint:hilightBgColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1739 |
self fillArcX:margin+lI y:y width:r2 height:r2+rI from:90 angle:180. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1740 |
self fillArcX:width-r2-rI-margin-1 y:y width:r2 height:r2+rI from:270 angle:180. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1741 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1742 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1743 |
a highlight-border around |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1744 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1745 |
hilightFrameColor notNil ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1746 |
self paint:hilightFrameColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1747 |
self displayLineFromX:radius+2 y:y toX:width-radius-3 y:y. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1748 |
self displayLineFromX:radius+2 y:y2 toX:width-radius-3 y:y2. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1749 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1750 |
self displayArcX:margin+lI y:y width:r2 height:r2+rI from:90 angle:180. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1751 |
self displayArcX:width-r2-rI-margin-1 y:y width:r2 height:r2+rI from:270 angle:180. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1752 |
^ self |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1753 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1754 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1755 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1756 |
an edge around |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1757 |
" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1758 |
(hilightLevel ~~ 0) ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1759 |
(hilightLevel < 0) ifTrue:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1760 |
topLeftColor := shadowColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1761 |
botRightColor := lightColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1762 |
] ifFalse:[ |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1763 |
topLeftColor := lightColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1764 |
botRightColor := shadowColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1765 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1766 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1767 |
self paint:topLeftColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1768 |
self displayLineFromX:radius+2 y:y toX:width-radius-3 y:y. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1769 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1770 |
self displayArcX:margin+lI y:y width:r2 height:r2+rI-1 from:90 angle:125. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1771 |
self displayArcX:width-r2-rI-margin-1 y:y width:r2 height:r2+rI-1 from:270+125 angle:55. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1772 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1773 |
self paint:botRightColor. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1774 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1775 |
self displayLineFromX:radius+2 y:y2 toX:width-radius-3 y:y2. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1776 |
self displayArcX:margin+lI y:y width:r2 height:r2+rI-1 from:90+125 angle:55. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1777 |
self displayArcX:width-r2-rI-margin-1 y:y width:r2 height:r2+rI-1 from:270 angle:125. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1778 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1779 |
^ self |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1780 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1781 |
^ super drawVisibleLine:visLineNr with:fg and:bg |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1782 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1783 |
"Created: 28.2.1996 / 18:41:17 / cg" |
1346
98f855d33d66
fixed arc-edges for openWin style
Claus Gittinger <cg@exept.de>
parents:
1285
diff
changeset
|
1784 |
"Modified: 14.10.1997 / 00:05:43 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1785 |
! ! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1786 |
|
202 | 1787 |
!MenuView methodsFor:'event handling'! |
1788 |
||
1789 |
buttonMotion:state x:x y:y |
|
3911
2e2c5429a2f9
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
3903
diff
changeset
|
1790 |
(self sensor hasButtonMotionEventFor:self) ifFalse:[ |
2e2c5429a2f9
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
3903
diff
changeset
|
1791 |
self setSelectionForX:x y:y |
202 | 1792 |
] |
1793 |
! |
|
1794 |
||
1795 |
buttonPress:button x:x y:y |
|
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
1796 |
self setSelectionForX:x y:y. |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
1797 |
|
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
1798 |
"Modified: 25.2.1997 / 22:32:22 / cg" |
202 | 1799 |
! |
1800 |
||
1801 |
buttonRelease:button x:x y:y |
|
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
1802 |
|hide| |
202 | 1803 |
|
1804 |
subMenuShown notNil ifTrue:[ |
|
1864 | 1805 |
^ self |
202 | 1806 |
]. |
1807 |
||
1864 | 1808 |
(x >= 0 |
1809 |
and:[x < width |
|
1810 |
and:[y >= 0 |
|
1811 |
and:[y < height]]]) ifTrue:[ |
|
1812 |
superMenu notNil ifTrue:[ |
|
1813 |
superMenu submenuTriggered. |
|
1814 |
||
2818 | 1815 |
shown ifFalse:[ |
1864 | 1816 |
superView notNil ifTrue:[ |
1817 |
superView shown ifTrue:[ |
|
3903 | 1818 |
superView isPopUpView ifTrue:[ |
1819 |
superView hide |
|
1820 |
]. |
|
1864 | 1821 |
] |
1822 |
] |
|
1823 |
] |
|
1824 |
]. |
|
1825 |
self performSelectedAction. |
|
202 | 1826 |
]. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
1827 |
|
497 | 1828 |
"/ |
1829 |
"/ not within mySelf |
|
1830 |
"/ |
|
1831 |
||
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
1832 |
superMenu notNil ifTrue:[ |
1864 | 1833 |
hide := hideOnRelease. |
1834 |
hide ifFalse:[ |
|
3153
499fc16c974a
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
2975
diff
changeset
|
1835 |
superMenu shown ifFalse:[ |
1864 | 1836 |
superView notNil ifTrue:[ |
1837 |
superView shown ifTrue:[ |
|
1838 |
hide := true |
|
1839 |
] |
|
1840 |
] |
|
1841 |
]. |
|
1842 |
]. |
|
1843 |
hide ifTrue:[ |
|
1844 |
superView hide |
|
1845 |
]. |
|
202 | 1846 |
]. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
1847 |
|
435 | 1848 |
"/ (superView notNil and:[superView isPopUpView]) ifTrue:[ |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1849 |
"/ 'refetch focus' printNL. |
435 | 1850 |
"/ superView regainControl. |
1851 |
"/ superView getKeyboardFocus. |
|
1852 |
"/ superView hide |
|
1853 |
"/ ] |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
1854 |
|
497 | 1855 |
"Modified: 8.3.1996 / 14:06:15 / cg" |
202 | 1856 |
! |
1857 |
||
1858 |
keyPress:aKey x:x y:y |
|
491 | 1859 |
|
1860 |
<resource: #keyboard (#Return #MenuSelect #Escape)> |
|
1861 |
||
202 | 1862 |
|m| |
1863 |
||
1864 |
subMenuShown notNil ifTrue:[ |
|
1860 | 1865 |
subMenuShown menuView keyPress:aKey x:0 y:0. |
1866 |
^ self |
|
202 | 1867 |
]. |
1868 |
||
1869 |
" |
|
1870 |
Return, space or the (virtual) MenuSelect |
|
1871 |
key trigger a selected entry. |
|
1872 |
" |
|
1873 |
(aKey == #Return |
|
1874 |
or:[aKey == #MenuSelect |
|
1875 |
or:[aKey == Character space]]) ifTrue:[ |
|
1860 | 1876 |
selection notNil ifTrue:[ |
1877 |
(subMenus notNil and:[(m := subMenus at:selection) notNil]) ifTrue:[ |
|
1878 |
self showSubmenu:selection. |
|
1879 |
m hideOnLeave:false |
|
1880 |
] ifFalse:[ |
|
1881 |
subMenuShown := nil. |
|
1882 |
self buttonRelease:2 x:0 y:0. |
|
1883 |
] |
|
1884 |
]. |
|
1885 |
^ self |
|
202 | 1886 |
]. |
317
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
269
diff
changeset
|
1887 |
aKey == #Escape ifTrue:[ |
1860 | 1888 |
masterView notNil ifTrue:[ |
1889 |
masterView hideSubmenu. |
|
1890 |
masterView hide. |
|
3971 | 1891 |
^ self. |
1860 | 1892 |
]. |
1893 |
superView hide. |
|
1894 |
^ self |
|
317
f23de8b78f5e
Escape closes pullDownMenus & PopUpLists
Claus Gittinger <cg@exept.de>
parents:
269
diff
changeset
|
1895 |
]. |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1896 |
aKey == #CursorRight ifTrue:[ |
1860 | 1897 |
selection notNil ifTrue:[ |
1898 |
(subMenus notNil and:[(m := subMenus at:selection) notNil]) ifTrue:[ |
|
1899 |
self showSubmenu:selection. |
|
1900 |
m hideOnLeave:false. |
|
1901 |
^ self |
|
1902 |
] |
|
1903 |
]. |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1904 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1905 |
aKey == #CursorLeft ifTrue:[ |
1860 | 1906 |
masterView notNil ifTrue:[ |
1907 |
masterView hideSubmenu. |
|
1908 |
masterView regainControl. |
|
1909 |
]. |
|
1910 |
superView hide. |
|
1911 |
^ self |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1912 |
]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
1913 |
|
202 | 1914 |
super keyPress:aKey x:x y:y |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
1915 |
|
1059 | 1916 |
"Modified: 25.2.1997 / 23:37:57 / cg" |
202 | 1917 |
! |
1918 |
||
1919 |
pointerLeave:state |
|
1920 |
subMenuShown notNil ifTrue:[ |
|
1860 | 1921 |
^ self |
202 | 1922 |
]. |
1923 |
"/ self setSelectionForX:-1 y:-1. "force deselect" |
|
1860 | 1924 |
self setSelection:nil |
202 | 1925 |
"/ superMenu notNil ifTrue:[ |
1926 |
"/ superMenu regainControl. |
|
1927 |
"/ ] |
|
683 | 1928 |
|
1929 |
"Modified: 25.5.1996 / 12:27:18 / cg" |
|
202 | 1930 |
! ! |
1931 |
||
2751 | 1932 |
!MenuView methodsFor:'initialization & release'! |
202 | 1933 |
|
1934 |
create |
|
1935 |
super create. |
|
1936 |
subMenuShown := nil. |
|
1937 |
self resizeIfChanged |
|
1938 |
! |
|
1939 |
||
1940 |
destroy |
|
1941 |
" |
|
1942 |
have to destroy the submenus manually here, |
|
1943 |
since they are no real subviews of myself |
|
1944 |
" |
|
1945 |
subMenus notNil ifTrue:[ |
|
1946 |
subMenus do:[:m | |
|
1947 |
m notNil ifTrue:[ |
|
1948 |
m destroy |
|
1949 |
] |
|
1950 |
]. |
|
1951 |
subMenus := nil |
|
1952 |
]. |
|
1953 |
super destroy. |
|
1954 |
! |
|
1955 |
||
939 | 1956 |
fetchDeviceResources |
1957 |
"fetch device colors, to avoid reallocation at redraw time" |
|
1958 |
||
1959 |
super fetchDeviceResources. |
|
1960 |
||
1989 | 1961 |
checkColor notNil ifTrue:[checkColor := checkColor onDevice:device]. |
1962 |
disabledFgColor notNil ifTrue:[disabledFgColor := disabledFgColor onDevice:device]. |
|
939 | 1963 |
|
3464 | 1964 |
hilightFgColorNoFocus := hilightFgColor. |
1965 |
hilightBgColorNoFocus := hilightBgColor. |
|
1966 |
||
939 | 1967 |
"Created: 14.1.1997 / 00:08:55 / cg" |
1968 |
! |
|
1969 |
||
202 | 1970 |
initEvents |
1971 |
super initEvents. |
|
1972 |
self enableLeaveEvents. |
|
3911
2e2c5429a2f9
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
3903
diff
changeset
|
1973 |
self enableMotionEvents. |
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
1974 |
|
202 | 1975 |
windowGroup notNil ifTrue:[ |
3911
2e2c5429a2f9
preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents:
3903
diff
changeset
|
1976 |
windowGroup sensor compressMotionEvents:true |
202 | 1977 |
] |
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
1978 |
|
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
1979 |
"Modified: 7.3.1996 / 14:18:09 / cg" |
202 | 1980 |
! |
1981 |
||
1982 |
initStyle |
|
967 | 1983 |
"setup viewStyle specifics" |
1984 |
||
202 | 1985 |
|style| |
1986 |
||
1987 |
super initStyle. |
|
1988 |
||
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
1989 |
"/ DefaultFont notNil ifTrue:[font := DefaultFont on:device]. |
202 | 1990 |
|
1991 |
DefaultCheckColor notNil ifTrue:[ |
|
1989 | 1992 |
checkColor := DefaultCheckColor |
202 | 1993 |
] ifFalse:[ |
1989 | 1994 |
checkColor := fgColor. |
202 | 1995 |
]. |
939 | 1996 |
disabledFgColor := DefaultDisabledForegroundColor. |
2498 | 1997 |
disabledEtchedFgColor := DefaultDisabledEtchedForegroundColor. |
202 | 1998 |
|
1999 |
DefaultForegroundColor notNil ifTrue:[ |
|
1989 | 2000 |
fgColor := DefaultForegroundColor onDevice:device |
202 | 2001 |
]. |
2002 |
DefaultBackgroundColor notNil ifTrue:[ |
|
1989 | 2003 |
bgColor := DefaultBackgroundColor onDevice:device |
202 | 2004 |
]. |
2005 |
||
2006 |
DefaultShadowColor notNil ifTrue:[ |
|
1989 | 2007 |
shadowColor := DefaultShadowColor onDevice:device |
202 | 2008 |
]. |
2009 |
DefaultLightColor notNil ifTrue:[ |
|
1989 | 2010 |
lightColor := DefaultLightColor onDevice:device |
202 | 2011 |
]. |
2012 |
||
2013 |
DefaultHilightLevel notNil ifTrue:[ |
|
1989 | 2014 |
hilightLevel := DefaultHilightLevel |
202 | 2015 |
] ifFalse:[ |
1989 | 2016 |
hilightLevel := 0. |
202 | 2017 |
]. |
512 | 2018 |
"/ hilightStyle := DefaultHilightStyle. |
202 | 2019 |
|
2020 |
hilightFrameColor := DefaultHilightFrameColor. |
|
2021 |
||
2022 |
styleSheet is3D ifTrue:[ |
|
1989 | 2023 |
"some 3D style menu - set hilight defaults to same" |
2024 |
||
2025 |
DefaultHilightForegroundColor notNil ifTrue:[ |
|
2026 |
hilightFgColor := DefaultHilightForegroundColor onDevice:device |
|
2027 |
] ifFalse:[ |
|
2028 |
hilightFgColor := fgColor. |
|
2029 |
]. |
|
2030 |
DefaultHilightBackgroundColor notNil ifTrue:[ |
|
2031 |
hilightBgColor := DefaultHilightBackgroundColor onDevice:device |
|
2032 |
] ifFalse:[ |
|
2033 |
hilightBgColor := bgColor. |
|
2034 |
]. |
|
2035 |
DefaultLineLevel notNil ifTrue:[ |
|
2036 |
lineLevel := DefaultLineLevel |
|
2037 |
] ifFalse:[ |
|
2038 |
lineLevel := -1. |
|
2039 |
] |
|
202 | 2040 |
] ifFalse:[ |
1989 | 2041 |
"some 2D style menu - set hilight defaults to inverse" |
2042 |
DefaultHilightForegroundColor notNil ifTrue:[ |
|
2043 |
hilightFgColor := DefaultHilightForegroundColor onDevice:device |
|
2044 |
] ifFalse:[ |
|
2045 |
hilightFgColor := bgColor. |
|
2046 |
]. |
|
2047 |
DefaultHilightBackgroundColor notNil ifTrue:[ |
|
2048 |
hilightBgColor := DefaultHilightBackgroundColor onDevice:device |
|
2049 |
] ifFalse:[ |
|
2050 |
hilightBgColor := fgColor. |
|
2051 |
]. |
|
2052 |
DefaultLineLevel notNil ifTrue:[ |
|
2053 |
lineLevel := DefaultLineLevel |
|
2054 |
] ifFalse:[ |
|
2055 |
lineLevel := 0. |
|
2056 |
] |
|
202 | 2057 |
]. |
2058 |
||
2059 |
DefaultLineInset notNil ifTrue:[ |
|
1989 | 2060 |
lineInset := DefaultLineInset |
202 | 2061 |
] ifFalse:[ |
1989 | 2062 |
lineInset := (device horizontalPixelPerMillimeter * 0.8) rounded. |
202 | 2063 |
]. |
2064 |
||
2065 |
" |
|
2066 |
the following has to be changed to |
|
2067 |
use the styleSheet too |
|
2068 |
" |
|
2069 |
style := styleSheet name. |
|
2070 |
||
2071 |
(style == #iris) ifTrue:[ |
|
1989 | 2072 |
device hasGrayscales ifTrue:[ |
2073 |
lineSpacing := 3 |
|
2074 |
]. |
|
202 | 2075 |
]. |
2076 |
(style == #motif) ifTrue:[ |
|
1989 | 2077 |
lineSpacing := (2 * hilightLevel) |
202 | 2078 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2079 |
"/ stupid - these are clobbered somewhere; see initialize and recreate |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2080 |
"/ hilightStyle == #openwin ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2081 |
"/ "add some space for rounded-hilight area" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2082 |
"/ self leftMargin:(font height // 2 + 2 "inset of rounded rect") "10". |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2083 |
"/ ] ifFalse:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2084 |
"/ (hilightLevel ~~ 0) ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2085 |
"/ self leftMargin:hilightLevel abs + self margin abs + 1. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2086 |
"/ lineSpacing := lineSpacing max:(hilightLevel abs * 2). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2087 |
"/ ] |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2088 |
"/ ]. |
202 | 2089 |
(style == #st80) ifTrue:[ |
1989 | 2090 |
level := 0. |
202 | 2091 |
]. |
2092 |
DefaultViewBackground notNil ifTrue:[ |
|
1989 | 2093 |
viewBackground := DefaultViewBackground onDevice:device |
202 | 2094 |
]. |
2095 |
||
967 | 2096 |
"Modified: 22.1.1997 / 11:57:23 / cg" |
202 | 2097 |
! |
2098 |
||
2099 |
initialize |
|
2100 |
|style| |
|
2101 |
||
2102 |
super initialize. |
|
2103 |
hideOnRelease := false. |
|
2104 |
autoScroll := false. |
|
334 | 2105 |
sizeFixed := false. |
202 | 2106 |
|
2107 |
(((style := styleSheet name) ~~ #normal) |
|
2108 |
and:[style ~~ #mswindows]) ifTrue:[ |
|
4027 | 2109 |
self borderWidth: 1. |
4024
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2110 |
(style ~~ #st80) ifTrue:[self level:1] |
202 | 2111 |
]. |
2112 |
||
2113 |
"stupid - have to redo this ..." |
|
2114 |
hilightStyle == #openwin ifTrue:[ |
|
4024
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2115 |
"add some space for rounded-hilight area" |
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2116 |
self leftMargin:(font height " // 2" + 2 "inset of rounded rect") "10". |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2117 |
] ifFalse:[ |
4024
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2118 |
(hilightLevel ~~ 0) ifTrue:[ |
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2119 |
self leftMargin:hilightLevel abs + margin abs + 1. |
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2120 |
lineSpacing := lineSpacing max:(hilightLevel abs * 2). |
7a30c88fc34d
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
3980
diff
changeset
|
2121 |
] |
202 | 2122 |
]. |
334 | 2123 |
|
751 | 2124 |
"Modified: 5.6.1996 / 14:36:56 / cg" |
202 | 2125 |
! |
2126 |
||
2127 |
recreate |
|
2258 | 2128 |
"when recreated after a snapin or a migration, resize myself, in case |
202 | 2129 |
font dimensions have changed on the display" |
2130 |
||
2131 |
super recreate. |
|
2132 |
hilightStyle == #openwin ifTrue:[ |
|
2258 | 2133 |
"add some space for rounded-hilight area" |
2134 |
self leftMargin:(font height // 2 + 2 "inset of rounded rect") "10". |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2135 |
] ifFalse:[ |
2258 | 2136 |
(hilightLevel ~~ 0) ifTrue:[ |
2137 |
self leftMargin:hilightLevel abs + self margin abs + 1. |
|
2138 |
lineSpacing := lineSpacing max:(hilightLevel abs * 2). |
|
2139 |
] |
|
202 | 2140 |
]. |
2141 |
self resize |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2142 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2143 |
"Modified: 28.2.1996 / 19:39:37 / cg" |
202 | 2144 |
! |
2145 |
||
2146 |
reinitialize |
|
2147 |
"this is called right after snapIn; |
|
2148 |
a kind of kludge - reset cursor (in case the save was |
|
2149 |
done with myself being shown and active)" |
|
2150 |
||
2151 |
super reinitialize. |
|
2152 |
selection := nil. "self selection:nil." |
|
2153 |
self showPassive |
|
0 | 2154 |
! ! |
2155 |
||
2156 |
!MenuView methodsFor:'private'! |
|
2157 |
||
7 | 2158 |
hideSubmenu |
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2159 |
"hide the currently shown subMenu (if any)" |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2160 |
|
1735
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2161 |
|m id| |
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2162 |
|
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2163 |
(m := subMenuShown) notNil ifTrue:[ |
1735
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2164 |
"/ race condition kludge ... |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2165 |
m realized ifFalse:[ |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2166 |
(id := m id) notNil ifTrue:[ |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2167 |
device unmapWindow:id. |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2168 |
] |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2169 |
] ifTrue:[ |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2170 |
m hide. |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2171 |
]. |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2172 |
|
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2173 |
subMenuShown := nil. |
3f596be86a0d
care for nil id when unmapping
Claus Gittinger <cg@exept.de>
parents:
1649
diff
changeset
|
2174 |
self setSelection:nil. |
7 | 2175 |
]. |
497 | 2176 |
|
1059 | 2177 |
"Modified: 25.2.1997 / 23:38:50 / cg" |
7 | 2178 |
! |
2179 |
||
202 | 2180 |
isCheckItem:line |
1919
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2181 |
"return true if \c, \b or \t is contained in the line arg. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2182 |
Care for '\\'." |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2183 |
|
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2184 |
|idx| |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2185 |
|
3294
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2186 |
line isString ifTrue:[ |
1919
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2187 |
idx := 1. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2188 |
[idx ~~ 0] whileTrue:[ |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2189 |
idx := line indexOf:$\ startingAt:idx. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2190 |
(idx ~~ 0) ifTrue:[ |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2191 |
idx < line size ifTrue:[ |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2192 |
('cbt' includes:(line at:(idx+1))) ifTrue:[ |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2193 |
^ true |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2194 |
]. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2195 |
]. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2196 |
idx := idx + 2. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2197 |
]. |
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2198 |
]. |
202 | 2199 |
]. |
2200 |
^ false. |
|
405
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
2201 |
|
1919
7752e8980de5
allow for \\ to allow the single \ to be displayed (DOS filenames)
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2202 |
"Modified: / 31.5.1999 / 12:59:07 / cg" |
119 | 2203 |
! |
2204 |
||
202 | 2205 |
isGraphicItem:line |
2206 |
(line = '-') ifTrue:[^ true]. |
|
2207 |
(line = '=') ifTrue:[^ true]. |
|
2208 |
(line = '') ifTrue:[^ true]. |
|
2209 |
^ false. |
|
127 | 2210 |
! |
119 | 2211 |
|
2973 | 2212 |
labelWithoutDoubleAmpersands:label |
3294
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2213 |
(label isString and:[label includesString:'&&']) ifTrue:[ |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2214 |
^ label copyReplaceString:'&&' withString:'&' |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2215 |
] ifFalse:[ |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2216 |
^ label |
a3266e46b191
handle nonString items correctly
Stefan Vogel <sv@exept.de>
parents:
3153
diff
changeset
|
2217 |
]. |
2973 | 2218 |
! |
2219 |
||
463 | 2220 |
performSelectedAction |
878 | 2221 |
|theSelector theAction isCheck checkOn val idx didItHere| |
463 | 2222 |
|
2069 | 2223 |
(superView notNil and:[superView isPopUpView]) ifTrue:[superView hideForAction]. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2224 |
superMenu notNil ifTrue:[superMenu submenuTriggered]. |
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2225 |
|
517
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
2226 |
idx := selection. |
fc4ed55dcd35
added action-blocks (per menu item)
Claus Gittinger <cg@exept.de>
parents:
512
diff
changeset
|
2227 |
idx notNil ifTrue:[ |
878 | 2228 |
|
2069 | 2229 |
(subMenus isNil or:[(subMenus at:idx) isNil]) ifTrue:[ |
2230 |
didItHere := false. |
|
2231 |
||
2232 |
self showActive. |
|
2233 |
[ |
|
2234 |
superMenu notNil ifTrue:[ |
|
2235 |
superMenu showActive |
|
2236 |
]. |
|
2237 |
||
2238 |
val := idx. |
|
2239 |
args notNil ifTrue:[ |
|
2240 |
val := args at:idx |
|
2241 |
]. |
|
2242 |
||
2243 |
isCheck := false. |
|
2244 |
onOffFlags notNil ifTrue:[ |
|
2245 |
onOffFlags size >= idx ifTrue:[ |
|
2246 |
checkOn := (onOffFlags at:idx). |
|
2247 |
isCheck := checkOn notNil. |
|
2248 |
isCheck ifTrue:[ |
|
2249 |
checkOn := val := checkOn not. |
|
2250 |
onOffFlags at:idx put:checkOn. |
|
2251 |
] |
|
2252 |
] |
|
2253 |
]. |
|
2254 |
||
2255 |
" |
|
2256 |
ST-80 style model notification |
|
2257 |
" |
|
2258 |
self sendChangeMessageWith:val. |
|
2259 |
||
2260 |
" |
|
2261 |
item actions or selectors-array |
|
2262 |
" |
|
2263 |
device activePointerGrab == self ifTrue:[ |
|
2264 |
device ungrabPointer. |
|
2265 |
]. |
|
2266 |
||
2267 |
actions notNil ifTrue:[ |
|
2268 |
theAction := actions at:idx ifAbsent:nil. |
|
2269 |
]. |
|
2270 |
||
2271 |
theAction isNil ifTrue: [ |
|
2272 |
selectors notNil ifTrue: [ |
|
2273 |
||
2274 |
"/ selectors may be: |
|
2275 |
"/ - a single selector used for all items |
|
2276 |
"/ - an array of selectors used per item |
|
2277 |
||
2278 |
selectors isSymbol ifTrue:[ |
|
2279 |
theSelector := selectors |
|
2280 |
] ifFalse:[ |
|
2281 |
(idx notNil |
|
2282 |
and:[idx <= selectors size]) ifTrue:[ |
|
2283 |
theSelector := selectors at:idx |
|
2284 |
] |
|
2285 |
]. |
|
2286 |
]. |
|
2287 |
]. |
|
2288 |
||
2289 |
(theSelector notNil |
|
2290 |
or:[theAction notNil]) ifTrue:[ |
|
2291 |
AbortSignal handle:[:ex | |
|
2292 |
ex return |
|
2293 |
] do:[ |
|
2294 |
|theReceiver| |
|
2295 |
||
2296 |
didItHere := true. |
|
2297 |
theAction notNil ifTrue:[ |
|
2502
8f5b721ac183
use new #perform:withOptionalArgument:
Claus Gittinger <cg@exept.de>
parents:
2498
diff
changeset
|
2298 |
theAction valueWithOptionalArgument:val |
2069 | 2299 |
] ifFalse:[ |
2300 |
"/ support for ST-80 style message splitting: |
|
2301 |
"/ if there is a menuPerformer it gets the |
|
2302 |
"/ message (if understood). |
|
2303 |
"/ Otherwise if there is a model, try that. |
|
2304 |
"/ Finally, if there is a receiver, |
|
2305 |
"/ its sent to that one. |
|
2306 |
||
2307 |
theReceiver := menuPerformer. |
|
2308 |
(theReceiver isNil |
|
2309 |
or:[(theReceiver respondsTo:theSelector) not]) |
|
2310 |
ifTrue:[ |
|
2311 |
theReceiver := model. |
|
2312 |
]. |
|
2313 |
(theReceiver isNil |
|
2314 |
or:[(theReceiver respondsTo:theSelector) not]) |
|
2315 |
ifTrue:[ |
|
2316 |
theReceiver := receiver. |
|
2317 |
]. |
|
2318 |
||
2683 | 2319 |
theSelector isArray ifTrue:[ |
2320 |
theReceiver perform:(theSelector first) withArguments:(theSelector copyFrom:2) |
|
2069 | 2321 |
] ifFalse:[ |
2683 | 2322 |
theSelector numArgs == 0 ifTrue:[ |
2323 |
theReceiver perform:theSelector |
|
2324 |
] ifFalse:[ |
|
2325 |
isCheck ifTrue:[ |
|
2326 |
self redrawLine:idx. |
|
2327 |
val := checkOn. |
|
2328 |
]. |
|
2329 |
||
2330 |
theReceiver perform:theSelector with:val |
|
2331 |
] |
|
2069 | 2332 |
] |
2333 |
] |
|
2334 |
||
2335 |
] |
|
2336 |
]. |
|
2337 |
||
2338 |
" |
|
2339 |
any action-block ? |
|
2340 |
" |
|
2341 |
actionBlock notNil ifTrue:[ |
|
2342 |
AbortSignal handle:[:ex | |
|
2343 |
ex return |
|
2344 |
] do:[ |
|
2345 |
didItHere ifTrue:[ |
|
2346 |
val := nil |
|
2347 |
]. |
|
2348 |
actionBlock numArgs == 1 ifTrue:[ |
|
2349 |
actionBlock value:val |
|
2350 |
] ifFalse:[ |
|
2351 |
actionBlock value:self value:val |
|
2352 |
] |
|
2353 |
] |
|
2354 |
]. |
|
2355 |
||
2521
ca205c023cc1
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
2502
diff
changeset
|
2356 |
] ensure:[ |
2069 | 2357 |
realized ifTrue:[ |
2358 |
self showPassive. |
|
2359 |
]. |
|
2360 |
superMenu notNil ifTrue:[ |
|
2361 |
superMenu showPassive |
|
2362 |
] |
|
2363 |
]. |
|
2364 |
]. |
|
463 | 2365 |
] |
2366 |
||
2367 |
"Created: 4.3.1996 / 11:19:22 / cg" |
|
963 | 2368 |
"Modified: 21.1.1997 / 15:42:52 / cg" |
463 | 2369 |
! |
2370 |
||
127 | 2371 |
recomputeSize |
2372 |
"resize myself to my preferred size |
|
2373 |
OBSOLETE - use resize" |
|
2374 |
||
2375 |
self resize. |
|
0 | 2376 |
! |
2377 |
||
202 | 2378 |
resize |
2379 |
"resize myself to my preferred size" |
|
77 | 2380 |
|
337 | 2381 |
sizeFixed == true ifFalse:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2382 |
widthOfWidestLine := nil. "/ i.e. unknown |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2383 |
super resize. |
334 | 2384 |
] |
2385 |
||
337 | 2386 |
"Modified: 9.2.1996 / 02:42:32 / cg" |
202 | 2387 |
! |
77 | 2388 |
|
202 | 2389 |
resizeIfChanged |
2390 |
needResize == true ifTrue:[ |
|
2391 |
self resize. |
|
2392 |
needResize := false |
|
2393 |
] |
|
77 | 2394 |
! |
2395 |
||
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2396 |
selectionChangedFrom:oldSelection |
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2397 |
|
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2398 |
"Created: 4.3.1996 / 22:10:54 / cg" |
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2399 |
! |
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2400 |
|
0 | 2401 |
setSelectionForX:x y:y |
77 | 2402 |
"select whatever is under x/y coordinate - if there is |
2403 |
a subMenu, show it" |
|
2404 |
||
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2405 |
<resource: #style (#'menu.subMenuPopInRightHalfOnly')> |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2406 |
|
133 | 2407 |
|newSelection subMenu| |
0 | 2408 |
|
38 | 2409 |
(x < 0 |
2410 |
or:[x >= width |
|
2411 |
or:[y < 0 |
|
2412 |
or:[y >= height]]]) ifTrue:[ |
|
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2413 |
" |
1860 | 2414 |
moved outside |
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2415 |
" |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2416 |
subMenuShown notNil ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2417 |
^ self |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2418 |
]. |
1860 | 2419 |
|
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2420 |
superMenu notNil ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2421 |
superMenu regainControl |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2422 |
]. |
38 | 2423 |
]. |
2424 |
||
0 | 2425 |
newSelection := self positionToSelectionX:x y:y. |
7 | 2426 |
newSelection ~= selection ifTrue:[ |
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2427 |
newSelection notNil ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2428 |
(enableFlags at:newSelection) ifFalse:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2429 |
newSelection := nil |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2430 |
] |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2431 |
]. |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2432 |
|
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2433 |
subMenuShown notNil ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2434 |
self hideSubmenu. |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2435 |
]. |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2436 |
|
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2437 |
self setSelection:newSelection. |
133 | 2438 |
]. |
7 | 2439 |
|
133 | 2440 |
subMenu := nil. |
2441 |
selection notNil ifTrue:[ |
|
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2442 |
subMenus notNil ifTrue:[ |
1864 | 2443 |
((styleSheet at:#'menu.subMenuPopInRightHalfOnly' default:false) not |
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2444 |
or:[x > (width // 2)]) ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2445 |
subMenu := (subMenus at:selection) |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2446 |
] |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2447 |
] |
133 | 2448 |
]. |
2449 |
subMenu notNil ifTrue:[ |
|
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2450 |
self showSubmenu:selection. |
133 | 2451 |
] ifFalse:[ |
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2452 |
subMenuShown notNil ifTrue:[ |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2453 |
self hideSubmenu. |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2454 |
]. |
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2455 |
subMenuShown := nil |
1864 | 2456 |
]. |
497 | 2457 |
|
1627
38d58b70124e
style option: submenu pops up everywhere in item or
Claus Gittinger <cg@exept.de>
parents:
1532
diff
changeset
|
2458 |
"Modified: / 29.7.1998 / 23:36:25 / cg" |
131 | 2459 |
! |
2460 |
||
202 | 2461 |
showSubmenu:index |
2462 |
"show subMenu at index" |
|
2463 |
||
4134 | 2464 |
|org mx my menuOrBlock menu rightInset| |
2465 |
||
2466 |
rightInset := 5. |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2467 |
|
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2468 |
menuOrBlock := subMenus at:index. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2469 |
menuOrBlock isNil ifTrue:[^ self]. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2470 |
menuOrBlock == subMenuShown ifTrue:[^ self]. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2471 |
|
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2472 |
menuOrBlock isBlock ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2473 |
menuOrBlock == blockOfSubMenuShown ifTrue:[^ self]. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2474 |
menu := menuOrBlock value. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2475 |
] ifFalse:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2476 |
menu := menuOrBlock. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2477 |
]. |
202 | 2478 |
|
4134 | 2479 |
mx := width - rightInset. |
202 | 2480 |
my := self yOfVisibleLine:index. |
2481 |
" |
|
2482 |
need to know the physical screen coordinate, |
|
2483 |
to map the subview there |
|
2484 |
" |
|
2434
a9b9d8f2ab5b
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2485 |
org := device translatePoint:(mx @ my) fromView:self toView:nil. |
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
2486 |
|
202 | 2487 |
" |
2488 |
before showing, process all of my expose events |
|
2489 |
" |
|
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2490 |
"/ "/ mhmh - is this still needed ? |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2491 |
"/ windowGroup notNil ifTrue:[ |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2492 |
"/ windowGroup processExposeEvents |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2493 |
"/ ]. |
202 | 2494 |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2495 |
menu topView device:device. "/ req'd for multiDisplay operation |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2496 |
menu superMenu:self. |
131 | 2497 |
|
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
2498 |
actionBlock notNil ifTrue:[ |
1860 | 2499 |
"/ mhmh - I am an ST-80 style menu |
2500 |
"/ which does not send any messages to the receiver, |
|
2501 |
"/ but returns the selector instead. |
|
2502 |
"/ let my submenu do so as well ... |
|
2503 |
||
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2504 |
menu menuView action:actionBlock |
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
2505 |
]. |
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
2506 |
|
202 | 2507 |
" |
2508 |
realize the submenu in MY windowgroup |
|
2509 |
" |
|
2510 |
windowGroup notNil ifTrue:[ |
|
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2511 |
menu windowGroup:windowGroup. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2512 |
windowGroup addTopView:menu. |
202 | 2513 |
]. |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2514 |
menu fixSize. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2515 |
menu origin:org. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2516 |
menu makeFullyVisible. |
4133 | 2517 |
|
2518 |
"/ cg: Jan-2010 |
|
2519 |
"/ if the submenu covers me, try to show it to the left instead of the right) |
|
4134 | 2520 |
(menu screenBounds intersects:(self screenBounds insetBy:(rightInset*2))) ifTrue:[ |
2521 |
menu origin:(org - (width @ 0) - (menu width @ 0) + ((rightInset*2) @ 0)). |
|
4133 | 2522 |
menu makeFullyVisible. |
2523 |
]. |
|
2524 |
||
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2525 |
menu noShadow. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2526 |
menu haveControl:true. "/ grap pointers during mapped |
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2527 |
|
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2528 |
"/ race condition kludge ... |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2529 |
menu realized ifFalse:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2530 |
menu realize. |
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2531 |
] ifTrue:[ |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2532 |
device mapWindow:menu id. |
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2533 |
]. |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2534 |
"/ device flush. |
3980
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2535 |
menuOrBlock isBlock ifTrue:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2536 |
blockOfSubMenuShown := menuOrBlock |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2537 |
] ifFalse:[ |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2538 |
blockOfSubMenuShown := nil |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2539 |
]. |
941724541993
allow for a block given as submenu
Claus Gittinger <cg@exept.de>
parents:
3971
diff
changeset
|
2540 |
subMenuShown := menu |
495
d993f23ea658
fixed subMenus with a menuPerformer (now also behaves the ST-80 way)
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
2541 |
|
2434
a9b9d8f2ab5b
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
2433
diff
changeset
|
2542 |
"Modified: / 10.10.2001 / 14:12:44 / cg" |
0 | 2543 |
! ! |
2544 |
||
202 | 2545 |
!MenuView methodsFor:'queries'! |
0 | 2546 |
|
202 | 2547 |
preferredExtent |
969 | 2548 |
"compute & return my preferredExtent from labels width's" |
2549 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2550 |
|margin2 w h extra| |
202 | 2551 |
|
3752
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2552 |
"/ If I have an explicit preferredExtent.. |
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2553 |
explicitExtent notNil ifTrue:[ |
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2554 |
^ explicitExtent |
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2555 |
]. |
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2556 |
|
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2557 |
"/ If I have a cached preferredExtent value.. |
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2558 |
preferredExtent notNil ifTrue:[ |
3752
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2559 |
^ preferredExtent |
714
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2560 |
]. |
5ff02d2d9fa7
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2561 |
|
202 | 2562 |
widthOfWidestLine := nil. "/ i.e. unknown |
119 | 2563 |
|
202 | 2564 |
margin2 := margin * 2. |
2565 |
w := self widthOfContents + leftMargin + leftMargin + margin2. |
|
2566 |
h := (self numberOfLines) * fontHeight - lineSpacing + (2 * topMargin) + margin2. |
|
228 | 2567 |
hilightLevel ~~ 0 ifTrue:[ |
3752
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2568 |
h := h + (hilightLevel abs) |
224 | 2569 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2570 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2571 |
extra := 0. |
202 | 2572 |
"if there is a submenu, add some space for the right arrow" |
2573 |
subMenus notNil ifTrue:[ |
|
3752
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2574 |
extra := 16 |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2575 |
]. |
461
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
2576 |
((ShowAcceleratorKeys ~~ false) and:[shortKeys notNil]) ifTrue:[ |
3752
9c3b292df738
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3551
diff
changeset
|
2577 |
extra := extra max:(self shortKeyInset) + 10 "/ spacing |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2578 |
]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2579 |
^ ((w+extra) @ h). |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2580 |
|
969 | 2581 |
"Modified: 23.1.1997 / 02:36:17 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2582 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2583 |
|
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2584 |
selectedItemHasSubmenu |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2585 |
selection isNil ifTrue:[^false]. |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2586 |
^ (subMenus notNil and:[(subMenus at:selection) notNil]). |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2587 |
|
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2588 |
"Modified: 20.11.1997 / 00:07:50 / cg" |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2589 |
! |
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2590 |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2591 |
shortKeyInset |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2592 |
"compute the width req'd for the shortKey" |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2593 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2594 |
maxShortKeyStringLen isNil ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2595 |
|
3323
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2596 |
shortKeys isNil ifTrue:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2597 |
maxShortKeyStringLen := 0 |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2598 |
] ifFalse:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2599 |
maxShortKeyStringLen := shortKeys |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2600 |
inject:0 |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2601 |
into:[:maxSoFar :thisKey | |short| |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2602 |
|
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2603 |
thisKey isNil ifTrue:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2604 |
maxSoFar |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2605 |
] ifFalse:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2606 |
short := device shortKeyStringFor:thisKey. |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2607 |
short isNil ifTrue:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2608 |
maxSoFar |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2609 |
] ifFalse:[ |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2610 |
maxSoFar max:(font widthOf:short) |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2611 |
] |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2612 |
] |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2613 |
] |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2614 |
]. |
202 | 2615 |
]. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2616 |
^ maxShortKeyStringLen |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2617 |
|
3323
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2618 |
"Created: / 28-02-1996 / 16:30:09 / cg" |
ce80842d41e0
shortKey handling moved to device (shared between menu and menuPanel)
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
2619 |
"Modified: / 08-08-2006 / 15:47:07 / cg" |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2620 |
! |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2621 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2622 |
shortKeyPrefixFor:aModifier |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2623 |
|m| |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2624 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2625 |
"/ aModifier = 'Alt' ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2626 |
"/ ^ '@-' |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2627 |
"/ ]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2628 |
"/ aModifier = 'Cmd' ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2629 |
"/ ^ '@-' |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2630 |
"/ ]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2631 |
"/ aModifier = 'Meta' ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2632 |
"/ ^ '$-' |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2633 |
"/ ]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2634 |
"/ aModifier = 'Ctrl' ifTrue:[ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2635 |
"/ ^ '^-' |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2636 |
"/ ]. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2637 |
"/ ^ aModifier. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2638 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2639 |
m := device modifierKeyTopFor:aModifier. |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2640 |
m notNil ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2641 |
^ m , '-' |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2642 |
]. |
508 | 2643 |
^ aModifier. |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2644 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2645 |
"Created: 28.2.1996 / 16:32:17 / cg" |
508 | 2646 |
"Modified: 20.3.1996 / 17:03:34 / cg" |
77 | 2647 |
! ! |
2648 |
||
0 | 2649 |
!MenuView methodsFor:'redrawing'! |
2650 |
||
202 | 2651 |
redrawFromVisibleLine:start to:stop |
2652 |
"redraw a line range - redefined to care for special entries." |
|
2653 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2654 |
"/ the natural way to do it is: |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2655 |
"/ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2656 |
"/ start to:stop do:[:visLine | |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2657 |
"/ self redrawVisibleLine:visLine |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2658 |
"/ ] |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2659 |
"/ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2660 |
"/ but I want to draw the stuff in big chunks for slow machines ... |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2661 |
"/ Q: is it worth it ? |
191
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
2662 |
|
202 | 2663 |
|first |
2664 |
index "{ Class: SmallInteger }" |
|
2665 |
current "{ Class: SmallInteger }" |
|
2666 |
line special index0| |
|
2667 |
||
2668 |
index0 := self visibleLineToListLine:start. |
|
2669 |
index0 notNil ifTrue:[ |
|
2959 | 2670 |
index := index0. |
2671 |
first := start. |
|
2672 |
current := start. |
|
2673 |
[current <= stop] whileTrue:[ |
|
2674 |
line := self visibleAt:current. |
|
2675 |
line notNil ifTrue:[ |
|
2676 |
line isText ifFalse:[ |
|
2960 | 2677 |
line := line asString string |
2959 | 2678 |
] |
2679 |
]. |
|
2680 |
||
2681 |
special := line notNil |
|
2682 |
and:[line isString |
|
2683 |
and:[(self isGraphicItem:line) |
|
2684 |
or:[line includes:$\ ]]]. |
|
2685 |
||
2686 |
(special |
|
2687 |
or:[shortKeys notNil |
|
2688 |
or:[(enableFlags at:index) not]]) ifTrue:[ |
|
2689 |
"a special case" |
|
2690 |
(first < current) ifTrue:[ |
|
2691 |
super redrawFromVisibleLine:first to:(current - 1) |
|
2692 |
]. |
|
2693 |
self redrawVisibleLine:current. |
|
2694 |
first := current + 1 |
|
2695 |
]. |
|
2696 |
current := current + 1. |
|
2697 |
index := index + 1 |
|
2698 |
]. |
|
2699 |
(first < current) ifTrue:[ |
|
2700 |
super redrawFromVisibleLine:first to:(current - 1) |
|
2701 |
]. |
|
2702 |
||
2703 |
"draw submenu marks" |
|
2704 |
subMenus notNil ifTrue:[ |
|
2705 |
index := index0. |
|
2706 |
start to:stop do:[:l | |
|
2707 |
index <= subMenus size ifTrue:[ |
|
2708 |
(subMenus at:index) notNil ifTrue:[ |
|
2709 |
self drawRightArrowInVisibleLine:l |
|
2710 |
]. |
|
2711 |
index := index + 1 |
|
2712 |
] |
|
2713 |
] |
|
2714 |
] |
|
202 | 2715 |
] |
405
39b9b0f04ccc
allow checkmarks at any position
Claus Gittinger <cg@exept.de>
parents:
392
diff
changeset
|
2716 |
|
635
cb2ac261994b
handle non-string items better
Claus Gittinger <cg@exept.de>
parents:
624
diff
changeset
|
2717 |
"Modified: 12.5.1996 / 21:13:31 / cg" |
0 | 2718 |
! |
2719 |
||
2720 |
redrawVisibleLine:visLineNr |
|
63 | 2721 |
"redefined from normal list-line drawing, to handle special |
2722 |
lines. These are: |
|
2498 | 2723 |
lines consisting of '-' only: draw a horizontal separating line |
2724 |
lines consisting of '=' only: draw double separating line |
|
2725 |
empty line : leave blank |
|
63 | 2726 |
there may be more in the future. |
2727 |
" |
|
2728 |
||
2729 |
|line lineNr y isSpecial isSeparatingLine |
|
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2730 |
isDoubleLine right clr1 clr2 text key| |
0 | 2731 |
|
2732 |
line := self visibleAt:visLineNr. |
|
2733 |
||
63 | 2734 |
isSpecial := isDoubleLine := isSeparatingLine := false. |
0 | 2735 |
(line = '-') ifTrue:[ |
2498 | 2736 |
isSeparatingLine := isSpecial := true. |
0 | 2737 |
] ifFalse:[ |
2498 | 2738 |
(line = '=') ifTrue:[ |
2739 |
isSeparatingLine := isSpecial := isDoubleLine := true. |
|
2740 |
] ifFalse:[ |
|
2741 |
(line = '') ifTrue:[ |
|
2742 |
isSpecial := true |
|
2743 |
] |
|
2744 |
] |
|
0 | 2745 |
]. |
63 | 2746 |
|
0 | 2747 |
isSpecial ifFalse:[ |
2498 | 2748 |
lineNr := self visibleLineToListLine:visLineNr. |
2749 |
(enableFlags at:lineNr) ifFalse:[ |
|
2750 |
text := self visibleAt:visLineNr. |
|
2751 |
disabledEtchedFgColor notNil ifTrue:[ |
|
2752 |
text := text asText emphasisAllAdd:(#etchColor -> disabledEtchedFgColor) |
|
2753 |
]. |
|
2754 |
self |
|
2755 |
drawLine:text |
|
2756 |
atX:(textStartLeft - viewOrigin x) |
|
2757 |
inVisible:visLineNr |
|
2758 |
with:disabledFgColor |
|
2759 |
and:bgColor. |
|
2572
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2760 |
|
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2761 |
"/ |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2762 |
"/ is there a shortKey ? |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2763 |
"/ |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2764 |
((ShowAcceleratorKeys ~~ false) |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2765 |
and:[shortKeys notNil |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2766 |
and:[(key := shortKeys at:lineNr ifAbsent:nil) notNil]]) ifTrue:[ |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2767 |
self drawAccelerator:key inVisibleLine:visLineNr with:disabledFgColor and:bgColor |
9b09dd9d9dae
dont forget to draw accelerator when disabled
Claus Gittinger <cg@exept.de>
parents:
2521
diff
changeset
|
2768 |
] |
2498 | 2769 |
"/ self drawVisibleLine:visLineNr with:disabledFgColor and:bgColor |
2770 |
] ifTrue:[ |
|
2771 |
super redrawVisibleLine:visLineNr |
|
2772 |
]. |
|
2773 |
||
2774 |
"/ |
|
2775 |
"/ is there a submenu ? |
|
2776 |
"/ |
|
2777 |
(subMenus notNil and:[(subMenus at:lineNr ifAbsent:nil) notNil]) ifTrue:[ |
|
2778 |
self drawRightArrowInVisibleLine:visLineNr |
|
2779 |
]. |
|
2780 |
^ self |
|
0 | 2781 |
]. |
2782 |
||
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2783 |
"/ |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2784 |
"/ handle separating lines |
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2785 |
"/ |
0 | 2786 |
|
59 | 2787 |
y := self yOfVisibleLine:visLineNr. |
38 | 2788 |
|
2789 |
self paint:bgColor. |
|
2790 |
self fillRectangleX:0 y:y width:width height:fontHeight. |
|
2791 |
||
0 | 2792 |
isSeparatingLine ifTrue:[ |
2498 | 2793 |
y := y + (fontHeight // 2). |
2794 |
isDoubleLine ifTrue:[ |
|
2795 |
y := y - (fontHeight // 8). |
|
2796 |
]. |
|
2797 |
||
2798 |
right := width - 1 - lineInset. |
|
2799 |
||
2800 |
lineLevel == 0 ifTrue:[ |
|
2801 |
self paint:fgColor. |
|
2802 |
self displayLineFromX:lineInset y:y toX:right y:y. |
|
2803 |
isDoubleLine ifTrue:[ |
|
2804 |
y := y + (fontHeight // 4). |
|
2805 |
self displayLineFromX:lineInset y:y toX:right y:y |
|
2806 |
] |
|
2807 |
] ifFalse:[ |
|
2808 |
"the inset on each side" |
|
2809 |
||
2810 |
lineLevel < 0 ifTrue:[ |
|
2811 |
clr1 := shadowColor. |
|
2812 |
clr2 := lightColor. |
|
2813 |
] ifFalse:[ |
|
2814 |
clr1 := lightColor. |
|
2815 |
clr2 := shadowColor. |
|
2816 |
]. |
|
2817 |
||
2818 |
self paint:clr1. |
|
2819 |
self displayLineFromX:lineInset y:y toX:right y:y. |
|
2820 |
self paint:clr2. |
|
2821 |
y := y + 1. |
|
2822 |
self displayLineFromX:lineInset y:y toX:right y:y. |
|
2823 |
isDoubleLine ifTrue:[ |
|
2824 |
y := y + (fontHeight // 4). |
|
2825 |
self displayLineFromX:lineInset y:y toX:right y:y. |
|
2826 |
y := y - 1. |
|
2827 |
self paint:clr1. |
|
2828 |
self displayLineFromX:lineInset y:y toX:right y:y. |
|
2829 |
] |
|
2830 |
] |
|
0 | 2831 |
] |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2832 |
|
461
45282807f7fa
handle shortKey & submenu-arrow in one line; allow turning of of accelerator display
Claus Gittinger <cg@exept.de>
parents:
460
diff
changeset
|
2833 |
"Modified: 2.3.1996 / 14:48:08 / cg" |
0 | 2834 |
! |
2835 |
||
202 | 2836 |
redrawVisibleLine:visLine col:col |
2837 |
"redefined to always draw a full line - for openwin handling" |
|
0 | 2838 |
|
202 | 2839 |
self redrawVisibleLine:visLine |
2840 |
! |
|
97 | 2841 |
|
202 | 2842 |
redrawVisibleLine:visLine from:startCol |
2843 |
"redefined to always draw a full line - for openwin handling" |
|
21 | 2844 |
|
202 | 2845 |
self redrawVisibleLine:visLine |
2846 |
! |
|
2847 |
||
2848 |
redrawVisibleLine:visLine from:startCol to:endCol |
|
2849 |
"redefined to always draw a full line - for openwin handling" |
|
2850 |
||
2851 |
self redrawVisibleLine:visLine |
|
0 | 2852 |
! ! |
2853 |
||
202 | 2854 |
!MenuView methodsFor:'selections'! |
2855 |
||
2856 |
isValidSelection:aNumber |
|
2857 |
"return true, if aNumber is ok for a selection lineNo" |
|
2858 |
||
2859 |
|line| |
|
2860 |
||
2861 |
(super isValidSelection:aNumber) ifFalse:[^ false]. |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1627
diff
changeset
|
2862 |
(enableFlags at:aNumber) ifFalse:[^ false]. |
202 | 2863 |
|
2864 |
line := self listAt:aNumber. |
|
2865 |
^ (self isGraphicItem:line) not |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1627
diff
changeset
|
2866 |
|
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1627
diff
changeset
|
2867 |
"Modified: / 8.8.1998 / 03:31:14 / cg" |
202 | 2868 |
! ! |
191
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
2869 |
|
202 | 2870 |
!MenuView methodsFor:'showing'! |
2871 |
||
2872 |
realize |
|
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2873 |
self resizeIfChanged. |
202 | 2874 |
super realize |
426
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2875 |
|
bf35bf40ab11
changes for accelerator-display
Claus Gittinger <cg@exept.de>
parents:
408
diff
changeset
|
2876 |
"Modified: 28.2.1996 / 18:17:05 / cg" |
202 | 2877 |
! |
2878 |
||
2879 |
show |
|
3551
8cca2a43e849
use accessors for hiddenOnRealize and explicitExtents
Claus Gittinger <cg@exept.de>
parents:
3464
diff
changeset
|
2880 |
self hiddenOnRealize:false. |
509 | 2881 |
self showPassive. |
202 | 2882 |
self realize |
509 | 2883 |
|
2884 |
"Modified: 21.3.1996 / 17:21:46 / cg" |
|
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2885 |
! |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2886 |
|
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2887 |
unmap |
1858 | 2888 |
"unmap the view - the view stays created (but invisible), and can be remapped again later." |
2889 |
||
1058
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2890 |
self hideSubmenu. |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2891 |
super unmap. |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2892 |
|
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2893 |
"Created: 25.2.1997 / 23:01:56 / cg" |
bf4c27091f6b
ignore motions if more are pending;
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
2894 |
"Modified: 25.2.1997 / 23:02:09 / cg" |
191
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
2895 |
! ! |
5ccbde40bb6b
draw strings half a lineSpacing lower - highlight frames look better
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
2896 |
|
110 | 2897 |
!MenuView methodsFor:'submenu notifications'! |
7 | 2898 |
|
70 | 2899 |
regainControl |
7 | 2900 |
"take over pointer control from a submenu" |
2901 |
||
70 | 2902 |
masterView notNil ifTrue:[ |
1860 | 2903 |
masterView regainControl. |
2904 |
subMenuShown := nil. |
|
70 | 2905 |
]. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2906 |
|
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2907 |
"Modified: 4.3.1996 / 23:17:15 / cg" |
7 | 2908 |
! |
2909 |
||
2910 |
showActive |
|
110 | 2911 |
"submenu is about to perform a menu-action - show wait cursor here as well" |
7 | 2912 |
|
2913 |
self cursor:(Cursor wait) |
|
2914 |
! |
|
2915 |
||
2916 |
showPassive |
|
110 | 2917 |
"submenu has finished its menu-action - show normal cursor again" |
7 | 2918 |
|
2919 |
self cursor:(Cursor hand) |
|
0 | 2920 |
! |
2921 |
||
202 | 2922 |
submenuTriggered |
2923 |
"submenu has performed some action - have to deselect here" |
|
77 | 2924 |
|
683 | 2925 |
self setSelection:nil. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2926 |
|
202 | 2927 |
"a bad kludge - 5 minutes before writing the alpha tapes ..." |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2928 |
superView isPopUpView ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2929 |
superView hide |
136 | 2930 |
]. |
202 | 2931 |
superMenu notNil ifTrue:[ |
1403
ddc59498d1c3
toggle & cursor behavior as in mswindows
Claus Gittinger <cg@exept.de>
parents:
1375
diff
changeset
|
2932 |
superMenu submenuTriggered |
202 | 2933 |
]. |
465
b473edeab54e
can now be controlled by keyboard
Claus Gittinger <cg@exept.de>
parents:
463
diff
changeset
|
2934 |
|
683 | 2935 |
"Modified: 25.5.1996 / 12:27:42 / cg" |
0 | 2936 |
! ! |
202 | 2937 |
|
878 | 2938 |
!MenuView class methodsFor:'documentation'! |
205 | 2939 |
|
2940 |
version |
|
4134 | 2941 |
^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.164 2010-02-02 09:54:28 cg Exp $' |
3966 | 2942 |
! |
2943 |
||
2944 |
version_CVS |
|
4134 | 2945 |
^ '$Header: /cvs/stx/stx/libwidg/MenuView.st,v 1.164 2010-02-02 09:54:28 cg Exp $' |
205 | 2946 |
! ! |