0
|
1 |
"
|
4
|
2 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
127
|
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 |
"
|
|
12 |
|
|
13 |
MenuView subclass:#ClickMenuView
|
202
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Menus'
|
0
|
18 |
!
|
|
19 |
|
38
|
20 |
!ClickMenuView class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
127
|
25 |
All Rights Reserved
|
0
|
26 |
|
38
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
ClickMenuViews are like menuViews, but deselects automatically
|
|
39 |
after clicked on an entry.
|
127
|
40 |
ClickMenuViews can be used as static menus (i.e. non-popping);
|
|
41 |
for example, the old launcher uses an instance of ClickMenuView.
|
|
42 |
"
|
|
43 |
!
|
|
44 |
|
|
45 |
examples
|
|
46 |
"
|
|
47 |
|top menu1 menu2|
|
|
48 |
|
|
49 |
top := StandardSystemView new.
|
|
50 |
menu1 := ClickMenuView
|
|
51 |
labels:#(
|
|
52 |
'foo'
|
|
53 |
'bar'
|
|
54 |
'baz '
|
|
55 |
'-'
|
|
56 |
'more foo'
|
|
57 |
'='
|
|
58 |
'quit'
|
|
59 |
)
|
|
60 |
selectors:#(
|
|
61 |
foo
|
|
62 |
bar
|
|
63 |
baz
|
|
64 |
nil
|
|
65 |
moreFoo
|
|
66 |
nil
|
|
67 |
destroy
|
|
68 |
)
|
|
69 |
receiver:top.
|
|
70 |
|
|
71 |
menu1 subMenuAt:#moreFoo put:(
|
|
72 |
PopUpMenu labels:#(
|
|
73 |
'more1 '
|
|
74 |
'more2 '
|
|
75 |
'more3'
|
|
76 |
)
|
|
77 |
selectors:#(
|
|
78 |
more1
|
|
79 |
more2
|
|
80 |
more3
|
|
81 |
)
|
|
82 |
receiver:self
|
|
83 |
).
|
|
84 |
menu1 resize; open.
|
|
85 |
top add:menu1.
|
|
86 |
top openWithExtent:(menu1 extent).
|
38
|
87 |
"
|
202
|
88 |
!
|
|
89 |
|
|
90 |
version
|
|
91 |
^ '$Header: /cvs/stx/stx/libwidg/ClickMenuView.st,v 1.7 1995-11-23 14:34:28 cg Exp $'
|
38
|
92 |
! !
|
0
|
93 |
|
|
94 |
!ClickMenuView methodsFor:'event handling'!
|
|
95 |
|
|
96 |
buttonRelease:button x:x y:y
|
|
97 |
super buttonRelease:button x:x y:y.
|
|
98 |
self selection:nil
|
|
99 |
! !
|
202
|
100 |
|