author | ca |
Mon, 21 Jun 2004 10:25:22 +0200 | |
changeset 4191 | 7f999428c830 |
parent 4180 | 85392e34c7a7 |
child 4254 | 4e1ead8d389a |
permissions | -rw-r--r-- |
135 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
1353 | 3 |
All Rights Reserved |
135 | 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 |
||
3347 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
135 | 15 |
View subclass:#TopView |
3370 | 16 |
instanceVariableNames:'type iconified keyboardProcessor' |
3768 | 17 |
classVariableNames:'TakeFocusWhenMapped ForceModalBoxesToOpenAtCenter |
4081 | 18 |
ForceModalBoxesToOpenAtPointer MasterSlaveMask WindowTypeMask |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
19 |
TypeMaster TypeSlave TypePartner TypeDialog TypePopUp |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
20 |
TypeUndecorated' |
1398 | 21 |
poolDictionaries:'' |
22 |
category:'Views-Basic' |
|
135 | 23 |
! |
24 |
||
1160 | 25 |
!TopView class methodsFor:'documentation'! |
135 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
1353 | 30 |
All Rights Reserved |
135 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
I am an abstract superclass of StandardSystemView and PopUpView; |
|
44 |
i.e. views which have no superview. |
|
616 | 45 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
46 |
Do not get confused by the name TopView - your applications |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
47 |
topViews are typically instances of StandardSystemView. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
48 |
|
1396 | 49 |
[instance variables:] |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
50 |
type <Integer> encodes master/slave relationship: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
51 |
#normal, #master, #slave or #partner |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
52 |
for modeless views |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
53 |
(the #master-, #slave- or #partner-type links multiple views |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
54 |
into a windowManagers windowGroup -> for de-iconification) |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
55 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
56 |
encodes window type: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
57 |
#normal, #dialog, #popup, #undecorated |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
58 |
|
616 | 59 |
[see also:] |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
60 |
StandardSystemView PopUpView DialogBox |
616 | 61 |
( introduction to view programming :html: programming/viewintro.html ) |
62 |
||
63 |
[author:] |
|
64 |
Claus Gittinger |
|
135 | 65 |
" |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
66 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
67 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
68 |
examples |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
69 |
" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
70 |
Notice, the following examples only demonstrate the windos style (not its modal behavior). |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
71 |
the style is controlled by the systems windowManager, and might even be ignored by some. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
72 |
(for example, the dialog- and normal styles often look the same). |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
73 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
74 |
The bahavior is controlled by ST/X, and controlled by the open vs. openModeless vs. openModal message. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
75 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
76 |
Modeless: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
77 |
regular style: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
78 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
79 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
80 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
81 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
82 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
83 |
v open |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
84 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
85 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
86 |
dialog: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
87 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
88 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
89 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
90 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
91 |
v beDialogView. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
92 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
93 |
v open |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
94 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
95 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
96 |
popUp (always on top): |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
97 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
98 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
99 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
100 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
101 |
v bePopUpView. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
102 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
103 |
v open |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
104 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
105 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
106 |
undecorated (looks loke popUp, but is not always on top): |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
107 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
108 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
109 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
110 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
111 |
v beUndecorated. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
112 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
113 |
v open |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
114 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
115 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
116 |
Modal: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
117 |
regular style: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
118 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
119 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
120 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
121 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
122 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
123 |
v openModal |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
124 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
125 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
126 |
dialog: |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
127 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
128 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
129 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
130 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
131 |
v beDialogView. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
132 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
133 |
v openModal |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
134 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
135 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
136 |
popUp (always on top): |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
137 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
138 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
139 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
140 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
141 |
v bePopUpView. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
142 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
143 |
v openModal |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
144 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
145 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
146 |
undecorated (looks loke popUp, but is not always on top): |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
147 |
[exBegin] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
148 |
|v| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
149 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
150 |
v := TopView new. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
151 |
v beUndecorated. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
152 |
v extent:200@200. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
153 |
v openModal |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
154 |
[exEnd] |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
155 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
156 |
" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
157 |
! ! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
158 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
159 |
!TopView class methodsFor:'class initialization'! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
160 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
161 |
initialize |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
162 |
MasterSlaveMask := 16r0F. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
163 |
TypeMaster := 16r01. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
164 |
TypeSlave := 16r02. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
165 |
TypePartner := 16r03. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
166 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
167 |
WindowTypeMask := 16rF0. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
168 |
TypeDialog := 16r10. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
169 |
TypePopUp := 16r20. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
170 |
TypeUndecorated := 16r30. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
171 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
172 |
" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
173 |
self initialize |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
174 |
" |
135 | 175 |
! ! |
176 |
||
1160 | 177 |
!TopView class methodsFor:'defaults'! |
135 | 178 |
|
179 |
defaultExtent |
|
586 | 180 |
"return the default extent of my instances. |
181 |
Topviews extents is 2/3 of screen by default" |
|
135 | 182 |
|
153 | 183 |
|display| |
184 |
||
185 |
display := Screen current. |
|
3072 | 186 |
display isNil ifTrue:[ |
187 |
^ 600 @ 400 |
|
188 |
]. |
|
3446 | 189 |
^ display defaultExtentForTopViews |
3519
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
190 |
! |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
191 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
192 |
forceModalBoxesToOpenAtCenter |
3768 | 193 |
"return the flag which forces all modal views to be opened |
3519
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
194 |
at the screens center" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
195 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
196 |
^ ForceModalBoxesToOpenAtCenter ? false |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
197 |
! |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
198 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
199 |
forceModalBoxesToOpenAtCenter:aBoolean |
3768 | 200 |
"set/clear a flag which forces all modal views to be opened |
3519
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
201 |
at the screens center" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
202 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
203 |
ForceModalBoxesToOpenAtCenter := aBoolean |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
204 |
|
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
205 |
" |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
206 |
TopView forceModalBoxesToOpenAtCenter:true |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
207 |
TopView forceModalBoxesToOpenAtCenter:false |
ab3bf0ab96d0
added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents:
3446
diff
changeset
|
208 |
" |
3768 | 209 |
! |
210 |
||
211 |
forceModalBoxesToOpenAtPointer |
|
212 |
"return the flag which forces all modal views to be opened |
|
213 |
at the current pointer position" |
|
214 |
||
215 |
^ ForceModalBoxesToOpenAtPointer ? false |
|
216 |
! |
|
217 |
||
218 |
forceModalBoxesToOpenAtPointer:aBoolean |
|
219 |
"set/clear the flag which forces all modal views to be opened |
|
220 |
at the current pointer position" |
|
221 |
||
222 |
ForceModalBoxesToOpenAtPointer := aBoolean |
|
3978 | 223 |
! |
224 |
||
225 |
takeFocusWhenMapped:aBoolean |
|
226 |
"if turned on, topViews will grab the keyboard when mapped. |
|
227 |
This is useful on systems like openView or Win32, where a view needs a click |
|
228 |
otherwise" |
|
229 |
||
230 |
TakeFocusWhenMapped := aBoolean |
|
231 |
||
232 |
" |
|
233 |
StandardSystemView takeFocusWhenMapped:true |
|
234 |
" |
|
135 | 235 |
! ! |
236 |
||
3880 | 237 |
!TopView methodsFor:'Compatibility-ST80'! |
1410
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
238 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
239 |
displayBox |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
240 |
^ self bounds |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
241 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
242 |
"Created: 3.3.1997 / 16:31:33 / cg" |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
243 |
! |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
244 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
245 |
displayBox:aRectangle |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
246 |
self origin:aRectangle origin corner:aRectangle corner |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
247 |
|
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
248 |
"Created: 3.3.1997 / 16:34:38 / cg" |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
249 |
! ! |
ee1f7f3b2dfd
added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents:
1401
diff
changeset
|
250 |
|
3370 | 251 |
!TopView methodsFor:'accessing'! |
252 |
||
253 |
keyboardProcessor |
|
254 |
"return my keyboard processor" |
|
255 |
||
256 |
^ keyboardProcessor |
|
257 |
||
258 |
"Created: / 18.6.1998 / 18:52:42 / cg" |
|
259 |
"Modified: / 18.6.1998 / 20:00:18 / cg" |
|
260 |
! |
|
261 |
||
262 |
keyboardProcessor:something |
|
263 |
"set my keyboard processor" |
|
264 |
||
265 |
keyboardProcessor := something. |
|
266 |
||
267 |
"Created: / 18.6.1998 / 18:52:42 / cg" |
|
268 |
"Modified: / 18.6.1998 / 20:00:30 / cg" |
|
4138 | 269 |
! |
270 |
||
271 |
label:labelString iconLabel:iconLabelString |
|
272 |
"/ ignored here - for compat. with StdSysViews |
|
3370 | 273 |
! ! |
274 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
275 |
!TopView methodsFor:'accessing-behavior'! |
269 | 276 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
277 |
beDialogView |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
278 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
279 |
type := (type bitClear:WindowTypeMask) bitOr:TypeDialog. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
280 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
281 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
282 |
type := #dialog |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
283 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
284 |
|
1765 | 285 |
beIndependent |
286 |
"make this an independent view; i.e. remove any master/slave or partner |
|
287 |
attribute (this is the default). |
|
288 |
However, the view remains in the current windowGroup" |
|
289 |
||
4081 | 290 |
type isInteger ifTrue:[ |
291 |
type := type bitClear:MasterSlaveMask. |
|
292 |
^ self. |
|
293 |
]. |
|
1765 | 294 |
type := nil |
295 |
! |
|
296 |
||
269 | 297 |
beMaster |
4032 | 298 |
"make this a master-view. |
299 |
All slave views within the same windowGroup will be closed if any master is closed |
|
300 |
and also de/iconify together with their master(s). |
|
301 |
(i.e. they follow their master(s))." |
|
269 | 302 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
303 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
304 |
type := (type bitClear:MasterSlaveMask) bitOr:TypeMaster. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
305 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
306 |
]. |
269 | 307 |
type := #master |
298 | 308 |
|
309 |
" |
|
310 |
see example in TopView>>beSlave |
|
311 |
" |
|
312 |
||
313 |
"Created: 10.12.1995 / 13:30:50 / cg" |
|
269 | 314 |
! |
315 |
||
316 |
bePartner |
|
317 |
"make this a partner-view. Each partner-view will automatically |
|
712 | 318 |
close other partner views (within the same windowGroup) when closed." |
269 | 319 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
320 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
321 |
type := (type bitClear:MasterSlaveMask) bitOr:TypePartner. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
322 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
323 |
]. |
269 | 324 |
type := #partner |
298 | 325 |
|
326 |
" |
|
327 |
create two topViews within the same group: |
|
328 |
if any of them is iconified/deiconified/closed, the other one is also |
|
329 |
||
330 |
|top1 top2| |
|
331 |
||
712 | 332 |
top1 := StandardSystemView new label:'partner'; extent:300@300. |
333 |
top2 := StandardSystemView new label:'partner'; extent:200@200. |
|
298 | 334 |
top1 bePartner. |
335 |
top2 bePartner. |
|
336 |
||
337 |
top1 open. |
|
338 |
top2 openInGroup:(top1 windowGroup) |
|
339 |
" |
|
340 |
||
341 |
"Created: 10.12.1995 / 13:29:59 / cg" |
|
712 | 342 |
"Modified: 25.5.1996 / 11:44:48 / cg" |
269 | 343 |
! |
344 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
345 |
bePopUpView |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
346 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
347 |
type := (type bitClear:WindowTypeMask) bitOr:TypePopUp. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
348 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
349 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
350 |
type := #popup |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
351 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
352 |
|
269 | 353 |
beSlave |
354 |
"make this a slave-view. It will be closed automatically, |
|
712 | 355 |
whenever any master of the windowgroup is closed. |
356 |
See also: #bePartner" |
|
269 | 357 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
358 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
359 |
type := (type bitClear:MasterSlaveMask) bitOr:TypeSlave. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
360 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
361 |
]. |
269 | 362 |
type := #slave |
298 | 363 |
|
364 |
" |
|
365 |
create two topViews within the same group: |
|
366 |
the slave is allowed to be iconified/close independ of the master; |
|
367 |
but if the master is iconified, the slave is also. |
|
368 |
||
369 |
|top1 top2| |
|
370 |
||
712 | 371 |
top1 := StandardSystemView new label:'master'; extent:300@300. |
372 |
top2 := StandardSystemView new label:'slave'; extent:200@200. |
|
298 | 373 |
top1 beMaster. |
374 |
top2 beSlave. |
|
375 |
||
376 |
top1 open. |
|
377 |
top2 openInGroup:(top1 windowGroup) |
|
378 |
" |
|
379 |
||
380 |
"Created: 10.12.1995 / 13:29:10 / cg" |
|
712 | 381 |
"Modified: 25.5.1996 / 11:45:30 / cg" |
269 | 382 |
! |
383 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
384 |
beUndecorated |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
385 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
386 |
type := (type bitClear:WindowTypeMask) bitOr:TypeUndecorated. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
387 |
^ self. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
388 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
389 |
type := nil |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
390 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
391 |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
392 |
focusSequence:aCollectionOfSubcomponents |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
393 |
"define the sequence for stepping through my components." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
394 |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
395 |
windowGroup isNil ifTrue:[ |
4140 | 396 |
windowGroup := self windowGroupClass new. |
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
397 |
]. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
398 |
windowGroup focusSequence:aCollectionOfSubcomponents. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
399 |
|
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
400 |
"Created: 6.3.1996 / 15:37:11 / cg" |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
401 |
"Modified: 30.4.1996 / 15:41:40 / cg" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
402 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
403 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
404 |
!TopView methodsFor:'event handling'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
405 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
406 |
keyPress:key x:x y:y |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
407 |
"notice: this is going to be moved into the upcoming |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
408 |
StandardSystemViewController." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
409 |
|
1160 | 410 |
<resource: #keyboard ( #Tab |
411 |
#FocusNext #FocusPrevious |
|
412 |
#CursorDown #CursorUp ) > |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
413 |
|
932 | 414 |
windowGroup notNil ifTrue:[ |
415 |
key == #Tab ifTrue:[ |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
416 |
self sensor shiftDown ifTrue:[ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
417 |
windowGroup focusPrevious |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
418 |
] ifFalse:[ |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
419 |
windowGroup focusNext |
932 | 420 |
]. |
421 |
^ self. |
|
422 |
]. |
|
423 |
(key == #FocusNext or:[key == #CursorDown]) ifTrue:[ |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
424 |
windowGroup focusNext. |
932 | 425 |
^ self. |
426 |
]. |
|
427 |
(key == #FocusPrevious or:[key == #CursorUp]) ifTrue:[ |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
428 |
windowGroup focusPrevious. |
932 | 429 |
^ self. |
430 |
]. |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
431 |
]. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
432 |
|
932 | 433 |
super keyPress:key x:x y:y |
434 |
||
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
435 |
"Created: 1.2.1996 / 22:08:30 / cg" |
1160 | 436 |
"Modified: 9.1.1997 / 12:17:38 / cg" |
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
437 |
! |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
438 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
439 |
showActivity:someMessage |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
440 |
"some activityNotification shalt be communicated to |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
441 |
the user. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
442 |
Default for activity notifications here: ignore them" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
443 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
444 |
^ self |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
445 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
446 |
"Created: 16.12.1995 / 18:40:13 / cg" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
447 |
"Modified: 23.4.1996 / 21:38:27 / cg" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
448 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
449 |
|
2466 | 450 |
!TopView methodsFor:'help stubs'! |
451 |
||
3697 | 452 |
flyByHelpTextFor:aSubView |
453 |
"this will vanish - its temporarily here to allow for stdSysViews to be |
|
454 |
used as a masterApp for dialogs" |
|
455 |
||
456 |
^ nil |
|
457 |
! |
|
458 |
||
459 |
helpTextFor:aSubView |
|
460 |
"this will vanish - its temporarily here to allow for stdSysViews to be |
|
461 |
used as a masterApp for dialogs" |
|
462 |
||
463 |
^ nil |
|
464 |
! |
|
465 |
||
2466 | 466 |
showHelp:aHelpText for:aView |
467 |
"dummy - added in case a regular topView is installed |
|
468 |
as a dialogs masterApplication. |
|
469 |
Concrete application subclasses may redefine this to |
|
470 |
display a help text in one of its message areas" |
|
471 |
! ! |
|
472 |
||
3884 | 473 |
!TopView methodsFor:'initialization & release'! |
2573 | 474 |
|
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
475 |
assignInitialKeyboardFocus |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
476 |
"assign the initial keyboard focus to a 'useful' component." |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
477 |
|
4180 | 478 |
|componentWithInitialFocus| |
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
479 |
|
4180 | 480 |
"/ |keyboardProcessor componentWithInitialFocus| |
481 |
"/ |
|
482 |
"/ keyboardProcessor := self keyboardProcessor. |
|
483 |
"/ keyboardProcessor notNil ifTrue:[ |
|
484 |
"/ componentWithInitialFocus := keyboardProcessor componentWithInitialFocus. |
|
485 |
"/ componentWithInitialFocus notNil ifTrue:[ |
|
486 |
"/ self windowGroup focusView:componentWithInitialFocus byTab:true. |
|
487 |
"/ "/ componentWithInitialFocus requestFocus. |
|
488 |
"/ ^ self. |
|
489 |
"/ ] |
|
490 |
"/ ]. |
|
491 |
||
492 |
(windowGroup notNil |
|
493 |
and:[(componentWithInitialFocus := windowGroup defaultKeyboardConsumer) notNil]) ifTrue:[ |
|
494 |
windowGroup focusView:componentWithInitialFocus byTab:true "false". |
|
495 |
] ifFalse:[ |
|
496 |
self assignKeyboardFocusToFirstInputField. |
|
4178
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
497 |
]. |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
498 |
! |
e176977f5f2c
initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents:
4140
diff
changeset
|
499 |
|
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
500 |
assignKeyboardFocusToFirstInputField |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
501 |
"assign the keyboard focus to the first input field, |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
502 |
or else to the first keyboardConsumer. |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
503 |
This prefers inputFields over editTextViews |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
504 |
(which may change in the future)" |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
505 |
|
3712
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
506 |
|firstConsumer firstCursorConsumer consumer| |
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
507 |
|
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
508 |
self allSubViewsDo:[:v | |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
509 |
v isInputField ifTrue:[ |
3585
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
510 |
"/ self windowGroup focusView:v. -- very old |
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
511 |
device platformName = 'WIN32' ifTrue:[ |
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
512 |
self windowGroup focusView:v byTab:true. |
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
513 |
] ifFalse:[ |
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
514 |
v requestFocus. |
9d7f0d16d20d
keyboard focus hack for windows
Claus Gittinger <cg@exept.de>
parents:
3519
diff
changeset
|
515 |
]. |
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
516 |
^ self |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
517 |
]. |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
518 |
(firstConsumer isNil and:[v isKeyboardConsumer]) ifTrue:[ |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
519 |
firstConsumer := v |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
520 |
]. |
3712
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
521 |
(firstCursorConsumer isNil and:[v isCursorKeyConsumer]) ifTrue:[ |
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
522 |
firstCursorConsumer := v |
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
523 |
]. |
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
524 |
]. |
3712
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
525 |
consumer := (firstConsumer ? firstCursorConsumer). |
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
526 |
consumer notNil ifTrue:[ |
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
527 |
consumer requestFocus. |
2693
8de1d8fd9a55
changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
528 |
"/ firstConsumer requestFocus. - could be denied; but we force it here |
3712
b32f73e34e34
second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents:
3706
diff
changeset
|
529 |
windowGroup focusView:consumer byTab:false. |
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
530 |
]. |
2693
8de1d8fd9a55
changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
531 |
|
8de1d8fd9a55
changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
532 |
"Modified: / 20.5.1999 / 18:14:16 / cg" |
2590
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
533 |
! |
90d1e3277513
moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents:
2573
diff
changeset
|
534 |
|
2573 | 535 |
destroy |
536 |
"the receiver is to be destroyed - look for partners and slaves" |
|
537 |
||
538 |
|wg dev| |
|
539 |
||
540 |
wg := windowGroup. "/ have to fetch windowGroup before; |
|
541 |
dev := device. "/ and device ... |
|
542 |
super destroy. "/ ... since destroy nils em |
|
543 |
||
544 |
"/ dev notNil ifTrue:[ |
|
545 |
"/ dev flush |
|
546 |
"/ ]. |
|
547 |
||
548 |
"/ |
|
549 |
"/ destroy slaves and partners |
|
550 |
"/ |
|
551 |
self masterSlaveMessage:#destroy inGroup:wg |
|
552 |
||
3446 | 553 |
"Modified: 20.3.1997 / 22:14:16 / cg" |
554 |
! |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
555 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
556 |
initialize |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
557 |
"initialize the topViews position for the screens center" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
558 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
559 |
|screenCenter| |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
560 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
561 |
super initialize. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
562 |
|
2874
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
563 |
device initializeTopViewHookFor:self. |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
564 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
565 |
screenCenter := device center. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
566 |
left := screenCenter x - (width // 2). |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
567 |
top := screenCenter y - (height // 2). |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
568 |
type := 0 |
2874
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
569 |
! |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
570 |
|
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
571 |
postRealize |
213e4f118402
postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents:
2808
diff
changeset
|
572 |
super postRealize. |
3370 | 573 |
|
574 |
keyboardProcessor isNil ifTrue:[ |
|
575 |
keyboardProcessor := KeyboardProcessor new. |
|
576 |
]. |
|
577 |
||
3446 | 578 |
device realizedTopViewHookFor:self |
3706 | 579 |
! |
580 |
||
581 |
release |
|
582 |
keyboardProcessor notNil ifTrue:[ |
|
583 |
keyboardProcessor release. |
|
584 |
keyboardProcessor := nil. |
|
585 |
]. |
|
586 |
super release |
|
3446 | 587 |
! ! |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
588 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
589 |
!TopView methodsFor:'misc'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
590 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
591 |
raiseDeiconified |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
592 |
"deiconify & bring to front" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
593 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
594 |
self isCollapsed ifTrue:[ |
3818
6a5b62a616a7
do not unmap in order to raiseDeiconified
Claus Gittinger <cg@exept.de>
parents:
3768
diff
changeset
|
595 |
"/ self unmap. |
645 | 596 |
self realize. |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
597 |
]. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
598 |
self raise |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
599 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
600 |
" |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
601 |
Transcript topView raiseDeiconified |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
602 |
" |
645 | 603 |
|
604 |
"Modified: 3.5.1996 / 23:49:36 / stefan" |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
605 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
606 |
|
2124
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
607 |
waitUntilClosed |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
608 |
"wait until the receiver has been closed. |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
609 |
Can be used to synchronize multiple-window applications, |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
610 |
and (especially) to wait until an application session is finished |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
611 |
when invoking commands with the rDoit mechanism" |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
612 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
613 |
[drawableId isNil] whileFalse:[ |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
614 |
Delay waitForSeconds:0.1. |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
615 |
]. |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
616 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
617 |
"asynchronous: |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
618 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
619 |
EditTextView open |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
620 |
" |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
621 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
622 |
"synchronous: |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
623 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
624 |
EditTextView open topView waitUntilClosed |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
625 |
" |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
626 |
|
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
627 |
"Modified: / 20.5.1998 / 18:03:37 / cg" |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
628 |
! |
750a1fc2a510
added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents:
2103
diff
changeset
|
629 |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
630 |
withCursor:aCursor do:aBlock |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
631 |
"evaluate aBlock while showing aCursor in all my views. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
632 |
Return the value as returned by aBlock." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
633 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
634 |
windowGroup notNil ifTrue:[ |
1353 | 635 |
^ windowGroup withCursor:aCursor do:aBlock |
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
636 |
]. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
637 |
^ super withCursor:aCursor do:aBlock |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
638 |
! ! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
639 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
640 |
!TopView methodsFor:'queries'! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
641 |
|
269 | 642 |
heightIncludingBorder |
643 |
"return the views overall-height" |
|
644 |
||
645 |
^ height |
|
646 |
! |
|
647 |
||
648 |
isCollapsed |
|
649 |
"ST80 compatibility: return true if the view is not shown (i.e. iconified)" |
|
650 |
||
1536 | 651 |
"/ ^ device windowIsIconified:drawableId |
269 | 652 |
^ shown not |
1536 | 653 |
|
654 |
"Modified: 4.4.1997 / 14:44:39 / cg" |
|
269 | 655 |
! |
656 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
657 |
isDialogView |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
658 |
"return true if this is a dialog view" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
659 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
660 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
661 |
^ (type bitAnd:WindowTypeMask) == TypeDialog |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
662 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
663 |
^ type == #dialog |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
664 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
665 |
|
3620 | 666 |
isMaster |
667 |
"return true, if this is a masterView" |
|
668 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
669 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
670 |
^ (type bitAnd:MasterSlaveMask) == TypeMaster |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
671 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
672 |
|
3620 | 673 |
^ type == #master |
674 |
! |
|
675 |
||
3347 | 676 |
isModal |
677 |
"return true, if the receiver has been opened modal" |
|
678 |
||
679 |
windowGroup isNil ifTrue:[^ false]. |
|
3446 | 680 |
^ windowGroup isModal |
681 |
! |
|
3347 | 682 |
|
3621 | 683 |
isPartner |
684 |
"return true, if this is a partnerView" |
|
685 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
686 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
687 |
^ (type bitAnd:MasterSlaveMask) == TypePartner |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
688 |
]. |
3621 | 689 |
^ type == #partner |
690 |
! |
|
691 |
||
1398 | 692 |
isPopUpView |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
693 |
"return true if I am a popup view. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
694 |
(i.e. I want to come up without decoration and popUp to top immediately)" |
1398 | 695 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
696 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
697 |
^ (type bitAnd:WindowTypeMask) == TypePopUp |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
698 |
]. |
1398 | 699 |
^ type == #popup |
700 |
||
701 |
"Created: 28.2.1997 / 22:12:30 / cg" |
|
702 |
"Modified: 28.2.1997 / 22:37:01 / cg" |
|
703 |
! |
|
704 |
||
3620 | 705 |
isSlave |
706 |
"return true, if this is a slaveView" |
|
707 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
708 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
709 |
^ (type bitAnd:MasterSlaveMask) == TypeSlave |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
710 |
]. |
3620 | 711 |
^ type == #slave |
712 |
! |
|
713 |
||
1481 | 714 |
isTopView |
715 |
"return true, since I am a topView" |
|
716 |
||
717 |
^ true |
|
718 |
||
719 |
"Created: 22.3.1997 / 14:45:55 / cg" |
|
720 |
! |
|
721 |
||
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
722 |
isUndecoratedView |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
723 |
"return true if I am an undecorated view." |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
724 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
725 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
726 |
^ (type bitAnd:WindowTypeMask) == TypeUndecorated |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
727 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
728 |
^ false |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
729 |
! |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
730 |
|
269 | 731 |
preferredExtent |
732 |
"return my preferred extent - this is the minimum size I would like to have. |
|
733 |
The default here is the classes default extent, |
|
734 |
however many subclasses redefine this to compute the actual value |
|
735 |
depending on the sizes of the contents or subcomponents." |
|
736 |
||
966
8e202c385338
handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents:
960
diff
changeset
|
737 |
"/ If I have an explicit preferredExtent .. |
8e202c385338
handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents:
960
diff
changeset
|
738 |
|
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
712
diff
changeset
|
739 |
preferredExtent notNil ifTrue:[ |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
712
diff
changeset
|
740 |
^ preferredExtent |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
712
diff
changeset
|
741 |
]. |
269 | 742 |
^ self class defaultExtent |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
712
diff
changeset
|
743 |
|
966
8e202c385338
handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents:
960
diff
changeset
|
744 |
"Modified: 19.7.1996 / 20:45:41 / cg" |
269 | 745 |
! |
746 |
||
747 |
widthIncludingBorder |
|
748 |
"return the views overall-width" |
|
749 |
||
750 |
^ width |
|
2808
627ce4f2a090
respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
751 |
! |
627ce4f2a090
respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents:
2799
diff
changeset
|
752 |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
753 |
windowStyle |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
754 |
"return a symbol describing my style (one of: #dialog, #popUp, #undecorated or #normal) |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
755 |
(used by the device as a decoration hint)" |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
756 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
757 |
|t| |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
758 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
759 |
type isInteger ifTrue:[ |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
760 |
t := type bitAnd:WindowTypeMask. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
761 |
t == TypeUndecorated ifTrue:[^ #undecorated]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
762 |
t == TypeDialog ifTrue:[^ #dialog]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
763 |
t == TypePopUp ifTrue:[^ #popUp]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
764 |
^ #normal |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
765 |
]. |
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
766 |
^ super windowStyle |
269 | 767 |
! ! |
768 |
||
3881 | 769 |
!TopView methodsFor:'show & hide'! |
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
770 |
|
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
771 |
fixPosition:aPoint |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
772 |
"set origin to aPoint, but make sure, that the box is fully visible |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
773 |
by shifting it into the visible screen area if nescessary. |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
774 |
This prevents invisible modalBoxes (which you could never close)." |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
775 |
|
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
776 |
self origin:aPoint. |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
777 |
self makeFullyVisible |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
778 |
|
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
779 |
"Created: 28.2.1997 / 16:39:31 / cg" |
1401
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
780 |
! |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
781 |
|
3916 | 782 |
map |
783 |
"make the view visible on the screen. |
|
784 |
For topViews, the windowManager will choose (or ask for) the |
|
785 |
views position on the screen. |
|
786 |
Notice: |
|
787 |
Actually, this method is only valid for topViews; |
|
788 |
however, it is defined here to allow things like 'Button new realize'" |
|
789 |
||
790 |
self mapAt:(self origin) iconified:false |
|
791 |
! |
|
792 |
||
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
793 |
mapIconified |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
794 |
"make the view visible but iconified. |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
795 |
In contrast to map, which does it non-iconified" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
796 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
797 |
realized ifFalse:[ |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
798 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
799 |
now, make the view visible |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
800 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
801 |
realized := true. |
2103
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
1836
diff
changeset
|
802 |
device |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
1836
diff
changeset
|
803 |
mapView:self id:drawableId iconified:true |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
1836
diff
changeset
|
804 |
atX:left y:top width:width height:height |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
1836
diff
changeset
|
805 |
minExtent:(self minExtent) maxExtent:(self maxExtent) |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
806 |
] |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
807 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
808 |
"Modified: 25.2.1997 / 22:44:33 / cg" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
809 |
"Created: 24.7.1997 / 12:48:21 / cg" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
810 |
! |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
811 |
|
1401
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
812 |
positionOffset |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
813 |
"return the delta, by which the box should be |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
814 |
displaced from the mouse pointer. |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
815 |
Here, the boxes center is returned as a default. |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
816 |
Usually redefined in subclasses to have the most convenient |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
817 |
ok-button appear under the pointer." |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
818 |
|
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
819 |
^ self extent // 2 |
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
820 |
|
fca5f070bc0b
positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents:
1399
diff
changeset
|
821 |
"Created: 28.2.1997 / 22:56:34 / cg" |
1399
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
822 |
! ! |
a10829e54d2c
fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents:
1398
diff
changeset
|
823 |
|
269 | 824 |
!TopView methodsFor:'startup'! |
825 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
826 |
openAt:aPosition transientFor:anotherView |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
827 |
"force the view to be opened at some position on the screen |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
828 |
AND tell the windowManager to NOT let the user choose a position |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
829 |
(i.e. suppress any ghostframe). |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
830 |
The view is marked as being a transient (i.e. pop-up) view for |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
831 |
anotherView - it will deiconify with it and (on some windowManagers) |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
832 |
have no iconify button of its own. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
833 |
Notice, that its up to the windowManager to care for any borders - |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
834 |
it seems not deterministic, where the view actually ends up being positioned. |
909
d2d624d57f61
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
835 |
Not all windowManagers (olwm) honor this - some insist on it ..." |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
836 |
|
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
837 |
|otherId| |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
838 |
|
1836 | 839 |
drawableId isNil ifTrue:[self create]. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
840 |
anotherView isNil ifTrue:[ |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
841 |
otherId := drawableId. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
842 |
] ifFalse:[ |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
843 |
anotherView create. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
844 |
otherId := anotherView id. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
845 |
]. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
846 |
device setTransient:drawableId for:otherId. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
847 |
self origin:aPosition. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
848 |
self open |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
849 |
|
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
850 |
" |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
851 |
|v1 v2| |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
852 |
|
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
853 |
v1 := StandardSystemView extent:300@300. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
854 |
v2 := StandardSystemView extent:300@300. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
855 |
v1 open. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
856 |
v2 openAt:0@0 transientFor:v1. |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
857 |
" |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
858 |
|
960 | 859 |
" |
860 |
|v1| |
|
861 |
||
862 |
v1 := StandardSystemView extent:300@300. |
|
863 |
v1 openAt:0@0 transientFor:v1. |
|
864 |
" |
|
865 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
866 |
"Created: 28.6.1996 / 10:51:55 / cg" |
1836 | 867 |
"Modified: 28.7.1997 / 18:53:16 / cg" |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
868 |
! |
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
869 |
|
1353 | 870 |
openDisplayAt:aPoint |
871 |
"ST-80 compatibility: open the view centered around aPoint" |
|
872 |
||
873 |
^ self openModelessAt:(aPoint - (self extent//2)) |
|
874 |
||
875 |
" |
|
876 |
(TopView new extent:200@200) openDisplayAt:300@300 |
|
877 |
" |
|
878 |
! |
|
879 |
||
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
880 |
openIconified |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
881 |
"open the view in iconified state" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
882 |
|
1829 | 883 |
self openModelessAt:nil iconified:true |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
884 |
|
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
885 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
886 |
FileBrowser new openIconified |
1829 | 887 |
ChangesBrowser new openIconified |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
888 |
" |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
889 |
|
1829 | 890 |
"Modified: 24.7.1997 / 14:54:58 / cg" |
1821
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
891 |
! |
d2b91606dc55
added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1765
diff
changeset
|
892 |
|
1336 | 893 |
openIn:aBoundaryRectangle |
894 |
"set origin & extent and open. |
|
895 |
The given extent overrides the receivers preferredExtent. |
|
896 |
Added for ST-80 compatibility" |
|
897 |
||
898 |
self |
|
899 |
origin:aBoundaryRectangle origin; |
|
900 |
extent:aBoundaryRectangle extent; |
|
901 |
sizeFixed:true. |
|
902 |
self open |
|
903 |
||
904 |
"Modified: 12.2.1997 / 11:58:21 / cg" |
|
905 |
! |
|
906 |
||
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
907 |
openTransientAt:aPosition |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
908 |
"force the view to be opened at soem position on the screen |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
909 |
AND tell the windowManager to NOT let the user choose a position |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
910 |
(i.e. suppress any ghostframe). |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
911 |
Notice, that its up to the windowManager to care for any borders - |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
912 |
it seems not deterministic, where the view actually ends up being positioned. |
909
d2d624d57f61
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
913 |
Not all windowManagers (olwm) honor this - some insist on it ..." |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
914 |
|
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
915 |
self openAt:aPosition transientFor:nil |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
916 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
917 |
"normal open: |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
918 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
919 |
|v| |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
920 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
921 |
v := StandardSystemView extent:300@300. |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
922 |
v open |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
923 |
" |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
924 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
925 |
"open at position: |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
926 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
927 |
|v| |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
928 |
|
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
929 |
v := StandardSystemView extent:300@300. |
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
930 |
v openTransientAt:10@10 |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
931 |
" |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
932 |
|
908
0fbe814e06ee
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
907
diff
changeset
|
933 |
"Created: 28.6.1996 / 10:52:30 / cg" |
909
d2d624d57f61
renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
934 |
"Modified: 28.6.1996 / 10:55:15 / cg" |
907
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
935 |
! |
6bc7254cdd6a
added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents:
775
diff
changeset
|
936 |
|
269 | 937 |
openWithExtent:anExtent |
938 |
"set extent and open. The given extent overrides the |
|
939 |
receivers preferredExtent. |
|
940 |
Added for ST-80 compatibility" |
|
941 |
||
942 |
self extent:anExtent; sizeFixed:true. |
|
943 |
self open |
|
625
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
944 |
! |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
945 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
946 |
openWithPriority:aPriority |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
947 |
"open the view, run the windowgroup process at |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
948 |
other than UserScehdulingPriority." |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
949 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
950 |
self open. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
951 |
windowGroup process priority:aPriority. |
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
952 |
|
4d8f6dc3af75
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
616
diff
changeset
|
953 |
"Created: 30.4.1996 / 15:34:44 / cg" |
269 | 954 |
! ! |
955 |
||
157 | 956 |
!TopView methodsFor:'window events'! |
957 |
||
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
958 |
mapped |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
959 |
"the recevier was unmapped (i.e. iconified); |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
960 |
look for partners and slaves." |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
961 |
|
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
962 |
realized := true. |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
963 |
super mapped. |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
964 |
|
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
965 |
"/ |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
966 |
"/ map slaves and partners |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
967 |
"/ |
2799
e7b1ea0db727
partners must be remapped (at the old position)
Claus Gittinger <cg@exept.de>
parents:
2693
diff
changeset
|
968 |
self masterSlaveMessage:#remap inGroup:windowGroup. |
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
969 |
|
3347 | 970 |
self isModal ifTrue:[ |
971 |
"take it away from any popup menu possibly still active" |
|
972 |
||
973 |
self forceUngrabKeyboard. |
|
974 |
self forceUngrabPointer. |
|
975 |
" |
|
976 |
get the focus |
|
977 |
" |
|
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
978 |
self getKeyboardFocus. |
3347 | 979 |
self enableEnterLeaveEvents |
980 |
] ifFalse:[ |
|
981 |
" |
|
982 |
ask for the focus - this avoids having to click on the |
|
983 |
view with WM's which need an explicit click. |
|
984 |
Q: is this a good idea ? |
|
985 |
" |
|
986 |
TakeFocusWhenMapped == true ifTrue:[ |
|
987 |
self getKeyboardFocus. |
|
988 |
] |
|
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
989 |
] |
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
990 |
|
3347 | 991 |
|
992 |
||
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
993 |
"Modified: / 10.9.1998 / 22:02:52 / cg" |
3446 | 994 |
"Modified: 30.5.1996 / 09:37:22 / cg" |
995 |
! |
|
2488
cb393b7431f0
oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents:
2466
diff
changeset
|
996 |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
997 |
masterSlaveMessage:aSelector inGroup:aWindowGroup |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
998 |
"send aSelector to partners and/or slaves. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
999 |
This is a private helper for destroy / mapped / unmapped" |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1000 |
|
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1001 |
aWindowGroup notNil ifTrue:[ |
1353 | 1002 |
"/ |
1003 |
"/ if I am a master or partner, send to all slaves |
|
1004 |
"/ |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1005 |
(self isMaster or:[self isPartner]) ifTrue:[ |
1353 | 1006 |
aWindowGroup slavesDo:[:v | v perform:aSelector]. |
1007 |
]. |
|
1008 |
"/ |
|
1009 |
"/ if I am a partner, send to all partners |
|
1010 |
"/ |
|
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1011 |
self isPartner ifTrue:[ |
1353 | 1012 |
aWindowGroup partnersDo:[:v | v ~~ self ifTrue:[v perform:aSelector]]. |
1013 |
]. |
|
501
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1014 |
]. |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1015 |
! |
0a701f42de02
focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents:
419
diff
changeset
|
1016 |
|
157 | 1017 |
unmapped |
1018 |
"the recevier was unmapped (i.e. iconified); |
|
1019 |
look for partners and slaves." |
|
1020 |
||
3035 | 1021 |
|r| |
1022 |
||
1023 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
|
1024 |
"keep the realized flag true (to avoid exiting the modal event loop). |
|
1025 |
Consider this a kludge." |
|
1026 |
r := realized. |
|
1027 |
super unmapped. |
|
1028 |
realized := r. |
|
1029 |
] ifFalse:[ |
|
1030 |
realized := false. |
|
1031 |
super unmapped. |
|
1032 |
]. |
|
419
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1033 |
|
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1034 |
"/ |
775 | 1035 |
"/ unmap slaves and partners |
419
07b575e87a34
openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents:
416
diff
changeset
|
1036 |
"/ |
658 | 1037 |
self masterSlaveMessage:#unmap inGroup:windowGroup |
157 | 1038 |
|
775 | 1039 |
"Modified: 30.5.1996 / 09:37:22 / cg" |
157 | 1040 |
! ! |
1041 |
||
1160 | 1042 |
!TopView class methodsFor:'documentation'! |
135 | 1043 |
|
269 | 1044 |
version |
4191 | 1045 |
^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.91 2004-06-21 08:25:22 ca Exp $' |
135 | 1046 |
! ! |
4079
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1047 |
|
8a66b0c94337
added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents:
4032
diff
changeset
|
1048 |
TopView initialize! |