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 |
|
593
|
41 |
ClickMenuViews can be used as persistent menus (i.e. non-popping);
|
127
|
42 |
for example, the old launcher uses an instance of ClickMenuView.
|
586
|
43 |
|
593
|
44 |
CAVEAT:
|
|
45 |
to support a better NextStep look, some popUpMenus should
|
|
46 |
become automatically a clickMenu ... (really ?)
|
|
47 |
|
586
|
48 |
[author:]
|
|
49 |
Claus Gittinger
|
593
|
50 |
|
|
51 |
[see also:]
|
|
52 |
PopUpMenu PullDownMenu
|
|
53 |
MenuView
|
127
|
54 |
"
|
|
55 |
!
|
|
56 |
|
|
57 |
examples
|
|
58 |
"
|
497
|
59 |
stupid example:
|
593
|
60 |
[exBegin]
|
497
|
61 |
|top menu1 menu2 application|
|
|
62 |
|
|
63 |
application := Plug new.
|
|
64 |
application respondTo:#foo
|
655
|
65 |
with:[Transcript showCR:'foo'].
|
497
|
66 |
application respondTo:#bar
|
655
|
67 |
with:[Transcript showCR:'bar'].
|
497
|
68 |
application respondTo:#baz
|
655
|
69 |
with:[Transcript showCR:'baz'].
|
497
|
70 |
application respondTo:#more1
|
655
|
71 |
with:[Transcript showCR:'more1'].
|
497
|
72 |
application respondTo:#more2
|
655
|
73 |
with:[Transcript showCR:'more2'].
|
497
|
74 |
application respondTo:#more3
|
655
|
75 |
with:[Transcript showCR:'more3'].
|
497
|
76 |
application respondTo:#quit
|
|
77 |
with:[top destroy].
|
127
|
78 |
|
497
|
79 |
top := StandardSystemView new.
|
|
80 |
menu1 := ClickMenuView
|
|
81 |
labels:#(
|
|
82 |
'foo'
|
|
83 |
'bar'
|
|
84 |
'baz '
|
|
85 |
'-'
|
|
86 |
'more foo'
|
|
87 |
'='
|
|
88 |
'quit'
|
|
89 |
)
|
|
90 |
selectors:#(
|
|
91 |
foo
|
|
92 |
bar
|
|
93 |
baz
|
|
94 |
nil
|
|
95 |
moreFoo
|
|
96 |
nil
|
593
|
97 |
quit
|
497
|
98 |
)
|
|
99 |
receiver:application.
|
127
|
100 |
|
497
|
101 |
menu1 subMenuAt:#moreFoo put:(
|
|
102 |
PopUpMenu labels:#(
|
|
103 |
'more1 '
|
|
104 |
'more2 '
|
|
105 |
'more3'
|
|
106 |
)
|
|
107 |
selectors:#(
|
|
108 |
more1
|
|
109 |
more2
|
|
110 |
more3
|
|
111 |
)
|
|
112 |
).
|
|
113 |
menu1 resize; open.
|
|
114 |
top add:menu1.
|
|
115 |
top openWithExtent:(menu1 extent).
|
593
|
116 |
[exEnd]
|
38
|
117 |
"
|
|
118 |
! !
|
0
|
119 |
|
|
120 |
!ClickMenuView methodsFor:'event handling'!
|
|
121 |
|
|
122 |
buttonRelease:button x:x y:y
|
593
|
123 |
"redefined to automatically deselect on release"
|
|
124 |
|
0
|
125 |
super buttonRelease:button x:x y:y.
|
684
|
126 |
self setSelection:nil
|
593
|
127 |
|
684
|
128 |
"Modified: 25.5.1996 / 12:26:49 / cg"
|
0
|
129 |
! !
|
202
|
130 |
|
205
|
131 |
!ClickMenuView class methodsFor:'documentation'!
|
|
132 |
|
|
133 |
version
|
684
|
134 |
^ '$Header: /cvs/stx/stx/libwidg/ClickMenuView.st,v 1.13 1996-05-25 12:22:42 cg Exp $'
|
205
|
135 |
! !
|