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
|
497
|
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.
|
497
|
40 |
|
127
|
41 |
ClickMenuViews can be used as static menus (i.e. non-popping);
|
|
42 |
for example, the old launcher uses an instance of ClickMenuView.
|
|
43 |
"
|
|
44 |
!
|
|
45 |
|
|
46 |
examples
|
|
47 |
"
|
497
|
48 |
stupid example:
|
|
49 |
|
|
50 |
|top menu1 menu2 application|
|
|
51 |
|
|
52 |
application := Plug new.
|
|
53 |
application respondTo:#foo
|
|
54 |
with:[Transcript showCr:'foo'].
|
|
55 |
application respondTo:#bar
|
|
56 |
with:[Transcript showCr:'bar'].
|
|
57 |
application respondTo:#baz
|
|
58 |
with:[Transcript showCr:'baz'].
|
|
59 |
application respondTo:#more1
|
|
60 |
with:[Transcript showCr:'more1'].
|
|
61 |
application respondTo:#more2
|
|
62 |
with:[Transcript showCr:'more2'].
|
|
63 |
application respondTo:#more3
|
|
64 |
with:[Transcript showCr:'more3'].
|
|
65 |
application respondTo:#quit
|
|
66 |
with:[top destroy].
|
127
|
67 |
|
497
|
68 |
top := StandardSystemView new.
|
|
69 |
menu1 := ClickMenuView
|
|
70 |
labels:#(
|
|
71 |
'foo'
|
|
72 |
'bar'
|
|
73 |
'baz '
|
|
74 |
'-'
|
|
75 |
'more foo'
|
|
76 |
'='
|
|
77 |
'quit'
|
|
78 |
)
|
|
79 |
selectors:#(
|
|
80 |
foo
|
|
81 |
bar
|
|
82 |
baz
|
|
83 |
nil
|
|
84 |
moreFoo
|
|
85 |
nil
|
|
86 |
destroy
|
|
87 |
)
|
|
88 |
receiver:application.
|
127
|
89 |
|
497
|
90 |
menu1 subMenuAt:#moreFoo put:(
|
|
91 |
PopUpMenu labels:#(
|
|
92 |
'more1 '
|
|
93 |
'more2 '
|
|
94 |
'more3'
|
|
95 |
)
|
|
96 |
selectors:#(
|
|
97 |
more1
|
|
98 |
more2
|
|
99 |
more3
|
|
100 |
)
|
|
101 |
).
|
|
102 |
menu1 resize; open.
|
|
103 |
top add:menu1.
|
|
104 |
top openWithExtent:(menu1 extent).
|
|
105 |
|
|
106 |
|
|
107 |
|
38
|
108 |
"
|
|
109 |
! !
|
0
|
110 |
|
|
111 |
!ClickMenuView methodsFor:'event handling'!
|
|
112 |
|
|
113 |
buttonRelease:button x:x y:y
|
|
114 |
super buttonRelease:button x:x y:y.
|
|
115 |
self selection:nil
|
|
116 |
! !
|
202
|
117 |
|
205
|
118 |
!ClickMenuView class methodsFor:'documentation'!
|
|
119 |
|
|
120 |
version
|
497
|
121 |
^ '$Header: /cvs/stx/stx/libwidg/ClickMenuView.st,v 1.9 1996-03-08 13:43:54 cg Exp $'
|
205
|
122 |
! !
|