author | Claus Gittinger <cg@exept.de> |
Fri, 23 Oct 2009 17:52:50 +0200 | |
changeset 5405 | 369200caeaaf |
parent 5390 | 9509eceb1348 |
child 5411 | 26b475890a60 |
permissions | -rw-r--r-- |
135 | 1 |
" |
2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
3152 | 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 |
" |
|
3196
43d42e7c388a
MUST invoke #postBuildWith: / #postBuildAsSubcanvasWith:,
tm
parents:
3191
diff
changeset
|
12 |
"{ Package: 'stx:libview' }" |
43d42e7c388a
MUST invoke #postBuildWith: / #postBuildAsSubcanvasWith:,
tm
parents:
3191
diff
changeset
|
13 |
|
727
bf23a306b6f2
renamed PseudoView to DisplaySurface
Claus Gittinger <cg@exept.de>
parents:
724
diff
changeset
|
14 |
DisplaySurface subclass:#SimpleView |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
15 |
instanceVariableNames:'superView subViews components styleSheet resources borderColor |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
16 |
borderWidth viewShape top left flagBits relativeOrigin |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
17 |
relativeExtent relativeCorner originRule extentRule cornerRule |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
18 |
insets layout shown hiddenOnRealize name level margin |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
19 |
innerClipRect shadowColor lightColor bitGravity viewGravity |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
20 |
controller windowGroup preferredExtent explicitExtent dependents |
4471 | 21 |
layoutManager visibilityChannel helpKey dropTarget' |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
22 |
classVariableNames:'Grey CentPoint ViewSpacing DefaultStyle StyleSheet |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
23 |
DefaultViewBackgroundColor DefaultBorderColor DefaultLightColor |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
24 |
DefaultShadowColor DefaultBorderWidth DefaultFocusColor |
3375 | 25 |
DefaultFocusBorderWidth ReturnFocusWhenClosingModalBoxes |
3394
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
26 |
FlagOriginChanged FlagExtentChanged FlagCornerChanged |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
27 |
FlagExtentChangedBeforeCreated FlagCanTab |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
28 |
FlagRequestFocusOnPointerEnter |
4407 | 29 |
FlagDoNotRequestFocusOnPointerEnter FlagNativeWidget |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
30 |
FlagIsUnmappedModalBox FlagIsMDIChild FlagHiddenOnRealize |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
31 |
FlagHasExplicitExtent' |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
32 |
poolDictionaries:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
33 |
category:'Views-Basic' |
135 | 34 |
! |
35 |
||
452
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
36 |
SimpleView class instanceVariableNames:'ClassResources DefaultFont' |
734 | 37 |
|
38 |
" |
|
3164
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
39 |
No other class instance variables are inherited by this class. |
734 | 40 |
" |
140 | 41 |
! |
135 | 42 |
|
5293
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
43 |
Notification subclass:#AboutToOpenBoxNotificationSignal |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
44 |
instanceVariableNames:'' |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
45 |
classVariableNames:'' |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
46 |
poolDictionaries:'' |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
47 |
privateIn:SimpleView |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
48 |
! |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
49 |
|
1903 | 50 |
Object subclass:#ViewShape |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
51 |
instanceVariableNames:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
52 |
classVariableNames:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
53 |
poolDictionaries:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
54 |
privateIn:SimpleView |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
55 |
! |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
56 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
57 |
SimpleView::ViewShape subclass:#RoundViewShape |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
58 |
instanceVariableNames:'' |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
59 |
classVariableNames:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
60 |
poolDictionaries:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
61 |
privateIn:SimpleView |
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
62 |
! |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
63 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
64 |
SimpleView::ViewShape subclass:#ArbitraryViewShape |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
65 |
instanceVariableNames:'viewShapeForm borderShapeForm' |
3055
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
66 |
classVariableNames:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
67 |
poolDictionaries:'' |
3a001a72cb9b
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
3010
diff
changeset
|
68 |
privateIn:SimpleView |
1903 | 69 |
! |
70 |
||
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
71 |
!SimpleView class methodsFor:'documentation'! |
135 | 72 |
|
73 |
copyright |
|
74 |
" |
|
75 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
3152 | 76 |
All Rights Reserved |
135 | 77 |
|
78 |
This software is furnished under a license and may be used |
|
79 |
only in accordance with the terms of that license and with the |
|
80 |
inclusion of the above copyright notice. This software may not |
|
81 |
be provided or otherwise made available to, or used by, any |
|
82 |
other person. No title to or ownership of the software is |
|
83 |
hereby transferred. |
|
84 |
" |
|
85 |
! |
|
86 |
||
87 |
documentation |
|
88 |
" |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
89 |
this class implements functions common to all Views which do not work on / show a model. |
135 | 90 |
Previously, all of this functionality used to be in the old View class, but has been |
4907 | 91 |
separated into this new SimpleView (which does not know about models) and the new View, |
4898 | 92 |
which does so. |
484 | 93 |
I'd prefer to call this class View and the current View class a ModelView, |
4898 | 94 |
but for backward compatibility it is better to leave things the way they are |
95 |
(there are simply too many subclasses of View around...). |
|
96 |
||
4907 | 97 |
Instances of SimpleView are seldom used directly, most views in the system inherit |
4898 | 98 |
from this class. However, sometimes a view is needed to create a dummy view for framing |
135 | 99 |
or layout purposes. |
100 |
||
616 | 101 |
[Instance variables:] |
135 | 102 |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
103 |
superView <View> my superview i.e. the view I am in |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
104 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
105 |
subViews <Collection> the collection of subviews |
5255 | 106 |
These are the views proper. |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
107 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
108 |
components <Collection> collection of gadgets (will be merged with subViews, soon) |
5255 | 109 |
These are lightweight gadgets (not seen by windows/x11). |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
110 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
111 |
styleSheet <ResourcePack> contains widget attributes (see libview/styles/*.style) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
112 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
113 |
resources <ResourcePack> contains national language translations (see lib*/resources/*.rs) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
114 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
115 |
borderColor <Color> color of border |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
116 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
117 |
borderWidth <Number> borderWidth in pixels (device dep.) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
118 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
119 |
viewShape <Form> shape of view & border (if device supports it) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
120 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
121 |
top <Number> actual top coordinate (pixels) in superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
122 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
123 |
left <Number> actual left coordinate (pixels) in superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
124 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
125 |
flagBits <Integer> flag bits (used to be individual booleans) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
126 |
extendChanged true if extend changed during setup |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
127 |
originChanged true if origin changed during setup |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
128 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
129 |
relativeOrigin <Number> relative origin in percent within superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
130 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
131 |
relativeExtent <Number> relative extent in percent within superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
132 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
133 |
relativeCorner <Number> relative corner in percent within superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
134 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
135 |
originRule <Block> rule to compute origin if superview changes size |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
136 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
137 |
extentRule <Block> rule to compute extent if superview changes size |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
138 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
139 |
cornerRule <Block> rule to compute corner if superview changes size |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
140 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
141 |
insets <Array> array with top, left, bottom & right insets (or nil) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
142 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
143 |
layout <LayoutObject> not yet implemented - will replace the above layout |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
144 |
variables. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
145 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
146 |
shown <Boolean> true if visible (false if iconified, unmapped or covered) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
147 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
148 |
hiddenOnRealize <Boolean> dont show automatically when superview is realized |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
149 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
150 |
name <String> my name (future use for resources) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
151 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
152 |
level <Number> 3D level relative to superview |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
153 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
154 |
margin <Number> convenient margin |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
155 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
156 |
innerClipRect <Rectangle> convenient inner clip (minus margin) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
157 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
158 |
shadowColor <Color> color used to draw 3D shadowed edges |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
159 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
160 |
lightColor <Color> color used to draw 3D lighted edges |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
161 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
162 |
bitGravity <nil | Symbol> gravity of contents (if device supports it) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
163 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
164 |
viewGravity <nil | Symbol> gravity of view (if device supports it) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
165 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
166 |
controller <nil | Controller> the controller (if any) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
167 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
168 |
windowGroup <WindowGroup> the windowGroup |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
169 |
|
5022 | 170 |
preferredExtent(*) <nil | Point> preferredExtent overWrite |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
171 |
if nonNil, the widget will not compute |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
172 |
its pref-extent, but use that value. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
173 |
|
5022 | 174 |
explicitExtent(*) <nil | Point> preferredExtent overWrite |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
175 |
if nonNil, the widget will not compute |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
176 |
its pref-extent, but use that value. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
177 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
178 |
dependents <nil | Collection> who depends on me |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
179 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
180 |
layoutManager |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
181 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
182 |
visibilityChannel |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
183 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
184 |
helpKey |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
185 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
186 |
dropTarget |
135 | 187 |
|
5022 | 188 |
(*) about to be changed to use preferredExtent as a cache and explicitExtent as |
189 |
an overwrite value. |
|
135 | 190 |
|
616 | 191 |
[Class variables:] |
135 | 192 |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
193 |
Grey <Color> the color grey - its used so often |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
194 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
195 |
ViewSpacing <Number> preferred spacing between views; 1mm |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
196 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
197 |
CentPoint <Point> 100 @ 100 - its used so often |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
198 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
199 |
StyleSheet <ResourcePack> contains all view-style specifics |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
200 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
201 |
ReturnFocusWhenClosingModalBoxes if true, a closing modalBox returns |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
202 |
<Boolean> the keyboard focus to the view which was |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
203 |
active when the box was opened. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
204 |
If false (the default), it is left to |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
205 |
window manager to assign a new focus. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
206 |
If running on olwm/olvwm (which requires an |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
207 |
explicit click to reassign a focus), it is |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
208 |
better to turn this on in a private.rc file. |
135 | 209 |
|
616 | 210 |
[styleSheet parameters:] |
135 | 211 |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
212 |
popupShadow <Boolean> if true, popupViews show a shadow below |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
213 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
214 |
popupLevel <nil | Integer> 3D level |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
215 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
216 |
borderWidth <nil | Integer> borderWidth (ignored in 3D styles) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
217 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
218 |
borderColor <nil | Color> borderColor (ignored in 3D styles) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
219 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
220 |
viewBackground <nil | Color> views background |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
221 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
222 |
shadowColor <nil | Color> color for shadow edges (ignored in 2D styles) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
223 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
224 |
lightColor <nil | Color> color for light edges (ignored in 2D styles) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
225 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
226 |
font <nil | Font> font to use |
135 | 227 |
|
228 |
||
229 |
TODO: |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
230 |
get rid of relativeOrigin, relativeCorner, originRule, extentRule, |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
231 |
and insets; replace by a single object which defines the size |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
232 |
(mhmh - ST-80 seems to call this LayoutFrame ?) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
233 |
-> be prepared for a change here in the near future and ONLY use |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
234 |
access methods to get those instance variables' values |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
235 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
236 |
get rid of 3D level & margin, move it to extra wrappers |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
237 |
(although this will make view setup more complicated, it will remove |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
238 |
complexity from the internals of view. Also, it will allow for more |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
239 |
varieties of borders.) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
240 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
241 |
add components (could also call them gadgets or lightweight views) |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
242 |
- views are expensive in terms of X resources. This would make all |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
243 |
framing/edge and panel helper views become cheap ST objects, instead |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
244 |
of views. |
616 | 245 |
|
246 |
||
247 |
[see also:] |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
248 |
StandardSystemView DialogBox |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
249 |
WindowGroup WindowEvent |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
250 |
Layout |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
251 |
( introduction to view programming :html: programming/viewintro.html ) |
616 | 252 |
|
253 |
[author:] |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
254 |
Claus Gittinger |
135 | 255 |
" |
151 | 256 |
! |
257 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
258 |
examples |
151 | 259 |
" |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
260 |
(all examples below use different viewBackgrounds, |
151 | 261 |
to make the individual subviews visible) |
262 |
||
616 | 263 |
a subView in a topView: |
3152 | 264 |
[exBegin] |
265 |
|top v| |
|
266 |
||
267 |
top := StandardSystemView new. |
|
268 |
v := View new. |
|
269 |
v origin:0.25 @ 0.25 corner:0.75 @ 0.75. |
|
270 |
top addSubView:v. |
|
271 |
top open |
|
272 |
[exEnd] |
|
616 | 273 |
|
274 |
||
275 |
the same, a bit more compact: |
|
3152 | 276 |
[exBegin] |
277 |
|top v| |
|
278 |
||
279 |
top := StandardSystemView new. |
|
280 |
v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:top. |
|
281 |
top open |
|
282 |
[exEnd] |
|
616 | 283 |
|
284 |
||
151 | 285 |
fixed position/size: |
3152 | 286 |
[exBegin] |
151 | 287 |
|top v1 v2| |
288 |
||
289 |
top := StandardSystemView new. |
|
290 |
top extent:300@300. |
|
291 |
||
292 |
v1 := View origin:10@10 |
|
3152 | 293 |
corner:50@50 |
294 |
in:top. |
|
151 | 295 |
v2 := View origin:60@10 |
3152 | 296 |
corner:150@100 |
297 |
in:top. |
|
151 | 298 |
|
299 |
v1 viewBackground:(Color red). |
|
300 |
v2 viewBackground:(Color yellow). |
|
301 |
||
302 |
top open |
|
3152 | 303 |
[exEnd] |
151 | 304 |
|
305 |
same, using ST-80 way of bulding up view hierarchies |
|
306 |
(recommended, if you plan to port applications later) |
|
3152 | 307 |
[exBegin] |
151 | 308 |
|top v1 v2| |
309 |
||
310 |
top := StandardSystemView new. |
|
311 |
top extent:300@300. |
|
312 |
||
313 |
v1 := View new. |
|
314 |
v1 origin:10@10 corner:50@50. |
|
315 |
||
316 |
v2 := View new. |
|
317 |
v2 origin:60@10 corner:150@100. |
|
318 |
||
319 |
v1 viewBackground:(Color red). |
|
320 |
v2 viewBackground:(Color yellow). |
|
321 |
||
322 |
top add:v1. |
|
323 |
top add:v2. |
|
324 |
||
325 |
v1 viewBackground:(Color red). |
|
326 |
v2 viewBackground:(Color yellow). |
|
327 |
||
328 |
top open |
|
3152 | 329 |
[exEnd] |
151 | 330 |
|
331 |
fixed origin, variable size: |
|
3152 | 332 |
[exBegin] |
151 | 333 |
|top v1 v2| |
334 |
||
335 |
top := StandardSystemView new. |
|
336 |
top extent:300@300. |
|
337 |
||
338 |
v1 := View new. |
|
339 |
v1 origin:10@10 corner:50@0.5. |
|
340 |
||
341 |
v2 := View new. |
|
342 |
v2 origin:60@10 corner:150@0.5. |
|
343 |
||
344 |
v1 viewBackground:(Color red). |
|
345 |
v2 viewBackground:(Color yellow). |
|
346 |
||
347 |
top add:v1. |
|
348 |
top add:v2. |
|
349 |
||
350 |
top open |
|
3152 | 351 |
[exEnd] |
151 | 352 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
353 |
fixed origin, variable size, |
151 | 354 |
bottomInset for constant distance from bottom: |
3152 | 355 |
[exBegin] |
151 | 356 |
|top v1 v2| |
357 |
||
358 |
top := StandardSystemView new. |
|
359 |
top extent:300@300. |
|
360 |
||
361 |
v1 := View new. |
|
362 |
v1 origin:10@10 corner:50@1.0. |
|
363 |
v1 bottomInset:10. |
|
364 |
||
365 |
v2 := View new. |
|
366 |
v2 origin:60@10 corner:150@1.0. |
|
367 |
v2 bottomInset:10. |
|
368 |
||
369 |
v1 viewBackground:(Color red). |
|
370 |
v2 viewBackground:(Color yellow). |
|
371 |
||
372 |
top add:v1. |
|
373 |
top add:v2. |
|
374 |
||
375 |
top open |
|
3152 | 376 |
[exEnd] |
151 | 377 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
378 |
variable origin, variable size, |
3152 | 379 |
[exBegin] |
151 | 380 |
|top v1 v2| |
381 |
||
382 |
top := StandardSystemView new. |
|
383 |
top extent:300@300. |
|
384 |
||
385 |
v1 := View new. |
|
386 |
v1 origin:0.0@0.0 corner:0.5@0.5. |
|
387 |
||
388 |
v2 := View new. |
|
389 |
v2 origin:0.5@0.0 corner:1.0@0.5. |
|
390 |
||
391 |
v1 viewBackground:(Color red). |
|
392 |
v2 viewBackground:(Color yellow). |
|
393 |
||
394 |
top add:v1. |
|
395 |
top add:v2. |
|
396 |
||
397 |
top open |
|
3152 | 398 |
[exEnd] |
151 | 399 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
400 |
variable origin, variable size, |
151 | 401 |
insets for some constant distance |
3152 | 402 |
[exBegin] |
151 | 403 |
|top v1 v2| |
404 |
||
405 |
top := StandardSystemView new. |
|
406 |
top extent:300@300. |
|
407 |
||
408 |
v1 := View new. |
|
409 |
v1 origin:0.0@0.0 corner:0.5@0.5. |
|
410 |
v1 rightInset:5. |
|
411 |
||
412 |
v2 := View new. |
|
413 |
v2 origin:0.5@0.0 corner:1.0@0.5. |
|
414 |
v2 leftInset:5. |
|
415 |
||
416 |
v1 viewBackground:(Color red). |
|
417 |
v2 viewBackground:(Color yellow). |
|
418 |
||
419 |
top add:v1. |
|
420 |
top add:v2. |
|
421 |
||
422 |
top open |
|
3152 | 423 |
[exEnd] |
151 | 424 |
|
425 |
using layout objects (ST-80 style): |
|
426 |
fully specifying the frame |
|
3152 | 427 |
[exBegin] |
151 | 428 |
|top v1 v2| |
429 |
||
430 |
top := StandardSystemView new. |
|
431 |
top extent:300@300. |
|
432 |
||
433 |
v1 := View new. |
|
434 |
v2 := View new. |
|
435 |
||
436 |
v1 viewBackground:(Color red). |
|
437 |
v2 viewBackground:(Color yellow). |
|
438 |
||
439 |
top add:v1 in:(LayoutFrame new |
|
3152 | 440 |
leftFraction:0.25; |
441 |
rightFraction:0.75; |
|
442 |
topFraction:0.0; |
|
443 |
bottomFraction:0.5). |
|
151 | 444 |
top add:v2 in:(LayoutFrame new |
3152 | 445 |
leftFraction:0.5; |
446 |
rightFraction:1.0; |
|
447 |
topFraction:0.5; |
|
448 |
bottomFraction:0.75). |
|
151 | 449 |
|
450 |
top open |
|
3152 | 451 |
[exEnd] |
151 | 452 |
|
453 |
another one, with offsets: |
|
3152 | 454 |
[exBegin] |
151 | 455 |
|top v1 v2| |
456 |
||
457 |
top := StandardSystemView new. |
|
458 |
top extent:300@300. |
|
459 |
||
460 |
v1 := View new. |
|
461 |
v2 := View new. |
|
462 |
||
463 |
v1 viewBackground:(Color red). |
|
464 |
v2 viewBackground:(Color yellow). |
|
465 |
||
466 |
top add:v1 in:(LayoutFrame new |
|
3152 | 467 |
leftFraction:0.0 offset:10; |
468 |
rightFraction:1.0 offset:-10; |
|
469 |
topFraction:0.0 offset:10; |
|
470 |
bottomFraction:0.5). |
|
151 | 471 |
top add:v2 in:(LayoutFrame new |
3152 | 472 |
leftFraction:0.0 offset:30; |
473 |
rightFraction:1.0 offset:-30; |
|
474 |
topFraction:0.5 offset:10; |
|
475 |
bottomFraction:0.75). |
|
151 | 476 |
|
477 |
top open |
|
3152 | 478 |
[exEnd] |
151 | 479 |
|
480 |
specifying origin only. Extent is views preferred |
|
481 |
(notice, that plain views have some defaultExtent of 100@100) |
|
3152 | 482 |
[exBegin] |
151 | 483 |
|top v1 v2| |
484 |
||
485 |
top := StandardSystemView new. |
|
486 |
top extent:300@300. |
|
487 |
||
488 |
v1 := View new. |
|
489 |
v2 := View new. |
|
490 |
||
491 |
v1 viewBackground:(Color red). |
|
492 |
v2 viewBackground:(Color yellow). |
|
493 |
||
494 |
top add:v1 in:(LayoutOrigin new |
|
3152 | 495 |
leftFraction:0.25; |
496 |
topFraction:0.0). |
|
151 | 497 |
top add:v2 in:(LayoutOrigin new |
3152 | 498 |
leftFraction:0.5; |
499 |
topFraction:0.5). |
|
151 | 500 |
|
501 |
top open |
|
3152 | 502 |
[exEnd] |
151 | 503 |
|
504 |
same example, using buttons which compute their preferredBounds: |
|
3152 | 505 |
[exBegin] |
151 | 506 |
|top v1 v2| |
507 |
||
508 |
top := StandardSystemView new. |
|
509 |
top extent:300@300. |
|
510 |
||
511 |
v1 := Button label:'foo'. |
|
512 |
v2 := Button label:'a very long buttonLabel'. |
|
513 |
||
514 |
v1 backgroundColor:(Color red). |
|
515 |
v2 backgroundColor:(Color yellow). |
|
516 |
||
517 |
top add:v1 in:(LayoutOrigin new |
|
3152 | 518 |
leftFraction:0.25; |
519 |
topFraction:0.0). |
|
151 | 520 |
top add:v2 in:(LayoutOrigin new |
3152 | 521 |
leftFraction:0.5; |
522 |
topFraction:0.5). |
|
151 | 523 |
|
524 |
top open |
|
3152 | 525 |
[exEnd] |
151 | 526 |
" |
269 | 527 |
! |
528 |
||
4497 | 529 |
examples_MDI |
530 |
" |
|
531 |
Currently, these are experimental and work under Windows only |
|
532 |
||
533 |
an MDI child: |
|
4834 | 534 |
[exBegin] |
535 |
|top v1 v2| |
|
536 |
||
537 |
top := StandardSystemView new. |
|
538 |
top extent:450 @ 300. |
|
539 |
top name:'MDI Client'. |
|
540 |
top beMDIClientView. |
|
541 |
top open. |
|
542 |
||
543 |
v1 := View new. |
|
544 |
v1 viewBackground:Color red. |
|
545 |
v1 origin:50 @ 50 corner:150 @ 100. |
|
546 |
v1 beMDIChildView. |
|
547 |
top addSubView:v1. |
|
548 |
||
549 |
v2 := View new. |
|
550 |
v2 viewBackground:Color green. |
|
551 |
v2 origin:50 @ 50 corner:150 @ 100. |
|
552 |
v2 beMDIChildView. |
|
553 |
top addSubView:v2. |
|
554 |
[exEnd] |
|
4497 | 555 |
" |
556 |
! |
|
557 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
558 |
layoutComputation |
269 | 559 |
" |
560 |
Due to historic reasons, there are 2 mechanisms to resize a view: |
|
3152 | 561 |
- (old, to be eliminated mechanism) |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
562 |
based upon info found in |
3152 | 563 |
relativeOrigin / relativeCorner / relativeExtent |
564 |
originRule / cornerRule / extentRule |
|
565 |
||
566 |
- (new, will migrate to that one) |
|
567 |
letting a layoutObject compute things |
|
269 | 568 |
|
569 |
Actually, the old mechanism is just as powerful, as the new (layoutObject |
|
570 |
based) mechanism; with the help of block=rules, you can compute whatever |
|
571 |
geometry is desired. |
|
572 |
However, having 6 instance variables in every view creates some overhead, |
|
573 |
which can be avoided in most cases (most views are either fixed-size or |
|
574 |
relative-sized). |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
575 |
Therefore (and also to make porting of ST-80 apps easier), ST/X will migrate |
269 | 576 |
to use layoutObjects. |
577 |
You will not see a difference at the views protocol level, since |
|
578 |
existing interfaces will (silently) create layoutObjects as appropriate. |
|
579 |
However, you should remove all direct accesses to the above mentioned |
|
580 |
instance variables, to be prepared for that change. |
|
581 |
||
582 |
Notice, that a view recomputes its size whenever its superview |
|
583 |
changes size. This is done via: |
|
3152 | 584 |
sizeChanged |
585 |
-> allSubviews: superViewChangedSize |
|
269 | 586 |
|
587 |
If the geometry computation as performed in superViewChangedSize |
|
588 |
is not powerful enough for your application, you can either: |
|
3152 | 589 |
- redefine superViewChangedSize |
590 |
- create a special layoutObject which computes a new layout. |
|
269 | 591 |
" |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
592 |
! |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
593 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
594 |
popupMenus |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
595 |
" |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
596 |
Due to historic reasons, there are multiple mechanisms for popupMenu |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
597 |
definition: |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
598 |
|
3152 | 599 |
- static menus |
600 |
||
601 |
- dynamic menus from the view |
|
602 |
||
603 |
- dynamic menus from the model / menuHolder |
|
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
604 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
605 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
606 |
static menus |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
607 |
------------ |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
608 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
609 |
The easiest to use is a static menu; this is useful, if some view |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
610 |
has a constant menu which never changes. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
611 |
It can be defined at initialization time or redefined any time later. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
612 |
The menu is defined with: |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
613 |
|
3152 | 614 |
someView middleButtonMenu:<aPopUpMenu> |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
615 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
616 |
Compatibility note: |
3152 | 617 |
static menus should no longer be used - their operation |
618 |
is incompatible with ST-80 and ST/X's dynamic menus. |
|
619 |
Do not use them if you care for compatibility. |
|
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
620 |
Also, they do not care for any menuPerformers or menuHolders. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
621 |
(instead, they use a receiver instance variable, which gets the messages). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
622 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
623 |
example: |
3152 | 624 |
|top v1 v2| |
625 |
||
626 |
top := StandardSystemView new. |
|
627 |
top extent:300@300. |
|
628 |
||
629 |
v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top. |
|
630 |
v1 viewBackground:Color red. |
|
631 |
||
632 |
v2 := View origin:0.5@0.0 corner:1.0@1.0 in:top. |
|
633 |
v2 viewBackground:Color yellow. |
|
634 |
||
635 |
v1 middleButtonMenu:( |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
636 |
PopUpMenu |
3152 | 637 |
labels:#('foo' 'bar') |
638 |
selectors:#(foo bar) |
|
639 |
receiver:v1 |
|
640 |
). |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
641 |
|
3152 | 642 |
top open. |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
643 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
644 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
645 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
646 |
dynamic menus |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
647 |
------------- |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
648 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
649 |
A dynamic menu can be provided by the view itself, or by the model. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
650 |
In addition, TextViews allow a separate menuHolder to provide the menu |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
651 |
(i.e. it may be different from the model). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
652 |
If the model shall provide the menu, set the views menuMessage to a selector |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
653 |
which is sent to the model. This message should return a popUpMenu. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
654 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
655 |
For textViews, the above is also valid, except if the menuHolder is explicitely |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
656 |
set - in this case, that one provides the menu; not the model. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
657 |
Dont get confused by the fact that menuHolders are only supported |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
658 |
by textViews. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
659 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
660 |
example: (in your application, the plug would be your application, topView or model) |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
661 |
Notice, that all menu messages are sent to the view (because no model was set) |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
662 |
- so the textView still performs the copy-function correctly |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
663 |
(but of course, does not respond to the fooBar messages). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
664 |
If a model was set, the menu would try the model first, but send its messages |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
665 |
to the view IFF the model would not respond to the menu message. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
666 |
(this allows mixing of menu messages for the view AND the model). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
667 |
|
3152 | 668 |
|top v1 v2 holder| |
669 |
||
670 |
holder := Plug new. |
|
671 |
holder respondTo:#menu1 |
|
672 |
with:[ |
|
673 |
v1 menuMessage:#otherMenu1. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
674 |
PopUpMenu |
3152 | 675 |
labels:#('foo' 'bar') |
676 |
selectors:#(foo bar). |
|
677 |
]. |
|
678 |
holder respondTo:#otherMenu1 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
679 |
with:[ |
3152 | 680 |
v1 menuMessage:#menu1. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
681 |
PopUpMenu |
3152 | 682 |
labels:#('other foo' 'other bar') |
683 |
selectors:#(foo bar). |
|
684 |
]. |
|
685 |
holder respondTo:#menu2 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
686 |
with:[ PopUpMenu |
3152 | 687 |
labels:#('copy' 'bar2') |
688 |
selectors:#(copySelection bar2) |
|
689 |
]. |
|
690 |
||
691 |
top := StandardSystemView new. |
|
692 |
top extent:300@300. |
|
693 |
||
694 |
v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top. |
|
695 |
v1 viewBackground:Color red. |
|
696 |
||
697 |
v2 := TextView origin:0.5@0.0 corner:1.0@1.0 in:top. |
|
698 |
v2 contents:'pop me up'. |
|
699 |
||
700 |
v1 model:holder; menuMessage:#menu1. |
|
701 |
v2 menuHolder:holder; menuMessage:#menu2. |
|
702 |
||
703 |
top open. |
|
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
704 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
705 |
an additional goody is the possibility, to change the menuPerformer (textViews only). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
706 |
If defined, that one will get the menus message (instead of the model/view). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
707 |
However, like above, if it does not respond to the message, its still sent to |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
708 |
the view. Notice, that with non-textViews, the menuPerformer is always the model. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
709 |
|
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
710 |
example: |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
711 |
(Notice: the executor understands the #copySelection message - therefore, the |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
712 |
views built-in copy is NOT performed |
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
713 |
- it could be forwarded to the view, though. |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
714 |
This could be useful to intercept/filter things). |
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
715 |
|
3152 | 716 |
|top v menuProvider menuExecutor | |
717 |
||
718 |
menuProvider := Plug new. |
|
719 |
menuProvider respondTo:#menu |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
720 |
with:[ PopUpMenu |
3152 | 721 |
labels:#('copy' 'foo') |
722 |
selectors:#(copySelection foo) |
|
723 |
]. |
|
724 |
||
725 |
menuExecutor := Plug new. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
726 |
menuExecutor respondTo:#copySelection |
3152 | 727 |
with:[Transcript showCR:'copy function']. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
728 |
menuExecutor respondTo:#foo |
3152 | 729 |
with:[Transcript showCR:'foo function']. |
730 |
||
731 |
top := StandardSystemView new. |
|
732 |
top extent:300@300. |
|
733 |
||
734 |
v := TextView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
735 |
v contents:'pop me up'. |
|
736 |
||
737 |
v menuHolder:menuProvider; menuMessage:#menu. |
|
738 |
v menuPerformer:menuExecutor. |
|
739 |
||
740 |
top open. |
|
522
1b041037c1ee
added docu on popUpMenu execution
Claus Gittinger <cg@exept.de>
parents:
520
diff
changeset
|
741 |
" |
135 | 742 |
! ! |
743 |
||
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
744 |
!SimpleView class methodsFor:'initialization'! |
135 | 745 |
|
746 |
initialize |
|
747 |
DefaultStyle isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
748 |
Font initialize. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
749 |
Form initialize. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
750 |
Color initialize. |
3378 | 751 |
]. |
752 |
self == SimpleView ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
753 |
Smalltalk addDependent:self "/ to get language changes |
3378 | 754 |
]. |
755 |
||
365 | 756 |
ReturnFocusWhenClosingModalBoxes := false. |
696 | 757 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
758 |
FlagOriginChanged := 2r000000000001. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
759 |
FlagExtentChanged := 2r000000000010. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
760 |
FlagCornerChanged := 2r000000000100. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
761 |
|
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
762 |
FlagCanTab := 2r000000001000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
763 |
FlagExtentChangedBeforeCreated := 2r000000010000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
764 |
FlagRequestFocusOnPointerEnter := 2r000000100000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
765 |
FlagDoNotRequestFocusOnPointerEnter := 2r000001000000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
766 |
FlagNativeWidget := 2r000010000000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
767 |
FlagIsUnmappedModalBox := 2r000100000000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
768 |
FlagIsMDIChild := 2r001000000000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
769 |
|
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
770 |
FlagHiddenOnRealize := 2r010000000000. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
771 |
FlagHasExplicitExtent := 2r100000000000. |
135 | 772 |
! |
773 |
||
774 |
postAutoload |
|
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
775 |
(Screen notNil and:[Screen current notNil]) ifTrue:[ |
3152 | 776 |
self updateStyleCache. |
2985
62552b74e805
do not read styleSheet if Display is nil
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
777 |
] |
135 | 778 |
! ! |
779 |
||
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
780 |
!SimpleView class methodsFor:'instance creation'! |
135 | 781 |
|
269 | 782 |
extent:extent |
783 |
"create a new view with given extent" |
|
784 |
||
785 |
^ self origin:nil extent:extent borderWidth:nil |
|
3152 | 786 |
font:nil label:nil in:nil |
269 | 787 |
! |
788 |
||
789 |
extent:extent in:aView |
|
790 |
"create a new view as a subview of aView with given extent" |
|
791 |
||
792 |
^ self origin:nil extent:extent borderWidth:nil |
|
3152 | 793 |
font:nil label:nil in:aView |
269 | 794 |
! |
795 |
||
796 |
extent:extent label:label |
|
797 |
"create a new view with given extent and label" |
|
798 |
||
799 |
^ self origin:nil extent:extent borderWidth:nil |
|
3152 | 800 |
font:nil label:label in:nil |
135 | 801 |
! |
802 |
||
803 |
in:aView |
|
804 |
"return a new view as a subview of aView. |
|
805 |
If aView is nil, it is left unspecified, in which superview |
|
806 |
the new view will be placed. The view can later be assigned |
|
807 |
by adding it to the superview via #addSubView:. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
808 |
If its later realized and no superview has ever been set, |
1918
a4042019bc8b
no need to set the container twice in SimpleView class>>in:
Claus Gittinger <cg@exept.de>
parents:
1903
diff
changeset
|
809 |
it will come up as a topview." |
135 | 810 |
|
811 |
|newView| |
|
812 |
||
813 |
newView := self basicNew. |
|
814 |
aView notNil ifTrue:[ |
|
3152 | 815 |
newView device:(aView graphicsDevice). |
2302
9525834a6be7
manual bg-pixmap drawing on devices which do not support them (win32)
Claus Gittinger <cg@exept.de>
parents:
2294
diff
changeset
|
816 |
"/ newView container:aView. |
135 | 817 |
] ifFalse:[ |
3152 | 818 |
newView device:Screen current |
135 | 819 |
]. |
820 |
newView initialize. |
|
821 |
aView notNil ifTrue:[aView addSubView:newView]. |
|
822 |
^ newView |
|
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
823 |
|
743 | 824 |
"Modified: 28.5.1996 / 20:24:58 / cg" |
135 | 825 |
! |
826 |
||
140 | 827 |
label:label |
828 |
"create a new view with given label" |
|
135 | 829 |
|
830 |
^ self origin:nil extent:nil borderWidth:nil |
|
3152 | 831 |
font:nil label:label in:nil |
140 | 832 |
! |
833 |
||
269 | 834 |
label:label in:aView |
835 |
"create a new view as subview of aView with given label" |
|
836 |
||
837 |
^ self origin:nil extent:nil borderWidth:nil |
|
3152 | 838 |
font:nil label:label in:aView |
269 | 839 |
! |
840 |
||
1393
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
841 |
model:aModel |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
842 |
"st-80 style view creation: create a new view and set its model. |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
843 |
Notice, that simpleViews do not understand #model:; however, |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
844 |
subclasses may." |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
845 |
|
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
846 |
^ self new model:aModel |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
847 |
|
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
848 |
"Created: 28.2.1997 / 19:27:40 / cg" |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
849 |
"Modified: 28.2.1997 / 19:28:12 / cg" |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
850 |
! |
0af63b69b416
moved class>>model from View to here.
Claus Gittinger <cg@exept.de>
parents:
1389
diff
changeset
|
851 |
|
269 | 852 |
on:aModel |
853 |
"create a new drawable on aModel" |
|
854 |
||
855 |
"although this one does not know about models, |
|
856 |
it can still send the model-assign message. This was done |
|
857 |
to catch obsolete calls to on:aDevice. |
|
858 |
" |
|
859 |
^ self new model:aModel. |
|
860 |
! |
|
861 |
||
862 |
onSameDeviceAs:anotherView |
|
863 |
"create a view on the same device as anotherView. |
|
864 |
Used with popUpMenus, which should be created on the device of |
|
865 |
its masterView." |
|
866 |
||
867 |
|device| |
|
868 |
||
869 |
anotherView notNil ifTrue:[ |
|
3152 | 870 |
device := anotherView graphicsDevice. |
269 | 871 |
] ifFalse:[ |
3152 | 872 |
device := Screen current. |
269 | 873 |
]. |
874 |
^ self onDevice:device |
|
743 | 875 |
|
876 |
"Modified: 28.5.1996 / 20:25:05 / cg" |
|
269 | 877 |
! |
878 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
879 |
origin:origin corner:corner |
269 | 880 |
"create a new view with given origin and extent" |
135 | 881 |
|
140 | 882 |
^ self origin:origin corner:corner borderWidth:nil |
3152 | 883 |
font:nil label:nil in:nil |
135 | 884 |
! |
885 |
||
886 |
origin:anOrigin corner:aCorner borderWidth:bw font:aFont label:aLabel in:aView |
|
887 |
|newView| |
|
888 |
||
889 |
aView notNil ifTrue:[ |
|
3152 | 890 |
newView := self basicNew. |
891 |
newView device:(aView graphicsDevice). |
|
892 |
newView initialize. |
|
893 |
aView addSubView:newView. |
|
135 | 894 |
] ifFalse:[ |
3152 | 895 |
newView := self onDevice:Screen current |
135 | 896 |
]. |
897 |
bw notNil ifTrue:[newView borderWidth:bw]. |
|
898 |
anOrigin notNil ifTrue:[newView origin:anOrigin]. |
|
899 |
aCorner notNil ifTrue:[newView corner:aCorner]. |
|
900 |
aFont notNil ifTrue:[newView font:aFont]. |
|
901 |
aLabel notNil ifTrue:[newView label:aLabel]. |
|
902 |
^ newView |
|
743 | 903 |
|
904 |
"Modified: 28.5.1996 / 20:25:15 / cg" |
|
135 | 905 |
! |
906 |
||
269 | 907 |
origin:origin corner:corner borderWidth:bw in:aView |
908 |
"create a new view as a subview of aView with given origin and extent" |
|
909 |
||
910 |
^ self origin:origin corner:corner borderWidth:bw |
|
3152 | 911 |
font:nil label:nil in:aView |
269 | 912 |
! |
913 |
||
914 |
origin:origin corner:corner in:aView |
|
915 |
"create a new view as a subview of aView with given origin and extent" |
|
916 |
||
917 |
^ self origin:origin corner:corner borderWidth:nil |
|
3152 | 918 |
font:nil label:nil in:aView |
269 | 919 |
! |
920 |
||
921 |
origin:origin extent:extent |
|
922 |
"create a new view with given origin and extent" |
|
923 |
||
924 |
^ self origin:origin extent:extent borderWidth:nil |
|
3152 | 925 |
font:nil label:nil in:nil |
269 | 926 |
! |
927 |
||
928 |
origin:origin extent:extent borderWidth:bw |
|
929 |
"create a new view with given origin, extent and borderWidth" |
|
930 |
||
931 |
^ self origin:origin extent:extent borderWidth:bw |
|
3152 | 932 |
font:nil label:nil in:nil |
269 | 933 |
! |
934 |
||
935 |
origin:anOrigin extent:anExtent borderWidth:bw font:aFont label:aLabel in:aView |
|
936 |
|newView| |
|
937 |
||
938 |
aView notNil ifTrue:[ |
|
3152 | 939 |
newView := self basicNew. |
940 |
newView device:(aView graphicsDevice). |
|
941 |
newView initialize. |
|
942 |
aView addSubView:newView. |
|
140 | 943 |
] ifFalse:[ |
3152 | 944 |
newView := self onDevice:Screen current |
140 | 945 |
]. |
269 | 946 |
bw notNil ifTrue:[newView borderWidth:bw]. |
947 |
anExtent notNil ifTrue:[newView extent:anExtent]. |
|
948 |
anOrigin notNil ifTrue:[newView origin:anOrigin]. |
|
949 |
aFont notNil ifTrue:[newView font:aFont]. |
|
950 |
aLabel notNil ifTrue:[newView label:aLabel]. |
|
951 |
^ newView |
|
743 | 952 |
|
953 |
"Modified: 28.5.1996 / 20:25:19 / cg" |
|
269 | 954 |
! |
955 |
||
956 |
origin:origin extent:extent borderWidth:bw in:aView |
|
957 |
"create a new view as a subview of aView with given origin, extent |
|
958 |
and borderWidth" |
|
959 |
||
960 |
^ self origin:origin extent:extent borderWidth:bw |
|
3152 | 961 |
font:nil label:nil in:aView |
269 | 962 |
! |
963 |
||
964 |
origin:origin extent:extent font:aFont label:label |
|
965 |
^ self origin:origin extent:extent borderWidth:nil |
|
3152 | 966 |
font:nil label:label in:nil |
269 | 967 |
! |
968 |
||
969 |
origin:origin extent:extent font:aFont label:label in:aView |
|
970 |
^ self origin:origin extent:extent borderWidth:nil |
|
3152 | 971 |
font:aFont label:label in:aView |
269 | 972 |
! |
973 |
||
974 |
origin:origin extent:extent in:aView |
|
975 |
"create a new view as a subview of aView with given origin and extent" |
|
976 |
||
977 |
^ self origin:origin extent:extent borderWidth:nil |
|
3152 | 978 |
font:nil label:nil in:aView |
269 | 979 |
! |
980 |
||
981 |
origin:origin extent:extent label:label |
|
982 |
"create a new view with given origin, extent and label" |
|
983 |
||
984 |
^ self origin:origin extent:extent borderWidth:nil |
|
3152 | 985 |
font:nil label:label in:nil |
135 | 986 |
! |
987 |
||
988 |
origin:anOrigin extent:anExtent |
|
3152 | 989 |
label:aLabel icon:aForm |
990 |
minExtent:minExtent maxExtent:maxExtent |
|
135 | 991 |
|newView| |
992 |
||
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
993 |
newView := self onDevice:Screen current. |
135 | 994 |
anOrigin notNil ifTrue:[newView origin:anOrigin]. |
995 |
anExtent notNil ifTrue:[newView extent:anExtent]. |
|
996 |
aLabel notNil ifTrue:[newView label:aLabel]. |
|
997 |
aForm notNil ifTrue:[newView icon:aForm]. |
|
998 |
minExtent notNil ifTrue:[newView minExtent:minExtent]. |
|
999 |
maxExtent notNil ifTrue:[newView maxExtent:maxExtent]. |
|
1000 |
^ newView |
|
1001 |
! |
|
1002 |
||
140 | 1003 |
origin:origin in:aView |
1004 |
"create a new view as a subview of aView with given origin" |
|
1005 |
||
1006 |
^ self origin:origin extent:nil borderWidth:nil |
|
3152 | 1007 |
font:nil label:nil in:aView |
135 | 1008 |
! ! |
1009 |
||
5293
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1010 |
!SimpleView class methodsFor:'Signal constants'! |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1011 |
|
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1012 |
aboutToOpenBoxNotificationSignal |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1013 |
^ AboutToOpenBoxNotificationSignal |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1014 |
! ! |
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
1015 |
|
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
1016 |
!SimpleView class methodsFor:'change & update'! |
269 | 1017 |
|
867 | 1018 |
update:something with:aParameter from:changedObject |
3378 | 1019 |
changedObject == Smalltalk ifTrue:[ |
5154 | 1020 |
(something == #Language or:[something == #LanguageTerritory]) ifTrue:[ |
1021 |
"flush resources on language changes" |
|
1022 |
self flushAllClassResources. |
|
1023 |
self allSubInstancesDo:[:eachView | eachView languageChanged]. |
|
1024 |
]. |
|
135 | 1025 |
] |
867 | 1026 |
|
1027 |
"Created: 15.6.1996 / 15:23:04 / cg" |
|
135 | 1028 |
! ! |
1029 |
||
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
1030 |
!SimpleView class methodsFor:'defaults'! |
135 | 1031 |
|
5366
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1032 |
defaultBackgroundColor |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1033 |
"return the default background color for drawing - usually, |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1034 |
that is the same as the viewBackgroundColor." |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1035 |
|
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1036 |
^ self defaultViewBackgroundColor |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1037 |
|
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1038 |
" |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1039 |
View defaultBackgroundColor |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1040 |
" |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1041 |
|
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1042 |
"Modified: 13.8.1997 / 19:37:55 / cg" |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1043 |
! |
ce5017348c83
added: #defaultBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
5358
diff
changeset
|
1044 |
|
140 | 1045 |
defaultExtent |
586 | 1046 |
"return the default extent of my instances. |
1047 |
The value returned here is usually ignored, and |
|
1048 |
the value from preferredExtent taken instead." |
|
140 | 1049 |
|
1050 |
CentPoint isNil ifTrue:[CentPoint := 100 @ 100]. |
|
1051 |
^ CentPoint |
|
586 | 1052 |
|
1053 |
"Modified: 22.4.1996 / 23:38:39 / cg" |
|
140 | 1054 |
! |
1055 |
||
269 | 1056 |
defaultFont |
990 | 1057 |
|f| |
1058 |
||
452
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1059 |
DefaultFont notNil ifTrue:[^ DefaultFont]. |
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1060 |
|
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1061 |
DefaultFont isNil ifTrue:[ |
3152 | 1062 |
self == SimpleView ifFalse:[ |
1063 |
f := self superclass defaultFont. |
|
1064 |
] ifTrue:[ |
|
1065 |
f := super defaultFont |
|
1066 |
]. |
|
452
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1067 |
]. |
997 | 1068 |
|
990 | 1069 |
f notNil ifTrue:[ |
3152 | 1070 |
DefaultFont := f. |
1071 |
f := f onDevice:(Screen current). |
|
1072 |
f notNil ifTrue:[ |
|
1073 |
DefaultFont := f. |
|
1074 |
] |
|
990 | 1075 |
]. |
452
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1076 |
^ DefaultFont |
467 | 1077 |
|
1078 |
"Modified: 27.2.1996 / 02:20:54 / cg" |
|
269 | 1079 |
! |
1080 |
||
450 | 1081 |
defaultFont:aFont |
452
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1082 |
"set the default font used for drawing" |
f38d70ba97a2
made DefaultFont a classINSTvariable
Claus Gittinger <cg@exept.de>
parents:
450
diff
changeset
|
1083 |
|
997 | 1084 |
|f| |
1085 |
||
527
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1086 |
DefaultFont := aFont. |
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1087 |
aFont notNil ifTrue:[ |
3152 | 1088 |
f := aFont onDevice:(Screen current). |
1089 |
f notNil ifTrue:[ |
|
1090 |
DefaultFont := f. |
|
1091 |
] |
|
527
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1092 |
] |
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1093 |
|
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1094 |
"Modified: 18.3.1996 / 12:56:20 / cg" |
450 | 1095 |
! |
1096 |
||
269 | 1097 |
defaultStyle |
1098 |
"return the default view style" |
|
1099 |
||
1100 |
^ DefaultStyle |
|
1101 |
||
1102 |
" |
|
1103 |
View defaultStyle |
|
1104 |
" |
|
135 | 1105 |
! |
1106 |
||
1107 |
defaultStyle:aStyle |
|
1108 |
"set the view style for new views" |
|
1109 |
||
2985
62552b74e805
do not read styleSheet if Display is nil
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
1110 |
DefaultStyle := aStyle. |
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1111 |
(Screen notNil and:[Screen current notNil]) ifTrue:[ |
3152 | 1112 |
self readStyleSheetAndUpdateAllStyleCaches. |
2985
62552b74e805
do not read styleSheet if Display is nil
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
1113 |
]. |
135 | 1114 |
|
1115 |
" |
|
1116 |
View defaultStyle:#next. SystemBrowser start |
|
1117 |
View defaultStyle:#motif. SystemBrowser start |
|
1118 |
View defaultStyle:#iris. SystemBrowser start |
|
1119 |
View defaultStyle:#st80. SystemBrowser start |
|
1120 |
View defaultStyle:#normal. SystemBrowser start |
|
1121 |
" |
|
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1122 |
|
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1123 |
"Modified: / 15.9.1998 / 22:05:02 / cg" |
135 | 1124 |
! |
1125 |
||
1860
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1126 |
defaultViewBackgroundColor |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1127 |
"return the default view background" |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1128 |
|
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1129 |
^ DefaultViewBackgroundColor |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1130 |
|
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1131 |
" |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1132 |
View defaultViewBackgroundColor |
1860
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1133 |
" |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1134 |
|
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1135 |
"Modified: 13.8.1997 / 19:37:55 / cg" |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1136 |
! |
95ce8aa47451
added access to DefaultViewBackgroundColor
Claus Gittinger <cg@exept.de>
parents:
1851
diff
changeset
|
1137 |
|
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1138 |
readStyleSheet |
3181 | 1139 |
"(re)load the styleSheet." |
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1140 |
|
4313
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1141 |
|iconLibraryClass | |
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1142 |
|
3762 | 1143 |
DefaultStyle isNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1144 |
self setDefaultStyle |
3762 | 1145 |
]. |
3002 | 1146 |
|
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1147 |
StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style'). |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1148 |
StyleSheet fileReadFailed ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1149 |
('SimpleView [warning]: ***** no styleSheet for ' , DefaultStyle , '-style.') errorPrintCR. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1150 |
DefaultStyle ~~ #normal ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1151 |
DefaultStyle := #normal. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1152 |
StyleSheet := ViewStyle fromFile:(DefaultStyle , '.style'). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1153 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1154 |
StyleSheet fileReadFailed ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1155 |
'SimpleView [warning]: not even a styleSheet for normal-style (using ugly defaults).' errorPrintCR. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1156 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1157 |
] |
4313
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1158 |
]. |
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1159 |
|
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1160 |
iconLibraryClass := StyleSheet at:#ToolbarIconLibrary. |
48fe65cf3fd2
iconLibrary-class from styleSheet
Claus Gittinger <cg@exept.de>
parents:
4295
diff
changeset
|
1161 |
ToolbarIconLibrary := iconLibraryClass ? GenericToolbarIconLibrary. |
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1162 |
|
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1163 |
"Created: / 15.9.1998 / 22:03:06 / cg" |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1164 |
! |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1165 |
|
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1166 |
readStyleSheetAndUpdateAllStyleCaches |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1167 |
"reload all style caches in all view classes. |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1168 |
Needed after a style change or when a style file has been changed" |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1169 |
|
3002 | 1170 |
DefaultStyle notNil ifTrue:[ |
3152 | 1171 |
self readStyleSheet. |
1172 |
self updateAllStyleCaches |
|
3002 | 1173 |
] |
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1174 |
|
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1175 |
"Created: / 15.9.1998 / 22:03:59 / cg" |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1176 |
! |
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1177 |
|
362 | 1178 |
returnFocusWhenClosingModalBoxes |
364
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1179 |
"return the current focus-return behavior. |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1180 |
See #returnFocusWhenClosingModalBoxes: for a description." |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1181 |
|
362 | 1182 |
^ ReturnFocusWhenClosingModalBoxes |
1183 |
! |
|
1184 |
||
1185 |
returnFocusWhenClosingModalBoxes:aBoolean |
|
364
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1186 |
"control the keyboard-focus behavior when a modal dialog |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1187 |
is closed. The default (true) is to return the focus to the view |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1188 |
which was active when the dialog was opened. |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1189 |
If false, it is left up to the display to set the focus. |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1190 |
For owm / ovwm (which requires an explicit click for the focus), |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1191 |
it is better to return the focus automatically. |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1192 |
For managers which assign the focus according the pointer position, |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1193 |
it may be better to turn the focus-return off. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1194 |
You should add a corresponding expression into your private.rc or |
364
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1195 |
display.rc file." |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1196 |
|
362 | 1197 |
ReturnFocusWhenClosingModalBoxes := aBoolean |
364
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1198 |
|
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1199 |
" |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1200 |
Dialog returnFocusWhenClosingModalBoxes:false |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1201 |
Dialog returnFocusWhenClosingModalBoxes:true |
b44b425e3ee1
oops - forgot to initialize the value of ReturnFocusWhenClosing
Claus Gittinger <cg@exept.de>
parents:
362
diff
changeset
|
1202 |
" |
362 | 1203 |
! |
1204 |
||
2294 | 1205 |
setDefaultStyle |
1206 |
|defStyle| |
|
1207 |
||
3185 | 1208 |
DefaultStyle isNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1209 |
defStyle := OperatingSystem getEnvironment:'STX_VIEWSTYLE'. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1210 |
defStyle notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1211 |
DefaultStyle := defStyle asSymbol. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1212 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1213 |
DefaultStyle := #mswindowsXP |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1214 |
]. |
2294 | 1215 |
]. |
1216 |
! |
|
1217 |
||
1161
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1218 |
styleSheet |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1219 |
"return the view style sheet information (a dictionary)" |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1220 |
|
3923 | 1221 |
StyleSheet isNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1222 |
self updateAllStyleCaches. |
3923 | 1223 |
]. |
1161
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1224 |
^ StyleSheet |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1225 |
|
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1226 |
" |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1227 |
View styleSheet |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1228 |
" |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1229 |
|
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1230 |
"Modified: 9.1.1997 / 13:47:42 / cg" |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1231 |
! |
07570a2d9008
added access to the styleSheet (for App-models)
Claus Gittinger <cg@exept.de>
parents:
1141
diff
changeset
|
1232 |
|
269 | 1233 |
styleSheet:aViewStyle |
1234 |
"set the view style from a style-sheet" |
|
1235 |
||
1236 |
StyleSheet := aViewStyle. |
|
1237 |
DefaultStyle := (StyleSheet at:'name' ifAbsent:'unknown') asSymbol. |
|
1238 |
self updateAllStyleCaches. |
|
1239 |
! |
|
1240 |
||
1241 |
updateAllStyleCaches |
|
1242 |
"reload all style caches in all view classes. |
|
1243 |
Needed after a style change or when a style file has been changed" |
|
1244 |
||
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1245 |
(Screen isNil or:[Screen current isNil]) ifTrue:[^ self]. |
2985
62552b74e805
do not read styleSheet if Display is nil
Stefan Vogel <sv@exept.de>
parents:
2979
diff
changeset
|
1246 |
|
269 | 1247 |
" |
1248 |
tell all view classes to flush any |
|
1249 |
cached style-data |
|
1250 |
" |
|
1251 |
self changed:#style. |
|
1252 |
SimpleView updateStyleCache. |
|
1253 |
SimpleView allSubclassesDo:[:aClass | |
|
3762 | 1254 |
aClass defaultFont:nil. |
1255 |
(aClass class includesSelector:#updateStyleCache) ifTrue:[ |
|
1256 |
aClass updateStyleCache |
|
1257 |
]. |
|
269 | 1258 |
] |
1259 |
||
1260 |
" |
|
1261 |
View updateAllStyleCaches |
|
1262 |
" |
|
527
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1263 |
|
2351
bb7cb7d8d723
separated style-handling into read-/update,
Claus Gittinger <cg@exept.de>
parents:
2302
diff
changeset
|
1264 |
"Modified: / 15.9.1998 / 22:04:15 / cg" |
269 | 1265 |
! |
1266 |
||
135 | 1267 |
updateStyleCache |
1268 |
"this method gets some heavily used style stuff and keeps |
|
1269 |
it in class-variables for faster access. |
|
1270 |
Subclasses should redefine this to load any cached style-values |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1271 |
into faster class variables as well. These should NOT do a |
135 | 1272 |
super updateStyleCache, since this method is called for all view-classes |
1273 |
anyway." |
|
1274 |
||
2492 | 1275 |
<resource: #style (#viewSpacing #font #borderWidth #borderColor |
3367 | 1276 |
#viewBackground #shadowColor #lightColor |
1277 |
#focusColor #focusBorderWidth)> |
|
2292
8efc5272cf0b
defaultStyle either from environmane (STX_VIEWSTYLE)
Claus Gittinger <cg@exept.de>
parents:
2274
diff
changeset
|
1278 |
|
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1279 |
|bgGrey currentScreen| |
135 | 1280 |
|
1281 |
" |
|
1282 |
when coming here the first time, we read the styleSheet |
|
1283 |
and keep the values in fast class variables |
|
1284 |
" |
|
1285 |
StyleSheet isNil ifTrue:[ |
|
3367 | 1286 |
self setDefaultStyle. |
1287 |
self readStyleSheet. |
|
135 | 1288 |
]. |
1289 |
||
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1290 |
currentScreen := Screen current. |
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1291 |
|
135 | 1292 |
Grey := StyleSheet viewGrey. |
1293 |
Grey isNil ifTrue:[ |
|
3367 | 1294 |
Grey := Color grey |
2829 | 1295 |
]. |
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1296 |
Grey := Grey onDevice:currentScreen. |
135 | 1297 |
|
151 | 1298 |
StyleSheet fileReadFailed ifTrue:[ |
3367 | 1299 |
bgGrey := White |
135 | 1300 |
] ifFalse:[ |
3367 | 1301 |
currentScreen hasGrayscales ifTrue:[ |
1302 |
bgGrey := Grey |
|
1303 |
] ifFalse:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1304 |
bgGrey := White |
3367 | 1305 |
] |
2829 | 1306 |
]. |
2994
c6be08b45a76
eliminated refs to Display (must use Screen current)
Stefan Vogel <sv@exept.de>
parents:
2985
diff
changeset
|
1307 |
bgGrey := bgGrey onDevice:currentScreen. |
135 | 1308 |
|
2492 | 1309 |
ViewSpacing := StyleSheet at:#viewSpacing. |
135 | 1310 |
ViewSpacing isNil ifTrue:[ |
3367 | 1311 |
ViewSpacing := currentScreen defaultStyleValueFor:#viewSpacing. |
2492 | 1312 |
]. |
1313 |
||
1314 |
DefaultBorderColor := StyleSheet colorAt:#borderColor. |
|
1678
5c93a4791a8b
prepare to fetch style defaults from device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1617
diff
changeset
|
1315 |
DefaultBorderColor isNil ifTrue:[ |
3367 | 1316 |
DefaultBorderColor := currentScreen defaultStyleValueFor:#borderColor |
1678
5c93a4791a8b
prepare to fetch style defaults from device (for windows)
Claus Gittinger <cg@exept.de>
parents:
1617
diff
changeset
|
1317 |
]. |
151 | 1318 |
|
1319 |
StyleSheet fileReadFailed ifTrue:[ |
|
3367 | 1320 |
DefaultBorderWidth := 1. |
1321 |
DefaultShadowColor := Black. |
|
1322 |
DefaultLightColor := White. |
|
1323 |
DefaultFocusColor := Black. |
|
1324 |
DefaultFocusBorderWidth := 2. |
|
1325 |
DefaultViewBackgroundColor := White. |
|
151 | 1326 |
] ifFalse:[ |
3367 | 1327 |
DefaultBorderWidth := StyleSheet at:#borderWidth default:0. |
1328 |
DefaultViewBackgroundColor := StyleSheet colorAt:#viewBackground default:bgGrey. |
|
1329 |
DefaultShadowColor := StyleSheet colorAt:#shadowColor. |
|
1330 |
DefaultLightColor := StyleSheet colorAt:#lightColor. |
|
1331 |
DefaultFocusColor := StyleSheet colorAt:#focusColor default:Color red. |
|
1332 |
DefaultFocusBorderWidth := StyleSheet at:'focusBorderWidth' default:2. |
|
151 | 1333 |
]. |
135 | 1334 |
|
526 | 1335 |
self == SimpleView ifTrue:[ |
3367 | 1336 |
DefaultFont := StyleSheet at:#font. |
1337 |
DefaultFont isNil ifTrue:[ |
|
1338 |
DefaultFont := Font family:'courier' face:'medium' style:'roman' size:12. |
|
1339 |
]. |
|
1340 |
DefaultFont := DefaultFont onDevice:currentScreen. |
|
527
743c5f8b932e
defaultFont style caching was wrong
Claus Gittinger <cg@exept.de>
parents:
526
diff
changeset
|
1341 |
] ifFalse:[ |
3367 | 1342 |
DefaultFont := nil |
135 | 1343 |
]. |
1344 |
||
1345 |
DefaultViewBackgroundColor isNil ifTrue:[ |
|
3367 | 1346 |
'SimpleView [warning]: bad viewBackground in style - using white' errorPrintCR. |
1347 |
DefaultViewBackgroundColor := White |
|
2492 | 1348 |
]. |
1349 |
||
1350 |
"Modified: / 29.4.1997 / 11:16:52 / dq" |
|
1351 |
"Modified: / 8.3.1999 / 01:36:05 / cg" |
|
135 | 1352 |
! |
1353 |
||
269 | 1354 |
viewSpacing |
1355 |
"return a convenient number of pixels used to separate views (usually 1mm). |
|
1356 |
Having this value here at a common place makes certain that all views |
|
1357 |
get a common look" |
|
1358 |
||
1359 |
^ ViewSpacing |
|
1360 |
! ! |
|
1361 |
||
5354 | 1362 |
!SimpleView class methodsFor:'misc ui support'! |
1363 |
||
1364 |
iconInBrowserSymbol |
|
1365 |
<resource: #programImage> |
|
1366 |
||
1367 |
^ #windowClassBrowserIcon |
|
1368 |
! ! |
|
1369 |
||
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
1370 |
!SimpleView class methodsFor:'resources'! |
269 | 1371 |
|
1372 |
classResources |
|
4091
3995bf25130a
classResources now understood by all classes
Claus Gittinger <cg@exept.de>
parents:
4069
diff
changeset
|
1373 |
"if not already loaded, get the classes resourcePack and return it" |
269 | 1374 |
|
1375 |
ClassResources isNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1376 |
ClassResources := super classResources. |
140 | 1377 |
]. |
269 | 1378 |
^ ClassResources |
1379 |
! |
|
1380 |
||
1381 |
classResources:aResourcePack |
|
1382 |
"allow setting of the classResources" |
|
1383 |
||
1384 |
ClassResources := aResourcePack |
|
1385 |
! |
|
1386 |
||
1387 |
flushAllClassResources |
|
1388 |
"flush all classes resource translations. |
|
1389 |
Needed after a resource file has changed." |
|
1390 |
||
1391 |
ResourcePack flushCachedResourcePacks. |
|
3378 | 1392 |
SimpleView withAllSubclassesDo:[:aClass | |
3762 | 1393 |
aClass flushClassResources. |
140 | 1394 |
] |
1395 |
||
1396 |
" |
|
269 | 1397 |
View flushAllClassResources |
140 | 1398 |
" |
269 | 1399 |
"to change the language: |
3762 | 1400 |
Language := #en. |
1401 |
Smalltalk changed:#Language. |
|
1402 |
View flushAllClassResources |
|
269 | 1403 |
or: |
3762 | 1404 |
Language := #de. |
1405 |
Smalltalk changed:#Language. |
|
1406 |
View flushAllClassResources |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1407 |
" |
269 | 1408 |
! |
1409 |
||
1410 |
flushClassResources |
|
1411 |
"flush classes resource string translations. |
|
1412 |
Needed whenever a resource file or language has changed" |
|
1413 |
||
1414 |
ClassResources := nil. |
|
1415 |
! |
|
1416 |
||
2130
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1417 |
resources |
5221 | 1418 |
"return the views resources - |
1419 |
that's a ResourcePack containing national language strings" |
|
1420 |
||
2130
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1421 |
^ self classResources |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1422 |
|
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1423 |
"Created: / 25.5.1998 / 13:00:30 / cg" |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1424 |
! |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
1425 |
|
269 | 1426 |
updateClassResources |
1427 |
"flush classes resource string translations and reload them. |
|
1428 |
Needed whenever a resource file or language has changed" |
|
1429 |
||
1430 |
ClassResources := nil. |
|
1431 |
self classResources |
|
135 | 1432 |
! ! |
1433 |
||
3781 | 1434 |
!SimpleView class methodsFor:'startup'! |
1435 |
||
1436 |
open |
|
1437 |
"create, realize the view - this topview and all its subviews will |
|
1438 |
run as a separate process with its own windowGroup" |
|
1439 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1440 |
^ self new open |
4054 | 1441 |
! |
1442 |
||
1443 |
openOnXScreenNamed:aScreenName |
|
1444 |
"create an instance of the view and open it |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1445 |
on some X display screen. The argument aScreenName must be |
4054 | 1446 |
a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0'). |
1447 |
For more info, read the document on multiple display |
|
1448 |
support and the documentation of the DeviceWorkstation class." |
|
1449 |
||
1450 |
|newDevice| |
|
1451 |
||
1452 |
[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1453 |
newDevice := XWorkstation newDispatchingFor:aScreenName. |
4054 | 1454 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1455 |
self warn:'Could not open display: ' , aScreenName. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1456 |
^ self |
4054 | 1457 |
]. |
1458 |
^ (self onDevice:newDevice) open. |
|
1459 |
||
1460 |
" |
|
1461 |
FileBrowser openOnXScreenNamed:'bitsy:0' |
|
1462 |
FileBrowser openOnXScreenNamed:':0' |
|
1463 |
View openOnXScreenNamed:'bitsy:0' |
|
1464 |
" |
|
1465 |
||
1466 |
"Modified: 13.1.1997 / 20:55:27 / cg" |
|
3781 | 1467 |
! ! |
1468 |
||
3880 | 1469 |
!SimpleView methodsFor:'Compatibility-ST80'! |
269 | 1470 |
|
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1471 |
bounds |
1182 | 1472 |
"ST-80 compatibility: return my bounds" |
1473 |
||
971 | 1474 |
^ (self origin) corner:(self corner) |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1475 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1476 |
"Created: 4.6.1996 / 21:23:27 / cg" |
1182 | 1477 |
"Modified: 10.1.1997 / 19:46:21 / cg" |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1478 |
! |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1479 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1480 |
bounds:aRectangle |
1182 | 1481 |
"ST-80 compatibility: change my bounds" |
1482 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
1483 |
self explicitExtent:true. |
971 | 1484 |
self pixelOrigin:aRectangle origin |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1485 |
corner:aRectangle corner |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1486 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1487 |
"Created: 4.6.1996 / 21:44:27 / cg" |
1182 | 1488 |
"Modified: 10.1.1997 / 19:46:36 / cg" |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1489 |
! |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1490 |
|
269 | 1491 |
checkForEvents |
1182 | 1492 |
"ST-80 compatibility: |
1493 |
check for any pending events and process them" |
|
1494 |
||
269 | 1495 |
(shown and:[windowGroup notNil]) ifTrue:[windowGroup processEvents]. |
1182 | 1496 |
|
1497 |
"Modified: 10.1.1997 / 19:46:06 / cg" |
|
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1498 |
! |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1499 |
|
3164
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1500 |
closeAndUnschedule |
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1501 |
"actually sent to a controller in VW... |
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1502 |
however, #open returns the view in ST/X, so we respond here" |
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1503 |
|
3316 | 1504 |
self topView destroy |
3164
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1505 |
! |
f3dce6ea8e3f
VW compatibility: closeAndUnschedule
Claus Gittinger <cg@exept.de>
parents:
3155
diff
changeset
|
1506 |
|
3775 | 1507 |
displayOn:aGCOrStream |
1182 | 1508 |
"ST-80 compatibility: (re-)display myself" |
1509 |
||
3775 | 1510 |
"/ what a kludge - Dolphin and Squeak mean: printOn:; |
1511 |
"/ ST/X (and some old ST80's) mean: draw-yourself on. |
|
1512 |
(aGCOrStream isStream or:[aGCOrStream == Transcript]) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1513 |
^ super displayOn:aGCOrStream |
3774 | 1514 |
]. |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1515 |
self redraw |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1516 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
1517 |
"Created: 4.6.1996 / 21:25:59 / cg" |
1182 | 1518 |
"Modified: 10.1.1997 / 19:46:58 / cg" |
1363 | 1519 |
! |
1520 |
||
1432 | 1521 |
displayPendingInvalidation |
1522 |
"dummy - for ST-80 compatibility" |
|
1523 |
||
1524 |
"Created: 6.3.1997 / 15:17:14 / cg" |
|
1525 |
"Modified: 6.3.1997 / 15:17:31 / cg" |
|
1526 |
! |
|
1527 |
||
4515
ecbf26955b5b
client:spec:builder: bogus masterApp handling
Claus Gittinger <cg@exept.de>
parents:
4502
diff
changeset
|
1528 |
invalidateRectangle:aRectangle repairNow:doRepairNow |
ecbf26955b5b
client:spec:builder: bogus masterApp handling
Claus Gittinger <cg@exept.de>
parents:
4502
diff
changeset
|
1529 |
self invalidate:aRectangle repairNow:doRepairNow |
ecbf26955b5b
client:spec:builder: bogus masterApp handling
Claus Gittinger <cg@exept.de>
parents:
4502
diff
changeset
|
1530 |
! |
ecbf26955b5b
client:spec:builder: bogus masterApp handling
Claus Gittinger <cg@exept.de>
parents:
4502
diff
changeset
|
1531 |
|
1363 | 1532 |
isEnabled |
1533 |
"return true, if this view is enabled (i.e. accepts user interaction). |
|
1534 |
Most views are enabled - only a few (buttons, SelectionInList etc.) can |
|
1535 |
be disabled. |
|
1536 |
#isEnabled is ST-80's equivalent of #enabled" |
|
1537 |
||
1538 |
^ self enabled |
|
1413 | 1539 |
! |
1540 |
||
2061
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1541 |
isOpen |
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1542 |
"ST80 compatibility" |
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1543 |
|
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1544 |
^ realized |
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1545 |
|
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1546 |
|
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1547 |
! |
25c1fcc1d7e8
added #isOpen for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1548 |
|
2159 | 1549 |
lookPreferences:prefs |
1550 |
"ignored - but required for some apps" |
|
1551 |
||
1552 |
"Created: / 19.6.1998 / 00:05:10 / cg" |
|
1553 |
! |
|
1554 |
||
1413 | 1555 |
newLayout:aLayoutObject |
1556 |
"set the layout object which controls my geometry. |
|
1557 |
ST80-compatibility." |
|
1558 |
||
1559 |
here layout:aLayoutObject. |
|
1560 |
||
1561 |
"Created: 3.3.1997 / 18:54:53 / cg" |
|
1427 | 1562 |
! |
1563 |
||
1564 |
refresh |
|
1565 |
self invalidate |
|
3909 | 1566 |
! |
1567 |
||
1568 |
takeKeyboardFocus |
|
1569 |
self requestFocus |
|
151 | 1570 |
! ! |
1571 |
||
3880 | 1572 |
!SimpleView methodsFor:'Compatibility-Squeak'! |
2956 | 1573 |
|
1574 |
insetDisplayBox |
|
1575 |
"Squeak mimicri: return my bounds" |
|
1576 |
||
1577 |
^ 0@0 corner:(self corner) |
|
1578 |
||
1579 |
! ! |
|
1580 |
||
2450 | 1581 |
!SimpleView methodsFor:'accessing'! |
1582 |
||
4483 | 1583 |
client:anApplicationModel |
1584 |
"release existing components and generate new components from |
|
1585 |
the applications windowSpec. |
|
1586 |
ATTENTION: this is a low level interface; postBuild is NOT invoked" |
|
1587 |
||
1588 |
^ self client:anApplicationModel spec:#windowSpec |
|
1589 |
||
1590 |
||
1591 |
! |
|
1592 |
||
1593 |
client:anApplication spec:aWindowSpecOrSelector |
|
1594 |
"release existing components and generate new components from |
|
1595 |
the applications windowSpec. |
|
1596 |
ATTENTION: this is a low level interface; postBuild is NOT invoked" |
|
1597 |
||
1598 |
^ self client:anApplication spec:aWindowSpecOrSelector builder:nil |
|
1599 |
||
1600 |
! |
|
1601 |
||
1602 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
|
1603 |
"release existing components and generate new components from |
|
4484
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1604 |
the given windowSpec, using the given builder." |
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1605 |
|
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1606 |
self client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:false |
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1607 |
! |
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1608 |
|
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1609 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenuBoolean |
97096c51797d
can now control if specs menu is wanted or not
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1610 |
"release existing components and generate new components from |
4483 | 1611 |
the given windowSpec, using the given builder. |
1612 |
ATTENTION: this is a low level interface. |
|
1613 |
TODO: this code is so ugly and badly designed - it must be redesigned |
|
1614 |
or at least well documented." |
|
1615 |
||
1616 |
|builder subSpec isApplicationModel thisApp savedView masterApp thisIsANewBuild| |
|
1617 |
||
1618 |
aWindowSpecOrSpecSymbol isNil ifTrue:[^ self]. |
|
1619 |
||
1620 |
isApplicationModel := true. |
|
1621 |
||
1622 |
(builder := aBuilder) isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1623 |
"/ problem: anApplication could have no builder |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1624 |
"/ or anApplication could be a non-appModel (theoretically - only providing a spec) |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1625 |
builder := anApplication perform:#builder ifNotUnderstood:[isApplicationModel := false. nil]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1626 |
builder isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1627 |
isApplicationModel ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1628 |
anApplication createBuilder. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1629 |
builder := anApplication builder |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1630 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1631 |
builder := UIBuilder new. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1632 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1633 |
] |
4483 | 1634 |
]. |
1635 |
||
1636 |
(subSpec := aWindowSpecOrSpecSymbol) isSymbol ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1637 |
anApplication isNil ifTrue:[^ self]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1638 |
subSpec := anApplication interfaceSpecFor:aWindowSpecOrSpecSymbol. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1639 |
subSpec isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1640 |
^ self |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1641 |
]. |
4483 | 1642 |
]. |
1643 |
||
1644 |
"/ if the appl is not the master, but the masters builder is used, |
|
1645 |
"/ we have to temporarily change the builders window |
|
1646 |
||
1647 |
masterApp := anApplication perform:#masterApplication ifNotUnderstood:[isApplicationModel := false. nil]. |
|
1648 |
thisApp := builder application. |
|
1649 |
(isApplicationModel and:[anApplication ~~ thisApp]) ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1650 |
masterApp ~~ thisApp ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1651 |
self error:'should not happen' mayProceed:true. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1652 |
masterApp isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1653 |
anApplication masterApplication:thisApp. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1654 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1655 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1656 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1657 |
builder application:anApplication. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1658 |
savedView := builder window. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1659 |
builder window:self. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1660 |
[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1661 |
anApplication buildSubCanvas:subSpec withMenu:withMenuBoolean withBuilder:builder. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1662 |
] ensure:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1663 |
builder window:savedView. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1664 |
builder application:thisApp. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1665 |
]. |
4483 | 1666 |
] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1667 |
thisIsANewBuild := builder window isNil. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1668 |
thisIsANewBuild ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1669 |
builder window:self. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1670 |
anApplication buildSubCanvas:subSpec withMenu:withMenuBoolean withBuilder:builder. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1671 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1672 |
"/ WARNING: in case of rebuilding, we do NOT invoke pre- and postBuilds |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1673 |
builder buildFromSpec:subSpec in:self. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1674 |
] |
4483 | 1675 |
]. |
1676 |
||
1677 |
"/ postBuildWith: will be called twice if code below is enabled |
|
1678 |
"/ notAnAppModel isNil ifTrue:[ |
|
1679 |
"/ notAnAppModel := (anApplication isKindOf:ApplicationModel) not |
|
1680 |
"/ ]. |
|
1681 |
"/ notAnAppModel ifTrue:[ |
|
1682 |
"/ builder buildFromSpec:subSpec in:self. |
|
1683 |
"/ ] ifFalse:[ |
|
1684 |
"/ savedView := builder window. |
|
1685 |
"/ builder window:self. |
|
1686 |
"/ [ |
|
1687 |
"/ anApplication buildSubCanvas:subSpec withBuilder:builder. |
|
1688 |
"/ ] ensure:[ |
|
1689 |
"/ savedView notNil ifTrue:[ |
|
1690 |
"/ builder window:savedView. |
|
1691 |
"/ ] |
|
1692 |
"/ ]. |
|
1693 |
"/ ]. |
|
1694 |
! |
|
1695 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1696 |
helpKey |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1697 |
^ helpKey |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1698 |
! |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1699 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1700 |
helpKey:something |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1701 |
helpKey := something. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1702 |
! |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1703 |
|
2450 | 1704 |
keyboardProcessor |
1705 |
"return my keyboard processor" |
|
1706 |
||
1707 |
^ nil |
|
1708 |
||
1709 |
"Created: / 13.2.1999 / 10:31:39 / cg" |
|
1710 |
! ! |
|
1711 |
||
2549
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1712 |
!SimpleView methodsFor:'accessing-behavior'! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1713 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1714 |
disable |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1715 |
"alternative method; redirected to basic mechanism" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1716 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1717 |
self enabled:false |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1718 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1719 |
"Modified: / 30.3.1999 / 14:47:30 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1720 |
"Created: / 30.3.1999 / 15:54:11 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1721 |
! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1722 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1723 |
enable |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1724 |
"alternative method; redirected to basic mechanism" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1725 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1726 |
self enabled:true |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1727 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1728 |
"Modified: / 30.3.1999 / 14:47:22 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1729 |
"Created: / 30.3.1999 / 15:54:16 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1730 |
! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1731 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1732 |
enabled |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1733 |
"views are enabled by default" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1734 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1735 |
^ true |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1736 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1737 |
"Modified: / 30.3.1999 / 16:27:57 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1738 |
! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1739 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1740 |
enabled:bool |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1741 |
"this is the basic machanism to enable/disable a view. |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1742 |
empty in this class; may be redefined by subclasses" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1743 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1744 |
"Modified: / 30.3.1999 / 14:46:24 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1745 |
"Created: / 30.3.1999 / 15:54:21 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1746 |
! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1747 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1748 |
isEnabled:aState |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1749 |
"ST-80 compatibility; set enabled state |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1750 |
" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1751 |
self enabled:aState |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1752 |
|
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1753 |
"Created: / 30.3.1999 / 15:54:29 / stefan" |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1754 |
! ! |
9c57f5897a90
Common enable/disable/enabled:/isEnabled: Protocol
Stefan Vogel <sv@exept.de>
parents:
2540
diff
changeset
|
1755 |
|
269 | 1756 |
!SimpleView methodsFor:'accessing-bg & border'! |
1757 |
||
3356
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1758 |
allSubViewsBackground:something |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1759 |
"set the viewBackground to something, a color, image or form, |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1760 |
recursively in all of my subviews" |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1761 |
|
4958 | 1762 |
self allSubViewsBackground:something if:[:v |true] |
1763 |
! |
|
1764 |
||
1765 |
allSubViewsBackground:something if:condition |
|
1766 |
"set the viewBackground to something, a color, image or form, |
|
1767 |
recursively in all of my subviews" |
|
1768 |
||
3356
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1769 |
subViews notNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1770 |
subViews do:[:v| |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1771 |
v allViewBackground:something if:condition |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1772 |
] |
3356
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1773 |
] |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1774 |
|
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1775 |
"Modified: / 18.7.1996 / 13:34:26 / cg" |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1776 |
"Created: / 31.10.2000 / 13:06:02 / bg" |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1777 |
! |
d3f6fd88e766
extracted allSubViewsBackground: from allViewBackground:
Claus Gittinger <cg@exept.de>
parents:
3345
diff
changeset
|
1778 |
|
4897 | 1779 |
allSubViewsForeground:something |
1780 |
"set the foreground to something, a color, image or form, |
|
1781 |
recursively in all of my subviews" |
|
1782 |
||
1783 |
subViews notNil ifTrue:[ |
|
4907 | 1784 |
subViews do:[:v| |
1785 |
v allViewForeground:something |
|
1786 |
] |
|
4897 | 1787 |
] |
1788 |
! |
|
1789 |
||
955 | 1790 |
allViewBackground:something |
1791 |
"set the viewBackground to something, a color, image or form, |
|
1792 |
in myself and recursively in all of my subviews" |
|
1793 |
||
4958 | 1794 |
self allViewBackground:something if:[:v |true] |
1795 |
! |
|
1796 |
||
1797 |
allViewBackground:something if:condition |
|
1798 |
"set the viewBackground to something, a color, image or form, |
|
1799 |
in myself and recursively in all of my subviews" |
|
1800 |
||
1801 |
(condition value:self) ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1802 |
viewBackground ~~ something ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1803 |
self viewBackground:something. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1804 |
self invalidate |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1805 |
]. |
4958 | 1806 |
]. |
1807 |
self allSubViewsBackground:something if:condition |
|
955 | 1808 |
! |
1809 |
||
4897 | 1810 |
allViewForeground:something |
1811 |
"set the foreground to something, a color, image or form, |
|
1812 |
in myself and recursively in all of my subviews" |
|
1813 |
||
1814 |
self foregroundColor:something. |
|
1815 |
self allSubViewsForeground:something |
|
1816 |
||
1817 |
"Modified: / 31.10.2000 / 13:06:17 / bg" |
|
1818 |
! |
|
1819 |
||
2158
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1820 |
backgroundColor |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1821 |
"return the background color of the contents - |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1822 |
here, (since there is no contents), the viewBackground is returned." |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1823 |
|
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1824 |
^ self viewBackground |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1825 |
|
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1826 |
"Modified: / 3.5.1997 / 10:28:04 / cg" |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1827 |
"Created: / 18.6.1998 / 15:59:36 / cg" |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1828 |
! |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1829 |
|
1726
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1830 |
backgroundColor:aColor |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1831 |
"set the background color of the contents - |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1832 |
here, (since there is no contents), the viewBackground is changed." |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1833 |
|
4192 | 1834 |
self viewBackground:aColor. |
1835 |
shown ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1836 |
self clear; invalidate. |
4192 | 1837 |
]. |
1726
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1838 |
|
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1839 |
"Created: 3.5.1997 / 10:26:49 / cg" |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1840 |
"Modified: 3.5.1997 / 10:28:04 / cg" |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1841 |
! |
51b0f8ed7572
added #backgroundColor: - for protocol completeness
Claus Gittinger <cg@exept.de>
parents:
1716
diff
changeset
|
1842 |
|
269 | 1843 |
borderColor |
1844 |
"return my borderColor" |
|
1845 |
||
794 | 1846 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
3152 | 1847 |
^ superView borderColor |
794 | 1848 |
]. |
1849 |
||
269 | 1850 |
^ borderColor |
794 | 1851 |
|
1852 |
"Modified: 5.6.1996 / 14:11:44 / cg" |
|
269 | 1853 |
! |
1854 |
||
1855 |
borderColor:aColor |
|
1856 |
"set my borderColor" |
|
1857 |
||
794 | 1858 |
"/ backward compatibility |
1859 |
"/ superView will be renamed to container soon. |
|
1860 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
|
5405 | 1861 |
superView borderColor:aColor. |
1862 |
^ self |
|
794 | 1863 |
]. |
1864 |
||
269 | 1865 |
(aColor ~~ borderColor) ifTrue:[ |
5405 | 1866 |
borderColor := aColor. |
1867 |
drawableId notNil ifTrue:[ |
|
1868 |
self setBorderColor |
|
1869 |
] |
|
269 | 1870 |
] |
794 | 1871 |
|
1872 |
"Modified: 5.6.1996 / 14:11:50 / cg" |
|
269 | 1873 |
! |
1874 |
||
1875 |
borderShape:aForm |
|
1876 |
"set the borderShape to aForm" |
|
1877 |
||
2757
e26b401eeb0c
allow for a shape to be taken away (i.e. no longer a shaped view)
Claus Gittinger <cg@exept.de>
parents:
2750
diff
changeset
|
1878 |
aForm isNil ifTrue:[ |
3152 | 1879 |
viewShape := nil. |
1880 |
drawableId notNil ifTrue:[ |
|
1881 |
device setWindowBorderShape:nil in:drawableId |
|
1882 |
] |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1883 |
] ifFalse:[ |
3152 | 1884 |
viewShape isNil ifTrue:[ |
1885 |
viewShape := ArbitraryViewShape new |
|
1886 |
]. |
|
1887 |
viewShape borderShapeForm:aForm. |
|
1888 |
drawableId notNil ifTrue:[ |
|
1889 |
device setWindowBorderShape:(aForm id) in:drawableId |
|
1890 |
] |
|
269 | 1891 |
] |
1903 | 1892 |
|
1893 |
"Modified: 18.9.1997 / 11:09:40 / cg" |
|
269 | 1894 |
! |
1895 |
||
1896 |
borderWidth |
|
1897 |
"return my borderWidth" |
|
1898 |
||
794 | 1899 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
3152 | 1900 |
^ superView borderWidth |
794 | 1901 |
]. |
1902 |
||
269 | 1903 |
^ borderWidth |
794 | 1904 |
|
1905 |
"Modified: 5.6.1996 / 14:11:57 / cg" |
|
269 | 1906 |
! |
1907 |
||
1908 |
borderWidth:aNumber |
|
1909 |
"set my borderWidth" |
|
1910 |
||
794 | 1911 |
"/ backward compatibility |
1912 |
"/ superView will be renamed to container soon. |
|
1913 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
|
5405 | 1914 |
^ superView borderWidth:aNumber |
794 | 1915 |
]. |
1916 |
||
269 | 1917 |
(aNumber ~~ borderWidth) ifTrue:[ |
5405 | 1918 |
borderWidth := aNumber. |
1919 |
drawableId notNil ifTrue:[ |
|
1920 |
self setBorderWidth. |
|
1921 |
] |
|
269 | 1922 |
] |
794 | 1923 |
|
1924 |
"Modified: 5.6.1996 / 14:12:05 / cg" |
|
269 | 1925 |
! |
1926 |
||
4150 | 1927 |
fillFormWithBorderShape:aForm |
1928 |
"fill aForm with my borderShape" |
|
1929 |
||
1930 |
aForm fillRectangle:(Rectangle origin:self origin corner:self corner). |
|
1931 |
! |
|
1932 |
||
2158
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1933 |
foregroundColor |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1934 |
"return the foreground color of the contents - |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1935 |
here, (since there is no contents), some default is returned." |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1936 |
|
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1937 |
^ Color black |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1938 |
|
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1939 |
"Modified: / 3.5.1997 / 10:28:04 / cg" |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1940 |
"Created: / 18.6.1998 / 16:57:33 / cg" |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1941 |
! |
948fe768cd36
added #foregroundColor & backgroundColor
Claus Gittinger <cg@exept.de>
parents:
2143
diff
changeset
|
1942 |
|
3392 | 1943 |
foregroundColor:aColor |
1944 |
"set the foreground color of the contents - |
|
1945 |
ignored here, since there is no contents." |
|
1946 |
! |
|
1947 |
||
4966
3a8ffabd2fa3
changed #foregroundColor:backgroundColor:
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1948 |
foregroundColor:fgColor backgroundColor:bgColor |
3a8ffabd2fa3
changed #foregroundColor:backgroundColor:
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1949 |
"set both the foreground and background colors of the contents" |
3a8ffabd2fa3
changed #foregroundColor:backgroundColor:
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1950 |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1951 |
self |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1952 |
foregroundColor:fgColor; |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
1953 |
backgroundColor:bgColor |
4966
3a8ffabd2fa3
changed #foregroundColor:backgroundColor:
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1954 |
! |
3a8ffabd2fa3
changed #foregroundColor:backgroundColor:
Claus Gittinger <cg@exept.de>
parents:
4964
diff
changeset
|
1955 |
|
269 | 1956 |
level |
1957 |
"return my level relative to superView (3D)" |
|
1958 |
||
794 | 1959 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
3152 | 1960 |
^ superView level |
794 | 1961 |
]. |
1962 |
||
269 | 1963 |
^ level |
794 | 1964 |
|
1965 |
"Modified: 5.6.1996 / 14:12:10 / cg" |
|
269 | 1966 |
! |
1967 |
||
1968 |
level:aNumber |
|
1969 |
"set my level relative to superView (3D)" |
|
1970 |
||
1971 |
|oldMargin how| |
|
1972 |
||
794 | 1973 |
"/ backward compatibility |
1974 |
"/ superView will be renamed to container soon. |
|
1975 |
(superView notNil and:[superView isBorderedWrapper]) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1976 |
^ superView level:aNumber |
794 | 1977 |
]. |
1978 |
||
269 | 1979 |
(aNumber ~~ level and:[aNumber notNil]) ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1980 |
self is3D ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1981 |
level := aNumber. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1982 |
oldMargin := margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1983 |
margin := level abs. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1984 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1985 |
realized ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1986 |
margin ~~ oldMargin ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1987 |
(margin > oldMargin) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1988 |
how := #smaller |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1989 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1990 |
how := #larger |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1991 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1992 |
self sizeChanged:how. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1993 |
self setInnerClip. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1994 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1995 |
shown ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1996 |
margin ~~ oldMargin ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1997 |
self clearView. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1998 |
self redrawX:margin y:margin |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
1999 |
width:width-(margin*2) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2000 |
height:height-(margin*2) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2001 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2002 |
self redrawEdges. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2003 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2004 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2005 |
] |
135 | 2006 |
] |
794 | 2007 |
|
2008 |
"Modified: 5.6.1996 / 14:12:17 / cg" |
|
269 | 2009 |
! |
2010 |
||
3698 | 2011 |
lightColor |
2012 |
"returb the color to be used for lighted edges (3D only)" |
|
2013 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2014 |
^ lightColor |
3698 | 2015 |
! |
2016 |
||
269 | 2017 |
lightColor:aColorOrImage |
2018 |
"set the color to be used for lighted edges (3D only)" |
|
2019 |
||
2020 |
lightColor := aColorOrImage |
|
2021 |
! |
|
2022 |
||
2023 |
margin |
|
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
2024 |
"return my inner margin - this is usually the level, |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2025 |
but can be more for some views |
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
2026 |
(textViews which add more margin between the border and the text)" |
269 | 2027 |
|
2028 |
^ margin |
|
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
2029 |
|
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
2030 |
"Modified: 5.6.1996 / 14:37:54 / cg" |
269 | 2031 |
! |
2032 |
||
5405 | 2033 |
setBorderWidth |
2034 |
"set my borderWidth in the devices physical view" |
|
2035 |
||
2036 |
|bw| |
|
2037 |
||
2038 |
bw := borderWidth. |
|
2039 |
(device supportsWindowBorder:bw) ifFalse:[ |
|
2040 |
bw > 1 ifTrue:[ |
|
2041 |
(device supportsWindowBorder:(bw := 1)) ifFalse:[ |
|
2042 |
^ self |
|
2043 |
]. |
|
2044 |
] |
|
2045 |
]. |
|
2046 |
||
2047 |
drawableId notNil ifTrue:[ |
|
2048 |
device setWindowBorderWidth:bw in:drawableId |
|
2049 |
] |
|
2050 |
! |
|
2051 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2052 |
setBorderWidth:aNumber |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2053 |
"set my borderWidth without affecting the real view (private only)" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2054 |
|
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2055 |
borderWidth := aNumber |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2056 |
! |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2057 |
|
3698 | 2058 |
shadowColor |
2059 |
"returb the color to be used for shadowed edges (3D only)" |
|
2060 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2061 |
^ shadowColor |
3698 | 2062 |
! |
2063 |
||
269 | 2064 |
shadowColor:aColorOrImage |
2065 |
"set the color to be used for shadowed edges (3D only)" |
|
2066 |
||
2067 |
shadowColor := aColorOrImage |
|
2068 |
! |
|
2069 |
||
2070 |
viewBackground:something |
|
2071 |
"set the viewBackground to something, a color, image or form. |
|
2072 |
If its a color and we run on a color display, also set shadow and light |
|
2073 |
colors - this means, that a red view will get light-red and dark-red |
|
2074 |
edges." |
|
2075 |
||
2584
55a405cec086
when lighting/darkening colors, take the average in the topLeft
Claus Gittinger <cg@exept.de>
parents:
2583
diff
changeset
|
2076 |
|avgColor| |
55a405cec086
when lighting/darkening colors, take the average in the topLeft
Claus Gittinger <cg@exept.de>
parents:
2583
diff
changeset
|
2077 |
|
1808 | 2078 |
"/ debug check only: |
4891 | 2079 |
self assert:(something notNil) message:'invalid viewBackground argument'. |
1808 | 2080 |
|
269 | 2081 |
something isColor ifTrue:[ |
4907 | 2082 |
device hasGrayscales ifTrue:[ |
2083 |
avgColor := something averageColorIn:(0@0 corner:7@7). |
|
2084 |
shadowColor := avgColor darkened "on:device". |
|
2085 |
lightColor := avgColor lightened "on:device". |
|
2086 |
] |
|
135 | 2087 |
]. |
269 | 2088 |
super viewBackground:something |
749 | 2089 |
|
1808 | 2090 |
"Modified: 4.7.1997 / 20:09:22 / cg" |
269 | 2091 |
! |
2092 |
||
2093 |
viewShape:aForm |
|
2094 |
"set the viewShape to aForm" |
|
2095 |
||
2757
e26b401eeb0c
allow for a shape to be taken away (i.e. no longer a shaped view)
Claus Gittinger <cg@exept.de>
parents:
2750
diff
changeset
|
2096 |
aForm isNil ifTrue:[ |
3152 | 2097 |
viewShape := nil. |
2098 |
drawableId notNil ifTrue:[ |
|
2099 |
device setWindowShape:nil in:drawableId |
|
2100 |
] |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2101 |
] ifFalse:[ |
3152 | 2102 |
viewShape isNil ifTrue:[ |
2103 |
viewShape := ArbitraryViewShape new |
|
2104 |
]. |
|
2105 |
||
2106 |
viewShape viewShapeForm:aForm. |
|
2107 |
drawableId notNil ifTrue:[ |
|
2108 |
device setWindowShape:(aForm id) in:drawableId |
|
2109 |
] |
|
135 | 2110 |
] |
1903 | 2111 |
|
2112 |
"Modified: 18.9.1997 / 11:11:04 / cg" |
|
269 | 2113 |
! ! |
2114 |
||
3139 | 2115 |
!SimpleView methodsFor:'accessing-channels'! |
2116 |
||
2117 |
setupChannel:newChannel for:changeSelector withOld:oldChannel |
|
2118 |
"common code to change a channel. |
|
2119 |
If changeSelector is non-nil, arrange for it to be sent when |
|
2120 |
the channel changes its value; otherwise, arrange for a simple update. |
|
2121 |
This is so common, that ist worth a helper method: |
|
2122 |
release any old channel (if non-nil), |
|
2123 |
arrange for changeSelector (or #update) to be sent for the new channel." |
|
2124 |
||
2125 |
|oldValue| |
|
2126 |
||
2127 |
oldChannel == newChannel ifTrue:[^ self]. |
|
2128 |
||
2129 |
oldChannel notNil ifTrue:[ |
|
3152 | 2130 |
changeSelector isNil ifTrue:[ |
2131 |
oldChannel removeDependent:self |
|
2132 |
] ifFalse:[ |
|
2133 |
oldChannel retractInterestsFor:self. |
|
2134 |
]. |
|
2135 |
oldValue := oldChannel value. |
|
3139 | 2136 |
]. |
2137 |
newChannel notNil ifTrue:[ |
|
3152 | 2138 |
changeSelector isNil ifTrue:[ |
2139 |
newChannel addDependent:self. |
|
2140 |
newChannel value ~~ oldValue ifTrue:[ |
|
2141 |
self update:#value with:nil from:newChannel. |
|
2142 |
] |
|
2143 |
] ifFalse:[ |
|
2144 |
newChannel onChangeSend:changeSelector to:self. |
|
2145 |
newChannel value ~~ oldValue ifTrue:[ |
|
2146 |
self perform:changeSelector. |
|
2147 |
] |
|
2148 |
] |
|
3139 | 2149 |
]. |
2150 |
||
2151 |
^ newChannel |
|
2152 |
||
2153 |
"Modified: / 31.10.1997 / 14:47:21 / cg" |
|
2154 |
! ! |
|
2155 |
||
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2156 |
!SimpleView methodsFor:'accessing-contents'! |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2157 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2158 |
heightOfContents |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2159 |
"return the height of the contents in logical units |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2160 |
- defaults to views visible area here. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2161 |
This method MUST be redefined in all view classess which are |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2162 |
going to be scrolled AND show data which has different size than |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2163 |
the view. For example, a view showing A4-size documents should return |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2164 |
the number of vertical pixels such a document has on this device. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2165 |
A view showing a bitmap of height 1000 should return 1000. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2166 |
If not redefined, scrollbars have no way of knowing the actual size |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2167 |
of the contents being shown. This is called by scrollBars to compute |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2168 |
the relative height of the document vs. the views actual size. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2169 |
The value returned here must be based on a scale of 1, since users |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2170 |
of this will scale as appropriate." |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2171 |
|
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2172 |
^ (self innerHeight max:(self maxSubViewBottom)) max:self maxComponentBottom |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2173 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2174 |
"Modified: 26.5.1996 / 12:44:21 / cg" |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2175 |
! |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2176 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2177 |
widthOfContents |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2178 |
"return the width of the contents in logical units |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2179 |
- defaults to views visible area here. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2180 |
This method MUST be redefined in all view classess which are |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2181 |
going to be scrolled AND show data which has different size than |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2182 |
the view. For example, a view showing A4-size documents should return |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2183 |
the number of horizontal pixels such a document has on this device. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2184 |
A view showing a bitmap of width 500 should return 500. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2185 |
If not redefined, scrollbars have no way of knowing the actual size |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2186 |
of the contents being shown. This is called by scrollBars to compute |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2187 |
the relative width of the document vs. the views actual width. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2188 |
The value returned here must be based on a scale of 1, since users |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2189 |
of this will scale as appropriate." |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2190 |
|
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2191 |
^ (self innerWidth max:(self maxSubViewRight)) max:self maxComponentRight |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2192 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
2193 |
"Modified: 26.5.1996 / 13:02:50 / cg" |
422
bb19798ffda1
fixed openAutonomous for new model opening setup
Claus Gittinger <cg@exept.de>
parents:
420
diff
changeset
|
2194 |
! ! |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
2195 |
|
269 | 2196 |
!SimpleView methodsFor:'accessing-dimensions'! |
2197 |
||
2198 |
allInset:aNumber |
|
2199 |
"set all insets; positive makes the view smaller, |
|
4630 | 2200 |
negative makes it larger.. |
2201 |
Obsolete: please use a layout object." |
|
269 | 2202 |
|
2203 |
insets isNil ifTrue:[ |
|
3152 | 2204 |
insets := Array new:4. |
269 | 2205 |
]. |
2206 |
insets atAllPut:aNumber. |
|
2207 |
||
2208 |
"force recomputation" |
|
2209 |
"/ drawableId isNil ifTrue:[ |
|
3375 | 2210 |
"/ self originChangedFlag:true |
269 | 2211 |
"/ ] ifFalse:[ |
3152 | 2212 |
self containerChangedSize. |
269 | 2213 |
"/ ] |
964 | 2214 |
|
2215 |
"Modified: 19.7.1996 / 17:30:18 / cg" |
|
269 | 2216 |
! |
2217 |
||
2218 |
bottom |
|
2219 |
"return the y position of the actual bottom edge (in pixels)" |
|
2220 |
||
2221 |
^ top + height - 1 |
|
2222 |
! |
|
2223 |
||
2224 |
bottom:aNumber |
|
2225 |
"set the corners y position" |
|
2226 |
||
2227 |
self corner:(self corner x @ aNumber) |
|
2228 |
! |
|
2229 |
||
2230 |
bottomInset |
|
2231 |
"return the inset of the bottom edge; positive is to the top, |
|
4630 | 2232 |
negative to the bottom. |
2233 |
Obsolete: please use a layout object." |
|
269 | 2234 |
|
2235 |
insets isNil ifTrue:[^ 0]. |
|
2236 |
^ insets at:4 |
|
2237 |
! |
|
2238 |
||
2239 |
bottomInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2240 |
"set the inset of the bottom edge; |
269 | 2241 |
positive is to the top (view becomes smaller), |
4630 | 2242 |
negative to the bottom (becomes larger). |
2243 |
Obsolete: please use a layout object." |
|
269 | 2244 |
|
4427 | 2245 |
|newInset| |
2246 |
||
269 | 2247 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2248 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 2249 |
]. |
4427 | 2250 |
newInset := aNumber. |
2251 |
newInset isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2252 |
newInset := 0. |
4427 | 2253 |
]. |
2254 |
(insets at:4) ~= newInset ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2255 |
insets at:4 put:newInset. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2256 |
self containerChangedSize |
4427 | 2257 |
] |
964 | 2258 |
|
2259 |
"Modified: 19.7.1996 / 17:30:22 / cg" |
|
269 | 2260 |
! |
2261 |
||
2262 |
center |
|
2263 |
"return the point at the center of the receiver (in pixels)" |
|
2264 |
||
2265 |
^ (left + (width // 2)) @ (top + (height // 2)) |
|
2266 |
! |
|
2267 |
||
2268 |
center:newCenter |
|
2269 |
"move the receiver so that newCenter, aPoint becomes the center point" |
|
2270 |
||
2271 |
self origin:(newCenter - ((width // 2) @ (height // 2))) |
|
2272 |
! |
|
2273 |
||
2274 |
computeCorner |
|
2275 |
"compute my corner; if I have a layoutObject, |
|
2276 |
relative origins or blocks to evaluate, compute it now .. |
|
2277 |
Blocks may return relative values or nil; nil means: take current value. |
|
2278 |
Returns the corner point in device coordinates (pixels)." |
|
2279 |
||
2280 |
|org newCorner newExt x y| |
|
2281 |
||
2282 |
" |
|
2283 |
slowly migrating to use layoutObjects ... |
|
2284 |
" |
|
2285 |
layout notNil ifTrue:[ |
|
3152 | 2286 |
superView isNil ifTrue:[^ self preferredBounds corner]. |
2287 |
^ (layout rectangleRelativeTo:(superView viewRectangle) |
|
2288 |
preferred:[self preferredBounds]) corner rounded |
|
269 | 2289 |
]. |
2290 |
||
2291 |
(cornerRule notNil) ifTrue:[ |
|
3152 | 2292 |
newCorner := cornerRule value. |
2293 |
" |
|
2294 |
allow return of relative values ... |
|
2295 |
" |
|
2296 |
x := newCorner x. |
|
2297 |
y := newCorner y. |
|
2298 |
x isNil ifTrue:[x := self corner x]. |
|
2299 |
y isNil ifTrue:[y := self corner y]. |
|
2300 |
((x isInteger not) or:[y isInteger not]) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2301 |
newCorner := self cornerFromRelativeCorner:x@y |
3152 | 2302 |
] |
269 | 2303 |
] ifFalse:[ |
3152 | 2304 |
(relativeCorner notNil) ifTrue:[ |
2305 |
newCorner := self cornerFromRelativeCorner:relativeCorner |
|
2306 |
] ifFalse:[ |
|
2307 |
org := self computeOrigin. |
|
2308 |
(extentRule notNil) ifTrue:[ |
|
2309 |
newExt := extentRule value |
|
2310 |
] ifFalse:[ |
|
2311 |
(relativeExtent notNil) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2312 |
newExt := self extentFromRelativeExtent:relativeExtent |
3152 | 2313 |
] ifFalse:[ |
2314 |
newExt := self extent. |
|
2315 |
] |
|
2316 |
]. |
|
2317 |
newCorner := org + newExt |
|
2318 |
] |
|
269 | 2319 |
]. |
2320 |
^ newCorner |
|
1389 | 2321 |
|
2322 |
"Modified: 28.2.1997 / 10:33:39 / cg" |
|
269 | 2323 |
! |
2324 |
||
2325 |
computeExtent |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2326 |
"compute my extent; if I have a layoutObject, a relative extent |
269 | 2327 |
or blocks to evaluate, compute it now .. |
2328 |
There is one catch here, if the dimension was defined |
|
2329 |
by origin/corner, compute them here and take that value. |
|
2330 |
I.e. origin/corner definition has precedence over extent definition. |
|
2331 |
Returns the extent in device coordinates (pixels)." |
|
2332 |
||
2333 |
|newOrg newExt newCorner x y| |
|
2334 |
||
2335 |
" |
|
2336 |
slowly migrating to use layoutObjects ... |
|
2337 |
" |
|
2338 |
layout notNil ifTrue:[ |
|
3152 | 2339 |
^ (layout rectangleRelativeTo:(superView viewRectangle) |
2340 |
preferred:[self preferredBounds]) extent rounded |
|
135 | 2341 |
]. |
269 | 2342 |
|
2343 |
(cornerRule notNil) ifTrue:[ |
|
3152 | 2344 |
newCorner := cornerRule value. |
2345 |
" |
|
2346 |
allow return of relative values ... |
|
2347 |
" |
|
2348 |
x := newCorner x. |
|
2349 |
y := newCorner y. |
|
2350 |
x isNil ifTrue:[x := self corner x]. |
|
2351 |
y isNil ifTrue:[y := self corner y]. |
|
2352 |
((x isInteger not) or:[y isInteger not]) ifTrue:[ |
|
2353 |
newCorner := self cornerFromRelativeCorner:x@y |
|
2354 |
] |
|
269 | 2355 |
] ifFalse:[ |
3152 | 2356 |
(relativeCorner notNil) ifTrue:[ |
2357 |
newCorner := self cornerFromRelativeCorner:relativeCorner |
|
2358 |
] ifFalse:[ |
|
2359 |
(extentRule notNil) ifTrue:[ |
|
2360 |
newExt := extentRule value. |
|
2361 |
" |
|
2362 |
allow return of relative values ... |
|
2363 |
" |
|
2364 |
x := newExt x. |
|
2365 |
y := newExt y. |
|
2366 |
x isNil ifTrue:[x := width]. |
|
2367 |
y isNil ifTrue:[y := height]. |
|
2368 |
((x isInteger not) or:[y isInteger not]) ifTrue:[ |
|
2369 |
newExt := self extentFromRelativeExtent:x@y |
|
2370 |
] |
|
2371 |
] ifFalse:[ |
|
2372 |
(relativeExtent notNil) ifTrue:[ |
|
2373 |
newExt := self extentFromRelativeExtent:relativeExtent |
|
2374 |
] ifFalse:[ |
|
2375 |
newExt := (width @ height). |
|
2376 |
]. |
|
2377 |
]. |
|
2378 |
]. |
|
269 | 2379 |
]. |
2380 |
||
2381 |
newCorner notNil ifTrue:[ |
|
3152 | 2382 |
newOrg := self computeOrigin. |
2383 |
^ newCorner - newOrg. |
|
269 | 2384 |
]. |
2385 |
^ newExt. |
|
2386 |
! |
|
2387 |
||
2388 |
computeOrigin |
|
2389 |
"compute my origin; if I have a layoutObject, a relative origin |
|
2390 |
or blocks to evaluate, compute it now .. |
|
2391 |
Blocks may return relative values or nil; nil means: take current value. |
|
2392 |
Returns the origin point in device coordinates (pixels)." |
|
2393 |
||
2394 |
|newOrg x y| |
|
2395 |
||
2396 |
" |
|
2397 |
slowly migrating to use layoutObjects ... |
|
2398 |
" |
|
2399 |
layout notNil ifTrue:[ |
|
3152 | 2400 |
superView isNil ifTrue:[^ 0@0]. |
2401 |
^ (layout rectangleRelativeTo:(superView viewRectangle) |
|
2402 |
preferred:[self preferredBounds]) origin rounded |
|
269 | 2403 |
]. |
2404 |
||
2405 |
(originRule notNil) ifTrue:[ |
|
3152 | 2406 |
newOrg := originRule value. |
2407 |
" |
|
2408 |
allow return of relative values ... |
|
2409 |
" |
|
2410 |
x := newOrg x. |
|
2411 |
y := newOrg y. |
|
2412 |
x isNil ifTrue:[x := self origin x]. |
|
2413 |
y isNil ifTrue:[y := self origin y]. |
|
2414 |
((x isInteger not) or:[y isInteger not]) ifTrue:[ |
|
2415 |
newOrg := self originFromRelativeOrigin:x@y. |
|
2416 |
] |
|
269 | 2417 |
] ifFalse:[ |
3152 | 2418 |
(relativeOrigin notNil) ifTrue:[ |
2419 |
newOrg := self originFromRelativeOrigin:relativeOrigin. |
|
2420 |
] ifFalse:[ |
|
2421 |
^ (left @ top). |
|
2422 |
]. |
|
269 | 2423 |
]. |
2424 |
^ newOrg |
|
2425 |
! |
|
2426 |
||
2427 |
corner |
|
2428 |
"return the lower right corner-point (in pixels)" |
|
2429 |
||
2430 |
"/ ^ (left + width "- 1") @ (top + height "- 1") |
|
2431 |
^ (left + width - 1) @ (top + height - 1) |
|
2432 |
||
2433 |
"Modified: 31.8.1995 / 16:51:40 / claus" |
|
2434 |
! |
|
2435 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2436 |
corner:corner |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2437 |
"set the views corner; |
269 | 2438 |
the corner argument may be: |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2439 |
a point |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2440 |
where integer fields mean 'pixel-values' |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2441 |
and float values mean 'relative-to-superview' |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2442 |
and nil means 'take current value'; |
269 | 2443 |
or a block returning a point which is interpreted as above. |
2444 |
Please migrate to use layoutObjects, if possible." |
|
2445 |
||
2446 |
|x y pixelCorner c| |
|
2447 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2448 |
self explicitExtent:true. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2449 |
|
269 | 2450 |
corner isBlock ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2451 |
cornerRule := corner. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2452 |
drawableId notNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2453 |
pixelCorner := corner value |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2454 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2455 |
self extentChangedFlag:true |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2456 |
] |
269 | 2457 |
] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2458 |
x := corner x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2459 |
y := corner y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2460 |
x isNil ifTrue:[x := self corner x]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2461 |
y isNil ifTrue:[y := self corner y]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2462 |
c := x @ y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2463 |
((x isInteger not) or:[y isInteger not]) ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2464 |
relativeCorner := c. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2465 |
pixelCorner := self cornerFromRelativeCorner. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2466 |
pixelCorner isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2467 |
self extentChangedFlag:true |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2468 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2469 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2470 |
pixelCorner := c |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2471 |
] |
269 | 2472 |
]. |
2473 |
||
2474 |
pixelCorner notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2475 |
self pixelCorner:pixelCorner |
269 | 2476 |
] |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2477 |
|
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2478 |
"Modified: 15.7.1996 / 09:51:06 / cg" |
269 | 2479 |
! |
2480 |
||
1327 | 2481 |
cornerRule |
2482 |
"return the corner block - non public; this will vanish without notice" |
|
2483 |
||
2484 |
^ cornerRule |
|
2485 |
! |
|
2486 |
||
269 | 2487 |
extent:extent |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2488 |
"set the views extent; |
269 | 2489 |
extent may be: |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2490 |
a point |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2491 |
where integer fields mean 'pixel-values' |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2492 |
and float values mean 'relative-to-superview' |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2493 |
and nil means 'leave current value'; |
269 | 2494 |
or a block returning a point which is interpreted as above. |
2495 |
Be careful when using relative extents: rounding errors may |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2496 |
accumulate. Better use origin/corner. |
1048
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2497 |
Best: migrate to use layour objects. |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2498 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2499 |
Notice: this sets the views explicitExtent flag, which prevents it normally |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2500 |
from resizing itself to its preferredExtent. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2501 |
See initialExtent: for a variation." |
269 | 2502 |
|
2503 |
|w h pixelExtent e| |
|
2504 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2505 |
self explicitExtent:true. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2506 |
|
269 | 2507 |
extent isBlock ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2508 |
extentRule := extent. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2509 |
drawableId notNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2510 |
pixelExtent := extent value |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2511 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2512 |
self extentChangedFlag:true |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2513 |
] |
135 | 2514 |
] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2515 |
w := extent x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2516 |
h := extent y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2517 |
w isNil ifTrue:[w := width]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2518 |
h isNil ifTrue:[h := height]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2519 |
e := w@h. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2520 |
((w isInteger not) or:[h isInteger not]) ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2521 |
relativeExtent := e. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2522 |
pixelExtent := self extentFromRelativeExtent. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2523 |
pixelExtent isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2524 |
self extentChangedFlag:true |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2525 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2526 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2527 |
relativeExtent := nil. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2528 |
pixelExtent := e |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2529 |
] |
269 | 2530 |
]. |
2531 |
pixelExtent notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2532 |
self pixelExtent:pixelExtent |
269 | 2533 |
] |
573
578ae7a2f7fa
clear any relative origin/extent, if set to an absolute
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
2534 |
|
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2535 |
"Modified: 15.7.1996 / 09:51:21 / cg" |
269 | 2536 |
! |
2537 |
||
1327 | 2538 |
extentRule |
2539 |
"return the extent block - non public; this will vanish without notice" |
|
2540 |
||
2541 |
^ extentRule |
|
2542 |
! |
|
2543 |
||
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2544 |
frame |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2545 |
"compatibility with displayObjects: returns my bounds" |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2546 |
|
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2547 |
^ self bounds |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2548 |
! |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
2549 |
|
269 | 2550 |
geometryLayout |
2551 |
"this method will vanish, as soon as all implementations of |
|
2552 |
#layout: are removed ... |
|
2553 |
(conflict for example in label>>layout:). |
|
2554 |
DO NOT USE #geometryLayout: in your code; it will be removed without |
|
2555 |
notice." |
|
2556 |
||
2557 |
^ here layout |
|
2558 |
! |
|
2559 |
||
2560 |
geometryLayout:aLayoutObject |
|
2561 |
"this method will vanish, as soon as all implementations of |
|
2562 |
#layout: are removed ... |
|
2563 |
(conflict for example in label>>layout:). |
|
2564 |
DO NOT USE #geometryLayout: in your code; it will be removed without |
|
2565 |
notice." |
|
2566 |
||
2567 |
here layout:aLayoutObject |
|
2568 |
! |
|
2569 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2570 |
hasExplicitExtent |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2571 |
"/ ^ explicitExtent. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2572 |
^ flagBits bitTest:FlagHasExplicitExtent. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2573 |
! |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2574 |
|
269 | 2575 |
height:aNumber |
2576 |
"set the views height in pixels" |
|
2577 |
||
2578 |
self extent:(width @ aNumber) |
|
2579 |
! |
|
2580 |
||
2581 |
heightIncludingBorder |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2582 |
"return my height including border |
269 | 2583 |
(this is my height as seen from the outside view; |
2584 |
while #height returns the height as seen by myself)" |
|
2585 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
2586 |
^ height + (2*self borderWidth) |
269 | 2587 |
! |
2588 |
||
2589 |
horizontalInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2590 |
"set the insets of the left/right edge; |
4630 | 2591 |
positive makes it smaller, negative makes it larger. |
2592 |
Obsolete: please use a layout object." |
|
269 | 2593 |
|
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2594 |
|newInset| |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2595 |
|
269 | 2596 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2597 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 2598 |
]. |
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2599 |
newInset := aNumber. |
4426 | 2600 |
aNumber isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2601 |
newInset := 0. |
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2602 |
]. |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2603 |
insets at:1 put:newInset. |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
2604 |
insets at:3 put:newInset. |
269 | 2605 |
|
2606 |
"force recomputation" |
|
2607 |
"/ drawableId isNil ifTrue:[ |
|
3375 | 2608 |
"/ self originChangedFlag:true |
269 | 2609 |
"/ ] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2610 |
self containerChangedSize. |
269 | 2611 |
"/ ] |
964 | 2612 |
|
4630 | 2613 |
"Modified: / 30-09-2006 / 15:19:28 / cg" |
269 | 2614 |
! |
2615 |
||
1048
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2616 |
initialExtent:extent |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2617 |
"set the views extent, but dont change its explicitExtent setting. |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2618 |
a variant of #extent." |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2619 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2620 |
|expl| |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2621 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2622 |
expl := self hasExplicitExtent. |
1048
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2623 |
self extent:extent. |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2624 |
self explicitExtent:expl |
1048
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2625 |
! |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2626 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2627 |
initialHeight:aNumber |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2628 |
"set the views height in pixels, but dont change its explicitExtent setting" |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2629 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2630 |
self initialExtent:(width @ aNumber) |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2631 |
! |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2632 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2633 |
initialWidth:aNumber |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2634 |
"set the views width in pixels, but dont change its explicitExtent setting" |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2635 |
|
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2636 |
self initialExtent:(aNumber @ height) |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2637 |
! |
f6d383b7f113
kludge interface added: #initialExtent / initialWidth & initialHeight
dq
parents:
1039
diff
changeset
|
2638 |
|
269 | 2639 |
innerHeight |
2640 |
"return the height of the view minus any 3D-shadow-borders" |
|
2641 |
||
2642 |
(margin == 0) ifTrue:[^ height]. |
|
2643 |
^ height - (2 * margin) |
|
2644 |
! |
|
2645 |
||
369 | 2646 |
innerHeight:pixels |
2647 |
"set the height of the view plus any 3D-shadow-borders. |
|
2648 |
This does not work with a relative size." |
|
2649 |
||
2650 |
^ self height:( pixels + (margin + self innerVerticalMargin * 2) ). |
|
2651 |
! |
|
2652 |
||
2653 |
innerHorizontalMargin |
|
2654 |
"return any additional inner margin (i.e. contents margin). |
|
2655 |
This should be redefined by views which do add margins |
|
2656 |
(for example: textViews do this)" |
|
2657 |
||
2658 |
^ 0 |
|
2659 |
! |
|
2660 |
||
2661 |
innerVerticalMargin |
|
2662 |
"return any additional inner margin (i.e. contents margin). |
|
2663 |
This should be redefined by views which do add margins |
|
2664 |
(for example: textViews do this)" |
|
2665 |
||
2666 |
^ 0 |
|
2667 |
! |
|
2668 |
||
269 | 2669 |
innerWidth |
2670 |
"return the width of the view minus any 3D-shadow-borders" |
|
2671 |
||
2672 |
(level == 0) ifTrue:[^ width]. |
|
2673 |
^ width - (2 * margin) |
|
2674 |
! |
|
2675 |
||
369 | 2676 |
innerWidth:pixels |
2677 |
"set the width of the view plus any 3D-shadow-borders. |
|
2678 |
This does not work with a relative size." |
|
2679 |
||
2680 |
^ self width:( pixels + (margin + self innerHorizontalMargin * 2) ). |
|
2681 |
! |
|
2682 |
||
269 | 2683 |
inset:aNumber |
2684 |
"set all insets; positive makes the view smaller, |
|
4630 | 2685 |
negative makes it larger.. |
2686 |
Obsolete: please use a layout object." |
|
269 | 2687 |
|
2688 |
self allInset:aNumber |
|
2689 |
! |
|
2690 |
||
2691 |
layout |
|
2692 |
"return the layout object which controls my geometry. |
|
2693 |
Currently, this is nil in most cases, and my geometry is |
|
2694 |
defined by relativeOrigin/relativeCorner/relativeExtent, |
|
2695 |
originRule/extentRule/cornerRule and inset. |
|
2696 |
Applications should be changed to use layoutObjects, |
|
2697 |
since the above listed instance variables will vanish." |
|
2698 |
||
2699 |
^ layout |
|
2700 |
! |
|
2701 |
||
2702 |
layout:aLayoutObject |
|
2703 |
"set the layout object which controls my geometry. |
|
2704 |
Currently, this is almost nowhere used but views will be |
|
2705 |
incrementally changed to use this new geometry management." |
|
2706 |
||
2707 |
layout := aLayoutObject. |
|
2708 |
superView isNil ifTrue:[ |
|
3375 | 2709 |
self originChangedFlag:true. |
2710 |
self cornerChangedFlag:true. |
|
2711 |
self extentChangedFlag:true. |
|
269 | 2712 |
] ifFalse:[ |
3152 | 2713 |
self containerChangedSize. |
269 | 2714 |
] |
2715 |
||
2716 |
"Modified: 19.9.1995 / 16:17:25 / claus" |
|
964 | 2717 |
"Modified: 19.7.1996 / 17:30:27 / cg" |
269 | 2718 |
! |
2719 |
||
2720 |
left |
|
2721 |
"return the x position of the left border (in pixels)" |
|
2722 |
||
2723 |
^ left |
|
2724 |
! |
|
2725 |
||
2726 |
left:aNumber |
|
2727 |
"set the x position" |
|
2728 |
||
2729 |
self origin:(aNumber @ top) |
|
2730 |
! |
|
2731 |
||
2732 |
left:newLeft top:newTop width:newWidth height:newHeight |
|
2733 |
"another way of specifying origin and extent" |
|
2734 |
||
2735 |
self origin:(newLeft @ newTop) extent:(newWidth @ newHeight) |
|
2736 |
! |
|
2737 |
||
2738 |
leftInset |
|
2739 |
"return the inset of the left edge; positive is to the right, |
|
4630 | 2740 |
negative to the left. |
2741 |
Obsolete: please use a layout object." |
|
269 | 2742 |
|
2743 |
insets isNil ifTrue:[^ 0]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2744 |
^ insets at:1 |
269 | 2745 |
! |
2746 |
||
2747 |
leftInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2748 |
"set the inset of the left edge; |
269 | 2749 |
positive is to the right (view becomes smaller), |
4630 | 2750 |
negative to the left (becomes larger). |
2751 |
Obsolete: please use a layout object." |
|
269 | 2752 |
|
4427 | 2753 |
|newInset| |
2754 |
||
269 | 2755 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2756 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 2757 |
]. |
4427 | 2758 |
newInset := aNumber. |
2759 |
newInset isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2760 |
newInset := 0. |
4427 | 2761 |
]. |
2762 |
(insets at:1) ~= newInset ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2763 |
insets at:1 put:newInset. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2764 |
self containerChangedSize. |
4427 | 2765 |
] |
964 | 2766 |
|
2767 |
"Modified: 19.7.1996 / 17:30:30 / cg" |
|
269 | 2768 |
! |
2769 |
||
2770 |
makeFullyVisible |
|
2771 |
"make sure, that the view is fully visible by shifting it |
|
2772 |
into the visible screen area if nescessary. |
|
2773 |
This method will be moved to StandardSystemView ..." |
|
2774 |
||
2775 |
|devBot devRight newTop newLeft| |
|
2776 |
||
2777 |
newTop := top. |
|
2778 |
newLeft := left. |
|
2779 |
||
1703 | 2780 |
((top + height) > (devBot := device usableHeight)) ifTrue:[ |
3152 | 2781 |
newTop := devBot - height |
269 | 2782 |
]. |
1703 | 2783 |
((left + width) > (devRight := device usableWidth)) ifTrue:[ |
3152 | 2784 |
newLeft := devRight - width |
269 | 2785 |
]. |
2786 |
(newTop < 0) ifTrue:[ |
|
3152 | 2787 |
newTop := 0. |
269 | 2788 |
]. |
2789 |
(newLeft < 0) ifTrue:[ |
|
3152 | 2790 |
newLeft := 0 |
269 | 2791 |
]. |
2792 |
((newTop ~~ top) or:[newLeft ~~ left]) ifTrue:[ |
|
3152 | 2793 |
self origin:newLeft @ newTop |
269 | 2794 |
] |
2795 |
! |
|
2796 |
||
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2797 |
makeRoundViewShapeWithBorder:bw |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2798 |
"setup my window for a round shaped view; |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2799 |
this is not supported by all devices" |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2800 |
|
3167
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2801 |
self makeRoundViewShapeWithBorder:bw opaque:true. |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2802 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2803 |
! |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2804 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2805 |
makeRoundViewShapeWithBorder:bw opaque:opaque |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2806 |
"setup my window for a round shaped view; |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2807 |
this is not supported by all devices" |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2808 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2809 |
|extent shapeForm borderForm w h f| |
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2810 |
|
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2811 |
device supportsRoundShapedViews ifTrue:[ |
3762 | 2812 |
"/ TODO: add code for round shaped view (mswin) |
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2813 |
]. |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2814 |
|
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2815 |
device supportsArbitraryShapedViews ifTrue:[ |
3762 | 2816 |
extent := self extent. |
2817 |
w := extent x. |
|
2818 |
h := extent y. |
|
2819 |
borderForm := Form extent:extent. |
|
2820 |
shapeForm := Form extent:extent. |
|
2821 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2822 |
borderForm fillArcX:0 y:0 |
3762 | 2823 |
width:w |
2824 |
height:h |
|
2825 |
from:0 |
|
2826 |
angle:360. |
|
2827 |
||
2828 |
opaque ifFalse:[ |
|
2829 |
f := borderForm. |
|
2830 |
borderForm foreground:(Color colorId:0). |
|
2831 |
] ifTrue:[ |
|
2832 |
f := shapeForm. |
|
2833 |
shapeForm foreground:(Color colorId:1). |
|
2834 |
]. |
|
2835 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2836 |
f fillArcX:lineWidth y:lineWidth |
3762 | 2837 |
width:w - (bw * 2) |
2838 |
height:h - (bw * 2) |
|
2839 |
from:0 |
|
2840 |
angle:360. |
|
2841 |
||
2842 |
self borderShape:borderForm. |
|
2843 |
self viewShape:shapeForm. |
|
2844 |
^ self. |
|
3474 | 2845 |
|
2846 |
"/ |
|
2847 |
"/ extent := self extent. |
|
3167
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2848 |
"/ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2849 |
"/ w := extent x. |
3474 | 2850 |
"/ h := extent y. |
2851 |
"/ borderForm := Form width:w height:h. |
|
2852 |
"/ "/ borderForm fill:(Color colorId:0). |
|
2853 |
"/ |
|
2854 |
"/ shapeForm := Form width:w height:h. |
|
2855 |
"/ "/ shapeForm fill:(Color colorId:0). |
|
2856 |
"/ |
|
2857 |
"/ borderForm foreground:(Color colorId:1). |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2858 |
"/ borderForm |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2859 |
"/ fillArcX:0 y:0 |
3474 | 2860 |
"/ width:w |
2861 |
"/ height:h |
|
2862 |
"/ from:0 |
|
2863 |
"/ angle:360. |
|
2864 |
"/ |
|
2865 |
"/ opaque ifFalse:[ |
|
2866 |
"/ f := borderForm. |
|
2867 |
"/ borderForm foreground:(Color colorId:0). |
|
2868 |
"/ ] ifTrue:[ |
|
2869 |
"/ f := shapeForm. |
|
2870 |
"/ shapeForm foreground:(Color colorId:1). |
|
2871 |
"/ ]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2872 |
"/ f |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2873 |
"/ fillArcX:bw y:bw |
3474 | 2874 |
"/ width:(w - (bw * 2)) |
2875 |
"/ height:(h - (bw * 2)) |
|
2876 |
"/ from:0 |
|
2877 |
"/ angle:360. |
|
2878 |
"/ |
|
2879 |
"/ self borderShape:borderForm. |
|
2880 |
"/ self viewShape:shapeForm |
|
3167
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2881 |
] |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2882 |
! |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2883 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2884 |
makeTransparentRectangularViewShapeWithBorder:bw |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2885 |
"setup my window for a rectangluar transparent shaped view; |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2886 |
this is not supported by all devices" |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2887 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2888 |
|extent shapeForm borderForm w h f| |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2889 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2890 |
"/ device supportsPolygonShapedViews ifTrue:[ |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2891 |
"/ "/ TODO: add code for mswin |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2892 |
"/ ]. |
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2893 |
|
9dc9abd86ba2
fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents:
3165
diff
changeset
|
2894 |
device supportsArbitraryShapedViews ifTrue:[ |
3367 | 2895 |
extent := self extent. |
2896 |
w := extent x. |
|
2897 |
h := extent y. |
|
2898 |
borderForm := Form extent:extent. |
|
2899 |
shapeForm := Form extent:extent. |
|
2900 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2901 |
borderForm |
3367 | 2902 |
fillRectangleX:0 y:0 |
2903 |
width:w |
|
2904 |
height:h. |
|
2905 |
||
2906 |
f := borderForm. |
|
2907 |
borderForm foreground:(Color colorId:0). |
|
2908 |
||
2909 |
borderForm |
|
2910 |
fillRectangleX:bw y:bw |
|
2911 |
width:w - (bw * 2) |
|
2912 |
height:h - (bw * 2). |
|
2913 |
||
2914 |
self borderShape:borderForm. |
|
2915 |
self viewShape:shapeForm. |
|
2916 |
^ self. |
|
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2917 |
] |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2918 |
|
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2919 |
! |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
2920 |
|
2127 | 2921 |
minExtent |
2103
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2922 |
"for compatibility with StdSysView" |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2923 |
|
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2924 |
^ nil |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2925 |
! |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
2926 |
|
269 | 2927 |
origin |
2928 |
"return the origin (in pixels)" |
|
2929 |
||
2930 |
^ left@top |
|
2931 |
! |
|
2932 |
||
2933 |
origin:origin |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2934 |
"set the views origin; |
269 | 2935 |
origin may be: |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2936 |
a point |
3152 | 2937 |
where integer fields mean 'pixel-values' |
2938 |
and float values mean 'relative-to-superview' |
|
2939 |
and nil means 'take current value'; |
|
269 | 2940 |
or a block returning a point which is interpreted as above. |
2941 |
Please migrate to use layout objects." |
|
2942 |
||
2943 |
|newLeft newTop pixelOrigin o| |
|
2944 |
||
2945 |
origin isBlock ifTrue:[ |
|
3152 | 2946 |
originRule := origin. |
2947 |
drawableId notNil ifTrue:[ |
|
2948 |
pixelOrigin := origin value |
|
2949 |
] ifFalse:[ |
|
3375 | 2950 |
self originChangedFlag:true |
3152 | 2951 |
] |
269 | 2952 |
] ifFalse:[ |
3152 | 2953 |
o := origin. |
2954 |
newLeft := origin x. |
|
2955 |
newTop := origin y. |
|
2956 |
newLeft isNil ifTrue:[newLeft := left]. |
|
2957 |
newTop isNil ifTrue:[newTop := top]. |
|
2958 |
o := newLeft @ newTop. |
|
2959 |
((newLeft isInteger not) or:[newTop isInteger not]) ifTrue:[ |
|
2960 |
relativeOrigin := o. |
|
2961 |
pixelOrigin := self originFromRelativeOrigin. |
|
2962 |
pixelOrigin isNil ifTrue:[ |
|
3375 | 2963 |
self originChangedFlag:true |
3152 | 2964 |
] |
2965 |
] ifFalse:[ |
|
2966 |
relativeOrigin := nil. |
|
2967 |
pixelOrigin := o |
|
2968 |
] |
|
269 | 2969 |
]. |
2970 |
pixelOrigin notNil ifTrue:[ |
|
3152 | 2971 |
self pixelOrigin:pixelOrigin |
269 | 2972 |
]. |
573
578ae7a2f7fa
clear any relative origin/extent, if set to an absolute
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
2973 |
|
578ae7a2f7fa
clear any relative origin/extent, if set to an absolute
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
2974 |
"Modified: 19.4.1996 / 15:12:36 / cg" |
269 | 2975 |
! |
2976 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
2977 |
origin:origin corner:corner |
269 | 2978 |
"set both origin and extent" |
2979 |
||
2980 |
|newLeft newTop newRight newBot| |
|
2981 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
2982 |
self explicitExtent:true. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
2983 |
|
269 | 2984 |
"do it as one operation if possible" |
2985 |
||
2986 |
origin isBlock ifFalse:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2987 |
corner isBlock ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2988 |
newLeft := origin x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2989 |
newLeft isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2990 |
newTop := origin y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2991 |
newTop isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2992 |
newRight := corner x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2993 |
newRight isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2994 |
newBot := corner y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2995 |
newBot isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2996 |
self pixelOrigin:origin corner:corner |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2997 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2998 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
2999 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3000 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3001 |
] |
135 | 3002 |
]. |
269 | 3003 |
self origin:origin. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3004 |
self corner:corner |
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3005 |
|
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3006 |
"Modified: 15.7.1996 / 09:52:43 / cg" |
269 | 3007 |
! |
3008 |
||
3009 |
origin:origin extent:extent |
|
3010 |
"set both origin and extent" |
|
3011 |
||
3012 |
|newLeft newTop newWidth newHeight| |
|
3013 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
3014 |
self explicitExtent:true. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3015 |
|
269 | 3016 |
"do it as one operation if possible" |
3017 |
||
3018 |
origin isBlock ifFalse:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3019 |
extent isBlock ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3020 |
newLeft := origin x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3021 |
newLeft isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3022 |
newTop := origin y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3023 |
newTop isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3024 |
newWidth := extent x. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3025 |
newWidth isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3026 |
newHeight := extent y. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3027 |
newHeight isInteger ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3028 |
self pixelOrigin:origin extent:extent |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3029 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3030 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3031 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3032 |
] |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3033 |
] |
269 | 3034 |
]. |
3035 |
self extent:extent. |
|
3036 |
self origin:origin |
|
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3037 |
|
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
3038 |
"Modified: 15.7.1996 / 09:52:39 / cg" |
269 | 3039 |
! |
3040 |
||
3041 |
originRelativeTo:aView |
|
3042 |
"return the origin (in pixels) relative to a superView, |
|
3043 |
or relative to the rootView (if the aView argument is nil). |
|
3044 |
If the receiver is nonNil and not a subview of aView, return nil." |
|
3045 |
||
3046 |
|currentView |
|
2414 | 3047 |
bw "{ Class: SmallInteger }" |
269 | 3048 |
sumX "{ Class: SmallInteger }" |
3049 |
sumY "{ Class: SmallInteger }" | |
|
3050 |
||
3051 |
currentView := self. |
|
3052 |
sumX := 0. |
|
3053 |
sumY := 0. |
|
3054 |
[currentView notNil] whileTrue:[ |
|
3152 | 3055 |
(currentView == aView) ifTrue:[ |
3056 |
^ (sumX @ sumY) |
|
3057 |
]. |
|
3058 |
bw := currentView borderWidth. |
|
3059 |
sumX := sumX + (currentView left) + bw. |
|
3060 |
sumY := sumY + (currentView top) + bw. |
|
3061 |
currentView := currentView superView |
|
269 | 3062 |
]. |
729
d2fdca1c2895
eliminated references to RootView
Claus Gittinger <cg@exept.de>
parents:
727
diff
changeset
|
3063 |
(aView isNil or:[aView == device rootView]) ifTrue:[ |
3152 | 3064 |
"return relative to screen ..." |
3065 |
^ (sumX @ sumY) |
|
269 | 3066 |
]. |
3067 |
^ nil |
|
3068 |
||
3069 |
" |
|
3070 |
|top sub1 sub2| |
|
3071 |
||
3072 |
top := StandardSystemView new. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3073 |
top extent:200@200. |
269 | 3074 |
sub1 := View origin:0.2 @ 0.2 corner:0.8 @ 0.8 in:top. |
3075 |
sub2 := Button origin:0.3 @ 0.3 corner:0.7 @ 0.7 in:sub1. |
|
3076 |
top openAndWait. |
|
697 | 3077 |
Transcript show:'button in top:'; showCR:(sub2 originRelativeTo:top). |
3078 |
Transcript show:'button on screen:'; showCR:(sub2 originRelativeTo:nil). |
|
269 | 3079 |
" |
2171
df6af7cc7a62
fixed #originRelativeTo: when borderWidth ~~ 0
Claus Gittinger <cg@exept.de>
parents:
2167
diff
changeset
|
3080 |
|
2414 | 3081 |
"Modified: / 5.12.1998 / 14:30:57 / cg" |
269 | 3082 |
! |
3083 |
||
1327 | 3084 |
originRule |
3085 |
"return the origin block - non public; this will vanish without notice" |
|
3086 |
||
3087 |
^ originRule |
|
3088 |
! |
|
3089 |
||
763 | 3090 |
preferredExtent:anExtentPoint |
3091 |
"override the views own preferredExtent computation, |
|
3092 |
and let it prefer the size given by the argument." |
|
3093 |
||
3094 |
preferredExtent := anExtentPoint. |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
3095 |
explicitExtent := anExtentPoint. |
1038
fb193cba16b6
#preferredExtent: no longer changes the extent
Claus Gittinger <cg@exept.de>
parents:
1035
diff
changeset
|
3096 |
|
fb193cba16b6
#preferredExtent: no longer changes the extent
Claus Gittinger <cg@exept.de>
parents:
1035
diff
changeset
|
3097 |
"Modified: 22.8.1996 / 13:41:47 / cg" |
763 | 3098 |
! |
3099 |
||
269 | 3100 |
relativeCorner |
4630 | 3101 |
"return the relative corner or nil. |
3102 |
Obsolete: please use a layout object." |
|
269 | 3103 |
|
3104 |
^ relativeCorner |
|
3105 |
! |
|
3106 |
||
3107 |
relativeCorner:aPoint |
|
4630 | 3108 |
"set the relative corner. |
3109 |
Obsolete: please use a layout object." |
|
269 | 3110 |
|
3627
eefbbc5c3d04
when setting a relativeExtent, clear any relativeCorner
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
3111 |
aPoint notNil ifTrue:[relativeExtent := nil]. |
269 | 3112 |
relativeCorner := aPoint |
3113 |
! |
|
3114 |
||
3115 |
relativeExtent |
|
4630 | 3116 |
"return the relative extent or nil. |
3117 |
Obsolete: please use a layout object." |
|
269 | 3118 |
|
3119 |
^ relativeExtent |
|
3120 |
! |
|
3121 |
||
3122 |
relativeExtent:aPoint |
|
4630 | 3123 |
"set the relative extent. |
3124 |
Obsolete: please use a layout object." |
|
269 | 3125 |
|
3627
eefbbc5c3d04
when setting a relativeExtent, clear any relativeCorner
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
3126 |
aPoint notNil ifTrue:[relativeCorner := nil]. |
269 | 3127 |
relativeExtent := aPoint |
3128 |
! |
|
3129 |
||
3130 |
relativeOrigin |
|
4630 | 3131 |
"return the relative origin or nil. |
3132 |
Obsolete: please use a layout object." |
|
269 | 3133 |
|
3134 |
^ relativeOrigin |
|
3135 |
! |
|
3136 |
||
3137 |
relativeOrigin:aPoint |
|
4630 | 3138 |
"set the relative origin. |
3139 |
Obsolete: please use a layout object." |
|
269 | 3140 |
|
3141 |
relativeOrigin := aPoint |
|
3142 |
! |
|
3143 |
||
3144 |
right |
|
3145 |
"return the x position of the right edge (in pixels)" |
|
3146 |
||
3147 |
^ left + width - 1 |
|
3148 |
||
3149 |
"Modified: 31.8.1995 / 19:31:10 / claus" |
|
3150 |
! |
|
3151 |
||
3152 |
right:aNumber |
|
3153 |
"set the corners x position" |
|
3154 |
||
3155 |
self corner:(aNumber @ self corner y) |
|
3156 |
! |
|
3157 |
||
3158 |
rightInset |
|
3159 |
"return the inset of the right edge; positive is to the left, |
|
4630 | 3160 |
negative to the right. |
3161 |
Obsolete: please use a layout object." |
|
269 | 3162 |
|
3163 |
insets isNil ifTrue:[^ 0]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3164 |
^ insets at:3 |
269 | 3165 |
! |
3166 |
||
3167 |
rightInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3168 |
"set the inset of the right edge; |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3169 |
positive is to the left (view becomes smaller), |
4630 | 3170 |
negative to the right (becomes larger). |
3171 |
Obsolete: please use a layout object." |
|
269 | 3172 |
|
4427 | 3173 |
|newInset| |
3174 |
||
269 | 3175 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3176 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 3177 |
]. |
4427 | 3178 |
newInset := aNumber. |
3179 |
newInset isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3180 |
newInset := 0. |
4427 | 3181 |
]. |
3182 |
(insets at:3) ~= newInset ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3183 |
insets at:3 put:newInset. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3184 |
self containerChangedSize. |
4427 | 3185 |
] |
964 | 3186 |
|
3187 |
"Modified: 19.7.1996 / 17:30:32 / cg" |
|
269 | 3188 |
! |
3189 |
||
3007 | 3190 |
setOrigin:aPoint |
3191 |
"set the origin only" |
|
3192 |
||
3193 |
left := aPoint x. |
|
3194 |
top := aPoint y. |
|
3195 |
! |
|
3196 |
||
269 | 3197 |
sizeFixed:aBoolean |
3198 |
"set/clear the fix-size attribute, if supported by concrete subclasses. |
|
3199 |
Views which want to resize themselfes as appropriate to their contents |
|
3200 |
should cease to do so and take their current size if sizeFixed is set to |
|
3201 |
true. Currently, only supported by Labels. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3202 |
This does NOT prevent the window manager from resizing the view, |
269 | 3203 |
instead it tell the view to NOT resize ITSELF. |
3204 |
Added here to provide a common protocol for all views." |
|
3205 |
||
3206 |
^ self |
|
3207 |
! |
|
3208 |
||
5228 | 3209 |
superViewRectangle |
3210 |
"return the inside area of the superView." |
|
3211 |
||
3212 |
superView isNil ifTrue:[ |
|
3213 |
^ Rectangle left:0 top:0 right:0 bottom:0. |
|
3214 |
]. |
|
3215 |
||
3216 |
^ superView viewRectangle. |
|
3217 |
! |
|
3218 |
||
269 | 3219 |
top |
3220 |
"return the y position of the top border" |
|
3221 |
||
3222 |
^ top |
|
3223 |
! |
|
3224 |
||
3225 |
top:aNumber |
|
3226 |
"set the y position" |
|
3227 |
||
3228 |
self origin:(left @ aNumber) |
|
3229 |
! |
|
3230 |
||
3231 |
topInset |
|
3232 |
"return the inset of the top edge; positive is to the bottom, |
|
4630 | 3233 |
negative to the top. |
3234 |
Obsolete: please use a layout object." |
|
269 | 3235 |
|
3236 |
insets isNil ifTrue:[^ 0]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3237 |
^ insets at:2 |
269 | 3238 |
! |
3239 |
||
3240 |
topInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3241 |
"set the inset of the top edge; |
269 | 3242 |
positive is to the bottom (view becomes smaller), |
4630 | 3243 |
negative to the top (becomes larger). |
3244 |
Obsolete: please use a layout object." |
|
269 | 3245 |
|
4427 | 3246 |
|newInset| |
3247 |
||
269 | 3248 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3249 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 3250 |
]. |
4427 | 3251 |
newInset := aNumber. |
3252 |
newInset isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3253 |
newInset := 0. |
4427 | 3254 |
]. |
3255 |
(insets at:2) ~= newInset ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3256 |
insets at:2 put:newInset. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3257 |
self containerChangedSize. |
4427 | 3258 |
] |
964 | 3259 |
|
3260 |
"Modified: 19.7.1996 / 17:30:45 / cg" |
|
269 | 3261 |
! |
3262 |
||
3263 |
verticalInset:aNumber |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3264 |
"set the insets of the top/bottom edge; |
4630 | 3265 |
positive makes it smaller, negative makes it larger. |
3266 |
Obsolete: please use a layout object." |
|
269 | 3267 |
|
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3268 |
|newInset| |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3269 |
|
269 | 3270 |
insets isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3271 |
insets := Array with:0 with:0 with:0 with:0 |
4426 | 3272 |
]. |
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3273 |
newInset := aNumber. |
4426 | 3274 |
aNumber isNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3275 |
newInset := 0. |
4530
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3276 |
]. |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3277 |
insets at:2 put:newInset. |
5afcace584e4
compact: #dropMessage:data:view:position:handle:
Stefan Vogel <sv@exept.de>
parents:
4524
diff
changeset
|
3278 |
insets at:4 put:newInset. |
269 | 3279 |
|
3280 |
"force recomputation" |
|
3281 |
"/ drawableId isNil ifTrue:[ |
|
3375 | 3282 |
"/ self originChangedFlag:true |
269 | 3283 |
"/ ] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
3284 |
self containerChangedSize. |
269 | 3285 |
"/ ] |
964 | 3286 |
|
4630 | 3287 |
"Modified: / 30-09-2006 / 15:19:45 / cg" |
269 | 3288 |
! |
3289 |
||
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3290 |
viewRectangle |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3291 |
"return the inside area. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3292 |
This is used by relative sized subviews and layout-computations |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3293 |
to base relative coordinates on. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3294 |
For most views, the value returned here (actual extent minus any |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3295 |
margins required for 3D levels) is ok. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3296 |
However, views which want some extra area around (for example: FramedBox) |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3297 |
may redefine this method to return a rectangle without this area |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3298 |
(thus, a relative sized subviews coordinates will be based on this net area) " |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3299 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3300 |
|m2| |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3301 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3302 |
m2 := margin + margin. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3303 |
^ (margin @ margin) extent:((width - m2) @ (height - m2)) |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3304 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3305 |
"Modified: 8.2.1996 / 20:05:00 / cg" |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3306 |
! |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3307 |
|
269 | 3308 |
width:aNumber |
3309 |
"set the views width in pixels" |
|
3310 |
||
3311 |
self extent:(aNumber @ height) |
|
3312 |
! |
|
3313 |
||
3314 |
widthIncludingBorder |
|
3315 |
"return my width including border |
|
3316 |
(this is my width as seen from the outside view; |
|
3317 |
while #width returns the width as seen by myself)" |
|
3318 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
3319 |
^ width + (2*self borderWidth) |
269 | 3320 |
! ! |
3321 |
||
3918
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3322 |
!SimpleView methodsFor:'accessing-display attributes'! |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3323 |
|
4497 | 3324 |
beMDIChildView |
3325 |
flagBits := flagBits bitOr:FlagIsMDIChild |
|
3326 |
! |
|
3327 |
||
4230 | 3328 |
beNativeWidget |
3329 |
flagBits := flagBits bitOr:FlagNativeWidget |
|
3330 |
! |
|
3331 |
||
4262 | 3332 |
beNonNativeWidget |
3333 |
flagBits := flagBits bitClear:FlagNativeWidget |
|
3334 |
! |
|
3335 |
||
4497 | 3336 |
isMDIChildView |
3337 |
^ flagBits bitTest:FlagIsMDIChild |
|
3338 |
! |
|
3339 |
||
4407 | 3340 |
isMarkedAsUnmappedModalBox |
3341 |
^ flagBits bitTest:FlagIsUnmappedModalBox |
|
3342 |
! |
|
3343 |
||
4230 | 3344 |
isNativeWidget |
3345 |
^ flagBits bitTest:FlagNativeWidget |
|
3346 |
! |
|
3347 |
||
4407 | 3348 |
markAsUnmappedModalBox |
3349 |
flagBits := flagBits bitOr:FlagIsUnmappedModalBox |
|
3350 |
! |
|
3351 |
||
3918
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3352 |
setWindowClass:windowClassNameString name:nameString |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3353 |
"define class and name of a window. |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3354 |
This may be used by the window manager to |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3355 |
select client specific resources." |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3356 |
|
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3357 |
device setWindowClass:windowClassNameString name:nameString in:drawableId. |
4407 | 3358 |
! |
3359 |
||
3360 |
unmarkAsUnmappedModalBox |
|
3361 |
flagBits := flagBits bitClear:FlagIsUnmappedModalBox |
|
3918
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3362 |
! ! |
f708df11e804
Set windowClasses based on application class name.
Stefan Vogel <sv@exept.de>
parents:
3909
diff
changeset
|
3363 |
|
269 | 3364 |
!SimpleView methodsFor:'accessing-hierarchy'! |
3365 |
||
756 | 3366 |
components |
3367 |
"return the collection of non-view components" |
|
3368 |
||
4516 | 3369 |
^ components ? #() |
756 | 3370 |
|
3371 |
"Created: 28.5.1996 / 23:59:37 / cg" |
|
3372 |
! |
|
3373 |
||
1182 | 3374 |
container |
3375 |
"return my container" |
|
3376 |
||
3377 |
^ superView |
|
3378 |
||
3379 |
"Created: 5.6.1996 / 01:08:36 / cg" |
|
3380 |
"Modified: 10.1.1997 / 19:47:59 / cg" |
|
3381 |
! |
|
3382 |
||
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3383 |
container:aContainer |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3384 |
"set my container (i.e. superView) to be aContainer" |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3385 |
|
3558
5b0c805753aa
fixed container: (no error if same container is given)
martin
parents:
3556
diff
changeset
|
3386 |
superView == aContainer ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3387 |
"/ no change |
3762 | 3388 |
^ self. |
3558
5b0c805753aa
fixed container: (no error if same container is given)
martin
parents:
3556
diff
changeset
|
3389 |
]. |
5b0c805753aa
fixed container: (no error if same container is given)
martin
parents:
3556
diff
changeset
|
3390 |
|
3485 | 3391 |
(drawableId notNil) ifTrue:[ |
3762 | 3392 |
"/ actually, this is worth an exception |
3393 |
"/ ('View [error]: ' , self printString , ' already realized - cannot change container') errorPrintCR. |
|
3394 |
self error:'already realized - cannot change container' mayProceed:true. |
|
3485 | 3395 |
]. |
1296 | 3396 |
(superView notNil and:[superView ~~ aContainer]) ifTrue:[ |
3762 | 3397 |
"/ actually, this is worth an exception |
3398 |
('View [warning]: ' , self printString , ' already has a container') errorPrintCR. |
|
3399 |
superView removeComponent:self. |
|
1296 | 3400 |
]. |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3401 |
superView := aContainer |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3402 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3403 |
"Created: 9.5.1996 / 00:40:56 / cg" |
1297 | 3404 |
"Modified: 29.1.1997 / 17:37:38 / cg" |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3405 |
! |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3406 |
|
5211 | 3407 |
hierarchicalIndex |
3408 |
^ superView hierarchicalIndexOfChild:self |
|
3409 |
! |
|
3410 |
||
3411 |
hierarchicalIndexInList:aViewCollection |
|
3412 |
|viewsWithSameName myName| |
|
3413 |
||
3414 |
myName := self uuidStringOrName. |
|
3415 |
viewsWithSameName := aViewCollection select:[:v | v uuidStringOrName = myName]. |
|
3416 |
viewsWithSameName size = 1 ifTrue:[ |
|
3417 |
^ nil "/ no conflict |
|
3418 |
]. |
|
3419 |
^ viewsWithSameName indexOf:self |
|
3420 |
! |
|
3421 |
||
3422 |
hierarchicalIndexOfChild:aView |
|
3423 |
^ nil |
|
3424 |
! |
|
3425 |
||
5050 | 3426 |
hierarchicalUUID |
3427 |
||
5211 | 3428 |
|uuidOrName superV hierarchicalViews hierarchicalUUID separator indexOrNil indexString| |
5050 | 3429 |
|
3430 |
hierarchicalUUID := ''. |
|
3431 |
hierarchicalViews := OrderedCollection with: self. |
|
3432 |
superV := self superView. |
|
3433 |
||
3434 |
[superV isNil] whileFalse:[ |
|
3435 |
hierarchicalViews addFirst: superV. |
|
3436 |
superV := superV superView. |
|
3437 |
]. |
|
3438 |
||
3439 |
hierarchicalViews doWithIndex:[:aView :index | |
|
5211 | 3440 |
uuidOrName := aView uuidStringOrName. |
3441 |
indexString := nil. |
|
3442 |
index > 1 ifTrue:[ |
|
3443 |
indexOrNil := aView hierarchicalIndex. |
|
3444 |
(indexOrNil notNil and:[indexOrNil ~= 1]) ifTrue:[ |
|
3445 |
indexString := '[',indexOrNil printString,']' |
|
3446 |
] |
|
3447 |
]. |
|
5050 | 3448 |
separator := index == 1 ifTrue:[''] ifFalse:['.']. |
5211 | 3449 |
hierarchicalUUID := hierarchicalUUID,separator,uuidOrName,(indexString?''). |
5050 | 3450 |
]. |
3451 |
^ hierarchicalUUID |
|
3452 |
! |
|
3453 |
||
269 | 3454 |
lower |
3455 |
"bring to back" |
|
3456 |
||
3457 |
drawableId isNil ifTrue:[self create]. |
|
3458 |
device lowerWindow:drawableId |
|
3459 |
||
3460 |
" |
|
3461 |
Transcript topView lower |
|
3462 |
" |
|
3463 |
! |
|
3464 |
||
3465 |
raise |
|
3466 |
"bring to front" |
|
3467 |
||
5262
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3468 |
"MS-windows: |
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3469 |
Raise does not raise a window above windows marked as 'TOPMOST'. |
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3470 |
(e.g. cmd.exe appears to mark itself as topmost when it gets the focus). |
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3471 |
Use #setForegroundWindow to raise above the currently active window, |
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3472 |
or mark as #beScreenDialog before opening" |
d7651814a2db
fixed raise, when a modal view opens another modal dialog,
Claus Gittinger <cg@exept.de>
parents:
5258
diff
changeset
|
3473 |
|
269 | 3474 |
drawableId isNil ifTrue:[self create]. |
5152 | 3475 |
device raiseWindowToTop:drawableId |
269 | 3476 |
|
3477 |
" |
|
3478 |
Transcript topView raise |
|
3479 |
" |
|
3480 |
! |
|
3481 |
||
3625 | 3482 |
setContainer:aContainer |
3483 |
"set my container (i.e. superView) to be aContainer" |
|
3484 |
||
3485 |
superView := aContainer |
|
3486 |
! |
|
3487 |
||
269 | 3488 |
subViews |
3489 |
"return the collection of subviews" |
|
3490 |
||
3626
fa436ffc8ae7
subViews always returns a collection
Claus Gittinger <cg@exept.de>
parents:
3625
diff
changeset
|
3491 |
^ subViews ? #() |
269 | 3492 |
! |
3493 |
||
3494 |
subViews:aListOfViews |
|
5214 | 3495 |
<resource: #obsolete> |
269 | 3496 |
"set the collection of subviews" |
3497 |
||
3616 | 3498 |
self obsoleteMethodWarning. |
3499 |
||
269 | 3500 |
subViews := aListOfViews. |
135 | 3501 |
subViews notNil ifTrue:[ |
3762 | 3502 |
subViews do:[:view | |
3503 |
view container:self |
|
3504 |
] |
|
135 | 3505 |
] |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3506 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3507 |
"Modified: 9.5.1996 / 00:42:28 / cg" |
135 | 3508 |
! |
3509 |
||
269 | 3510 |
superView |
3511 |
"return my superView" |
|
3512 |
||
3513 |
^ superView |
|
3514 |
! |
|
3515 |
||
3516 |
superView:aView |
|
3517 |
"set my superView to be aView" |
|
3518 |
||
3434 | 3519 |
<resource:#obsolete> |
3520 |
||
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3521 |
self obsoleteMethodWarning:'use #container:'. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3522 |
self container:aView. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3523 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
3524 |
"Modified: 9.5.1996 / 00:46:24 / cg" |
269 | 3525 |
! |
3526 |
||
662
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3527 |
topComponent |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3528 |
"return the topmost component - thats the one with no superview. |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3529 |
For ST-80 compatibility." |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3530 |
|
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3531 |
^ self topView |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3532 |
|
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3533 |
"Modified: 9.5.1996 / 01:40:24 / cg" |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3534 |
! |
8263420fe544
added #topComponent for VisualPart protocol compatibility
Claus Gittinger <cg@exept.de>
parents:
660
diff
changeset
|
3535 |
|
269 | 3536 |
topView |
3537 |
"return the topView - thats the one with no superview" |
|
3538 |
||
3425 | 3539 |
|v next n| |
3540 |
||
3541 |
n := 1. |
|
269 | 3542 |
v := self. |
3543 |
[v notNil] whileTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3544 |
(next := v container) isNil ifTrue:[^ v]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3545 |
v := next. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3546 |
n := n + 1. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3547 |
n > 1000 ifTrue:[self error:'circular superView chain']. |
135 | 3548 |
]. |
3549 |
||
269 | 3550 |
^ nil |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3551 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3552 |
"Modified: 5.6.1996 / 01:09:12 / cg" |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3553 |
! |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3554 |
|
5211 | 3555 |
uuidStringOrName |
3556 |
|uuid| |
|
3557 |
||
3558 |
(uuid := self uuid) isNil ifTrue: [^ self name]. |
|
3559 |
^ uuid printString |
|
3560 |
! |
|
3561 |
||
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3562 |
view |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3563 |
"return my view - for real views, thats the receiver. |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3564 |
For wrappers, its the real view that contains it" |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3565 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3566 |
^ self |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3567 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3568 |
"Created: 4.6.1996 / 21:32:11 / cg" |
269 | 3569 |
! ! |
3570 |
||
3571 |
!SimpleView methodsFor:'accessing-menus'! |
|
3572 |
||
3573 |
menuHolder |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3574 |
"who has the menu ? |
269 | 3575 |
By default, I have it." |
3576 |
||
3577 |
^ self |
|
3578 |
! |
|
3579 |
||
3580 |
menuMessage |
|
3581 |
"Return the symbol sent to myself to aquire the menu" |
|
3582 |
||
3583 |
^ #middleButtonMenu |
|
3584 |
! |
|
3585 |
||
3586 |
menuPerformer |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3587 |
"who should perform the menu actions ? |
269 | 3588 |
By default, I do it." |
3589 |
||
3590 |
^ self |
|
3591 |
! |
|
3592 |
||
3593 |
yellowButtonMenu |
|
3594 |
"actually, this should be called 'middleButtonMenu'. |
|
3595 |
But for ST-80 compatibility .... |
|
3596 |
This method will vanish, once all views have controllers |
|
3597 |
associated with them; for now, duplicate some code also found in |
|
3598 |
controller." |
|
3599 |
||
3821 | 3600 |
|sym menuHolder| |
269 | 3601 |
|
3602 |
menuHolder := self menuHolder. |
|
3821 | 3603 |
menuHolder isNil ifTrue:[^ nil]. |
3604 |
||
3605 |
(menuHolder isKindOf:Menu) ifTrue:[^ menuHolder]. |
|
3606 |
||
3607 |
sym := self menuMessage. |
|
3608 |
sym isNil ifTrue:[^ nil]. |
|
3609 |
||
3610 |
" |
|
3611 |
mhmh - for backward compatibility, try to ask |
|
3612 |
the model first, then use the views menu. |
|
3613 |
" |
|
3614 |
(menuHolder respondsTo:sym) ifFalse:[ |
|
5292 | 3615 |
(self respondsTo:sym) ifTrue:[ |
3616 |
menuHolder := self |
|
3617 |
] |
|
3618 |
]. |
|
3619 |
||
3620 |
sym numArgs > 0 ifTrue:[ |
|
3621 |
"/ squeak compatibility (with args): create the empty menu here, let model add items |
|
3622 |
^ menuHolder perform:sym withOptionalArgument:(Menu new) and:(device shiftDown). |
|
3894 | 3623 |
]. |
3624 |
||
3821 | 3625 |
" |
3626 |
ask the menuHolder for the menu |
|
3627 |
" |
|
3628 |
^ menuHolder perform:sym. |
|
135 | 3629 |
! ! |
3630 |
||
3631 |
!SimpleView methodsFor:'accessing-misc'! |
|
3632 |
||
3633 |
bitGravity |
|
3634 |
"return the bitGravity - thats the direction where the contents will move |
|
3635 |
when the the view is resized." |
|
3636 |
||
3637 |
^ bitGravity |
|
3638 |
! |
|
3639 |
||
3640 |
bitGravity:gravity |
|
3641 |
"set the bitGravity - thats the direction where the contents will move |
|
3642 |
when the view is resized." |
|
3643 |
||
3644 |
bitGravity ~~ gravity ifTrue:[ |
|
3152 | 3645 |
bitGravity := gravity. |
3646 |
drawableId notNil ifTrue:[ |
|
3647 |
device setBitGravity:gravity in:drawableId |
|
3648 |
] |
|
135 | 3649 |
] |
3650 |
! |
|
3651 |
||
737 | 3652 |
clippingRectangle:aRectangle |
153 | 3653 |
"set the clipping rectangle for drawing (in logical coordinates); |
754 | 3654 |
a nil argument turns off clipping (i.e. whole view is drawable). |
153 | 3655 |
Redefined to care for any margin." |
3656 |
||
3657 |
|x y w h| |
|
3658 |
||
3659 |
aRectangle isNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3660 |
clipRect isNil ifTrue:[^ self]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3661 |
gcId notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3662 |
device noClipIn:drawableId gc:gcId |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3663 |
] |
153 | 3664 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3665 |
clipRect notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3666 |
(clipRect = aRectangle) ifTrue:[^ self] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3667 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3668 |
gcId notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3669 |
x := aRectangle left. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3670 |
y := aRectangle top. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3671 |
w := aRectangle width. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3672 |
h := aRectangle height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3673 |
transformation notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3674 |
x := transformation applyToX:x. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3675 |
y := transformation applyToY:y. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3676 |
w := transformation applyScaleX:w. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3677 |
h := transformation applyScaleY:h. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3678 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3679 |
(x isMemberOf:SmallInteger) ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3680 |
w := w + (x - x truncated). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3681 |
x := x truncated |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3682 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3683 |
(y isMemberOf:SmallInteger) ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3684 |
h := h + (y - y truncated). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3685 |
y := y truncated |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3686 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3687 |
(w isMemberOf:SmallInteger) ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3688 |
w := w truncated + 1 |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3689 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3690 |
(h isMemberOf:SmallInteger) ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3691 |
h := h truncated + 1 |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3692 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3693 |
x < margin ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3694 |
x := margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3695 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3696 |
y < margin ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3697 |
y := margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3698 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3699 |
x + w - 1 >= (width-margin) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3700 |
w := width - margin - x |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3701 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3702 |
y + h - 1 >= (height-margin) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3703 |
h := height - margin - y |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3704 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3705 |
w := w max:0. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3706 |
h := h max:0. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3707 |
device setClipX:x y:y width:w height:h in:drawableId gc:gcId |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3708 |
] |
153 | 3709 |
]. |
3710 |
clipRect := aRectangle |
|
737 | 3711 |
|
3712 |
"Created: 28.5.1996 / 19:50:03 / cg" |
|
754 | 3713 |
"Modified: 28.5.1996 / 22:32:15 / cg" |
153 | 3714 |
! |
3715 |
||
3716 |
fullName |
|
3717 |
"return my full name to be used for resource-access" |
|
3718 |
||
3719 |
superView notNil ifTrue:[ |
|
5290 | 3720 |
^ superView fullName , '.' , self name |
3721 |
]. |
|
3722 |
^ self name |
|
153 | 3723 |
! |
3724 |
||
269 | 3725 |
name |
3726 |
"return my name component to be used for resource-access" |
|
3727 |
||
5290 | 3728 |
name isNil ifTrue:[ |
3729 |
name := self class name "asString" asLowercaseFirst |
|
3730 |
]. |
|
269 | 3731 |
^ name |
3732 |
! |
|
3733 |
||
3734 |
name:aString |
|
3735 |
"set my name component to be used for resource-access" |
|
3736 |
||
3737 |
name := aString |
|
3738 |
! |
|
3739 |
||
153 | 3740 |
processName |
3741 |
"return a string to be shown in the process monitor" |
|
3742 |
||
3743 |
^ self name |
|
269 | 3744 |
! |
3745 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3746 |
styleSheet |
269 | 3747 |
"return the styleSheet. This is set at early view-creation time, |
3748 |
from the defaultStyleSheet which is valid at that time. |
|
3749 |
It is not affected by later defaultStyle changes" |
|
3750 |
||
3751 |
^ styleSheet |
|
3752 |
||
3753 |
"Created: 10.9.1995 / 11:02:20 / claus" |
|
3754 |
! |
|
3755 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3756 |
styleSheet:aStyleSheet |
3384 | 3757 |
"change the styleSheet. Knowledgable users only, please." |
3758 |
||
3759 |
styleSheet := aStyleSheet. |
|
3760 |
! |
|
3761 |
||
4990 | 3762 |
uuid |
5017 | 3763 |
"return my uuid (for the pollonium st/x capture/replay tool)" |
3764 |
||
3765 |
^ uuid |
|
4990 | 3766 |
! |
3767 |
||
3768 |
uuid:aUUID |
|
5017 | 3769 |
"set my uuid (for the pollonium st/x capture/replay tool)" |
3770 |
||
3771 |
uuid := aUUID |
|
4990 | 3772 |
! |
3773 |
||
269 | 3774 |
viewGravity |
3775 |
"return the viewGravity - thats the direction where the view will move |
|
3776 |
when the superView is resized." |
|
3777 |
||
3778 |
^ viewGravity |
|
3779 |
! |
|
3780 |
||
3781 |
viewGravity:gravity |
|
3782 |
"set the viewGravity - thats the direction where the view will move |
|
3783 |
when the superView is resized." |
|
3784 |
||
3785 |
viewGravity ~~ gravity ifTrue:[ |
|
3152 | 3786 |
viewGravity := gravity. |
3787 |
drawableId notNil ifTrue:[ |
|
3788 |
device setWindowGravity:gravity in:drawableId |
|
3789 |
] |
|
269 | 3790 |
] |
140 | 3791 |
! ! |
3792 |
||
3793 |
!SimpleView methodsFor:'accessing-mvc'! |
|
3794 |
||
1187
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3795 |
application |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3796 |
"return the application, under which this view was opened, |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3797 |
or nil, if there is no application" |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3798 |
|
1751 | 3799 |
superView notNil ifTrue:[ |
3152 | 3800 |
^ superView application |
1187
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3801 |
]. |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3802 |
^ nil |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3803 |
|
1190 | 3804 |
"Modified: 13.1.1997 / 20:30:31 / cg" |
1187
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3805 |
! |
c41d3a2591fd
added #application - in case a non-topView is opened as topView,
Claus Gittinger <cg@exept.de>
parents:
1182
diff
changeset
|
3806 |
|
269 | 3807 |
aspect:aspectSymbol |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3808 |
"ST-80 style updating: If a views aspectSymbol is nonNil, |
269 | 3809 |
it will respond to changes of this aspect from the model. |
3810 |
Alias for aspectMessage: for ST-80 compatibility." |
|
3811 |
||
3812 |
self aspectMessage:aspectSymbol |
|
3813 |
! |
|
3814 |
||
140 | 3815 |
controller |
1943 | 3816 |
"return the controller. For views which implement the controller |
3817 |
functionality themself, return the receiver itself" |
|
3818 |
||
3819 |
^ controller ? self |
|
3820 |
||
3821 |
"Modified: / 31.10.1997 / 19:58:10 / cg" |
|
140 | 3822 |
! |
3823 |
||
3824 |
controller:aController |
|
1943 | 3825 |
"set the controller - thats the one handling user events" |
140 | 3826 |
|
3827 |
controller := aController. |
|
3828 |
controller notNil ifTrue:[ |
|
3152 | 3829 |
controller view:self. |
135 | 3830 |
] |
1943 | 3831 |
|
3832 |
"Modified: / 31.10.1997 / 19:58:33 / cg" |
|
135 | 3833 |
! |
3834 |
||
140 | 3835 |
model |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3836 |
"return nil - simpleViews have no model (only providing geometric)" |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3837 |
|
135 | 3838 |
^ nil |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3839 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
3840 |
"Modified: 5.6.1996 / 14:17:29 / cg" |
135 | 3841 |
! |
3842 |
||
1182 | 3843 |
sensor |
3844 |
"return the views sensor" |
|
3845 |
||
3846 |
windowGroup notNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3847 |
^ windowGroup sensor. |
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
3848 |
]. |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
3849 |
|
4209 | 3850 |
"there is no window group. Deliver events synchronously" |
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
3851 |
|
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
3852 |
^ SynchronousWindowSensor new. |
1182 | 3853 |
|
3854 |
"Modified: 10.1.1997 / 19:47:13 / cg" |
|
3855 |
! |
|
3856 |
||
954 | 3857 |
setController:aController |
3858 |
"set the controller but do not affect the model/view releationship" |
|
3859 |
||
3860 |
controller := aController. |
|
3861 |
||
3862 |
"Created: 18.7.1996 / 11:43:40 / cg" |
|
3863 |
! |
|
3864 |
||
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3865 |
setWindowGroup:aGroup |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3866 |
"set the window group." |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3867 |
|
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3868 |
windowGroup := aGroup |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3869 |
|
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3870 |
"Created: 19.8.1997 / 17:58:35 / cg" |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3871 |
! |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3872 |
|
269 | 3873 |
windowGroup |
3874 |
"return the window group. For old style views, return nil" |
|
3875 |
||
3876 |
^ windowGroup |
|
3877 |
! |
|
3878 |
||
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3879 |
windowGroup:newGroup |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3880 |
"set the window group of myself and recursively of any children. |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3881 |
If I am currently in a group, remove me from it it." |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3882 |
|
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3883 |
windowGroup notNil ifTrue:[ |
3152 | 3884 |
windowGroup removeView:self. |
3885 |
windowGroup := nil |
|
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3886 |
]. |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3887 |
windowGroup := newGroup. |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3888 |
newGroup notNil ifTrue:[ |
3152 | 3889 |
newGroup addView:self. |
1877 | 3890 |
|
3891 |
]. |
|
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3892 |
subViews notNil ifTrue:[ |
3152 | 3893 |
subViews do:[:aSubview | |
3894 |
aSubview windowGroup:newGroup |
|
3895 |
] |
|
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3896 |
]. |
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
3897 |
|
1877 | 3898 |
"Modified: 20.8.1997 / 13:26:37 / cg" |
269 | 3899 |
! ! |
3900 |
||
3901 |
!SimpleView methodsFor:'accessing-transformation'! |
|
3902 |
||
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3903 |
maxComponentBottom |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3904 |
"return the maximum of all components bottom" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3905 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3906 |
components isNil ifTrue:[^ 0]. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3907 |
^ components inject:0 into:[:maxSoFar :sub |
3152 | 3908 |
| (sub bottom) max:maxSoFar]. |
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3909 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3910 |
"Created: 26.5.1996 / 12:44:05 / cg" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3911 |
"Modified: 26.5.1996 / 12:56:39 / cg" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3912 |
! |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3913 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3914 |
maxComponentRight |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3915 |
"return the maximum of all components rights" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3916 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3917 |
components isNil ifTrue:[^ 0]. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3918 |
^ components inject:0 into:[:maxSoFar :sub |
3152 | 3919 |
| (sub right) max:maxSoFar]. |
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3920 |
|
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3921 |
"Modified: 26.5.1996 / 12:56:39 / cg" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3922 |
"Created: 26.5.1996 / 13:02:19 / cg" |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3923 |
! |
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
3924 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3925 |
maxSubViewBottom |
269 | 3926 |
"/ subViews isNil ifTrue:[^ 0]. |
3927 |
"/ ^ subViews inject:0 into:[:maxSoFar :sub | (sub top + sub height) max:maxSoFar]. |
|
3928 |
^ 0 |
|
3929 |
! |
|
3930 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3931 |
maxSubViewRight |
269 | 3932 |
"/ subViews isNil ifTrue:[^ 0]. |
3933 |
"/ ^ subViews inject:0 into:[:maxSoFar :sub | (sub left + sub width) max:maxSoFar]. |
|
3934 |
^ 0 |
|
3935 |
! |
|
3936 |
||
3937 |
scale:aPoint |
|
3938 |
"set the scale factor of the transformation" |
|
3939 |
||
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
3940 |
super scale:aPoint. |
269 | 3941 |
self computeInnerClip |
3942 |
! |
|
3943 |
||
3944 |
setViewOrigin:aPoint |
|
3945 |
"set the viewOrigin - i.e. virtually scroll without redrawing" |
|
3946 |
||
3947 |
|p| |
|
3948 |
||
3949 |
p := aPoint negated. |
|
3950 |
transformation isNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3951 |
transformation := WindowingTransformation scale:1 translation:p |
269 | 3952 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3953 |
transformation translation:p |
269 | 3954 |
]. |
3955 |
clipRect notNil ifTrue:[ |
|
3152 | 3956 |
self setInnerClip. |
269 | 3957 |
]. |
3958 |
! |
|
3959 |
||
3960 |
viewOrigin |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3961 |
"return the viewOrigin; thats the coordinate of the contents |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3962 |
which is shown topLeft in the view |
269 | 3963 |
(i.e. the origin of the visible part of the contents)." |
3964 |
||
3965 |
transformation isNil ifTrue:[ |
|
3152 | 3966 |
^ 0@0 |
269 | 3967 |
]. |
3968 |
^ transformation translation negated |
|
3969 |
! |
|
3970 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3971 |
visibleArea |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3972 |
"return the rectangle that contains the visible part |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3973 |
of the view in user coordinates." |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3974 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3975 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3976 |
transformation isNil ifTrue:[ |
3152 | 3977 |
^ Rectangle left:0 top:0 width:width height:height. |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3978 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3979 |
^ Rectangle origin:(transformation translation negated) |
3152 | 3980 |
extent:((width @ height) scaledBy:(transformation scale)). |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3981 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3982 |
"Created: 12.7.1996 / 11:57:04 / stefan" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3983 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
3984 |
|
269 | 3985 |
xOriginOfContents |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3986 |
"return the x coordinate of the viewOrigin in pixels; |
269 | 3987 |
used by scrollBars to compute thumb position within the document." |
3988 |
||
3989 |
^ self viewOrigin x |
|
3990 |
! |
|
3991 |
||
3992 |
yOriginOfContents |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
3993 |
"return the y coordinate of the viewOrigin in pixels; |
269 | 3994 |
used by scrollBars to compute thumb position within the document." |
3995 |
||
3996 |
^ self viewOrigin y |
|
3997 |
! ! |
|
3998 |
||
370 | 3999 |
!SimpleView methodsFor:'accessing-visibility'! |
4000 |
||
4001 |
beInvisible |
|
1524 | 4002 |
"make the view invisible; if my container is visible, |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4003 |
change visibility immediately; |
1524 | 4004 |
otherwise, arrange for the receiver to be not realized, |
4005 |
when the container is made visible." |
|
4006 |
||
370 | 4007 |
self hiddenOnRealize:true. |
4008 |
realized ifTrue:[ |
|
3367 | 4009 |
(superView isNil "/ I am a topView |
4010 |
or:[superView realized "/ superview already shown |
|
4011 |
or:[superView id notNil]]) "/ superview already created |
|
4012 |
ifTrue:[ |
|
4013 |
self unmap |
|
4014 |
] |
|
370 | 4015 |
] |
4016 |
||
1524 | 4017 |
"Modified: 3.4.1997 / 21:20:40 / cg" |
370 | 4018 |
! |
4019 |
||
4020 |
beVisible |
|
1524 | 4021 |
"make the view visible; if my container is already visible, |
4022 |
change visibility immediately; otherwise, arrange for the receiver |
|
4023 |
to be made visible when the container is made visible. |
|
4024 |
Notice, that the command may not be sent immediately to the display, |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4025 |
and that ST/X considers the view to be still invisible until a |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4026 |
visibility event arrives from the display. |
1754 | 4027 |
Thus, the view may remain logically invisible |
1524 | 4028 |
for a while. (see #beVisibleNow for more on this)" |
4029 |
||
370 | 4030 |
self hiddenOnRealize:false. |
4031 |
realized ifFalse:[ |
|
3762 | 4032 |
superView isNil ifTrue:[ "/ I am a topView |
4033 |
drawableId isNil ifTrue:[ |
|
4034 |
"this once was: |
|
4035 |
self realize. |
|
4036 |
but we don't want Topviews to realize implicitly. |
|
4037 |
BTW. the code doesn't work anyway" |
|
4038 |
] ifFalse:[ |
|
4039 |
self remap. |
|
4040 |
]. |
|
4041 |
] ifFalse:[ |
|
4042 |
(superView realized "/ superview already shown |
|
4043 |
or:[superView id notNil]) "/ superview already created |
|
4044 |
ifTrue:[ |
|
4045 |
self realize |
|
4046 |
] |
|
4047 |
]. |
|
370 | 4048 |
] |
4049 |
||
4050 |
" |
|
4051 |
|top topFrame check list| |
|
4052 |
||
4053 |
top := StandardSystemView new. |
|
4054 |
top extent:150@400. |
|
4055 |
topFrame := VerticalPanelView origin:0.0@0.0 corner:1.0@0.4 in:top. |
|
4056 |
topFrame horizontalLayout:#leftSpace. |
|
4057 |
||
4058 |
topFrame add:(check := CheckBox label:'hidden'). |
|
4059 |
check pressAction:[list beInvisible]. |
|
4060 |
check releaseAction:[list beVisible]. |
|
4061 |
||
4062 |
list := ScrollableView for:SelectionInListView. |
|
4063 |
list origin:0.0@0.4 corner:1.0@1.0. |
|
4064 |
list list:#('foo' 'bar' 'baz'). |
|
4065 |
top add:list. |
|
4066 |
||
4067 |
check turnOn. |
|
4068 |
list beInvisible. |
|
4069 |
||
4070 |
top open |
|
4071 |
" |
|
4072 |
||
1981
0c3b8ef42df8
Take care of views with nil visibleID in #beVisible
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
4073 |
"Created: / 22.9.1995 / 15:50:33 / claus" |
0c3b8ef42df8
Take care of views with nil visibleID in #beVisible
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
4074 |
"Modified: / 17.6.1997 / 11:23:00 / cg" |
0c3b8ef42df8
Take care of views with nil visibleID in #beVisible
Stefan Vogel <sv@exept.de>
parents:
1960
diff
changeset
|
4075 |
"Modified: / 14.1.1998 / 17:33:15 / stefan" |
1524 | 4076 |
! |
4077 |
||
4078 |
beVisibleNow |
|
4079 |
"make the view visible immediately. |
|
4080 |
In contrast to #beVisible, this waits until the view is really |
|
4081 |
visible." |
|
4082 |
||
4083 |
self beVisible. |
|
3648 | 4084 |
device sync. "thats a round-trip; when returning, the view is definitely visible" |
4085 |
||
2721 | 4086 |
"/ realized := true. |
4087 |
"/ shown := true. |
|
1524 | 4088 |
|
4089 |
"Created: 3.4.1997 / 21:23:28 / cg" |
|
370 | 4090 |
! |
4091 |
||
4092 |
hidden |
|
4093 |
"return true, if the view does not want to be realized |
|
4094 |
automatically when superview is realized" |
|
4095 |
||
3434 | 4096 |
<resource:#obsolete> |
4097 |
||
370 | 4098 |
self obsoleteMethodWarning:'use #isHiddenOnRealize'. |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4099 |
^ self isHiddenOnRealize |
370 | 4100 |
|
1754 | 4101 |
"Modified: 17.6.1997 / 11:19:55 / cg" |
370 | 4102 |
! |
4103 |
||
4104 |
hidden:aBoolean |
|
4105 |
"if the argument is true, the receiver view will not |
|
4106 |
be realized automatically when superview is realized" |
|
4107 |
||
3434 | 4108 |
<resource:#obsolete> |
4109 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4110 |
self obsoleteMethodWarning:'use #hiddenOnRealize:'. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4111 |
self hiddenOnRealize:aBoolean |
370 | 4112 |
|
4113 |
"Modified: 17.1.1996 / 11:45:06 / cg" |
|
4114 |
! |
|
4115 |
||
4116 |
hiddenOnRealize:aBoolean |
|
4117 |
"if the argument is true, the receiver view will not |
|
1754 | 4118 |
be mapped (i.e. shown) automatically when the superview is realized. |
370 | 4119 |
The hiddenOnRealize flag is useful to create views which are |
1524 | 4120 |
to be made visible conditionally or later. |
4121 |
For ST-80 compatibility, please use #beVisible / #beInvisible." |
|
370 | 4122 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4123 |
"/ hiddenOnRealize := aBoolean |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4124 |
aBoolean ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
4125 |
flagBits := flagBits bitOr:FlagHiddenOnRealize |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4126 |
] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
4127 |
flagBits := flagBits bitClear:FlagHiddenOnRealize |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4128 |
]. |
1524 | 4129 |
|
1754 | 4130 |
"Modified: 17.6.1997 / 11:23:26 / cg" |
4131 |
! |
|
4132 |
||
4133 |
isHiddenOnRealize |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
4134 |
"return true, if the receiver will NOT be mapped when realized. |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4135 |
False otherwise. |
370 | 4136 |
The hiddenOnRealize flag is useful to create views which are |
4137 |
to be made visible conditionally or later." |
|
4138 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4139 |
"/ ^ hiddenOnRealize |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
4140 |
^ flagBits bitTest:FlagHiddenOnRealize. |
1754 | 4141 |
|
4142 |
"Created: 17.6.1997 / 11:21:42 / cg" |
|
370 | 4143 |
! |
4144 |
||
3516 | 4145 |
isVisible |
4146 |
"return true, if the view is visible" |
|
4147 |
||
4148 |
^ self realized |
|
4149 |
! |
|
4150 |
||
1938
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4151 |
isVisible:aBoolean |
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4152 |
"make the view visible or invisible" |
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4153 |
|
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4154 |
aBoolean ifTrue:[ |
3152 | 4155 |
self beVisible |
1938
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4156 |
] ifFalse:[ |
3152 | 4157 |
self beInvisible |
1938
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4158 |
] |
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4159 |
|
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4160 |
"Created: / 27.10.1997 / 04:23:04 / cg" |
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4161 |
! |
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4162 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4163 |
setVisibilityChannel:aValueHolder |
3139 | 4164 |
"set the valueHolder, which holds the visible boolean value" |
4165 |
||
3367 | 4166 |
visibilityChannel := aValueHolder |
3139 | 4167 |
! |
4168 |
||
370 | 4169 |
shown |
4170 |
"return true if the view is shown; false if not. |
|
4171 |
Shown means: the view is mapped and is not completely covered." |
|
4172 |
||
4173 |
^ shown |
|
3366 | 4174 |
! |
4175 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4176 |
visibilityChannel |
3367 | 4177 |
"return a valueHolder for visible/invisible" |
4178 |
||
4179 |
^ visibilityChannel |
|
4180 |
||
4181 |
"Modified: / 30.3.1999 / 13:49:56 / stefan" |
|
3366 | 4182 |
! |
4183 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4184 |
visibilityChannel:aValueHolder |
3367 | 4185 |
"set the valueHolder, which holds the visible boolean value" |
4186 |
||
3366 | 4187 |
|
4188 |
|prev| |
|
4189 |
||
3367 | 4190 |
prev := visibilityChannel. |
4191 |
visibilityChannel := aValueHolder. |
|
3366 | 4192 |
self setupChannel:aValueHolder for:#visibilityStateChanged withOld:prev |
4193 |
||
3367 | 4194 |
" |
4195 |
|v h| |
|
4196 |
||
4197 |
v := View new. |
|
4198 |
v visibilityChannel:(h := ValueHolder with:true). |
|
4199 |
v open. |
|
4200 |
Delay waitForSeconds:2. |
|
4201 |
h value:false. |
|
4202 |
Delay waitForSeconds:2. |
|
4203 |
h value:true. |
|
4204 |
Delay waitForSeconds:2. |
|
4205 |
" |
|
4206 |
||
4207 |
"Created: / 14.1.1998 / 17:11:15 / stefan" |
|
4208 |
"Modified: / 14.1.1998 / 17:33:40 / stefan" |
|
370 | 4209 |
! ! |
4210 |
||
269 | 4211 |
!SimpleView methodsFor:'adding & removing components'! |
4212 |
||
4213 |
add:aComponent |
|
4214 |
"add a component (either a view or gadget) to the collection of |
|
4215 |
subComponents." |
|
4216 |
||
4217 |
self addComponent:aComponent |
|
4218 |
! |
|
4219 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4220 |
add:aComponent at:anOrigin |
1335 | 4221 |
"for ST-80 compatibility. |
4222 |
add a component at some origin" |
|
4223 |
||
4224 |
|l comp| |
|
4225 |
||
1614 | 4226 |
comp := aComponent. |
4227 |
||
4228 |
"/ (comp isWrapper not |
|
4229 |
"/ or:[comp isLayoutWrapper not]) ifTrue:[ |
|
4230 |
"/ comp := LayoutWrapper on:comp |
|
4231 |
"/ ]. |
|
1335 | 4232 |
|
4233 |
l := anOrigin asLayout. |
|
4234 |
comp layout:l. |
|
4235 |
||
4236 |
self addComponent:comp |
|
4237 |
||
1614 | 4238 |
"Modified: 18.4.1997 / 20:00:20 / cg" |
1335 | 4239 |
! |
4240 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4241 |
add:aComponentOrCollection in:aRectangleOrLayoutFrame |
269 | 4242 |
"for ST-80 compatibility. |
4243 |
add a component in some frame; the argument may be either a rectangle |
|
4244 |
with relative coordinates, or an instance of LayoutFrame, specifying |
|
4245 |
both relative coordinates and the insets." |
|
4246 |
||
1617
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4247 |
|l wrapper| |
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4248 |
|
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4249 |
aComponentOrCollection isCollection ifTrue:[ |
3152 | 4250 |
wrapper := View new. |
4251 |
aComponentOrCollection do:[:aComponent | |
|
4252 |
wrapper add:aComponent |
|
4253 |
] |
|
1617
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4254 |
] ifFalse:[ |
3152 | 4255 |
wrapper := aComponentOrCollection |
1617
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4256 |
]. |
269 | 4257 |
|
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
4258 |
l := aRectangleOrLayoutFrame asLayout. |
269 | 4259 |
|
4260 |
"/ will soon be replaced by: |
|
4261 |
"/ aComponent layout:l. |
|
1617
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4262 |
wrapper geometryLayout:l. |
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4263 |
|
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4264 |
self addComponent:wrapper. |
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4265 |
|
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4266 |
^ wrapper |
7a9eba5beeed
add:in: changed to handle collections
Claus Gittinger <cg@exept.de>
parents:
1615
diff
changeset
|
4267 |
|
1756 | 4268 |
"Modified: 17.6.1997 / 18:03:34 / cg" |
269 | 4269 |
! |
4270 |
||
4271 |
addComponent:aComponent |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4272 |
"components (i.e. gadgets or lightweight views) are being prepared. |
269 | 4273 |
Dont use this right now for non-views" |
4274 |
||
4275 |
aComponent isView ifTrue:[ |
|
3152 | 4276 |
self addSubView:aComponent |
269 | 4277 |
] ifFalse:[ |
3152 | 4278 |
components isNil ifTrue:[ |
4279 |
components := OrderedCollection new |
|
4280 |
]. |
|
4281 |
components add:aComponent. |
|
4282 |
aComponent container:self. |
|
4283 |
shown ifTrue:[ |
|
4284 |
aComponent displayOn:self |
|
4285 |
] |
|
269 | 4286 |
] |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4287 |
|
683
ecc5d13f22b2
redraw new components if already visible
Claus Gittinger <cg@exept.de>
parents:
662
diff
changeset
|
4288 |
"Modified: 13.5.1996 / 21:19:51 / cg" |
269 | 4289 |
! |
4290 |
||
4291 |
addSubView:newView |
|
4292 |
"add a view to the collection of subviews" |
|
4293 |
||
4294 |
subViews isNil ifTrue:[ |
|
3653 | 4295 |
subViews := OrderedCollection with:newView |
269 | 4296 |
] ifFalse:[ |
3653 | 4297 |
(subViews includesIdentical:newView) ifTrue:[ |
4298 |
self error:'trying to add a view twice' mayProceed:true. |
|
4299 |
^ self. |
|
4300 |
]. |
|
4301 |
subViews add:newView. |
|
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4302 |
]. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4303 |
self setContainerIn:newView. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4304 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4305 |
"Modified: 9.5.1996 / 00:47:16 / cg" |
269 | 4306 |
! |
4307 |
||
4308 |
addSubView:newView after:aView |
|
4309 |
"add a view to the collection of subviews after another view. |
|
4310 |
This makes sense, in Panels and other layout views, to enter a new |
|
4311 |
element at some defined place." |
|
4312 |
||
4313 |
subViews isNil ifTrue:[ |
|
3653 | 4314 |
subViews := OrderedCollection with:newView |
269 | 4315 |
] ifFalse:[ |
3653 | 4316 |
(subViews includesIdentical:newView) ifTrue:[ |
4317 |
self error:'trying to add a view twice' mayProceed:true. |
|
4318 |
^ self. |
|
4319 |
]. |
|
4320 |
aView isNil ifTrue:[ |
|
4321 |
subViews add:newView |
|
4322 |
] ifFalse:[ |
|
4323 |
subViews add:newView after:aView. |
|
4324 |
] |
|
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4325 |
]. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4326 |
self setContainerIn:newView. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4327 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4328 |
"Modified: 9.5.1996 / 00:47:20 / cg" |
269 | 4329 |
! |
4330 |
||
4331 |
addSubView:newView before:aView |
|
4332 |
"add a view to the collection of subviews before another view. |
|
4333 |
This makes sense, in Panels and other layout views, to enter a new |
|
4334 |
element at some defined place." |
|
4335 |
||
4336 |
subViews isNil ifTrue:[ |
|
3653 | 4337 |
subViews := OrderedCollection with:newView |
269 | 4338 |
] ifFalse:[ |
3653 | 4339 |
(subViews includesIdentical:newView) ifTrue:[ |
4340 |
self error:'trying to add a view twice' mayProceed:true. |
|
4341 |
^ self. |
|
4342 |
]. |
|
4343 |
aView isNil ifTrue:[ |
|
4344 |
subViews addFirst:newView |
|
4345 |
] ifFalse:[ |
|
4346 |
subViews add:newView before:aView. |
|
4347 |
] |
|
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4348 |
]. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4349 |
self setContainerIn:newView. |
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4350 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4351 |
"Modified: 9.5.1996 / 00:47:23 / cg" |
269 | 4352 |
! |
4353 |
||
4354 |
addSubView:aView in:bounds borderWidth:bw |
|
4355 |
"for ST-80 V2.x compatibility" |
|
4356 |
||
4357 |
aView borderWidth:bw. |
|
4358 |
self add:aView in:bounds. |
|
4359 |
! |
|
4360 |
||
1439 | 4361 |
addSubViewFirst:newView |
4362 |
"add a view to the front of the collection of subviews" |
|
4363 |
||
4364 |
subViews isNil ifTrue:[ |
|
3653 | 4365 |
subViews := OrderedCollection with:newView |
1439 | 4366 |
] ifFalse:[ |
3653 | 4367 |
(subViews includesIdentical:newView) ifTrue:[ |
4368 |
self error:'trying to add a view twice' mayProceed:true. |
|
4369 |
^ self. |
|
4370 |
]. |
|
4371 |
subViews addFirst:newView. |
|
1439 | 4372 |
]. |
4373 |
self setContainerIn:newView. |
|
4374 |
||
4375 |
"Modified: 9.5.1996 / 00:47:16 / cg" |
|
4376 |
"Created: 6.3.1997 / 18:43:38 / cg" |
|
4377 |
! |
|
4378 |
||
269 | 4379 |
component:aComponent |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4380 |
"components (i.e. gadgets or lightweight views) are being prepared. |
269 | 4381 |
Dont use this right now for non-views" |
4382 |
||
4383 |
aComponent origin:0.0@0.0 corner:1.0@1.0. |
|
4384 |
aComponent isView ifTrue:[ |
|
3152 | 4385 |
self addSubView:aComponent |
269 | 4386 |
] ifFalse:[ |
3152 | 4387 |
components := OrderedCollection with:aComponent. |
4388 |
aComponent container:self. |
|
4389 |
||
4390 |
shown ifTrue:[ |
|
4391 |
aComponent displayOn:self |
|
4392 |
] |
|
269 | 4393 |
] |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4394 |
|
683
ecc5d13f22b2
redraw new components if already visible
Claus Gittinger <cg@exept.de>
parents:
662
diff
changeset
|
4395 |
"Modified: 13.5.1996 / 21:20:29 / cg" |
269 | 4396 |
! |
4397 |
||
4398 |
destroySubViews |
|
4399 |
"remove all subviews" |
|
4400 |
||
4401 |
subViews notNil ifTrue:[ |
|
5245
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4402 |
subViews copy do:[:aSubView | |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4403 |
aSubView destroy. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4404 |
]. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4405 |
|
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4406 |
"/ paranoia ;-) |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4407 |
subViews size ~~ 0 ifTrue:[ |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4408 |
(self class name , ' >>View [warning]: some subView(s) did not destroy: ' , subViews printString) infoPrintCR. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4409 |
subViews := nil |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4410 |
]. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4411 |
]. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4412 |
|
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4413 |
components notNil ifTrue:[ |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4414 |
components copy do:[:aComponent | |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4415 |
aComponent destroy. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4416 |
]. |
af593d6e31a9
handle non-view components in destroySubViews
Claus Gittinger <cg@exept.de>
parents:
5229
diff
changeset
|
4417 |
components := nil. |
269 | 4418 |
] |
4419 |
! |
|
4420 |
||
4421 |
removeComponent:aComponent |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4422 |
"components (i.e. gadgets or lightweight views) are being prepared. |
269 | 4423 |
Dont use this right now for non-views" |
4424 |
||
4425 |
aComponent isView ifTrue:[ |
|
4834 | 4426 |
self removeSubView:aComponent |
269 | 4427 |
] ifFalse:[ |
4834 | 4428 |
components isNil ifTrue:[^self]. |
4429 |
components remove:aComponent ifAbsent:[]. |
|
4430 |
aComponent container:nil |
|
269 | 4431 |
] |
4579 | 4432 |
|
4433 |
"Modified: / 11-09-2006 / 17:14:30 / User" |
|
269 | 4434 |
! |
4435 |
||
4436 |
removeSubView:aView |
|
4437 |
"remove a view from the collection of subviews" |
|
4438 |
||
4439 |
subViews notNil ifTrue:[ |
|
3762 | 4440 |
subViews remove:aView ifAbsent:[nil]. |
4441 |
aView setContainer:nil. |
|
4442 |
||
4443 |
(subViews size == 0) ifTrue:[ |
|
4444 |
subViews := nil |
|
4445 |
] |
|
269 | 4446 |
] |
4447 |
! |
|
4448 |
||
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4449 |
setContainerIn:aView |
269 | 4450 |
"common code for addSubView* methods" |
4451 |
||
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4452 |
aView container:self. |
743 | 4453 |
(aView graphicsDevice ~~ device) ifTrue:[ |
3762 | 4454 |
'SimpleView [warning]: subview (' errorPrint. aView class name errorPrint. |
4455 |
') has different device than me (' errorPrint. |
|
4456 |
self class name errorPrint. ').' errorPrintCR. |
|
4457 |
aView device:device |
|
3616 | 4458 |
]. |
660
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4459 |
|
2ae938f29875
renamed #superView: to #container (migration towards ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
659
diff
changeset
|
4460 |
"Created: 9.5.1996 / 00:46:59 / cg" |
1172
a69398754511
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
4461 |
"Modified: 10.1.1997 / 18:06:49 / cg" |
269 | 4462 |
! ! |
4463 |
||
4464 |
!SimpleView methodsFor:'change & update'! |
|
4465 |
||
1437
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4466 |
changedPreferredBounds:someArgument |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4467 |
"tell any dependents, that I have changed my preferred bounds; |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4468 |
Interface is provided mostly provided for ST80 compatibility; |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4469 |
here, translate into ST/X's mechanism for telling others about this." |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4470 |
|
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4471 |
^ self changed:#preferredExtent |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4472 |
|
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4473 |
"Modified: 6.3.1997 / 16:12:02 / cg" |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4474 |
! |
9fb2c38adb79
added #changedPreferredBounds for compatibility
Claus Gittinger <cg@exept.de>
parents:
1432
diff
changeset
|
4475 |
|
4038
538491244f6f
preps for handling language changes
Claus Gittinger <cg@exept.de>
parents:
3968
diff
changeset
|
4476 |
languageChanged |
538491244f6f
preps for handling language changes
Claus Gittinger <cg@exept.de>
parents:
3968
diff
changeset
|
4477 |
! |
538491244f6f
preps for handling language changes
Claus Gittinger <cg@exept.de>
parents:
3968
diff
changeset
|
4478 |
|
269 | 4479 |
update:aspect with:aParameter from:changedObject |
4480 |
"an update request" |
|
4481 |
||
4482 |
aspect == #sizeOfView ifTrue:[ |
|
3762 | 4483 |
"one of the views we depend on changed its size" |
4484 |
^ self containerChangedSize. |
|
3730 | 4485 |
]. |
4486 |
super update:aspect with:aParameter from:changedObject |
|
964 | 4487 |
|
4488 |
"Modified: 19.7.1996 / 17:30:48 / cg" |
|
269 | 4489 |
! ! |
4490 |
||
4491 |
!SimpleView methodsFor:'cursor animation'! |
|
4492 |
||
4493 |
showBusyWhile:aBlock |
|
4494 |
"evaluate some time consuming block, while doing this, |
|
1943 | 4495 |
show a spinning wheel cursor. If those bitmaps are not found, |
4496 |
fallback to the standard busy cursor. |
|
4497 |
Experimental." |
|
269 | 4498 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4499 |
|ok bitmaps cursors maskForm process oldCursor| |
269 | 4500 |
|
4501 |
oldCursor := cursor. |
|
4502 |
||
4503 |
ok := true. |
|
4834 | 4504 |
bitmaps := #('wheel1' 'wheel2' 'wheel3' 'wheel4') |
4505 |
collect:[:name | |
|
4506 |
|f| |
|
4507 |
||
4508 |
f := Smalltalk imageFromFileNamed:(name , '.xbm') forClass:self class. |
|
4509 |
f isNil ifTrue:[ |
|
4510 |
('SimpleView [warning]: no bitmap file: ' , name , '.xbm') errorPrintCR. |
|
4511 |
ok := false |
|
4512 |
]. |
|
4513 |
f |
|
4514 |
]. |
|
1141 | 4515 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4516 |
ok ifTrue:[ |
4834 | 4517 |
maskForm := Smalltalk imageFromFileNamed:'wheelm.xbm' forClass:self class. |
4518 |
maskForm isNil ifTrue:[ |
|
4519 |
('SimpleView [warning]: no bitmap file: wheelm.xbm') errorPrintCR. |
|
4520 |
ok := false |
|
4521 |
]. |
|
269 | 4522 |
]. |
4523 |
||
4524 |
ok ifFalse:[ |
|
4834 | 4525 |
self cursor:Cursor wait. |
4526 |
aBlock ensure:[ |
|
4527 |
self cursor:oldCursor |
|
4528 |
] |
|
269 | 4529 |
] ifTrue:[ |
4834 | 4530 |
cursors := bitmaps collect:[:form | (Cursor sourceForm:form |
4531 |
maskForm:maskForm |
|
4532 |
hotX:8 |
|
4533 |
hotY:8) onDevice:device]. |
|
4534 |
||
4535 |
process := [ |
|
4536 |
Delay waitForSeconds:0.25. |
|
4537 |
[true] whileTrue:[ |
|
4538 |
cursors do:[:curs | |
|
4539 |
self cursor:curs. |
|
4540 |
Delay waitForSeconds:0.05 |
|
4541 |
] |
|
4542 |
] |
|
4543 |
] forkAt:(Processor activeProcess priority + 1). |
|
4544 |
||
4545 |
aBlock ensure:[ |
|
4546 |
process terminate. |
|
4547 |
self cursor:oldCursor |
|
4548 |
] |
|
269 | 4549 |
]. |
4550 |
||
4551 |
" |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4552 |
View new realize showBusyWhile:[ Delay waitForSeconds:5 ] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4553 |
Transcript showBusyWhile:[ Delay waitForSeconds:5 ] |
269 | 4554 |
" |
1141 | 4555 |
|
1943 | 4556 |
"Modified: / 31.10.1997 / 19:59:49 / cg" |
269 | 4557 |
! ! |
4558 |
||
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4559 |
!SimpleView methodsFor:'dependents access'! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4560 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4561 |
addDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4562 |
"make the argument, anObject be a dependent of the receiver" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4563 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4564 |
|wasBlocked| |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4565 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4566 |
wasBlocked := OperatingSystem blockInterrupts. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4567 |
[ |
3762 | 4568 |
|deps| |
4569 |
||
4570 |
deps := dependents. |
|
4571 |
"/ |
|
4572 |
"/ store the very first dependent directly in |
|
4573 |
"/ the dependents instVar |
|
4574 |
"/ |
|
4575 |
(deps isNil and:[anObject isCollection not]) ifTrue:[ |
|
4576 |
dependents := anObject |
|
4577 |
] ifFalse:[ |
|
4578 |
"/ |
|
4579 |
"/ store more dependents in the dependents collection |
|
4580 |
"/ |
|
4581 |
deps isCollection ifTrue:[ |
|
4582 |
deps add:anObject |
|
4583 |
] ifFalse:[ |
|
4584 |
deps == anObject ifFalse:[ |
|
4585 |
deps isNil ifTrue:[ |
|
4586 |
dependents := (IdentitySet with:anObject) |
|
4587 |
] ifFalse:[ |
|
4588 |
dependents := (IdentitySet with:deps with:anObject) |
|
4589 |
] |
|
4590 |
] |
|
4591 |
] |
|
4592 |
] |
|
3604
e32b5044a59e
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3601
diff
changeset
|
4593 |
] ensure:[ |
3762 | 4594 |
wasBlocked ifFalse:[ |
4595 |
OperatingSystem unblockInterrupts |
|
4596 |
] |
|
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4597 |
] |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4598 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4599 |
"Modified: 8.1.1997 / 23:40:30 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4600 |
"Created: 11.6.1997 / 13:10:40 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4601 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4602 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4603 |
dependents |
2015 | 4604 |
"return a Collection of dependents" |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4605 |
|
1938
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4606 |
dependents isNil ifTrue:[^ #()]. |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4607 |
dependents isCollection ifTrue:[ |
3152 | 4608 |
^ dependents |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4609 |
]. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4610 |
^ IdentitySet with:dependents |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4611 |
|
1938
8c7584b4d61f
empty dependents are returned as an empty collection.
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
4612 |
"Created: / 11.6.1997 / 13:10:44 / cg" |
2015 | 4613 |
"Modified: / 26.1.1998 / 11:18:36 / cg" |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4614 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4615 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4616 |
dependents:aCollection |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4617 |
"set the collection of dependents" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4618 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4619 |
|dep| |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4620 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4621 |
aCollection size == 1 ifTrue:[ |
3152 | 4622 |
dep := aCollection first. |
4623 |
dep isCollection ifFalse:[ |
|
4624 |
dependents := aCollection first. |
|
4625 |
^ self |
|
4626 |
] |
|
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4627 |
]. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4628 |
dependents := aCollection |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4629 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4630 |
"Modified: 19.4.1996 / 12:23:05 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4631 |
"Created: 11.6.1997 / 13:10:47 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4632 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4633 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4634 |
dependentsDo:aBlock |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4635 |
"evaluate aBlock for all of my dependents" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4636 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4637 |
|deps| |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4638 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4639 |
deps := dependents. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4640 |
deps notNil ifTrue:[ |
3152 | 4641 |
deps isCollection ifTrue:[ |
4642 |
deps do:aBlock |
|
4643 |
] ifFalse:[ |
|
4644 |
aBlock value:deps |
|
4645 |
] |
|
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4646 |
] |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4647 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4648 |
"Created: 11.6.1997 / 13:10:51 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4649 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4650 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4651 |
removeDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4652 |
"make the argument, anObject be independent of the receiver" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4653 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4654 |
|wasBlocked| |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4655 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4656 |
"/ must do this save from interrupts, since the dependents collection |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4657 |
"/ is possibly accessed from multiple threads. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4658 |
"/ Used to use #valueUninterruptably here; inlined that code for slightly |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4659 |
"/ faster execution. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4660 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4661 |
wasBlocked := OperatingSystem blockInterrupts. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4662 |
[ |
3762 | 4663 |
|deps sz dep| |
4664 |
||
4665 |
deps := dependents. |
|
4666 |
deps notNil ifTrue:[ |
|
4667 |
deps isCollection ifTrue:[ |
|
4668 |
deps remove:anObject ifAbsent:[]. |
|
4669 |
(sz := deps size) == 0 ifTrue:[ |
|
4670 |
dependents := nil |
|
4671 |
] ifFalse:[ |
|
4672 |
sz == 1 ifTrue:[ |
|
4673 |
(dep := deps first) isCollection ifFalse:[ |
|
4674 |
dependents := dep |
|
4675 |
] |
|
4676 |
] |
|
4677 |
] |
|
4678 |
] ifFalse:[ |
|
4679 |
deps == anObject ifTrue:[ |
|
4680 |
dependents := nil |
|
4681 |
] |
|
4682 |
] |
|
4683 |
] |
|
3604
e32b5044a59e
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
3601
diff
changeset
|
4684 |
] ensure:[ |
3762 | 4685 |
wasBlocked ifFalse:[ |
4686 |
OperatingSystem unblockInterrupts |
|
4687 |
] |
|
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4688 |
] |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4689 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4690 |
"Modified: 8.1.1997 / 23:41:39 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4691 |
"Created: 11.6.1997 / 13:11:58 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4692 |
! ! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4693 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4694 |
!SimpleView methodsFor:'dependents access (non weak)'! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4695 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4696 |
addNonWeakDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4697 |
"make the argument, anObject be a dependent of the receiver. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4698 |
Since all dependencies are nonWeak in Model, this is simply |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4699 |
forwarded to addDependent:" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4700 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4701 |
^ self addDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4702 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4703 |
"Created: 11.6.1997 / 13:15:40 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4704 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4705 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4706 |
interests |
2037
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4707 |
"return a Collection of interests - empty if there is none. |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4708 |
Here, we use the normal dependents collection for interests." |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4709 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4710 |
^ self dependents |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4711 |
|
2037
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4712 |
"Modified: / 14.10.1996 / 22:19:58 / stefan" |
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4713 |
"Created: / 11.6.1997 / 13:15:44 / cg" |
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4714 |
"Modified: / 30.1.1998 / 14:07:48 / cg" |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4715 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4716 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4717 |
nonWeakDependents |
2037
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4718 |
"return a Collection of dependents - empty if there is none. |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4719 |
Since all dependencies are nonWeak in Model, this is a dummy." |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4720 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4721 |
^ self dependents |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4722 |
|
2037
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4723 |
"Created: / 11.6.1997 / 13:15:48 / cg" |
25c7b949b117
#interests & #weakDependents always return a collection
Claus Gittinger <cg@exept.de>
parents:
2015
diff
changeset
|
4724 |
"Modified: / 30.1.1998 / 14:06:55 / cg" |
1747
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4725 |
! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4726 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4727 |
removeNonWeakDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4728 |
"make the argument, anObject be independent of the receiver. |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4729 |
Since all dependencies are nonWeak in Model, this is simply |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4730 |
forwarded to removeDependent:" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4731 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4732 |
^ self removeDependent:anObject |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4733 |
|
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4734 |
"Created: 11.6.1997 / 13:15:52 / cg" |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4735 |
! ! |
355fdbae0104
keep dependents locally - for faster access.
Claus Gittinger <cg@exept.de>
parents:
1743
diff
changeset
|
4736 |
|
1308 | 4737 |
!SimpleView methodsFor:'drag & drop'! |
4738 |
||
4649 | 4739 |
canDrop:aDropContext |
4740 |
"return true, if we can drop using a dropContexts information (the new drop interface). |
|
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4741 |
This method should be redefined in views which can take objects" |
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4742 |
|
1308 | 4743 |
^ false |
1581
45908e82a49d
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1559
diff
changeset
|
4744 |
|
4649 | 4745 |
"Modified: / 13-10-2006 / 16:05:23 / cg" |
4746 |
! |
|
4747 |
||
4748 |
canDrop:aDropContext at:positionInView |
|
4749 |
"return true, if we can drop using a dropContexts information (the new drop interface). |
|
4750 |
This method should be redefined in views which can take objects" |
|
4751 |
||
4752 |
^ self canDrop:aDropContext |
|
4753 |
||
4754 |
"Modified: / 13-10-2006 / 16:05:42 / cg" |
|
4755 |
! |
|
4756 |
||
4757 |
canDropObjects:aCollectionOfDropObjects |
|
4758 |
"return true, if we can drop aCollectionOfDropObjects (the OLD drop interface). |
|
4759 |
This method should be redefined in views which can take objects" |
|
4760 |
||
4761 |
^ false |
|
4762 |
||
4763 |
"Modified: / 13-10-2006 / 16:06:03 / cg" |
|
4764 |
! |
|
4765 |
||
4766 |
canDropObjects:aCollectionOfDropObjects at:positionInView |
|
4767 |
"return true, if we can drop aCollectionOfDropObjects (the OLD drop interface). |
|
4768 |
This method should be redefined in views which can take objects" |
|
4769 |
||
4770 |
^ self canDropObjects:aCollectionOfDropObjects |
|
4771 |
||
4772 |
"Modified: / 13-10-2006 / 16:06:15 / cg" |
|
1581
45908e82a49d
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1559
diff
changeset
|
4773 |
! |
45908e82a49d
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1559
diff
changeset
|
4774 |
|
3947 | 4775 |
dragAutoScroll:aContext |
4776 |
"called by the DragAndDropManager to scroll during a drag/drop operation |
|
4834 | 4777 |
if necassery (decided by the widget itself); |
4460 | 4778 |
If a scroll is done, return true otherwise false (used to restore the background). |
4779 |
By default false is returned." |
|
4780 |
||
3947 | 4781 |
^ false |
4782 |
! |
|
4783 |
||
4649 | 4784 |
drop:aDropContext |
4785 |
"drop manager wants to drop using info in aDropContext (the new drop interface). |
|
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4786 |
An error here, because this is only sent, if #canDrop: returned true; |
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4787 |
if you redefined #canDrop: in a subclass, #drop: must also be redefined." |
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4788 |
|
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4789 |
self subclassResponsibility |
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
4790 |
|
4649 | 4791 |
"Modified: / 13-10-2006 / 16:07:58 / cg" |
4792 |
! |
|
4793 |
||
4794 |
drop:aDropContext at:aPoint |
|
4795 |
"drop manager wants to drop using info in aDropContext (the new drop interface). |
|
1308 | 4796 |
If I have an application, forward the request. |
4797 |
Otherwise, ignore it. This is only sent, if #canDrop: returned true; |
|
4798 |
if you redefined #canDrop: in a subclass, #drop:at: must also be redefined." |
|
4799 |
||
4649 | 4800 |
self drop:aDropContext |
4801 |
||
4802 |
"Modified: / 13-10-2006 / 16:07:41 / cg" |
|
4803 |
! |
|
4804 |
||
4805 |
dropObjects:aCollectionOfDropObjects |
|
4806 |
"someone wants to drop aCollectionOfDropObjects (the OLD drop interface). |
|
4807 |
An error here, because this is only sent, if #canDrop: returned true; |
|
4808 |
if you redefined #canDropObjects: in a subclass, #dropObjects: must also be redefined." |
|
4809 |
||
4810 |
self subclassResponsibility |
|
4811 |
||
4812 |
"Created: / 13-10-2006 / 16:06:48 / cg" |
|
4813 |
! |
|
4814 |
||
4815 |
dropObjects:aCollectionOfDropObjects at:aPoint |
|
4816 |
"someone wants to drop aCollectionOfDropObjects (the OLD drop interface). |
|
4817 |
An error here, because this is only sent, if #canDrop: returned true; |
|
4818 |
if you redefined #canDropObjects: in a subclass, #dropObjects: must also be redefined." |
|
4819 |
||
4820 |
self dropObjects:aCollectionOfDropObjects |
|
4821 |
||
4822 |
"Created: / 13-10-2006 / 16:07:03 / cg" |
|
3591 | 4823 |
! |
4824 |
||
4825 |
dropTarget |
|
4460 | 4826 |
"returns the dropTarget or nil" |
4827 |
||
4471 | 4828 |
^ dropTarget |
4829 |
! |
|
4830 |
||
4831 |
dropTarget:aDropTragetOrNil |
|
4832 |
"set the dropTarget" |
|
4833 |
||
4834 |
dropTarget := aDropTragetOrNil. |
|
1308 | 4835 |
! ! |
4836 |
||
269 | 4837 |
!SimpleView methodsFor:'edge drawing'! |
4838 |
||
4839 |
drawBottomEdge |
|
4840 |
"draw bottom 3D edge into window frame" |
|
4841 |
||
4842 |
self drawBottomEdgeLevel:level |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4843 |
shadow:shadowColor |
3152 | 4844 |
light:lightColor |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4845 |
halfShadow:nil |
3152 | 4846 |
halfLight:nil |
4847 |
style:nil. |
|
269 | 4848 |
! |
4849 |
||
4850 |
drawBottomEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle |
|
4851 |
|botFg |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4852 |
count "{ Class: SmallInteger }" |
269 | 4853 |
b r| |
4854 |
||
4855 |
count := level. |
|
4856 |
count == 0 ifTrue:[^ self]. |
|
4857 |
||
4858 |
(count < 0) ifTrue:[ |
|
3152 | 4859 |
botFg := lightColor. |
4860 |
count := count negated |
|
269 | 4861 |
] ifFalse:[ |
3152 | 4862 |
((edgeStyle == #soft) and:[level > 1]) ifTrue:[ |
4863 |
botFg := halfShadowColor |
|
4864 |
] ifFalse:[ |
|
4865 |
botFg := shadowColor |
|
4866 |
]. |
|
269 | 4867 |
]. |
4868 |
super paint:botFg. |
|
4869 |
super lineWidth:0. |
|
4870 |
||
4871 |
r := width - 1. |
|
4872 |
0 to:(count - 1) do:[:i | |
|
3152 | 4873 |
b := height - 1 - i. |
4874 |
super displayDeviceLineFromX:i y:b toX:(r - i) y:b |
|
269 | 4875 |
]. |
4876 |
||
4877 |
((edgeStyle == #soft) and:[level > 1]) ifTrue:[ |
|
3152 | 4878 |
b := height - 1. |
4879 |
super paint:shadowColor. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4880 |
super displayDeviceLineFromX:1 y:b toX:r y:b. |
1444 | 4881 |
]. |
4882 |
||
4883 |
self edgeDrawn:#bottom. |
|
4884 |
||
4885 |
"Modified: 7.3.1997 / 17:59:39 / cg" |
|
269 | 4886 |
! |
4887 |
||
4888 |
drawEdges |
|
4889 |
"draw all of my 3D edges" |
|
4890 |
||
4891 |
self drawEdgesForX:0 y:0 width:width height:height level:level |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4892 |
shadow:shadowColor |
3152 | 4893 |
light:lightColor |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4894 |
halfShadow:nil |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4895 |
halfLight:nil |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4896 |
style:nil |
269 | 4897 |
! |
4898 |
||
4899 |
drawEdgesForX:x y:y width:w height:h level:l |
|
4900 |
"draw 3D edges into a rectangle" |
|
4901 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4902 |
self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4903 |
drawEdgesForX:x y:y width:w height:h level:l |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4904 |
shadow:shadowColor light:lightColor |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4905 |
halfShadow:nil halfLight:nil |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4906 |
style:nil |
714
2679dd9318ef
clear area under components in redraw
Claus Gittinger <cg@exept.de>
parents:
711
diff
changeset
|
4907 |
! |
269 | 4908 |
|
4909 |
drawLeftEdge |
|
4910 |
"draw left 3D edge into window frame" |
|
4911 |
||
4912 |
self drawLeftEdgeLevel:level |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4913 |
shadow:shadowColor |
3152 | 4914 |
light:lightColor |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4915 |
halfShadow:nil |
3152 | 4916 |
halfLight:nil |
4917 |
style:nil. |
|
269 | 4918 |
! |
4919 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4920 |
drawLeftEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle |
269 | 4921 |
|leftFg leftHalfFg paint b |
4922 |
count "{ Class: SmallInteger }" | |
|
4923 |
||
4924 |
count := level. |
|
4925 |
count == 0 ifTrue:[^ self]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4926 |
|
269 | 4927 |
(count < 0) ifTrue:[ |
3152 | 4928 |
leftFg := shadowColor. |
4929 |
leftHalfFg := halfShadowColor. |
|
4930 |
count := count negated. |
|
269 | 4931 |
] ifFalse:[ |
3152 | 4932 |
leftFg := lightColor. |
4933 |
leftHalfFg := halfLightColor. |
|
269 | 4934 |
]. |
4935 |
leftHalfFg isNil ifTrue:[ |
|
3152 | 4936 |
leftHalfFg := leftFg |
269 | 4937 |
]. |
4938 |
||
4939 |
((edgeStyle == #soft) and:[level > 0]) ifTrue:[ |
|
3152 | 4940 |
paint := leftHalfFg |
269 | 4941 |
] ifFalse:[ |
3152 | 4942 |
paint := leftFg |
269 | 4943 |
]. |
4944 |
super paint:paint. |
|
4945 |
super lineWidth:0. |
|
4946 |
||
4947 |
b := height - 1. |
|
4948 |
0 to:(count - 1) do:[:i | |
|
3152 | 4949 |
super displayDeviceLineFromX:i y:i toX:i y:(b - i) |
269 | 4950 |
]. |
4951 |
||
4952 |
((edgeStyle == #soft) and:[level > 2]) ifTrue:[ |
|
3152 | 4953 |
super paint:(device blackColor). |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4954 |
super displayDeviceLineFromX:0 y:0 toX:0 y:b. |
1444 | 4955 |
]. |
4956 |
||
4957 |
self edgeDrawn:#left. |
|
4958 |
||
4959 |
"Modified: 7.3.1997 / 17:59:53 / cg" |
|
269 | 4960 |
! |
4961 |
||
4962 |
drawRightEdge |
|
4963 |
"draw right 3D edge into window frame" |
|
4964 |
||
4965 |
self drawRightEdgeLevel:level |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4966 |
shadow:shadowColor |
3152 | 4967 |
light:lightColor |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4968 |
halfShadow:nil |
3152 | 4969 |
halfLight:nil |
4970 |
style:nil. |
|
269 | 4971 |
! |
4972 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4973 |
drawRightEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle |
269 | 4974 |
|rightFg |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
4975 |
count "{ Class: SmallInteger }" |
269 | 4976 |
r b| |
4977 |
||
4978 |
count := level. |
|
4979 |
count == 0 ifTrue:[^ self]. |
|
4980 |
||
4981 |
(count < 0) ifTrue:[ |
|
3152 | 4982 |
rightFg := lightColor. |
4983 |
count := count negated |
|
269 | 4984 |
] ifFalse:[ |
3152 | 4985 |
((edgeStyle == #soft) and:[level > 1]) ifTrue:[ |
4986 |
rightFg := halfShadowColor |
|
4987 |
] ifFalse:[ |
|
4988 |
rightFg := shadowColor |
|
4989 |
]. |
|
269 | 4990 |
]. |
4991 |
super paint:rightFg. |
|
4992 |
super lineWidth:0. |
|
4993 |
||
4994 |
b := height - 1. |
|
4995 |
0 to:(count - 1) do:[:i | |
|
3152 | 4996 |
r := width - 1 - i. |
4997 |
super displayDeviceLineFromX:r y:i toX:r y:(b - i) |
|
269 | 4998 |
]. |
4999 |
((edgeStyle == #soft) and:[level > 1]) ifTrue:[ |
|
3152 | 5000 |
r := width - 1. |
5001 |
super paint:shadowColor. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5002 |
super displayDeviceLineFromX:r y:1 toX:r y:b. |
1444 | 5003 |
]. |
5004 |
||
5005 |
self edgeDrawn:#right. |
|
5006 |
||
5007 |
"Modified: 7.3.1997 / 18:00:02 / cg" |
|
269 | 5008 |
! |
5009 |
||
5010 |
drawTopEdge |
|
5011 |
"draw top 3D edge into window frame" |
|
5012 |
||
5013 |
self drawTopEdgeLevel:level |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5014 |
shadow:shadowColor |
3152 | 5015 |
light:lightColor |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5016 |
halfShadow:nil |
3152 | 5017 |
halfLight:nil |
5018 |
style:nil. |
|
269 | 5019 |
! |
5020 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5021 |
drawTopEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle |
269 | 5022 |
|topFg topHalfFg paint r |
5023 |
count "{ Class: SmallInteger }" | |
|
5024 |
||
5025 |
count := level. |
|
5026 |
count == 0 ifTrue:[^ self]. |
|
5027 |
||
5028 |
(count < 0) ifTrue:[ |
|
3152 | 5029 |
topFg := shadowColor. |
5030 |
topHalfFg := halfShadowColor. |
|
5031 |
count := count negated |
|
269 | 5032 |
] ifFalse:[ |
3152 | 5033 |
topFg := lightColor. |
5034 |
topHalfFg := halfLightColor. |
|
269 | 5035 |
]. |
5036 |
topHalfFg isNil ifTrue:[ |
|
3152 | 5037 |
topHalfFg := topFg |
269 | 5038 |
]. |
5039 |
||
5040 |
((edgeStyle == #soft) and:[level > 0]) ifTrue:[ |
|
3152 | 5041 |
paint := topHalfFg |
269 | 5042 |
] ifFalse:[ |
3152 | 5043 |
paint := topFg |
269 | 5044 |
]. |
5045 |
super paint:paint. |
|
5046 |
super lineWidth:0. |
|
5047 |
||
5048 |
r := width - 1. |
|
5049 |
0 to:(count - 1) do:[:i | |
|
3152 | 5050 |
super displayDeviceLineFromX:i y:i toX:(r - i) y:i |
269 | 5051 |
]. |
5052 |
((edgeStyle == #soft) and:[level > 2]) ifTrue:[ |
|
3152 | 5053 |
super paint:(device blackColor). |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5054 |
super displayDeviceLineFromX:0 y:0 toX:r y:0. |
1444 | 5055 |
]. |
5056 |
||
5057 |
self edgeDrawn:#top. |
|
5058 |
||
5059 |
"Modified: 7.3.1997 / 18:00:11 / cg" |
|
269 | 5060 |
! |
5061 |
||
5062 |
redrawEdges |
|
5063 |
"redraw my edges (if any)" |
|
5064 |
||
5065 |
(level ~~ 0) ifTrue:[ |
|
3152 | 5066 |
shown ifTrue:[ |
5067 |
self clippingRectangle:nil. |
|
5068 |
self drawEdges. |
|
5069 |
self deviceClippingRectangle:innerClipRect |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5070 |
] |
739 | 5071 |
] |
5072 |
||
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5073 |
"Modified: / 25.5.1999 / 14:50:25 / cg" |
269 | 5074 |
! ! |
5075 |
||
5076 |
!SimpleView methodsFor:'enumerating subviews'! |
|
5077 |
||
4720 | 5078 |
allSubViewsDetect:aBlock ifNone:exceptionBlock |
5079 |
"find a subview for which aBlock returns true (recursively)" |
|
5080 |
||
5081 |
subViews notNil ifTrue:[ |
|
4834 | 5082 |
subViews do:[:aSubview | |
5083 |
|v| |
|
5084 |
||
5085 |
(aBlock value:aSubview) ifTrue:[ ^ aSubview ]. |
|
5086 |
v := aSubview allSubViewsDetect:aBlock ifNone:nil. |
|
5087 |
v notNil ifTrue:[^ v]. |
|
5088 |
] |
|
5089 |
]. |
|
5090 |
^ exceptionBlock value. |
|
4720 | 5091 |
|
5092 |
"Modified: 12.2.1997 / 12:23:38 / cg" |
|
5093 |
! |
|
5094 |
||
269 | 5095 |
allSubViewsDo:aBlock |
5096 |
"evaluate aBlock for all subviews (recursively)" |
|
5097 |
||
1335 | 5098 |
subViews notNil ifTrue:[ |
3653 | 5099 |
subViews do:[:aSubview | |
5100 |
aSubview withAllSubViewsDo:aBlock |
|
5101 |
] |
|
269 | 5102 |
] |
1335 | 5103 |
|
5104 |
"Modified: 12.2.1997 / 12:23:38 / cg" |
|
269 | 5105 |
! |
5106 |
||
5254
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5107 |
changeSequenceOrderFor:aSubViewOrComponent to:anIndex |
1984 | 5108 |
"change a subview's position in the subviews collection. |
5254
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5109 |
Usually, this only affects the order of components in a panelView, |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5110 |
unless they overlap. In that case, the later view is placed above the earlier." |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5111 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5112 |
aSubViewOrComponent isView ifFalse:[ |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5113 |
^ self changeSequenceOrderForComponent:aSubViewOrComponent to:anIndex |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5114 |
]. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5115 |
^ self changeSequenceOrderForView:aSubViewOrComponent to:anIndex |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5116 |
! |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5117 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5118 |
changeSequenceOrderForComponent:aComponent to:anIndex |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5119 |
"change a components's position in the components collection. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5120 |
The later components is drawn above the earlier." |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5121 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5122 |
|removedComponent| |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5123 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5124 |
(components notNil and:[components size >= anIndex]) ifTrue:[ |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5125 |
removedComponent := components remove:aComponent ifAbsent:nil. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5126 |
removedComponent notNil ifTrue:[ |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5127 |
components add:removedComponent beforeIndex:anIndex. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5128 |
^ true |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5129 |
] |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5130 |
]. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5131 |
^ false |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5132 |
! |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5133 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5134 |
changeSequenceOrderForView:aSubView to:anIndex |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5135 |
"change a subview's position in the subviews collection. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5136 |
Usually, this only affects the order of components in a panelView, |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5137 |
unless they overlap. In that case, the later view is placed above the earlier." |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5138 |
|
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5139 |
|removedView| |
1363 | 5140 |
|
5141 |
(subViews notNil and:[subViews size >= anIndex]) ifTrue:[ |
|
5254
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5142 |
removedView := subViews remove:aSubView ifAbsent:nil. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5143 |
removedView notNil ifTrue:[ |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5144 |
subViews add:removedView beforeIndex:anIndex. |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5145 |
^ true |
ba9d96c13e7a
changeSequence: care for disjoint components/subView containers
Claus Gittinger <cg@exept.de>
parents:
5250
diff
changeset
|
5146 |
] |
1363 | 5147 |
]. |
5148 |
^ false |
|
5149 |
! |
|
5150 |
||
269 | 5151 |
withAllSubViewsDo:aBlock |
5152 |
"evaluate aBlock for the receiver and all subviews (recursively)" |
|
5153 |
||
5154 |
aBlock value:self. |
|
5155 |
self allSubViewsDo:aBlock |
|
135 | 5156 |
! ! |
5157 |
||
5158 |
!SimpleView methodsFor:'event handling'! |
|
5159 |
||
4455 | 5160 |
alienDrop:aCollectionOfDropObjects position:positionOrNil |
1581
45908e82a49d
drop argument is always a collection
Claus Gittinger <cg@exept.de>
parents:
1559
diff
changeset
|
5161 |
"a drop from some other non-ST/X application." |
1555
6280ab9b914d
alien drop - converts to ST/X drop
Claus Gittinger <cg@exept.de>
parents:
1544
diff
changeset
|
5162 |
|
4834 | 5163 |
|view positionInView tDelayed |
5164 |
anyNonExisting whichNonExisting checkForAnyNonExisting |
|
4654 | 5165 |
app target dropContext| |
4652 | 5166 |
|
5167 |
"/ mhmh - sometimes, the dropped file is not present. |
|
5168 |
"/ how comes ? And what should be done to avoid this ? |
|
4463
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5169 |
|
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5170 |
checkForAnyNonExisting := |
5031
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5171 |
[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5172 |
anyNonExisting := false. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5173 |
aCollectionOfDropObjects do:[:eachDropObject | |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5174 |
eachDropObject isFileObject ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5175 |
eachDropObject isDirectory ifFalse:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5176 |
eachDropObject theObject asFilename exists ifFalse:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5177 |
anyNonExisting := true. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5178 |
whichNonExisting := eachDropObject theObject asFilename. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5179 |
] |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5180 |
] |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5181 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5182 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5183 |
anyNonExisting |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5184 |
]. |
4463
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5185 |
|
4652 | 5186 |
self withWaitCursorDo:[ |
5031
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5187 |
tDelayed := 0. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5188 |
checkForAnyNonExisting doWhile:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5189 |
anyNonExisting ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5190 |
Delay waitForSeconds:0.3. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5191 |
tDelayed := tDelayed + 0.3. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5192 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5193 |
anyNonExisting and:[ tDelayed <= 3]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5194 |
]. |
4463
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5195 |
]. |
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5196 |
|
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5197 |
(anyNonExisting and:[checkForAnyNonExisting value]) ifTrue:[ |
5031
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5198 |
Dialog warn:('Dropfile not present: %1' bindWith:whichNonExisting pathName). |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5199 |
^ self |
4463
d61225317fe6
oops - must wait for a while after a drop - sigh (win32)
Claus Gittinger <cg@exept.de>
parents:
4460
diff
changeset
|
5200 |
]. |
4455 | 5201 |
|
5202 |
view := self. |
|
5203 |
positionInView := positionOrNil. |
|
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5204 |
|
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5205 |
app := view application. |
5031
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5206 |
app notNil ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5207 |
(app canDropObjects:aCollectionOfDropObjects in:view at:positionInView) ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5208 |
app dropObjects:aCollectionOfDropObjects in:view at:positionInView. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5209 |
^ self. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5210 |
]. |
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5211 |
]. |
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5212 |
|
4455 | 5213 |
[view notNil] whileTrue:[ |
5031
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5214 |
"new mechanism to get a dropTarget" |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5215 |
target := view dropTarget. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5216 |
target notNil ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5217 |
dropContext := DropContext new. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5218 |
dropContext dropObjects:aCollectionOfDropObjects. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5219 |
dropContext dropTarget:target. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5220 |
|
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5221 |
(target canDrop:dropContext) ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5222 |
target drop:dropContext. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5223 |
^ self. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5224 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5225 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5226 |
|
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5227 |
(view canDropObjects:aCollectionOfDropObjects at:positionInView) ifTrue:[ |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5228 |
view dropObjects:aCollectionOfDropObjects at:positionInView. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5229 |
^ self. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5230 |
]. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5231 |
view := view superView. |
733b5e829b2b
care for nil application in alienDrop:position:
Claus Gittinger <cg@exept.de>
parents:
5029
diff
changeset
|
5232 |
positionInView := nil. |
1555
6280ab9b914d
alien drop - converts to ST/X drop
Claus Gittinger <cg@exept.de>
parents:
1544
diff
changeset
|
5233 |
] |
6280ab9b914d
alien drop - converts to ST/X drop
Claus Gittinger <cg@exept.de>
parents:
1544
diff
changeset
|
5234 |
|
4654 | 5235 |
"Modified: / 17-10-2006 / 18:00:46 / cg" |
1555
6280ab9b914d
alien drop - converts to ST/X drop
Claus Gittinger <cg@exept.de>
parents:
1544
diff
changeset
|
5236 |
! |
6280ab9b914d
alien drop - converts to ST/X drop
Claus Gittinger <cg@exept.de>
parents:
1544
diff
changeset
|
5237 |
|
4579 | 5238 |
buttonMultiPress:button x:x y:y |
5239 |
"button was pressed quickly again - check my components for a hit." |
|
5240 |
||
5241 |
components notNil ifTrue:[ |
|
4834 | 5242 |
self componentsContainingX:x y:y do:[:comp :cx :cy | |
5243 |
comp buttonMultiPress:button x:cx y:cy. |
|
5244 |
^ self |
|
5245 |
] |
|
4579 | 5246 |
]. |
5247 |
||
5248 |
super buttonMultiPress:button x:x y:y |
|
5249 |
||
5250 |
"Modified: / 08-05-1996 / 23:43:41 / cg" |
|
5251 |
"Created: / 13-09-2006 / 16:34:23 / User" |
|
5252 |
! |
|
5253 |
||
269 | 5254 |
buttonPress:button x:x y:y |
659 | 5255 |
"button was pressed - check my components for a hit." |
269 | 5256 |
|
5257 |
components notNil ifTrue:[ |
|
3152 | 5258 |
self componentsContainingX:x y:y do:[:comp :cx :cy | |
5259 |
comp buttonPress:button x:cx y:cy. |
|
5260 |
^ self |
|
5261 |
] |
|
140 | 5262 |
]. |
5263 |
||
269 | 5264 |
super buttonPress:button x:x y:y |
271
88d9e485a5da
menu handling: if entry is a checkToggleEntry, AND selector wants an argument,
Claus Gittinger <cg@exept.de>
parents:
269
diff
changeset
|
5265 |
|
659 | 5266 |
"Modified: 8.5.1996 / 23:43:41 / cg" |
5267 |
! |
|
5268 |
||
5269 |
buttonRelease:button x:x y:y |
|
5270 |
"button was released - check my components for a hit." |
|
5271 |
||
5272 |
components notNil ifTrue:[ |
|
3152 | 5273 |
self componentsContainingX:x y:y do:[:comp :cx :cy | |
5274 |
comp buttonRelease:button x:cx y:cy. |
|
5275 |
^ self |
|
5276 |
] |
|
659 | 5277 |
]. |
5278 |
||
5279 |
super buttonRelease:button x:x y:y |
|
5280 |
||
5281 |
"Modified: 8.5.1996 / 23:41:58 / cg" |
|
5282 |
"Created: 8.5.1996 / 23:43:25 / cg" |
|
193 | 5283 |
! |
5284 |
||
5133 | 5285 |
changeScaleForMouseWheelZoom:amount |
5286 |
"CTRL-wheel action. |
|
5287 |
ignored here - redefined in views which can zoom" |
|
5288 |
||
5289 |
|oldScale newScale factor| |
|
5290 |
||
5291 |
amount > 0 ifTrue:[ |
|
5292 |
factor := 1.2. |
|
5293 |
] ifFalse:[ |
|
5294 |
factor := 0.8. |
|
5295 |
]. |
|
5296 |
oldScale := self scale. |
|
5297 |
newScale := (oldScale * factor) max:0.1. |
|
5298 |
self scale:newScale. |
|
5299 |
self invalidate. |
|
5300 |
! |
|
5301 |
||
1544
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5302 |
clientMessage:msgType format:msgFormat eventData:msgData |
4999
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5303 |
"a client message - very X-specific and only useful for special applications. |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5304 |
Forwarded to my application (if I have one)" |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5305 |
|
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5306 |
|app| |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5307 |
|
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5308 |
(app := self application) notNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5309 |
app clientMessage:msgType format:msgFormat eventData:msgData |
4999
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5310 |
]. |
1544
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5311 |
! |
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5312 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5313 |
closeRequest |
2216
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5314 |
"programmatic close request" |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5315 |
|
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5316 |
self destroy |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5317 |
|
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5318 |
"Modified: / 3.8.1998 / 19:50:50 / cg" |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5319 |
! |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5320 |
|
140 | 5321 |
configureX:x y:y width:newWidth height:newHeight |
5322 |
"my size has changed by window manager action" |
|
5323 |
||
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5324 |
|how anyEdge mustRedrawBottomEdge mustRedrawRightEdge p originChanged| |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5325 |
|
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5326 |
originChanged := (left ~= x) or:[top ~= y]. |
180 | 5327 |
|
2966 | 5328 |
left := x. |
5329 |
top := y. |
|
5330 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5331 |
(superView isNil |
180 | 5332 |
and:[drawableId notNil]) ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5333 |
"/ have to be careful - some window managers (motif) wrap another |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5334 |
"/ view around and the reported origin is relative to that. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5335 |
"/ not relative to the screen. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5336 |
p := device translatePoint:0@0 fromView:self toView:nil. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5337 |
p := p + self borderWidth. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5338 |
left := p x. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5339 |
top := p y. |
2414 | 5340 |
]. |
5341 |
||
140 | 5342 |
((width ~~ newWidth) or:[height ~~ newHeight]) ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5343 |
realized ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5344 |
width := newWidth. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5345 |
height := newHeight. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5346 |
self extentChangedFlag:true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5347 |
^ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5348 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5349 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5350 |
((newWidth <= width) and:[newHeight <= height]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5351 |
how := #smaller |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5352 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5353 |
((newWidth >= width) and:[newHeight >= height]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5354 |
how := #larger |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5355 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5356 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5357 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5358 |
level ~~ 0 ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5359 |
mustRedrawBottomEdge := newHeight < height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5360 |
mustRedrawRightEdge := newWidth < width. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5361 |
anyEdge := mustRedrawBottomEdge or:[mustRedrawRightEdge] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5362 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5363 |
anyEdge := false |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5364 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5365 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5366 |
width := newWidth. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5367 |
height := newHeight. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5368 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5369 |
"recompute inner-clip if needed" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5370 |
self setInnerClip. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5371 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5372 |
" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5373 |
must first process pending exposes; |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5374 |
otherwise, those may be drawn at a wrong position |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5375 |
" |
971 | 5376 |
"/ claus: no; expose events are in the same queue as configure events; |
5377 |
"/ which is exactly for that reason ... |
|
5378 |
||
5379 |
"/ windowGroup notNil ifTrue:[ |
|
5380 |
"/ windowGroup processExposeEvents |
|
5381 |
"/ ]. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5382 |
self sizeChanged:how. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5383 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5384 |
(anyEdge and:[shown]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5385 |
mustRedrawBottomEdge ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5386 |
self invalidateDeviceRectangle:((0 @ (height-1-margin)) extent:width@margin) repairNow:false. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5387 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5388 |
mustRedrawRightEdge ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5389 |
self invalidateDeviceRectangle:((width-1-margin)@0 extent:margin@height) repairNow:false. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5390 |
]. |
2821
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5391 |
"/ OLD code: |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5392 |
"/ self clippingRectangle:nil. |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5393 |
"/ mustRedrawBottomEdge ifTrue:[ |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5394 |
"/ self drawBottomEdge |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5395 |
"/ ]. |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5396 |
"/ mustRedrawRightEdge ifTrue:[ |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5397 |
"/ self drawRightEdge |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5398 |
"/ ]. |
8eda25202d32
async border redraw when size changes
Claus Gittinger <cg@exept.de>
parents:
2816
diff
changeset
|
5399 |
"/ self deviceClippingRectangle:innerClipRect |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5400 |
] |
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5401 |
]. |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5402 |
|
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5403 |
originChanged ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5404 |
self changed:#origin. |
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
5405 |
]. |
739 | 5406 |
|
3518
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
5407 |
"Modified: / 10.10.2001 / 14:14:19 / cg" |
138 | 5408 |
! |
5409 |
||
964 | 5410 |
containerChangedSize |
5411 |
"my container has changed size; if I have relative |
|
5412 |
origin/extent or blocks to evaluate, do it now .." |
|
5413 |
||
1063 | 5414 |
|oldWidth oldHeight oldTop oldLeft newExt newOrg r| |
964 | 5415 |
|
5416 |
oldWidth := width. |
|
5417 |
oldHeight := height. |
|
5418 |
oldTop := top. |
|
5419 |
oldLeft := left. |
|
5420 |
||
5421 |
" |
|
5422 |
slowly migrating to use layoutObjects ... |
|
5423 |
" |
|
5424 |
layout isNil ifTrue:[ |
|
3762 | 5425 |
newOrg := self computeOrigin. |
5426 |
newExt := self computeExtent. |
|
964 | 5427 |
] ifFalse:[ |
3762 | 5428 |
r := (layout rectangleRelativeTo:(superView viewRectangle) |
5429 |
preferred:[self preferredBounds]). |
|
5430 |
newOrg := r origin rounded. |
|
5431 |
newExt := r extent rounded. |
|
964 | 5432 |
"/ newOrg printNL. |
5433 |
"/ newExt printNL. |
|
5434 |
]. |
|
5435 |
||
3394
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5436 |
"/ newOrg notNil ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5437 |
"/ ((newOrg x == oldLeft) and:[newOrg y == oldTop]) ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5438 |
"/ newOrg := nil |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5439 |
"/ ] |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5440 |
"/ ]. |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5441 |
"/ newExt notNil ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5442 |
"/ ((newExt x == width) and:[newExt y == height]) ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5443 |
"/ newExt := nil |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5444 |
"/ ] |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5445 |
"/ ]. |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5446 |
"/ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5447 |
"/ newExt isNil ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5448 |
"/ newOrg notNil ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5449 |
"/ self pixelOrigin:newOrg |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5450 |
"/ ] |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5451 |
"/ ] ifFalse:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5452 |
"/ newOrg isNil ifTrue:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5453 |
"/ self pixelExtent:newExt |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5454 |
"/ ] ifFalse:[ |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5455 |
"/ self pixelOrigin:newOrg extent:newExt |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5456 |
"/ ] |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5457 |
"/ ] |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
5458 |
self pixelOrigin:newOrg extent:newExt |
964 | 5459 |
|
5460 |
"Modified: 19.7.1996 / 17:32:50 / cg" |
|
5461 |
! |
|
5462 |
||
5463 |
containerMapped |
|
5464 |
"my container was mapped (became visible). |
|
5465 |
If I was previously realized, this implies that I myself |
|
5466 |
am now mapped as well." |
|
5467 |
||
5468 |
"/ if I was not previously shown, tell it to all of |
|
5469 |
"/ my subviews (they remember this in the shown instVar) |
|
5470 |
||
5471 |
realized ifTrue:[ |
|
3152 | 5472 |
shown ifFalse:[ |
964 | 5473 |
"/ old: |
5474 |
"/ shown := true. |
|
5475 |
"/ subViews notNil ifTrue:[ |
|
5476 |
"/ subViews do:[:v | |
|
5477 |
"/ v containerMapped |
|
5478 |
"/ ] |
|
5479 |
"/ ] |
|
5480 |
||
5481 |
"/ which is equivalent to: |
|
3152 | 5482 |
self mapped. |
5483 |
] |
|
964 | 5484 |
]. |
5485 |
||
5486 |
"Modified: 30.5.1996 / 11:41:02 / cg" |
|
5487 |
"Created: 19.7.1996 / 17:41:10 / cg" |
|
5488 |
! |
|
5489 |
||
5490 |
containerUnmapped |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5491 |
"my container was unmapped |
964 | 5492 |
- this implies that the recevier is now also unmapped." |
5493 |
||
5494 |
"/ if I was previously shown, tell it to all of |
|
5495 |
"/ my subviews (they remember this in the shown instVar) |
|
5496 |
||
5497 |
realized ifTrue:[ |
|
3152 | 5498 |
shown ifTrue:[ |
5499 |
self unmapped |
|
5500 |
] |
|
964 | 5501 |
] |
5502 |
||
5503 |
"Modified: 30.5.1996 / 11:41:25 / cg" |
|
5504 |
"Created: 19.7.1996 / 17:43:50 / cg" |
|
5505 |
! |
|
5506 |
||
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
5507 |
copyDataEvent:parameter eventData:msgData |
4999
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5508 |
"a copyData message - very Win32-specific and only useful for special applications. |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5509 |
Forwarded to my application (If I have one)" |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5510 |
|
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5511 |
|app| |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5512 |
|
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5513 |
(app := self application) notNil ifTrue:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
5514 |
app copyDataEvent:parameter eventData:msgData |
4999
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5515 |
]. |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5516 |
! |
b56e53c1b4d4
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4993
diff
changeset
|
5517 |
|
269 | 5518 |
destroyed |
5519 |
"view has been destroyed by someone else (usually window system)" |
|
5520 |
||
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
5521 |
shown ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
5522 |
shown := false. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
5523 |
self changed:#visibility. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
5524 |
]. |
269 | 5525 |
super destroyed |
3183
e55c249cd6e5
kludge: remove objectAttributes when destroyed.
Claus Gittinger <cg@exept.de>
parents:
3182
diff
changeset
|
5526 |
|
e55c249cd6e5
kludge: remove objectAttributes when destroyed.
Claus Gittinger <cg@exept.de>
parents:
3182
diff
changeset
|
5527 |
"Modified: / 18.2.2000 / 11:20:34 / cg" |
269 | 5528 |
! |
5529 |
||
4460 | 5530 |
dropMessage:dropTypeSymbol data:dropValue position:dropPosition handle:dropHandle |
4455 | 5531 |
"a drop from some other window (X: DND or Win32 drag&drop). |
1544
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5532 |
Convert to the ST/X drag and drop protocol here." |
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5533 |
|
1559 | 5534 |
|dropObjects| |
5535 |
||
4834 | 5536 |
(dropTypeSymbol == WindowEvent dropType_file |
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5537 |
or:[dropTypeSymbol == WindowEvent dropType_directory]) ifTrue:[ |
4834 | 5538 |
dropObjects := Array with:(DropObject newFile:dropValue) |
1559 | 5539 |
] ifFalse:[ |
4834 | 5540 |
dropTypeSymbol == WindowEvent dropType_files ifTrue:[ |
5541 |
dropObjects := (dropValue collect:[:fn | DropObject newFile:fn]) |
|
5542 |
] ifFalse:[ |
|
5543 |
dropTypeSymbol == WindowEvent dropType_text ifTrue:[ |
|
5544 |
dropObjects := Array with:(DropObject newText:dropValue) |
|
5545 |
] ifFalse:[ |
|
5546 |
dropObjects := Array with:(DropObject new:dropValue) |
|
5547 |
] |
|
5548 |
] |
|
4455 | 5549 |
]. |
5550 |
||
4460 | 5551 |
"/ Transcript showCR:'Drop:'. |
5552 |
"/ Transcript show:' View:'; showCR:self. |
|
5553 |
"/ Transcript show:' Position:'; showCR:dropPosition. |
|
5554 |
"/ Transcript show:' Data:'; showCR:dropObjects. |
|
5555 |
||
5556 |
self alienDrop:dropObjects position:dropPosition. |
|
5557 |
device dragFinish:dropHandle. |
|
1559 | 5558 |
|
4647
a13c63aed017
drop: canDrop:at:/drop:at: now invoke canDrop:/drop:;
Claus Gittinger <cg@exept.de>
parents:
4630
diff
changeset
|
5559 |
"Modified: / 13-10-2006 / 10:10:23 / cg" |
1544
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5560 |
! |
4b78320b98fe
dummy client- and dropMessage handling
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
5561 |
|
135 | 5562 |
exposeX:x y:y width:w height:h |
5563 |
"a low level redraw event from device |
|
5564 |
- let subclass handle the redraw and take care of edges here" |
|
5565 |
||
3340 | 5566 |
|leftEdge topEdge rightEdge botEdge anyEdge nx ny nw nh dx dy dw dh old oldPaint| |
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5567 |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
5568 |
shown ifFalse:[ |
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5569 |
^ self |
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
5570 |
]. |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
5571 |
|
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5572 |
nw := dw := w. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5573 |
nh := dh := h. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5574 |
nx := dx := x. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5575 |
ny := dy := y. |
135 | 5576 |
|
5577 |
anyEdge := false. |
|
5578 |
||
5579 |
" |
|
5580 |
check if there is a need to draw an edge (i.e. if margin is hit) |
|
5581 |
" |
|
5582 |
(margin ~~ 0) ifTrue:[ |
|
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5583 |
leftEdge := false. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5584 |
topEdge := false. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5585 |
rightEdge := false. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5586 |
botEdge := false. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5587 |
transformation notNil ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5588 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5589 |
need device coordinates for this test |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5590 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5591 |
nx := transformation applyToX:nx. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5592 |
ny := transformation applyToY:ny. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5593 |
nw := transformation applyScaleX:nw. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5594 |
nh := transformation applyScaleY:nh. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5595 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5596 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5597 |
adjust expose rectangle, to exclude the margin. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5598 |
Care for rounding errors ... |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5599 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5600 |
(nx isMemberOf:SmallInteger) ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5601 |
old := nx. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5602 |
nx := nx truncated. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5603 |
nw := nw + (nx - old). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5604 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5605 |
(ny isMemberOf:SmallInteger) ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5606 |
old := ny. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5607 |
ny := ny truncated. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5608 |
nh := nh + (ny - old). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5609 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5610 |
(nw isMemberOf:SmallInteger) ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5611 |
nw := nw truncated + 1 |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5612 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5613 |
(nh isMemberOf:SmallInteger) ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5614 |
nh := nh truncated + 1 |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5615 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5616 |
|
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5617 |
dx := nx. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5618 |
dy := ny. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5619 |
dw := nw. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5620 |
dh := nh. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5621 |
|
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5622 |
(nx < margin) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5623 |
old := nx. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5624 |
nx := margin. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5625 |
nw := nw - (nx - old). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5626 |
leftEdge := anyEdge := true. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5627 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5628 |
((nx + nw - 1) >= (width - margin)) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5629 |
nw := (width - margin - nx). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5630 |
rightEdge := anyEdge := true. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5631 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5632 |
(ny < margin) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5633 |
old := ny. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5634 |
ny := margin. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5635 |
nh := nh - (ny - old). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5636 |
topEdge := anyEdge := true. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5637 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5638 |
((ny + nh - 1) >= (height - margin)) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5639 |
nh := (height - margin - ny). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5640 |
botEdge := anyEdge := true. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5641 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5642 |
transformation notNil ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5643 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5644 |
need logical coordinates for redraw |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5645 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5646 |
nx := transformation applyInverseToX:nx. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5647 |
ny := transformation applyInverseToY:ny. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5648 |
nw := transformation applyInverseScaleX:nw. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5649 |
nh := transformation applyInverseScaleY:nh. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5650 |
]. |
135 | 5651 |
]. |
5652 |
||
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
5653 |
(nw > 0 and:[nh > 0]) ifTrue:[ |
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5654 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5655 |
redraw inside area |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5656 |
" |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5657 |
self clippingRectangle:(Rectangle left:nx top:ny width:nw height:nh). |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5658 |
|
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5659 |
self redrawX:nx y:ny width:nw height:nh. |
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
5660 |
]. |
135 | 5661 |
|
5662 |
" |
|
5663 |
redraw edge(s) |
|
5664 |
" |
|
5665 |
anyEdge ifTrue:[ |
|
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5666 |
self deviceClippingRectangle:nil. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5667 |
oldPaint := paint. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5668 |
(topEdge and:[leftEdge and:[botEdge and:[rightEdge]]]) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5669 |
self drawEdges |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5670 |
] ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5671 |
topEdge ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5672 |
self drawTopEdge |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5673 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5674 |
leftEdge ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5675 |
self drawLeftEdge |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5676 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5677 |
botEdge ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5678 |
self drawBottomEdge |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5679 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5680 |
rightEdge ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5681 |
self drawRightEdge |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5682 |
] |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5683 |
]. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
5684 |
self paint:oldPaint. |
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5685 |
]. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5686 |
self deviceClippingRectangle:innerClipRect. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5687 |
|
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
5688 |
"Modified: / 25.5.1999 / 14:57:38 / cg" |
135 | 5689 |
! |
5690 |
||
269 | 5691 |
focusIn |
2506 | 5692 |
"got keyboard focus (via the window manager). |
5693 |
Nothing done here" |
|
5694 |
||
269 | 5695 |
! |
5696 |
||
5697 |
focusOut |
|
2506 | 5698 |
"lost keyboard focus (via the window manager). |
5699 |
Nothing done here" |
|
269 | 5700 |
! |
5701 |
||
5702 |
hasKeyboardFocus:aBoolean |
|
2506 | 5703 |
"notification from the windowGroup that I got the keyboardFocus." |
5704 |
||
5705 |
delegate notNil ifTrue:[ |
|
3152 | 5706 |
delegate perform:#hasKeyboardFocus: with:aBoolean ifNotUnderstood:nil |
2506 | 5707 |
]. |
140 | 5708 |
^ self |
5709 |
! |
|
5710 |
||
5711 |
keyPress:key x:x y:y |
|
5712 |
"a key has been pressed. If there are components, |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5713 |
pass it to the corresponding one. |
140 | 5714 |
Otherwise, forward it to the superview, if there is any." |
5715 |
||
510 | 5716 |
<resource: #keyboard ( #Menu ) > |
5717 |
||
3247
d6e631975bd1
forward Menu-key (CMD-Z) to focusView if there is one.
Claus Gittinger <cg@exept.de>
parents:
3242
diff
changeset
|
5718 |
|focusView| |
d6e631975bd1
forward Menu-key (CMD-Z) to focusView if there is one.
Claus Gittinger <cg@exept.de>
parents:
3242
diff
changeset
|
5719 |
|
140 | 5720 |
components notNil ifTrue:[ |
3367 | 5721 |
components notNil ifTrue:[ |
5722 |
self componentsContainingX:x y:y do:[:comp :cx :cy | |
|
5723 |
comp keyPress:key x:cx y:cy. |
|
5724 |
^ self |
|
5725 |
] |
|
5726 |
]. |
|
490
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5727 |
]. |
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5728 |
|
494 | 5729 |
key == #Menu ifTrue:[ |
3367 | 5730 |
((focusView := self windowGroup focusView) notNil |
5731 |
and:[focusView ~~ self]) |
|
5732 |
ifTrue:[ |
|
5733 |
"/ forward to the focusView |
|
5734 |
focusView keyPress:key x:-1 y:-1. |
|
5735 |
^ self |
|
5736 |
]. |
|
5737 |
^ self activateMenu. |
|
135 | 5738 |
]. |
5739 |
||
490
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5740 |
x isNil ifTrue:[ |
3367 | 5741 |
"/ already redelegated, but nowhere handled |
5742 |
superView notNil ifTrue:[ |
|
5743 |
superView keyPress:key x:nil y:nil. |
|
5744 |
]. |
|
5745 |
^ self |
|
490
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5746 |
]. |
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5747 |
|
1d2ed059a063
delegated keyboardMessages get nil as x/y
Claus Gittinger <cg@exept.de>
parents:
489
diff
changeset
|
5748 |
superView notNil ifTrue:[ |
3367 | 5749 |
superView |
5750 |
dispatchEvent:#keyPress:x:y: |
|
5751 |
arguments:(Array with:key with:0 with:0) |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5752 |
|
2127 | 5753 |
"/ WindowEvent |
5754 |
"/ sendEvent:#keyPress:x:y: |
|
5755 |
"/ arguments:(Array with:key with:0 with:0) |
|
5756 |
"/ view:superView |
|
411
2d5deb02d8f8
if not already forwarded, let keyEvents be handled by superView
Claus Gittinger <cg@exept.de>
parents:
393
diff
changeset
|
5757 |
] ifFalse:[ |
3367 | 5758 |
super keyPress:key x:x y:y |
135 | 5759 |
] |
411
2d5deb02d8f8
if not already forwarded, let keyEvents be handled by superView
Claus Gittinger <cg@exept.de>
parents:
393
diff
changeset
|
5760 |
|
2127 | 5761 |
"Modified: / 20.5.1998 / 22:55:08 / cg" |
659 | 5762 |
! |
5763 |
||
5764 |
keyRelease:key x:x y:y |
|
5765 |
"a key has been released. If there are components, |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5766 |
pass it to the corresponding one. |
659 | 5767 |
Otherwise, do whatever my superclass would do." |
5768 |
||
5769 |
components notNil ifTrue:[ |
|
3152 | 5770 |
components notNil ifTrue:[ |
5771 |
self componentsContainingX:x y:y do:[:comp :cx :cy | |
|
5772 |
comp keyRelease:key x:cx y:cy. |
|
5773 |
^ self |
|
5774 |
] |
|
5775 |
]. |
|
659 | 5776 |
]. |
5777 |
||
5778 |
super keyRelease:key x:x y:y |
|
5779 |
||
5780 |
"Modified: 8.5.1996 / 23:44:36 / cg" |
|
5781 |
"Created: 8.5.1996 / 23:45:28 / cg" |
|
135 | 5782 |
! |
5783 |
||
269 | 5784 |
mapped |
5785 |
"the view has been mapped (by some outside |
|
5786 |
action - i.e. window manager de-iconified me)" |
|
5787 |
||
5082
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5788 |
|shownBefore| |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5789 |
|
269 | 5790 |
" |
5791 |
the old code was: |
|
5792 |
||
5082
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5793 |
realized := true. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5794 |
shown := true. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5795 |
... |
269 | 5796 |
|
5797 |
this created a race condition, if the view was |
|
5798 |
realized and shortly after unrealized - before the mapped event |
|
1379 | 5799 |
arrived. This lead to realized being set to true even thought the |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5800 |
view was not. |
1379 | 5801 |
Boy - that was a bad one (hard to reproduce and hard to find). |
269 | 5802 |
" |
5803 |
||
5804 |
realized ifTrue:[ |
|
5082
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5805 |
shownBefore := shown. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5806 |
|
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5807 |
"/ currently, the 'shown ifFalse:' optimization is |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5808 |
"/ not ok, since 'shown' is also modified by visibilityChanges. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5809 |
"/ Also, when remapped, X11 only sends a mapped event for the topView. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5810 |
"/ Therefore, synthetically generate those #superViewMapped messages |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5811 |
"/ in any case. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5812 |
|
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5813 |
shown := true. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5814 |
" |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5815 |
backed views will not get expose events - have |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5816 |
to force a redraw here to get things drawn into |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5817 |
backing store. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5818 |
" |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5819 |
backed ifTrue:[ |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5820 |
self redrawX:0 y:0 width:width height:height |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5821 |
]. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5822 |
|
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5823 |
"/ tell my subViews ... |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5824 |
subViews notNil ifTrue:[ |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5825 |
subViews do:[:v | v mapped |
2721 | 5826 |
"/ v shown ifFalse:[ |
5827 |
"/ v mapped |
|
5828 |
"/ ] |
|
5082
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5829 |
] |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5830 |
]. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5831 |
shownBefore ~~ true ifTrue:[ |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5832 |
self changed:#visibility. |
3b3aaba11664
only send visibility-change if there really is one when mapped
Claus Gittinger <cg@exept.de>
parents:
5060
diff
changeset
|
5833 |
] |
269 | 5834 |
] |
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
5835 |
|
1379 | 5836 |
"Modified: 25.2.1997 / 22:41:34 / cg" |
269 | 5837 |
! |
5838 |
||
2733
5af2417bc450
pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents:
2727
diff
changeset
|
5839 |
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime |
2701 | 5840 |
"the mouseWheel was turned - handle as a scroll operation. |
5841 |
Specialized application windows may redefine this for any other |
|
2709 | 5842 |
operation. |
5843 |
Here, we scroll some amount which depends upon the views contents height |
|
5844 |
(but never too much); |
|
5845 |
if shift is pressed, always scroll a single scroll-step; |
|
5846 |
if ctrl is pressed, always scroll one page." |
|
5847 |
||
5130 | 5848 |
|pageScroll amountToScroll zoomInOrOut sensor| |
2709 | 5849 |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
5850 |
sensor := self sensor. |
5130 | 5851 |
|
5852 |
UserPreferences current allowMouseWheelZoom ifTrue:[ |
|
5132 | 5853 |
zoomInOrOut := sensor ctrlDown. |
5130 | 5854 |
zoomInOrOut ifTrue:[ |
5855 |
self mouseWheelZoom:amount. |
|
5856 |
^ self. |
|
5857 |
]. |
|
5858 |
]. |
|
5859 |
||
5132 | 5860 |
pageScroll := sensor shiftDown. |
2709 | 5861 |
|
5862 |
pageScroll ifFalse:[ |
|
5130 | 5863 |
amountToScroll := self verticalScrollStep. |
5864 |
sensor shiftDown ifFalse:[ |
|
5865 |
amountToScroll := self scaleMouseWheelScrollAmount:amountToScroll. |
|
5866 |
] |
|
2709 | 5867 |
]. |
2701 | 5868 |
|
2699 | 5869 |
amount > 0 ifTrue:[ |
5130 | 5870 |
pageScroll ifTrue:[ |
5871 |
self pageUp |
|
5872 |
] ifFalse:[ |
|
5873 |
self scrollUp:amountToScroll |
|
5874 |
] |
|
2699 | 5875 |
] ifFalse:[ |
5130 | 5876 |
pageScroll ifTrue:[ |
5877 |
self pageDown |
|
5878 |
] ifFalse:[ |
|
5879 |
self scrollDown:amountToScroll |
|
5880 |
] |
|
2709 | 5881 |
]. |
5882 |
||
5883 |
"Modified: / 21.5.1999 / 19:58:42 / cg" |
|
2699 | 5884 |
! |
5885 |
||
5130 | 5886 |
mouseWheelZoom:amount |
5132 | 5887 |
"CTRL-wheel action. |
5888 |
ignored here - redefined in views which can zoom" |
|
5889 |
||
5133 | 5890 |
"/ self changeScaleForMouseWheelZoom:amount |
5130 | 5891 |
! |
5892 |
||
1381 | 5893 |
pointerEnter:state x:x y:y |
3087 | 5894 |
"mouse pointer entered - request the keyboard focus (sometimes)" |
5895 |
||
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5896 |
|doRequestFocus| |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5897 |
|
4968 | 5898 |
"/ first ask my flags if its enforced or forbidden |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5899 |
self requestFocusOnPointerEnter ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5900 |
doRequestFocus := true |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5901 |
] ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5902 |
self doNotRequestFocusOnPointerEnter ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5903 |
doRequestFocus := false |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5904 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5905 |
"/ then look for the settings. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5906 |
doRequestFocus := self wantsFocusWithPointerEnter |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5907 |
] |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5908 |
]. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5909 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
5910 |
doRequestFocus ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
5911 |
self requestFocus. |
4968 | 5912 |
]. |
1381 | 5913 |
! |
5914 |
||
269 | 5915 |
reparented |
5916 |
"the view has changed its parent by some outside |
|
5917 |
action - i.e. window manager has added a frame. |
|
5918 |
nothing done here" |
|
5919 |
||
5920 |
^ self |
|
5921 |
! |
|
5922 |
||
5923 |
saveAndTerminate |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5924 |
"window manager wants me to save and go away; |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5925 |
- notice, that not all window managers are nice enough to |
269 | 5926 |
send this event, but simply destroy the view instead. |
5927 |
Can be redefined in subclasses to do whatever is required |
|
5928 |
to prepare for restart." |
|
5929 |
||
2216
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5930 |
self closeRequest |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5931 |
|
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
5932 |
"Modified: / 3.8.1998 / 19:51:26 / cg" |
269 | 5933 |
! |
5934 |
||
4674 | 5935 |
scaleMouseWheelScrollAmount:amountToScroll |
4739 | 5936 |
|hCont factor innerHeight| |
5937 |
||
5938 |
"/ test whether innerHeight == 0 |
|
4855 | 5939 |
"/ could happen if the view is resized to 0 (panel) |
4739 | 5940 |
innerHeight := self innerHeight. |
5941 |
innerHeight > 0 ifFalse:[ ^ 1 ]. |
|
4674 | 5942 |
|
5943 |
hCont := self heightOfContents. |
|
4739 | 5944 |
hCont > (innerHeight * 3) ifTrue:[ |
4907 | 5945 |
factor := (hCont // innerHeight) min:4. |
5946 |
^ amountToScroll * factor. |
|
4834 | 5947 |
]. |
5948 |
^ amountToScroll |
|
4674 | 5949 |
! |
5950 |
||
269 | 5951 |
sizeChanged:how |
5952 |
"tell subviews if I change size. |
|
5953 |
How is either #smaller, #larger or nil, and is used to control the order, |
|
5954 |
in which subviews are notified (possibly reducing redraw activity)" |
|
5955 |
||
1290
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
5956 |
|subViews| |
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
5957 |
|
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
5958 |
(subViews := self subViews) notNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5959 |
(how isNil "false" |
3152 | 5960 |
or:[how == #smaller]) ifTrue:[ |
5961 |
subViews do:[:view | |
|
5962 |
view notNil ifTrue:[ |
|
5963 |
view containerChangedSize |
|
5964 |
] |
|
5965 |
] |
|
5966 |
] ifFalse:[ |
|
5967 |
"doing it reverse speeds up resizing - usually subviews |
|
5968 |
are created from top-left to bottom-right; therefore |
|
5969 |
bottom-right views will be moved/resized first, then top-left ones; |
|
5970 |
this avoids multiple redraws of subviews" |
|
5971 |
||
5972 |
subViews reverseDo:[:view | |
|
5973 |
view notNil ifTrue:[ |
|
5974 |
view containerChangedSize |
|
5975 |
] |
|
5976 |
] |
|
5977 |
] |
|
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
5978 |
]. |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
5979 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
5980 |
components notNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
5981 |
(how isNil "false" |
3152 | 5982 |
or:[how == #smaller]) ifTrue:[ |
5983 |
components do:[:view | |
|
5984 |
view containerChangedSize |
|
5985 |
] |
|
5986 |
] ifFalse:[ |
|
5987 |
"doing it reverse speeds up resizing - usually subviews |
|
5988 |
are created from top-left to bottom-right; therefore |
|
5989 |
bottom-right views will be moved/resized first, then top-left ones; |
|
5990 |
this avoids multiple redraws of subviews" |
|
5991 |
||
5992 |
components reverseDo:[:view | |
|
5993 |
view containerChangedSize |
|
5994 |
] |
|
5995 |
] |
|
135 | 5996 |
]. |
1290
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
5997 |
|
269 | 5998 |
self changed:#sizeOfView with:how. |
1290
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
5999 |
|
269 | 6000 |
superView notNil ifTrue:[ |
3152 | 6001 |
superView subViewChangedSize |
269 | 6002 |
] |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
6003 |
|
2084
e997f6ea54c2
also pass down #larger to sizeCanged: method.
Claus Gittinger <cg@exept.de>
parents:
2061
diff
changeset
|
6004 |
"Modified: / 2.4.1998 / 13:59:59 / cg" |
269 | 6005 |
! |
6006 |
||
6007 |
subViewChangedSize |
|
320
b7b8dc88fe9f
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
312
diff
changeset
|
6008 |
"some subview has changed its size; we are not interested |
269 | 6009 |
in that here, but some geometry managers redefine this, to reorganize |
6010 |
components if that happens." |
|
6011 |
||
6012 |
^ self |
|
6013 |
||
6014 |
"Created: 22.9.1995 / 14:44:59 / claus" |
|
6015 |
! |
|
6016 |
||
6017 |
terminate |
|
6018 |
"window manager wants me to go away; |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6019 |
- notice, that not all window managers are nice enough to |
269 | 6020 |
send this event, but simply destroy the view instead. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6021 |
Can be redefined in subclasses to do whatever cleanup is |
269 | 6022 |
required." |
6023 |
||
2216
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
6024 |
self closeRequest |
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
6025 |
|
a9d902b2cc4b
#terminate -> #closeRequest -> #destroy
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
6026 |
"Modified: / 3.8.1998 / 19:51:23 / cg" |
269 | 6027 |
! |
6028 |
||
6029 |
unmapped |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6030 |
"the view has been unmapped |
269 | 6031 |
(either by some outside action - i.e. window manager iconified me, |
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
6032 |
or due to unmapping of my parentView)." |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
6033 |
|
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
6034 |
"/ if I was previously shown, tell it to all of |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
6035 |
"/ my subviews (they remember this in the shown instVar) |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
6036 |
|
769 | 6037 |
"/ currently, the 'shown ifTrue:' optimization is |
964 | 6038 |
"/ not ok, since 'shown' is also modified by visibilityChanges. |
6039 |
"/ Also, when remapped, X11 only sends a mapped event for the topView. |
|
769 | 6040 |
"/ Therefore, synthetically generate those #superViewUnmapped messages |
6041 |
"/ in any case. |
|
4736 | 6042 |
|wdgr| |
769 | 6043 |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6044 |
shown ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6045 |
shown := false. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6046 |
self changed:#visibility. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6047 |
]. |
4736 | 6048 |
(wdgr := self windowGroup) notNil ifTrue:[ |
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6049 |
wdgr focusView == self ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6050 |
wdgr focusViewUnmapped. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6051 |
]. |
4736 | 6052 |
]. |
6053 |
||
1379 | 6054 |
subViews notNil ifTrue:[ |
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6055 |
subViews do:[:v | |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6056 |
v containerUnmapped |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6057 |
]. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6058 |
self changed:#visibility. |
1379 | 6059 |
] |
6060 |
||
6061 |
"Modified: 25.2.1997 / 22:40:52 / cg" |
|
135 | 6062 |
! |
6063 |
||
6064 |
visibilityChange:how |
|
6065 |
"the visibility of the view has changed (by some outside |
|
6066 |
action - i.e. window manager rearranged things). |
|
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
6067 |
Using this knowledge avoids useless redraw in obscured views." |
135 | 6068 |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6069 |
|shownBefore| |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6070 |
|
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6071 |
shownBefore := shown. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6072 |
|
135 | 6073 |
how == #fullyObscured ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
6074 |
shown := false |
135 | 6075 |
] ifFalse:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
6076 |
shown := true. |
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6077 |
]. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6078 |
shownBefore ~~ shown ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6079 |
self changed:#visibility. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6080 |
]. |
3139 | 6081 |
! |
6082 |
||
6083 |
visibilityStateChanged |
|
6084 |
"this is called when our visibilityChannel changes" |
|
6085 |
||
3410 | 6086 |
self isVisible:visibilityChannel value |
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6087 |
! |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6088 |
|
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6089 |
win32NativeScroll:scrollCode position:newPosition |
4834 | 6090 |
"this is generated by a native scrollBar widget. |
6091 |
We should never arrive here, as its only supposed to be |
|
6092 |
sent to scrollableViews..." |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6093 |
|
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6094 |
scrollCode == #SB_LINEDOWN ifTrue:[ |
4834 | 6095 |
self scrollDown. |
6096 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6097 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6098 |
scrollCode == #SB_LINEUP ifTrue:[ |
4834 | 6099 |
self scrollUp. |
6100 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6101 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6102 |
scrollCode == #SB_LINELEFT ifTrue:[ |
4834 | 6103 |
self scrollLeft. |
6104 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6105 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6106 |
scrollCode == #SB_LINERIGHT ifTrue:[ |
4834 | 6107 |
self scrollRight. |
6108 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6109 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6110 |
scrollCode == #SB_PAGEDOWN ifTrue:[ |
4834 | 6111 |
self pageDown. |
6112 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6113 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6114 |
scrollCode == #SB_PAGEUP ifTrue:[ |
4834 | 6115 |
self pageUp. |
6116 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6117 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6118 |
scrollCode == #SB_PAGELEFT ifTrue:[ |
4834 | 6119 |
self pageLeft. |
6120 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6121 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6122 |
scrollCode == #SB_PAGERIGHT ifTrue:[ |
4834 | 6123 |
self pageRight. |
6124 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6125 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6126 |
scrollCode == #SB_THUMBPOSITIONVERTICAL ifTrue:[ |
4834 | 6127 |
self scrollVerticalToPercent:newPosition. |
6128 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6129 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6130 |
scrollCode == #SB_THUMBPOSITIONHORIZONTAL ifTrue:[ |
4834 | 6131 |
self scrollHorizontalToPercent:newPosition. |
6132 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6133 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6134 |
scrollCode == #SB_THUMBTRACKVERTICAL ifTrue:[ |
4834 | 6135 |
self scrollVerticalToPercent:newPosition. |
6136 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6137 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6138 |
scrollCode == #SB_THUMBTRACKHORIZONTAL ifTrue:[ |
4834 | 6139 |
self scrollHorizontalToPercent:newPosition. |
6140 |
^ self. |
|
4833
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6141 |
]. |
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6142 |
|
384612cc7d37
win32NativeScroll:position: moved from ScrollableView
Claus Gittinger <cg@exept.de>
parents:
4825
diff
changeset
|
6143 |
scrollCode == #SB_ENDSCROLL ifTrue:[ |
4834 | 6144 |
^ self. |
6145 |
]. |
|
269 | 6146 |
! ! |
6147 |
||
1302 | 6148 |
!SimpleView methodsFor:'event simulation'! |
6149 |
||
6150 |
pushEvent:aSelector |
|
6151 |
"push some messageSend into my event queue - |
|
6152 |
I will perform the corresponding method when its time |
|
6153 |
to handle events (useful to update low-prio views from |
|
6154 |
a higher prio process, to avoid blocking in the high prio one)" |
|
6155 |
||
2143
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6156 |
^ self pushEvent:aSelector withArguments:#() |
1302 | 6157 |
|
6158 |
" |
|
6159 |
|v| |
|
6160 |
||
6161 |
v := View new openAndWait. |
|
6162 |
v fill:Color red. |
|
6163 |
v pushEvent:#redraw |
|
6164 |
" |
|
6165 |
||
2143
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6166 |
"Modified: / 10.6.1998 / 17:28:40 / cg" |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6167 |
! |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6168 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6169 |
pushEvent:aSelector with:arg |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6170 |
"push some 1-arg messageSend into my event queue - |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6171 |
I will perform the corresponding method when its time |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6172 |
to handle events (useful to update low-prio views from |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6173 |
a higher prio process, to avoid blocking in the high prio one)" |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6174 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6175 |
^ self pushEvent:aSelector withArguments:(Array with:arg) |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6176 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6177 |
"Created: / 10.6.1998 / 17:27:17 / cg" |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6178 |
! |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6179 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6180 |
pushEvent:aSelector with:arg1 with:arg2 |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6181 |
"push some 1-arg messageSend into my event queue - |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6182 |
I will perform the corresponding method when its time |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6183 |
to handle events (useful to update low-prio views from |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6184 |
a higher prio process, to avoid blocking in the high prio one)" |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6185 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6186 |
^ self pushEvent:aSelector withArguments:(Array with:arg1 with:arg2) |
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6187 |
|
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6188 |
"Created: / 10.6.1998 / 17:27:41 / cg" |
1302 | 6189 |
! |
6190 |
||
6191 |
pushEvent:aSelector withArguments:args |
|
6192 |
"push some messageSend into my event queue - |
|
6193 |
I will perform the corresponding method when its time |
|
6194 |
to handle events (useful to update low-prio views from |
|
6195 |
a higher prio process, to avoid blocking in the high prio one)" |
|
6196 |
||
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
6197 |
self sensor pushUserEvent:aSelector for:self withArguments:args |
1302 | 6198 |
|
6199 |
" |
|
6200 |
|v| |
|
6201 |
||
6202 |
v := (Button label:'hello') openAndWait. |
|
6203 |
Delay waitForSeconds:1. |
|
6204 |
v pushEvent:#buttonPress:x:y: withArguments:#(1 10 10). |
|
6205 |
Delay waitForSeconds:1. |
|
6206 |
v pushEvent:#buttonRelease:x:y: withArguments:#(1 10 10). |
|
6207 |
" |
|
6208 |
||
2143
d5b9c2e64ce9
added #pushEvent:with: and #pushEvent:with:with:
Claus Gittinger <cg@exept.de>
parents:
2138
diff
changeset
|
6209 |
"Modified: / 10.6.1998 / 17:28:16 / cg" |
4347 | 6210 |
! |
6211 |
||
6212 |
startButtonLongPressedHandlerProcess |
|
6213 |
"start a process, which simulates a right-button press if the left-button |
|
6214 |
has been pressed, but not released, and stayed pressed for a while. |
|
6215 |
This is very handy for single-button-mice, as used with the MAC" |
|
6216 |
||
6217 |
|p| |
|
6218 |
||
6219 |
self stopButtonLongPressedHandlerProcess. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6220 |
p := |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6221 |
[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6222 |
Delay waitForSeconds:0.7. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6223 |
self sensor leftButtonPressed ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6224 |
"/ simulate a right-button press |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6225 |
self buttonPress:2 x:0 y:0 |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6226 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6227 |
] newProcess. |
4347 | 6228 |
|
6229 |
device buttonLongPressedHandlerProcess:p. |
|
6230 |
p resume. |
|
6231 |
! |
|
6232 |
||
6233 |
stopButtonLongPressedHandlerProcess |
|
6234 |
"stop any long-button-pressed process" |
|
6235 |
||
6236 |
|p| |
|
6237 |
||
6238 |
(p := device buttonLongPressedHandlerProcess) notNil ifTrue:[ |
|
6239 |
"/ Transcript showCR:'stop'. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6240 |
device buttonLongPressedHandlerProcess:nil. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6241 |
p terminate. |
4347 | 6242 |
]. |
1302 | 6243 |
! ! |
6244 |
||
2506 | 6245 |
!SimpleView methodsFor:'focus handling'! |
6246 |
||
3150 | 6247 |
canTab |
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6248 |
"returns true if the widget is tabable" |
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6249 |
|
3375 | 6250 |
"/ ^ canTab == true |
6251 |
^ flagBits bitTest:FlagCanTab |
|
6252 |
! |
|
6253 |
||
6254 |
canTab:aBoolean |
|
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6255 |
"set widget tabable or not" |
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6256 |
|
3375 | 6257 |
"/ canTab := aBoolean |
6258 |
aBoolean ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6259 |
flagBits := flagBits bitOr:FlagCanTab |
3375 | 6260 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6261 |
flagBits := flagBits bitClear:FlagCanTab |
3375 | 6262 |
]. |
3150 | 6263 |
! |
6264 |
||
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6265 |
doNotRequestFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6266 |
"returns true if widget SHOULD NOT request the focus on pointer enter; |
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6267 |
if false is returned, the behavior depends upon the settings." |
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6268 |
|
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6269 |
^ flagBits bitTest:FlagDoNotRequestFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6270 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6271 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6272 |
doNotRequestFocusOnPointerEnter:aBoolean |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6273 |
"if true, setup that the widget SHOULD NOT request the focus on pointer enter; |
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6274 |
if false, the behavior depends upon the settings." |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6275 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6276 |
aBoolean ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6277 |
flagBits := flagBits bitOr:FlagDoNotRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6278 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6279 |
flagBits := flagBits bitClear:FlagDoNotRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6280 |
]. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6281 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6282 |
|
3155 | 6283 |
focusNext |
6284 |
"get next focus view to self |
|
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6285 |
Skip invisible, disabled or widgets the extent is to small" |
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6286 |
|
4736 | 6287 |
shown ifFalse:[^ nil]. |
6288 |
||
6289 |
^ self focusNextForWhich:[:v | v shown] |
|
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6290 |
! |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6291 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6292 |
focusNextChildAfter:aChildView |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6293 |
"get the next focus view after aChildView in mySelf or nil, |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6294 |
if there is none. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6295 |
Skip invisible or disabled widgets" |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6296 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6297 |
|viewInSubView index subviewsInFocusOrder| |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6298 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6299 |
shown ifFalse:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6300 |
subViews isNil ifTrue:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6301 |
subviewsInFocusOrder := self subviewsInFocusOrder. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6302 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6303 |
index := subviewsInFocusOrder identityIndexOf:aChildView. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6304 |
index == 0 ifTrue:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6305 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6306 |
subviewsInFocusOrder from:(index + 1) do:[:eachChildAfterTheOne | |
4834 | 6307 |
eachChildAfterTheOne shown ifTrue:[ |
6308 |
(eachChildAfterTheOne canTab and:[eachChildAfterTheOne enabled]) ifTrue:[ |
|
6309 |
^ eachChildAfterTheOne |
|
6310 |
]. |
|
6311 |
||
6312 |
(viewInSubView := eachChildAfterTheOne focusNext) notNil ifTrue:[ |
|
6313 |
^ viewInSubView |
|
6314 |
]. |
|
6315 |
]. |
|
3155 | 6316 |
]. |
6317 |
^ nil |
|
6318 |
! |
|
6319 |
||
4736 | 6320 |
focusNextForWhich:aCondition |
6321 |
"get next focus view to self |
|
6322 |
Skip invisible, disabled or widgets the extent is to small" |
|
6323 |
||
6324 |
|viewInSubView| |
|
6325 |
||
6326 |
self subviewsInFocusOrder do:[:aSubView| |
|
4834 | 6327 |
(aSubView canTab |
6328 |
and:[aSubView enabled |
|
6329 |
and:[aCondition value:aSubView]]) ifTrue:[ |
|
6330 |
^ aSubView |
|
6331 |
]. |
|
6332 |
||
6333 |
(viewInSubView := aSubView focusNextForWhich:aCondition) notNil ifTrue:[ |
|
6334 |
^ viewInSubView |
|
6335 |
] |
|
4736 | 6336 |
]. |
6337 |
^ nil |
|
6338 |
! |
|
6339 |
||
3155 | 6340 |
focusPrevious |
6341 |
"get previous focus view to self |
|
4446
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6342 |
Skip invisible & disabled widgets." |
49376dd5489f
dont want 'em ugly comments !!!!!
Claus Gittinger <cg@exept.de>
parents:
4433
diff
changeset
|
6343 |
|
3155 | 6344 |
|viewInSubView| |
6345 |
||
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6346 |
shown ifTrue:[ |
4834 | 6347 |
self subviewsInFocusOrder reverseDo:[:aSubView| |
6348 |
aSubView shown ifTrue:[ |
|
6349 |
viewInSubView := aSubView focusPrevious. |
|
6350 |
||
6351 |
viewInSubView notNil ifTrue:[ |
|
6352 |
^ viewInSubView |
|
6353 |
]. |
|
6354 |
(aSubView canTab and:[aSubView enabled]) ifTrue:[ |
|
6355 |
^ aSubView |
|
6356 |
]. |
|
6357 |
] |
|
6358 |
] |
|
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6359 |
]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6360 |
^ nil |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6361 |
! |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6362 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6363 |
focusPreviousChildBefore:aChildView |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6364 |
"get the previous focus view before aChildView in mySelf or nil, if there is none. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6365 |
Skip invisible or disabled widgets" |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6366 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6367 |
|viewInSubView index subviewsInFocusOrder| |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6368 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6369 |
shown ifFalse:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6370 |
subViews isNil ifTrue:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6371 |
subviewsInFocusOrder := self subviewsInFocusOrder. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6372 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6373 |
index := subviewsInFocusOrder identityIndexOf:aChildView. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6374 |
index == 0 ifTrue:[ ^ nil ]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6375 |
|
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6376 |
subviewsInFocusOrder from:1 to:(index - 1) reverseDo:[:eachChildBeforeTheOne | |
4834 | 6377 |
eachChildBeforeTheOne shown ifTrue:[ |
6378 |
(viewInSubView := eachChildBeforeTheOne focusPrevious) notNil ifTrue:[ |
|
6379 |
^ viewInSubView |
|
6380 |
]. |
|
6381 |
||
6382 |
(eachChildBeforeTheOne canTab and:[eachChildBeforeTheOne enabled]) ifTrue:[ |
|
6383 |
^ eachChildBeforeTheOne |
|
6384 |
]. |
|
6385 |
]. |
|
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6386 |
]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6387 |
"/ the code below allows for a notebooks tab-list to be reached |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6388 |
(self canTab and:[self enabled]) ifTrue:[ |
4834 | 6389 |
^ self |
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6390 |
]. |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6391 |
|
3155 | 6392 |
^ nil |
6393 |
! |
|
6394 |
||
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6395 |
requestDoNotFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6396 |
"returns true if widget SHOULD NOT request the focus on pointer enter; |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6397 |
if false is returned, the behavior depends upon the settings. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6398 |
" |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6399 |
^ flagBits bitTest:FlagDoNotRequestFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6400 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6401 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6402 |
requestDoNotFocusOnPointerEnter:aBoolean |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6403 |
"if true, setup that the widget SHOULD NOT request the focus on pointer enter; |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6404 |
if false, the behavior depends upon the settings. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6405 |
" |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6406 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6407 |
aBoolean ifTrue:[ |
3762 | 6408 |
flagBits := flagBits bitOr:FlagDoNotRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6409 |
] ifFalse:[ |
3762 | 6410 |
flagBits := flagBits bitClear:FlagDoNotRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6411 |
]. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6412 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6413 |
|
2506 | 6414 |
requestFocus |
6415 |
"request focus from my windowGroup; |
|
6416 |
typically, this is invoked when the mouse pointer enters a |
|
6417 |
widget. The request may or may not be ignored by the wGroup |
|
6418 |
(it will be ignored, if an explicit focus-change is currently |
|
6419 |
active - i.e. if the user tabbed into a widget)" |
|
6420 |
||
6421 |
windowGroup notNil ifTrue:[ |
|
3152 | 6422 |
^ windowGroup focusRequestFrom:self |
2506 | 6423 |
]. |
6424 |
^ true |
|
6425 |
! |
|
6426 |
||
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6427 |
requestFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6428 |
"returns true if widget SHOULD request the focus on pointer enter; |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6429 |
if false is returned, the behavior depends upon the settings. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6430 |
" |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6431 |
^ flagBits bitTest:FlagRequestFocusOnPointerEnter |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6432 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6433 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6434 |
requestFocusOnPointerEnter:aBoolean |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6435 |
"if true, setup that the widget SHOULD request the focus on pointer enter; |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6436 |
if false, the behavior depends upon the settings. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6437 |
" |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6438 |
|
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6439 |
aBoolean ifTrue:[ |
3762 | 6440 |
flagBits := flagBits bitOr:FlagRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6441 |
] ifFalse:[ |
3762 | 6442 |
flagBits := flagBits bitClear:FlagRequestFocusOnPointerEnter |
3590
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6443 |
]. |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6444 |
! |
8e942a9ff4aa
two more flags: request / doNotRequest focus on pointer enter
Claus Gittinger <cg@exept.de>
parents:
3586
diff
changeset
|
6445 |
|
2506 | 6446 |
showFocus:explicit |
6447 |
"highlight myself somehow to tell user that I have the focus. |
|
6448 |
If explicit is true, the focus came via focusStepping (i.e. tabbing); |
|
6449 |
if false, it came via the window manager (i.e. pointer entering). |
|
6450 |
Only change my border, if this is an explicit focusChange." |
|
6451 |
||
2907
901ffdc575a8
ask device if it supports borders
Claus Gittinger <cg@exept.de>
parents:
2886
diff
changeset
|
6452 |
|delta clrId bd| |
2506 | 6453 |
|
6454 |
explicit ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6455 |
(drawableId notNil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6456 |
and:[superView notNil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6457 |
and:[styleSheet notNil]]) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6458 |
(styleSheet at:#'focus.showBorder' default:true) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6459 |
(device supportsWindowBorder:(bd := DefaultFocusBorderWidth)) ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6460 |
(device supportsWindowBorder:(bd := 1)) ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6461 |
bd := 0. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6462 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6463 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6464 |
delta := bd - self borderWidth. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6465 |
delta ~~ 0 ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6466 |
(left == 0 or:[top == 0]) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6467 |
device resizeWindow:drawableId width:width-delta-delta height:height-delta-delta. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6468 |
] ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6469 |
device moveWindow:drawableId x:left-delta y:top-delta. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6470 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6471 |
device setWindowBorderWidth:bd in:drawableId. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6472 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6473 |
|
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6474 |
clrId := (DefaultFocusColor onDevice:device) colorId. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6475 |
clrId isNil ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6476 |
clrId := device blackpixel |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6477 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6478 |
device setWindowBorderColor:clrId in:drawableId. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6479 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6480 |
] |
2506 | 6481 |
] ifFalse:[ |
2560 | 6482 |
"/ superView notNil ifTrue:[ |
6483 |
"/ superView showFocus:explicit |
|
6484 |
"/ ] |
|
2506 | 6485 |
] |
6486 |
||
6487 |
"Modified: / 17.9.1998 / 15:08:34 / cg" |
|
6488 |
! |
|
6489 |
||
6490 |
showNoFocus:explicit |
|
6491 |
"undo the effect of showFocus. |
|
6492 |
Explicit tells if the focus came via focusStepping (i.e. tabbing) |
|
6493 |
or via the window manager (i.e. pointer entering). |
|
6494 |
Only change my border, if this is an explicit focusChange." |
|
6495 |
||
2907
901ffdc575a8
ask device if it supports borders
Claus Gittinger <cg@exept.de>
parents:
2886
diff
changeset
|
6496 |
|delta bd| |
2506 | 6497 |
|
6498 |
explicit ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6499 |
(drawableId notNil and:[superView notNil]) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6500 |
(styleSheet at:#'focus.showBorder' default:true) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6501 |
(device supportsWindowBorder:(bd := self borderWidth)) ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6502 |
(device supportsWindowBorder:(bd := 1)) ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6503 |
bd := 0. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6504 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6505 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6506 |
delta := DefaultFocusBorderWidth - bd. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6507 |
delta ~~ 0 ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6508 |
device setWindowBorderWidth:bd in:drawableId. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6509 |
device moveWindow:drawableId x:left y:top. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6510 |
device resizeWindow:drawableId width:width height:height. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6511 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6512 |
self setBorderColor. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6513 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6514 |
] |
2506 | 6515 |
] |
6516 |
||
6517 |
"Modified: / 17.9.1998 / 15:08:02 / cg" |
|
6518 |
! |
|
6519 |
||
4734
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6520 |
subviewsInFocusOrder |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6521 |
^ subViews ? #() |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6522 |
! |
cad9cacb9cde
focus handling changed: looking for subviewsInFocusOrder
ca
parents:
4720
diff
changeset
|
6523 |
|
4425 | 6524 |
takeFocus |
6525 |
"Unconditionally take the focus from my windowGroup" |
|
6526 |
||
6527 |
windowGroup notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6528 |
windowGroup focusView:self byTab:nil "/false. |
4425 | 6529 |
]. |
6530 |
! |
|
6531 |
||
2506 | 6532 |
wantsFocusWithButtonPress |
2741
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6533 |
"views which do not like to take the keyboard focus |
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6534 |
with buttonPress can do so by redefining this |
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6535 |
to return false" |
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6536 |
|
3087 | 6537 |
(self class == SimpleView) ifTrue:[ |
3762 | 6538 |
"/ a pure filler/geometric layout view |
6539 |
^ false |
|
3581
72e09769d372
do not take focus when disabled
Claus Gittinger <cg@exept.de>
parents:
3559
diff
changeset
|
6540 |
]. |
72e09769d372
do not take focus when disabled
Claus Gittinger <cg@exept.de>
parents:
3559
diff
changeset
|
6541 |
^ self enabled |
2741
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6542 |
! |
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6543 |
|
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6544 |
wantsFocusWithPointerEnter |
2506 | 6545 |
"views which like to take the keyboard focus |
2741
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6546 |
when the pointer enters can do so by redefining this |
2506 | 6547 |
to return true" |
6548 |
||
2741
7e85a327ce98
added extra query: #wantsFocusWithButtonPress
Claus Gittinger <cg@exept.de>
parents:
2733
diff
changeset
|
6549 |
^ false |
2506 | 6550 |
! ! |
6551 |
||
3087 | 6552 |
!SimpleView methodsFor:'grabbing'! |
6553 |
||
6554 |
forceUngrabKeyboard |
|
6555 |
"force a keyboard ungrab - even if was not the grabber" |
|
6556 |
||
6557 |
device ungrabKeyboard. |
|
6558 |
||
6559 |
! |
|
6560 |
||
6561 |
forceUngrabPointer |
|
6562 |
"force a pointer ungrab - even if was not the grabber" |
|
6563 |
||
6564 |
device ungrabPointer |
|
6565 |
||
6566 |
! |
|
6567 |
||
6568 |
grabKeyboard |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6569 |
"grab the keayboard - that is: report all keyboard events to myself, |
3087 | 6570 |
even if the mouse moved out of myself. |
6571 |
Returns true, if the grab was sucessfull (could fail, if some other |
|
6572 |
application has a grab - but thats very unlikely)." |
|
6573 |
||
6574 |
^ device grabKeyboardInView:self. |
|
6575 |
! |
|
6576 |
||
6577 |
grabPointer |
|
6578 |
"grab the pointer - that is: report all motion events relative to |
|
6579 |
myself, even if moved out of myself. |
|
6580 |
Returns true, if the grab was sucessfull (could fail, if some other |
|
6581 |
application has a grab - but thats very unlikely)." |
|
6582 |
||
6583 |
^ self grabPointerWithCursor:nil |
|
6584 |
! |
|
6585 |
||
6586 |
grabPointerWithCursor:aCursorOrNil |
|
6587 |
"grab the pointer - that is: report all motion events relative to |
|
6588 |
myself, even if moved out of myself. |
|
6589 |
Show aCursor during the grab, if the cursor argument is not nil. |
|
6590 |
Returns true, if the grab was sucessfull (could fail, if some other |
|
6591 |
application has a grab - but thats very unlikely)." |
|
6592 |
||
6593 |
||
6594 |
"/ (sensor := self sensor) notNil ifTrue:[ |
|
6595 |
"/ "/ make certain all X events have been received |
|
6596 |
"/ device sync. |
|
6597 |
"/ "/ now all events have been received. |
|
6598 |
"/ "/ now, flush all pointer events |
|
6599 |
"/ sensor flushMotionEventsFor:nil |
|
6600 |
"/ ]. |
|
6601 |
||
6602 |
aCursorOrNil notNil ifTrue:[ |
|
3762 | 6603 |
cursor := (aCursorOrNil onDevice:device). |
6604 |
^ device grabPointerInView:self withCursor:cursor |
|
3087 | 6605 |
]. |
6606 |
^ device grabPointerInView:self |
|
6607 |
! |
|
6608 |
||
6609 |
ungrabKeyboard |
|
6610 |
"ungrab the keyboard - but only if I was the grabber" |
|
6611 |
||
6612 |
|sensor| |
|
6613 |
||
6614 |
device activeKeyboardGrab == self ifTrue:[ |
|
3152 | 6615 |
(sensor := self sensor) notNil ifTrue:[ |
6616 |
"/ make certain all X events have been received |
|
6617 |
device sync. |
|
6618 |
"/ now all events have been received. |
|
6619 |
"/ now, flush all pointer events |
|
6620 |
sensor flushKeyboardFor:self |
|
6621 |
]. |
|
6622 |
device ungrabKeyboard. |
|
3087 | 6623 |
]. |
6624 |
||
6625 |
! |
|
6626 |
||
6627 |
ungrabPointer |
|
6628 |
"ungrab the pointer - but only if I was the grabber" |
|
6629 |
||
6630 |
|sensor| |
|
6631 |
||
6632 |
device activePointerGrab == self ifTrue:[ |
|
3152 | 6633 |
(sensor := self sensor) notNil ifTrue:[ |
6634 |
"/ make certain all X events have been received |
|
6635 |
device sync. |
|
6636 |
"/ now all events have been received. |
|
6637 |
"/ now, flush all pointer events |
|
6638 |
sensor flushMotionEventsFor:self |
|
6639 |
]. |
|
6640 |
device ungrabPointer. |
|
3087 | 6641 |
] |
6642 |
! ! |
|
6643 |
||
269 | 6644 |
!SimpleView methodsFor:'informing others of changes'! |
6645 |
||
6646 |
contentsChanged |
|
6647 |
"this one is sent, whenever contents changes size - |
|
6648 |
tell dependents about the change (i.e. scrollers)." |
|
6649 |
||
6650 |
self changed:#sizeOfContents |
|
6651 |
! |
|
6652 |
||
3383
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6653 |
noticeOfWindowClose |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6654 |
|app| |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6655 |
|
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6656 |
(app := self application) notNil ifTrue:[ |
3762 | 6657 |
app noticeOfWindowClose:self |
3383
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6658 |
]. |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6659 |
! |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6660 |
|
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6661 |
noticeOfWindowOpen |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6662 |
|app| |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6663 |
|
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6664 |
(app := self application) notNil ifTrue:[ |
3762 | 6665 |
app noticeOfWindowOpen:self |
3383
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6666 |
]. |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6667 |
! |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6668 |
|
269 | 6669 |
originChanged:delta |
6670 |
"this one is sent, after the origin of my contents has changed - |
|
6671 |
tell dependents (i.e. scrollers) about this" |
|
6672 |
||
3510 | 6673 |
(delta = (0@0)) ifTrue:[^ self]. |
269 | 6674 |
self changed:#originOfContents with:delta. |
6675 |
"/ subViews notNil ifTrue:[ |
|
6676 |
"/ subViews do:[:aSubView | |
|
6677 |
"/ aSubView pixelOrigin:((aSubView left @ aSubView top) - delta) |
|
6678 |
"/ ] |
|
6679 |
"/ ] |
|
6680 |
! |
|
6681 |
||
6682 |
originWillChange |
|
6683 |
"this one is sent, just before viewOrigin changes - |
|
6684 |
gives subclasses a chance to catch scrolls easily |
|
6685 |
(for example to hide cursor before scroll)" |
|
6686 |
||
6687 |
^ self |
|
6688 |
! ! |
|
6689 |
||
3165 | 6690 |
!SimpleView methodsFor:'initialization & release'! |
269 | 6691 |
|
6692 |
defaultControllerClass |
|
6693 |
^ nil "/ Controller |
|
6694 |
! |
|
6695 |
||
483
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6696 |
defaultExtent |
586 | 6697 |
"return the default extent of my instances." |
6698 |
||
483
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6699 |
^ self class defaultExtent |
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6700 |
|
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6701 |
"Created: 1.3.1996 / 19:20:46 / cg" |
586 | 6702 |
"Modified: 22.4.1996 / 23:38:27 / cg" |
483
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6703 |
! |
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6704 |
|
3662 | 6705 |
defaultFont |
6706 |
^ self class defaultFont |
|
6707 |
! |
|
6708 |
||
2573 | 6709 |
destroy |
6710 |
"unmap & destroy - make me invisible, destroy subviews then |
|
6711 |
make me unknown to the device" |
|
6712 |
||
6713 |
realized ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6714 |
self unmap. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6715 |
]. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6716 |
shown ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6717 |
shown := false. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6718 |
self changed:#visibility. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6719 |
]. |
2573 | 6720 |
|
6721 |
"/ controller notNil ifTrue:[ |
|
6722 |
"/ controller release. |
|
6723 |
"/ controller := nil. |
|
6724 |
"/ ]. |
|
6725 |
||
6726 |
subViews notNil ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6727 |
self destroySubViews. |
2573 | 6728 |
]. |
6729 |
superView notNil ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6730 |
superView removeSubView:self. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6731 |
superView := nil |
2573 | 6732 |
]. |
6733 |
super destroy. |
|
6734 |
||
3709 | 6735 |
self release. |
6736 |
||
2573 | 6737 |
"/ superView isNil ifTrue:[ |
6738 |
"/ device flush |
|
6739 |
"/ ]. |
|
6740 |
||
6741 |
controller notNil ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6742 |
controller release. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6743 |
controller := nil. |
2573 | 6744 |
]. |
6745 |
||
6746 |
windowGroup notNil ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6747 |
windowGroup removeView:self. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
6748 |
windowGroup := nil |
3383
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6749 |
]. |
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6750 |
|
111b54361247
postOpenedWith, windowEvent and noticeOfWindow-Whatever
tm
parents:
3382
diff
changeset
|
6751 |
self noticeOfWindowClose. |
2573 | 6752 |
! |
6753 |
||
269 | 6754 |
initEvents |
6755 |
"will be sent by create - can be redefined by subclasses to enable |
|
6756 |
view events" |
|
6757 |
||
6758 |
^ self |
|
6759 |
! |
|
6760 |
||
6761 |
initStyle |
|
6762 |
"this method sets up all style dependent things" |
|
6763 |
||
6764 |
self initStyleSheet. |
|
6765 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6766 |
self setBorderWidth:(DefaultBorderWidth ? 1). |
269 | 6767 |
viewBackground := DefaultViewBackgroundColor. |
6768 |
||
6769 |
DefaultLightColor notNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6770 |
lightColor := DefaultLightColor. |
269 | 6771 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6772 |
device hasGrayscales ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6773 |
(viewBackground isImageOrForm and:[viewBackground colorMap isNil]) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6774 |
lightColor := viewBackground averageColor lightened. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6775 |
] ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6776 |
lightColor := viewBackground lightened. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6777 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6778 |
DefaultLightColor := lightColor. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6779 |
] ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6780 |
" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6781 |
this seems strange: on B&W screens, we create the light color |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6782 |
darker than normal viewBackground (White) - |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6783 |
to make the boundary of the view visible |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6784 |
" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6785 |
lightColor := Color gray:50 |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6786 |
] |
269 | 6787 |
]. |
6788 |
DefaultShadowColor notNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6789 |
shadowColor := DefaultShadowColor. |
269 | 6790 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6791 |
shadowColor := Black |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6792 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6793 |
|
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6794 |
self borderColor:DefaultBorderColor. |
3669 | 6795 |
"/ font := self defaultFont. -- already done in #initialize |
2829 | 6796 |
font := font onDevice:device. |
747 | 6797 |
|
749 | 6798 |
"Modified: 28.5.1996 / 21:13:58 / cg" |
269 | 6799 |
! |
6800 |
||
6801 |
initStyleSheet |
|
6802 |
"this method gets the styleSheet" |
|
6803 |
||
6804 |
" |
|
6805 |
when coming here the first time, we read the styleSheet |
|
6806 |
and keep the values in fast class variables |
|
6807 |
" |
|
6808 |
StyleSheet isNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6809 |
DefaultStyle isNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6810 |
"/ the very-very first time (no styleSheet yet) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6811 |
View setDefaultStyle. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6812 |
View defaultStyle:DefaultStyle. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6813 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
6814 |
SimpleView updateAllStyleCaches |
269 | 6815 |
]. |
6816 |
||
6817 |
styleSheet := StyleSheet. |
|
1005
03041f7fb340
init styleSheet (in case no startup file did it)
Claus Gittinger <cg@exept.de>
parents:
997
diff
changeset
|
6818 |
|
03041f7fb340
init styleSheet (in case no startup file did it)
Claus Gittinger <cg@exept.de>
parents:
997
diff
changeset
|
6819 |
"Modified: 25.7.1996 / 22:00:06 / cg" |
269 | 6820 |
! |
6821 |
||
6822 |
initialize |
|
6823 |
"initialize all state of the view - usually redefined in subclasses, |
|
6824 |
but always doing a 'super initialize'. Each class should setup its |
|
6825 |
locals - and not forget the others. |
|
6826 |
View setup is separated into two parts, the general setup done here |
|
6827 |
and the style specific setup in initStyle. Each view should be prepared |
|
6828 |
for a stylechange by being sent another initStyle with a new style value. |
|
6829 |
(in this case, it should set all of its style-dependent things, but |
|
6830 |
leave the state and contents as-is)" |
|
6831 |
||
6832 |
|ext myClass controllerClass| |
|
6833 |
||
3375 | 6834 |
flagBits := 0. |
6835 |
||
269 | 6836 |
super initialize. |
6837 |
||
3662 | 6838 |
font := self defaultFont. |
4123 | 6839 |
font := font onDevice:device. |
269 | 6840 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
6841 |
shown := realized := false. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
6842 |
"/ hiddenOnRealize := false. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
6843 |
"/ explicitExtent := false. |
269 | 6844 |
|
6845 |
"fill in some defaults - some of them are usually redefined in subclasses |
|
6846 |
initialize methods" |
|
6847 |
||
6848 |
myClass := self class. |
|
5290 | 6849 |
"/ name := myClass name "asString" asLowercaseFirst. - now lazy |
269 | 6850 |
resources := myClass classResources. |
6851 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6852 |
level := margin := 0. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6853 |
self setBorderWidth:0. |
269 | 6854 |
|
6855 |
self initStyle. |
|
6856 |
||
483
32537786bca6
change defaultExtent protocol (ask inst first, then class)
Claus Gittinger <cg@exept.de>
parents:
472
diff
changeset
|
6857 |
ext := self defaultExtent. |
269 | 6858 |
left := top := 0. |
6859 |
width := ext x. |
|
6860 |
height := ext y. |
|
6861 |
||
3375 | 6862 |
self originChangedFlag:false. |
6863 |
self extentChangedFlag:false. |
|
6864 |
self cornerChangedFlag:false. |
|
2084
e997f6ea54c2
also pass down #larger to sizeCanged: method.
Claus Gittinger <cg@exept.de>
parents:
2061
diff
changeset
|
6865 |
bitGravity := #NorthWest. "/ nil. |
269 | 6866 |
viewGravity := nil. |
6867 |
||
6868 |
controllerClass := self defaultControllerClass. |
|
6869 |
controllerClass notNil ifTrue:[ |
|
5290 | 6870 |
controller := controllerClass new. |
6871 |
controller view:self. |
|
3967
ed1e413b0ded
invoke #initializeMiddleButtonMenu from #initialize;
Claus Gittinger <cg@exept.de>
parents:
3947
diff
changeset
|
6872 |
]. |
ed1e413b0ded
invoke #initializeMiddleButtonMenu from #initialize;
Claus Gittinger <cg@exept.de>
parents:
3947
diff
changeset
|
6873 |
|
ed1e413b0ded
invoke #initializeMiddleButtonMenu from #initialize;
Claus Gittinger <cg@exept.de>
parents:
3947
diff
changeset
|
6874 |
self initializeMiddleButtonMenu. |
2382 | 6875 |
|
6876 |
"Modified: / 1.10.1998 / 14:31:05 / cg" |
|
269 | 6877 |
! |
6878 |
||
6879 |
initializeMiddleButtonMenu |
|
3968 | 6880 |
"a place to initialize menu - this one is sent once when the view-object is initialized. |
6881 |
usually redefined in subclasses; default here is no menu. |
|
269 | 6882 |
Notice, that static middleButtonmenus are a historic thing in ST/X; |
3968 | 6883 |
you may prefer to create the menu dynamically." |
269 | 6884 |
|
6885 |
^ self |
|
6886 |
! |
|
6887 |
||
6888 |
prepareForReinit |
|
6889 |
super prepareForReinit. |
|
6890 |
windowGroup notNil ifTrue:[ |
|
3152 | 6891 |
windowGroup reinitialize |
269 | 6892 |
] |
6893 |
! |
|
6894 |
||
6895 |
reinitStyle |
|
6896 |
"this method is called for a style change" |
|
6897 |
||
6898 |
|t| |
|
6899 |
||
6900 |
self initStyle. |
|
3945
bdbc16f787dc
systemColorChange on windows
Claus Gittinger <cg@exept.de>
parents:
3926
diff
changeset
|
6901 |
(drawableId notNil and:[gcId notNil]) ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6902 |
"force a change" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6903 |
t := self borderWidth. self setBorderWidth:nil. self borderWidth:t. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6904 |
t := viewBackground. viewBackground := nil. self viewBackground:t. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6905 |
self clearView. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
6906 |
self invalidate. |
2357
29a966362aad
clear and invalidate in reinitStyle.
Claus Gittinger <cg@exept.de>
parents:
2355
diff
changeset
|
6907 |
]. |
29a966362aad
clear and invalidate in reinitStyle.
Claus Gittinger <cg@exept.de>
parents:
2355
diff
changeset
|
6908 |
|
29a966362aad
clear and invalidate in reinitStyle.
Claus Gittinger <cg@exept.de>
parents:
2355
diff
changeset
|
6909 |
"Modified: / 18.9.1998 / 21:15:33 / cg" |
269 | 6910 |
! |
6911 |
||
6912 |
reinitialize |
|
795 | 6913 |
"this is called right after snapIn" |
269 | 6914 |
|
2649 | 6915 |
|myController sv| |
269 | 6916 |
|
6917 |
"if I have already been reinited - return" |
|
6918 |
drawableId notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6919 |
^ self |
269 | 6920 |
]. |
6921 |
||
6922 |
" |
|
6923 |
superView must be there, first |
|
6924 |
" |
|
6925 |
superView notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6926 |
(sv := superView view) id isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6927 |
sv reinitialize |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6928 |
] |
2452
0c63e21efd57
(re)initCursor in reinitialize (i.e. after snapIn)
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
6929 |
]. |
0c63e21efd57
(re)initCursor in reinitialize (i.e. after snapIn)
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
6930 |
|
0c63e21efd57
(re)initCursor in reinitialize (i.e. after snapIn)
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
6931 |
"reinit cursor" |
0c63e21efd57
(re)initCursor in reinitialize (i.e. after snapIn)
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
6932 |
self initCursor. |
269 | 6933 |
|
6934 |
myController := controller. |
|
6935 |
controller := nil. |
|
6936 |
self recreate. |
|
6937 |
||
6938 |
"if I was mapped, do it again" |
|
6939 |
realized ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6940 |
"only remap if I have a superview - otherwise, I might be |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6941 |
a hidden iconView or menu ..." |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6942 |
superView notNil ifTrue:[ |
269 | 6943 |
"/ shown ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6944 |
device |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6945 |
moveResizeWindow:drawableId x:left y:top width:width height:height; |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6946 |
mapWindow:drawableId |
4907 | 6947 |
"/ mapView:self id:drawableId iconified:false |
6948 |
"/ atX:left y:top width:width height:height |
|
6949 |
"/ minExtent:(self minExtent) maxExtent:(self maxExtent) |
|
269 | 6950 |
"/ ]. |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6951 |
]. |
269 | 6952 |
]. |
6953 |
||
6954 |
"restore controller" |
|
2452
0c63e21efd57
(re)initCursor in reinitialize (i.e. after snapIn)
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
6955 |
controller := myController. |
795 | 6956 |
|
2649 | 6957 |
"Modified: / 6.5.1999 / 13:11:07 / cg" |
4372
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6958 |
! |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6959 |
|
4978
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6960 |
release |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6961 |
"remove all dependencies from the receiver" |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6962 |
|
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6963 |
visibilityChannel notNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6964 |
visibilityChannel retractInterestsFor:self. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
6965 |
visibilityChannel removeDependent:self. visibilityChannel := nil |
4978
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6966 |
]. |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6967 |
|
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6968 |
dependents := nil. |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6969 |
|
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6970 |
"Modified: 19.4.1996 / 10:31:35 / cg" |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6971 |
"Created: 11.6.1997 / 13:11:53 / cg" |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6972 |
! |
72d873c3eb05
must retract an interest - not remove dependent
Claus Gittinger <cg@exept.de>
parents:
4971
diff
changeset
|
6973 |
|
4372
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6974 |
restarted |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6975 |
"sent by my windowGroup, when restarted from an image. |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6976 |
Nothing done here, but can be redefined to perform any actions |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6977 |
required to reset some state after an image-restart. |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6978 |
|
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6979 |
Only top views (usually instances of TopView) get this message sent. |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6980 |
Since SimpleViews can act as a top view, too this message is implemented |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6981 |
in SimpleView" |
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6982 |
|
30c22dddafcf
Moved up #restarted to SimpleView
Stefan Vogel <sv@exept.de>
parents:
4352
diff
changeset
|
6983 |
^ self |
135 | 6984 |
! ! |
6985 |
||
3371 | 6986 |
!SimpleView methodsFor:'keyboard control'! |
6987 |
||
6988 |
defineShortcutAndTranslateLabelStringFrom:aString |
|
6989 |
|i| |
|
6990 |
||
6991 |
aString isString ifFalse:[ ^ aString]. |
|
6992 |
||
6993 |
(aString includes:$&) ifFalse:[ ^ aString]. |
|
6994 |
i := self shortcutAndTranslatedStringFrom:aString. |
|
6995 |
self shortcutKey:(i at:1). |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
6996 |
^ i at:2. |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
6997 |
! |
3371 | 6998 |
|
6999 |
mnemonicKey |
|
4492 | 7000 |
"get the mnemonic key or nil if undefined" |
4834 | 7001 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7002 |
^ self objectAttributeAt:#mnemonicKey |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7003 |
! |
3371 | 7004 |
|
4834 | 7005 |
mnemonicKey:aSymbolOrNil |
4492 | 7006 |
"set or clear the mnemonic key" |
4834 | 7007 |
|
3371 | 7008 |
aSymbolOrNil isSymbol ifTrue:[ |
4834 | 7009 |
self objectAttributeAt:#mnemonicKey put:aSymbolOrNil |
3371 | 7010 |
] ifFalse:[ |
4834 | 7011 |
self removeObjectAttribute:#mnemonicKey |
7012 |
]. |
|
7013 |
! |
|
7014 |
||
7015 |
mnemonicViewNext:aKeyEvent |
|
3371 | 7016 |
"a mnemonicKey event as forwarded from the keyboardProcessor - if there |
4492 | 7017 |
is the mnemonic-key defined for a subView return the view otherwise nil." |
4834 | 7018 |
|
3371 | 7019 |
|key rawKey mnemonic view| |
7020 |
||
4492 | 7021 |
key := aKeyEvent key. |
3371 | 7022 |
rawKey := aKeyEvent rawKey. |
4492 | 7023 |
(shown and:[ subViews notNil ]) ifTrue:[ |
4834 | 7024 |
subViews do:[:aSubView | |
7025 |
aSubView shown ifTrue:[ |
|
7026 |
(aSubView enabled |
|
7027 |
and:[ |
|
7028 |
(mnemonic := aSubView mnemonicKey) notNil |
|
7029 |
and:[ (mnemonic == rawKey or:[ mnemonic == key ]) ] |
|
7030 |
]) |
|
7031 |
ifTrue:[ ^ aSubView ]. |
|
7032 |
(view := aSubView mnemonicViewNext:aKeyEvent) notNil ifTrue:[ |
|
7033 |
^ view |
|
7034 |
]. |
|
7035 |
] |
|
7036 |
] |
|
3371 | 7037 |
]. |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7038 |
^ nil |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7039 |
! |
3371 | 7040 |
|
7041 |
performShortcutAction |
|
7042 |
"perform my shortcutKey action. |
|
7043 |
" |
|
3374 | 7044 |
"/ intentionally left blank here |
7045 |
! |
|
3371 | 7046 |
|
4834 | 7047 |
processShortcut:aKeyEvent |
3371 | 7048 |
"a shortcutKey event as forwarded from the keyboardProcessor - if there is the |
4492 | 7049 |
shortcut-key defined process the shortcut and return true otherwise false." |
4834 | 7050 |
|
3371 | 7051 |
|key| |
7052 |
||
7053 |
shown ifTrue:[ |
|
4834 | 7054 |
self enabled ifTrue:[ |
7055 |
(key := self shortcutKey) notNil ifTrue:[ |
|
7056 |
(key == aKeyEvent key or:[ key == aKeyEvent rawKey ]) ifTrue:[ |
|
7057 |
self requestFocus. |
|
7058 |
(controller ? self) performShortcutAction. |
|
7059 |
^ true |
|
7060 |
] |
|
7061 |
]. |
|
7062 |
]. |
|
7063 |
subViews notNil ifTrue:[ |
|
7064 |
subViews do:[:aSubView | |
|
7065 |
(aSubView processShortcut:aKeyEvent) ifTrue:[ |
|
7066 |
^ true |
|
7067 |
] |
|
7068 |
] |
|
7069 |
] |
|
3371 | 7070 |
]. |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7071 |
^ false |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7072 |
! |
3371 | 7073 |
|
7074 |
shortcutAndTranslatedStringFrom:aString |
|
7075 |
"return an array filled with an extracted shortcut key and a translated string; |
|
7076 |
looks for and reemoves any ampercent character from aString, and adds underline emphasis to the |
|
7077 |
following character" |
|
7078 |
||
3642 | 7079 |
|xLatedString c n s pos shortcutCharacter shortcut| |
3371 | 7080 |
|
7081 |
xLatedString := '' writeStream. |
|
7082 |
s := aString readStream. |
|
7083 |
||
7084 |
[s atEnd] whileFalse:[ |
|
3762 | 7085 |
c := s next. |
7086 |
c == $& ifTrue:[ |
|
7087 |
n := s peek. |
|
7088 |
(n notNil and:[n isLetter]) ifTrue:[ |
|
7089 |
c := s next. |
|
7090 |
pos := xLatedString size + 1. |
|
7091 |
] ifFalse:[ |
|
7092 |
n == $& ifTrue:[ |
|
7093 |
s next. |
|
7094 |
] |
|
7095 |
] |
|
7096 |
]. |
|
7097 |
c notNil ifTrue:[ |
|
7098 |
xLatedString nextPut:c |
|
7099 |
] |
|
3371 | 7100 |
]. |
7101 |
||
7102 |
xLatedString := xLatedString contents. |
|
7103 |
pos notNil ifTrue:[ |
|
3762 | 7104 |
shortcutCharacter := xLatedString at:pos ifAbsent:nil. |
7105 |
||
7106 |
xLatedString isText ifFalse:[ |
|
7107 |
xLatedString := Text string:xLatedString |
|
7108 |
]. |
|
7109 |
xLatedString emphasisAt:pos add:#underline. |
|
7110 |
||
7111 |
shortcut := ('Cmd' , shortcutCharacter asLowercase) asSymbol. |
|
3371 | 7112 |
]. |
7113 |
^ Array with:shortcut with:xLatedString |
|
7114 |
||
7115 |
" |
|
7116 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello' ) last |
|
7117 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&llo' ) last |
|
7118 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&&llo' ) last |
|
7119 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he& llo' ) last |
|
7120 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&123llo' ) last |
|
7121 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello &' ) last |
|
7122 |
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello &&' ) last |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7123 |
" |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7124 |
! |
3371 | 7125 |
|
7126 |
shortcutKey |
|
4492 | 7127 |
"get the shortcut key" |
4834 | 7128 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7129 |
^ self objectAttributeAt:#shortcutKey |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7130 |
! |
3371 | 7131 |
|
4834 | 7132 |
shortcutKey:aSymbolOrNil |
4492 | 7133 |
"set or clear the shortcut key" |
4834 | 7134 |
|
4492 | 7135 |
aSymbolOrNil notNil ifTrue:[ |
4834 | 7136 |
self objectAttributeAt:#shortcutKey put:aSymbolOrNil |
3371 | 7137 |
] ifFalse:[ |
4834 | 7138 |
self removeObjectAttribute:#shortcutKey |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7139 |
]. |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
7140 |
! ! |
3371 | 7141 |
|
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7142 |
!SimpleView methodsFor:'menu handling'! |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7143 |
|
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7144 |
activateMenu |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7145 |
"activate my menu. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7146 |
This code will move into the controller ASAP |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7147 |
If there is a static middleButtonMenu, that one is taken, |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7148 |
and handled in the superClass (static menus are a historic leftOver). |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7149 |
Otherwise, the follwing steps are performed: |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7150 |
|
4834 | 7151 |
- ask the receiver for the menu (via #yellowButtonMenu) |
7152 |
- ask the receiver for the menuPerformer. |
|
7153 |
- startUp the menu - it is supposed to return an actionSelector |
|
7154 |
- if the menuPerformer responds to the selector, |
|
7155 |
send it to the performer; |
|
7156 |
otherwise send it to the view (the receiver) |
|
7157 |
This is funny, it allows additional menuItems to be added |
|
7158 |
AND still get the views copy/cut/paste functionality. |
|
7159 |
Without this, you had to redefine and forward all of those |
|
7160 |
messages in the performer." |
|
2489
f7ce16896fa1
process exposes when menu closes.
Claus Gittinger <cg@exept.de>
parents:
2465
diff
changeset
|
7161 |
|
f7ce16896fa1
process exposes when menu closes.
Claus Gittinger <cg@exept.de>
parents:
2465
diff
changeset
|
7162 |
|menu menuPerformer actionSelector prevReceiver wg| |
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7163 |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
7164 |
self middleButtonMenu isNil ifTrue:[ |
4834 | 7165 |
" |
7166 |
try ST-80 style menus first: |
|
7167 |
if there is a model, and a menuMessage is defined, |
|
7168 |
ask model for the menu and launch that if non-nil. |
|
7169 |
" |
|
7170 |
menu := self yellowButtonMenu. |
|
7171 |
menu notNil ifTrue:[ |
|
7172 |
" |
|
7173 |
got one, launch the menu. It is supposed |
|
7174 |
to return an actionSelector. |
|
7175 |
" |
|
7176 |
menuPerformer := self menuPerformer value. |
|
7177 |
||
7178 |
"/ could be a spec ... |
|
7179 |
menu isArray ifTrue:[ |
|
7180 |
menu := menu decodeAsLiteralArray. |
|
7181 |
menu receiver:menuPerformer. |
|
7182 |
menu findGuiResourcesIn:(self menuHolder). |
|
7183 |
] ifFalse:[ |
|
7184 |
(menu respondsTo:#receiver) ifTrue:[ |
|
7185 |
menuPerformer := menu receiver ? menuPerformer. |
|
7186 |
]. |
|
7187 |
]. |
|
7188 |
||
7189 |
" |
|
7190 |
a temporary kludge: |
|
7191 |
pass myself as receiver, the menuPerformer as performer; |
|
7192 |
the menu will send its messages to either the |
|
7193 |
menuPerformer or me (its receiver). |
|
7194 |
This allows for the ST-80 behavior, where some messages |
|
7195 |
go to the model, others to the view |
|
7196 |
(copy/cut/paste). |
|
7197 |
" |
|
7198 |
(prevReceiver := menu receiver) isNil ifTrue:[ |
|
7199 |
"/ kludge for oldStyle menus (MenuView/PopUpMenu) |
|
7200 |
"/ not req'd for real Menus |
|
7201 |
"/ (menu isKindOf:Menu) ifFalse:[ |
|
7202 |
(menu respondsTo:#menuPerformer:) ifTrue:[ |
|
7203 |
menu receiver:self. "/ really ? |
|
7204 |
menu menuPerformer:menuPerformer. |
|
7205 |
] ifFalse:[ |
|
7206 |
"/ ] ifTrue:[ |
|
7207 |
"/ new style menu |
|
7208 |
menu receiver:menuPerformer. |
|
7209 |
] |
|
7210 |
]. |
|
7211 |
||
7212 |
"/ |
|
7213 |
"/ startup the menu - this returns a selector |
|
7214 |
"/ |
|
7215 |
actionSelector := self startUpMenu:menu. |
|
7216 |
||
7217 |
"/ before doing anything else, redraw expose area from |
|
7218 |
"/ the menu (in case the action changes my state) |
|
7219 |
(wg := self windowGroup) notNil ifTrue:[ |
|
7220 |
wg processExposeEvents. |
|
7221 |
]. |
|
7222 |
||
7223 |
(actionSelector notNil and:[actionSelector isSymbol]) ifTrue:[ |
|
7224 |
self dispatchMenuSelection:actionSelector to: menuPerformer. |
|
7225 |
]. |
|
7226 |
||
7227 |
menu receiver:prevReceiver. |
|
7228 |
||
7229 |
^ self |
|
7230 |
]. |
|
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7231 |
]. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7232 |
|
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7233 |
"/ |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7234 |
"/ old style static menu |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7235 |
"/ |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7236 |
super activateMenu |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7237 |
|
2127 | 7238 |
"Created: / 1.3.1996 / 13:24:18 / cg" |
2246
8666105a8750
care for menuPerformer, when using newStyle menu in
Claus Gittinger <cg@exept.de>
parents:
2243
diff
changeset
|
7239 |
"Modified: / 14.8.1998 / 18:09:31 / cg" |
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7240 |
! |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7241 |
|
3241 | 7242 |
dispatchMenuSelection:menuSelection to:aMenuPerformerOrNil |
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7243 |
"dispatch a menu message. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7244 |
This code will move into the controller ASAP" |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7245 |
|
1943 | 7246 |
|actionSelector actionArg1 actionArg2 app menuPerformer| |
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7247 |
|
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7248 |
actionSelector := menuSelection. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7249 |
|
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7250 |
" |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7251 |
mhmh - kludge for selectors with argument |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7252 |
" |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7253 |
(menuSelection isMemberOf:Array) ifTrue:[ |
3762 | 7254 |
actionArg1 := menuSelection at:2. |
7255 |
actionSelector := menuSelection at:1. |
|
3241 | 7256 |
]. |
7257 |
||
7258 |
menuPerformer := aMenuPerformerOrNil ? self menuPerformer. |
|
1839 | 7259 |
|
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7260 |
" |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7261 |
mhmh - ST-80 seems to send some to the model and |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7262 |
others (copy/cut/paste) to the controller/view |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7263 |
Simulate this behavior, by looking what the model responds to. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7264 |
" |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7265 |
actionSelector isSymbol ifTrue:[ |
3762 | 7266 |
(menuPerformer respondsTo:actionSelector) ifFalse:[ |
7267 |
((app := self application) respondsTo:actionSelector) ifTrue:[ |
|
7268 |
menuPerformer := app. |
|
7269 |
actionArg1 := self model. |
|
7270 |
actionArg2 := self controller. |
|
7271 |
] ifFalse:[ |
|
7272 |
(self respondsTo:actionSelector) ifTrue:[ |
|
7273 |
menuPerformer := self |
|
7274 |
] |
|
7275 |
] |
|
7276 |
]. |
|
7277 |
menuPerformer perform:actionSelector withOptionalArgument:actionArg1 and:actionArg2. |
|
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7278 |
]. |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7279 |
|
1943 | 7280 |
"Created: / 20.6.1997 / 11:47:42 / cg" |
7281 |
"Modified: / 1.11.1997 / 13:45:23 / cg" |
|
3533 | 7282 |
! |
7283 |
||
7284 |
menuFromSpec:aMenuOrMenuSpec |
|
7285 |
"create a menu for the receiver from a spec" |
|
7286 |
||
3559 | 7287 |
|spec| |
7288 |
||
7289 |
aMenuOrMenuSpec isNil ifTrue:[^ nil]. |
|
3533 | 7290 |
|
7291 |
aMenuOrMenuSpec isArray ifTrue:[ |
|
3762 | 7292 |
spec := aMenuOrMenuSpec decodeAsLiteralArray. |
3533 | 7293 |
] ifFalse:[ |
3762 | 7294 |
spec := aMenuOrMenuSpec. |
3533 | 7295 |
]. |
3556
eaea177415b0
findGuiResources... now sets the receiver, if not yet set
Claus Gittinger <cg@exept.de>
parents:
3540
diff
changeset
|
7296 |
"/ spec receiver:self. -- now done in findGuiResources ... |
3533 | 7297 |
spec findGuiResourcesIn:self. |
7298 |
^ spec. |
|
3752 | 7299 |
! |
7300 |
||
7301 |
startUpMenu:aMenu |
|
3753 | 7302 |
^ aMenu startUpFor:self |
1759
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7303 |
! ! |
f4cd63a4d736
extracted menu dispatch code into sep. method.
Claus Gittinger <cg@exept.de>
parents:
1756
diff
changeset
|
7304 |
|
140 | 7305 |
!SimpleView methodsFor:'private'! |
7306 |
||
659 | 7307 |
componentsContainingX:x y:y do:aBlock |
4609 | 7308 |
(x isNil or:[y isNil]) ifTrue:[ |
4834 | 7309 |
"/ delegated |
7310 |
^ self |
|
4609 | 7311 |
]. |
7312 |
||
659 | 7313 |
components notNil ifTrue:[ |
4834 | 7314 |
components reverseDo:[:aComponent | |
7315 |
|thisFrame| |
|
7316 |
||
7317 |
thisFrame := aComponent bounds. |
|
7318 |
(thisFrame containsPointX:x y:y) ifTrue:[ |
|
7319 |
"/ prepare for masked/non-rectangular components ... |
|
7320 |
(aComponent perform:#containsPointX:y: with:x with:y ifNotUnderstood:true) |
|
7321 |
ifTrue:[ |
|
7322 |
aBlock value:aComponent |
|
7323 |
value:x - thisFrame left |
|
7324 |
value:y - thisFrame top. |
|
7325 |
] |
|
7326 |
] |
|
7327 |
] |
|
4609 | 7328 |
]. |
7329 |
||
7330 |
"Created: / 08-05-1996 / 23:40:59 / cg" |
|
7331 |
"Modified: / 13-09-2006 / 18:55:30 / User" |
|
659 | 7332 |
! |
7333 |
||
140 | 7334 |
computeInnerClip |
7335 |
"compute, but do not set the inside clip-area" |
|
7336 |
||
7337 |
|m2 nX nY nW nH| |
|
7338 |
||
4139 | 7339 |
margin isNil ifTrue:[margin := 0]. |
140 | 7340 |
(margin ~~ 0) ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7341 |
m2 := margin + margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7342 |
nX := nY := margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7343 |
nW := width - m2. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7344 |
nH := height - m2. |
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7345 |
"/ transformation notNil ifTrue:[ |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7346 |
"/ nX := transformation applyInverseToX:nX. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7347 |
"/ nY := transformation applyInverseToY:nY. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7348 |
"/ nW := transformation applyInverseScaleX:nW. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7349 |
"/ nH := transformation applyInverseScaleY:nH. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7350 |
"/ ]. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7351 |
innerClipRect := Rectangle |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7352 |
left:nX |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7353 |
top:nY |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7354 |
width:nW |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7355 |
height:nH |
140 | 7356 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7357 |
"no clipping" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7358 |
innerClipRect := nil |
140 | 7359 |
] |
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7360 |
|
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7361 |
"Modified: / 22.5.1999 / 16:50:58 / cg" |
140 | 7362 |
! |
7363 |
||
269 | 7364 |
cornerFromRelativeCorner |
7365 |
"compute & return pixel corner from relativeCorner" |
|
7366 |
||
7367 |
^ self cornerFromRelativeCorner:relativeCorner |
|
7368 |
! |
|
7369 |
||
7370 |
cornerFromRelativeCorner:aPoint |
|
7371 |
"compute & return pixel corner from a relativeCorner, aPoint" |
|
7372 |
||
7373 |
|p r b bw| |
|
7374 |
||
7375 |
p := self pointFromRelative:aPoint. |
|
7376 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7377 |
bw := self borderWidth ? 0. |
269 | 7378 |
insets isNil ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7379 |
bw == 0 ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7380 |
^ p |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7381 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7382 |
^ (p x - bw) @ (p y - bw) |
269 | 7383 |
]. |
7384 |
r := (insets at:3) + bw. |
|
7385 |
b := (insets at:4) + bw. |
|
7386 |
||
7387 |
"/ r := b := bw. |
|
7388 |
"/ rightInset notNil ifTrue:[ |
|
7389 |
"/ r := rightInset + bw |
|
7390 |
"/ ]. |
|
7391 |
"/ bottomInset notNil ifTrue:[ |
|
7392 |
"/ b := bottomInset + bw |
|
7393 |
"/ ]. |
|
7394 |
((r ~~ 0) or:[b ~~ 0]) ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7395 |
^ (p x - r) @ (p y - b) |
269 | 7396 |
]. |
7397 |
^ p |
|
2382 | 7398 |
|
7399 |
"Modified: / 1.10.1998 / 13:21:33 / cg" |
|
269 | 7400 |
! |
7401 |
||
3518
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7402 |
detectViewAt:aPoint |
3540 | 7403 |
"find the subView which contains aPoint - invisible components are ignored. |
7404 |
This is almost the same as #componentContainingX:y: (if that existed) " |
|
7405 |
||
7406 |
^ self detectViewAt:aPoint ignoreInvisible:false |
|
7407 |
! |
|
7408 |
||
7409 |
detectViewAt:aPoint ignoreInvisible:ignoreInvisible |
|
7410 |
"find the subView which contains aPoint - invisible components are ignored if |
|
7411 |
the ignoreInvisible argument is false. |
|
3518
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7412 |
This is almost the same as #componentContainingX:y: (if that existed) " |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7413 |
|
3642 | 7414 |
|subViews| |
3518
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7415 |
|
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7416 |
(subViews := self subViews) notNil ifTrue:[ |
3762 | 7417 |
subViews do:[:v| |p| |
7418 |
(ignoreInvisible or:[v shown]) ifTrue:[ |
|
7419 |
( (aPoint x between:(v left) and:(v right)) |
|
7420 |
and:[aPoint y between:(v top) and:(v bottom)] |
|
7421 |
) ifTrue:[ |
|
7422 |
"/ found a subview - the point is there |
|
7423 |
p := device translatePoint:aPoint fromView:self toView:v. |
|
7424 |
^ v detectViewAt:p ignoreInvisible:ignoreInvisible. |
|
7425 |
] |
|
7426 |
] |
|
7427 |
] |
|
3518
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7428 |
]. |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7429 |
"/ no subview - the point is here |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7430 |
^ self |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7431 |
|
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7432 |
"Modified: / 10.10.2001 / 13:45:26 / cg" |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7433 |
! |
983e7730a905
use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
3516
diff
changeset
|
7434 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7435 |
explicitExtent:aBoolean |
5060
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7436 |
"set the exeplicit extent flag to aBoolean." |
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7437 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7438 |
aBoolean ifTrue:[ |
5060
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7439 |
flagBits := flagBits bitOr:FlagHasExplicitExtent |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7440 |
] ifFalse:[ |
5060
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7441 |
flagBits := flagBits bitClear:FlagHasExplicitExtent |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7442 |
]. |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7443 |
! |
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
7444 |
|
269 | 7445 |
extentFromRelativeExtent |
7446 |
"compute & return pixel extent from relativeExtent" |
|
7447 |
||
7448 |
^ self extentFromRelativeExtent:relativeExtent |
|
7449 |
! |
|
7450 |
||
7451 |
extentFromRelativeExtent:aPoint |
|
7452 |
"compute & return pixel extent from relativeExtent, aPoint" |
|
7453 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7454 |
|rel newX newY inRect bw bw2 i| |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7455 |
|
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7456 |
bw := self borderWidth ? 0. |
269 | 7457 |
|
7458 |
superView isNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7459 |
inRect := 0@0 extent:device extent |
269 | 7460 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7461 |
inRect := superView viewRectangle. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7462 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7463 |
|
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7464 |
bw2 := bw * 2. |
269 | 7465 |
|
7466 |
rel := aPoint x. |
|
7467 |
rel isInteger ifFalse:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7468 |
newX := (rel * (inRect width + bw2)) asInteger + inRect left. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7469 |
(bw ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7470 |
newX := newX - bw |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7471 |
]. |
269 | 7472 |
] ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7473 |
newX := rel |
269 | 7474 |
]. |
7475 |
||
7476 |
rel := aPoint y. |
|
7477 |
rel isInteger ifFalse:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7478 |
newY := (rel * (inRect height + bw2)) asInteger + inRect top. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7479 |
(bw ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7480 |
newY := newY - bw |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7481 |
]. |
269 | 7482 |
] ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7483 |
newY := rel |
269 | 7484 |
]. |
7485 |
||
7486 |
insets notNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7487 |
i := insets at:1. "top" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7488 |
(i ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7489 |
newX := newX - i |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7490 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7491 |
i := insets at:3. "left" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7492 |
(i ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7493 |
newX := newX - i |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7494 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7495 |
i := insets at:2. "right" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7496 |
(i ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7497 |
newY := newY - i |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7498 |
]. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7499 |
i := insets at:4. "bottom" |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7500 |
(i ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7501 |
newY := newY - i |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7502 |
]. |
269 | 7503 |
]. |
7504 |
^ newX @ newY |
|
7505 |
! |
|
7506 |
||
7507 |
originFromRelativeOrigin |
|
7508 |
"compute & return pixel origin from relativeOrigin" |
|
7509 |
||
7510 |
^ self originFromRelativeOrigin:relativeOrigin |
|
7511 |
! |
|
7512 |
||
7513 |
originFromRelativeOrigin:aPoint |
|
7514 |
"compute & return pixel origin from relativeOrigin, aPoint" |
|
7515 |
||
7516 |
|p l t| |
|
7517 |
||
7518 |
p := self pointFromRelative:aPoint. |
|
7519 |
||
7520 |
insets isNil ifTrue:[ |
|
3152 | 7521 |
^ p |
269 | 7522 |
]. |
7523 |
l := insets at:1. |
|
7524 |
t := insets at:2. |
|
7525 |
||
7526 |
"/ l := t := 0. |
|
7527 |
"/ leftInset notNil ifTrue:[ |
|
7528 |
"/ l := leftInset |
|
7529 |
"/ ]. |
|
7530 |
"/ topInset notNil ifTrue:[ |
|
7531 |
"/ t := topInset |
|
7532 |
"/ ]. |
|
7533 |
((l ~~ 0) or:[t ~~ 0]) ifTrue:[ |
|
3152 | 7534 |
^ (p x + l) @ (p y + t) |
269 | 7535 |
]. |
7536 |
^ p |
|
7537 |
! |
|
7538 |
||
7539 |
pixelCorner:corner |
|
7540 |
"set the views corner in pixels" |
|
7541 |
||
7542 |
|w h| |
|
7543 |
||
7544 |
w := corner x - left + 1. |
|
7545 |
h := corner y - top + 1. |
|
7546 |
self pixelOrigin:(left @ top) extent:(w @ h) |
|
7547 |
||
7548 |
"Modified: 31.8.1995 / 18:20:22 / claus" |
|
7549 |
! |
|
7550 |
||
7551 |
pixelExtent:extent |
|
7552 |
"set the views extent in pixels" |
|
7553 |
||
7554 |
self pixelOrigin:(left @ top) extent:extent |
|
7555 |
! |
|
7556 |
||
1363 | 7557 |
pixelOrigin |
7558 |
"return the views origin in pixels. For subviews. the origin is relative |
|
7559 |
to the superviews top-left. For topViews, its the screen origin." |
|
7560 |
||
7561 |
^ self computeOrigin |
|
7562 |
! |
|
7563 |
||
269 | 7564 |
pixelOrigin:origin |
7565 |
"set the views origin in pixels. For subviews. the origin is relative |
|
7566 |
to the superviews top-left. For topViews, its the screen origin." |
|
7567 |
||
7568 |
|newLeft newTop| |
|
7569 |
||
7570 |
newLeft := origin x. |
|
7571 |
newTop := origin y. |
|
7572 |
((newTop ~~ top) or:[newLeft ~~ left]) ifTrue:[ |
|
3152 | 7573 |
top := newTop. |
7574 |
left := newLeft. |
|
7575 |
||
7576 |
" |
|
7577 |
if the receiver is visible, or is a topView, perform the |
|
7578 |
operation right away - otherwise, simply remember that the |
|
7579 |
origin has changed - will tell the display once we get realized |
|
7580 |
" |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7581 |
"/ (shown |
269 | 7582 |
"/ or:[superView isNil and:[drawableId notNil]]) ifTrue:[ |
7583 |
||
3152 | 7584 |
"/ no, have to do it if drawableId is there |
7585 |
"/ (otherwise, we could not move unmapped views around ... |
|
7586 |
"/ |
|
7587 |
drawableId notNil ifTrue:[ |
|
7588 |
device moveWindow:drawableId x:left y:top |
|
7589 |
] ifFalse:[ |
|
3375 | 7590 |
self originChangedFlag:true |
3152 | 7591 |
] |
269 | 7592 |
] |
7593 |
! |
|
7594 |
||
7595 |
pixelOrigin:origin corner:corner |
|
7596 |
"set the views origin and corner in pixels" |
|
7597 |
||
7598 |
|w h| |
|
7599 |
||
7600 |
w := corner x - origin x + 1. |
|
7601 |
h := corner y - origin y + 1. |
|
7602 |
self pixelOrigin:origin extent:(w @ h) |
|
7603 |
||
7604 |
"Modified: 31.8.1995 / 18:24:16 / claus" |
|
7605 |
! |
|
7606 |
||
140 | 7607 |
pixelOrigin:origin extent:extent |
7608 |
"set the views origin and extent in pixels" |
|
7609 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7610 |
|newLeft newTop newWidth newHeight how |
140 | 7611 |
mustRedrawBottomEdge mustRedrawRightEdge mustRepaintBottom |
3340 | 7612 |
mustRepaintRight sameOrigin oldWidth oldHeight oldPaint| |
140 | 7613 |
|
7614 |
newLeft := origin x. |
|
7615 |
newTop := origin y. |
|
7616 |
sameOrigin := ((newTop == top) and:[newLeft == left]). |
|
7617 |
||
7618 |
newWidth := extent x. |
|
7619 |
newHeight := extent y. |
|
7620 |
||
7621 |
" |
|
7622 |
X complains badly if you try to create/resize a view with |
|
7623 |
a dimension <= 0 ... (although I think that 0 maks sense ...) |
|
7624 |
" |
|
7625 |
newWidth < 1 ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7626 |
newWidth := 1. |
140 | 7627 |
]. |
7628 |
newHeight < 1 ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7629 |
newHeight := 1 |
140 | 7630 |
]. |
7631 |
||
7632 |
((newWidth == width) and:[newHeight == height]) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7633 |
sameOrigin ifTrue:[^ self]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7634 |
self changed:#origin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7635 |
^ self pixelOrigin:origin |
140 | 7636 |
]. |
7637 |
top := newTop. |
|
7638 |
left := newLeft. |
|
7639 |
||
7640 |
"/ shown ifTrue:[ "4-nov-94 actually correct," |
|
7641 |
drawableId notNil ifTrue:[ "but theres a bug in menus when resized while hidden" |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7642 |
mustRedrawBottomEdge := (level ~~ 0) and:[newHeight < height]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7643 |
mustRedrawRightEdge := (level ~~ 0) and:[newWidth < width]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7644 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7645 |
((newHeight <= height) and:[newWidth <= width]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7646 |
how := #smaller |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7647 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7648 |
((newHeight >= height) and:[newWidth >= width]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7649 |
how := #larger |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7650 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7651 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7652 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7653 |
mustRepaintRight := false. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7654 |
mustRepaintBottom := false. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7655 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7656 |
oldWidth := width. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7657 |
oldHeight := height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7658 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7659 |
shown ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7660 |
(level ~~ 0) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7661 |
"clear the old edges" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7662 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7663 |
newWidth > width ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7664 |
self clippingRectangle:nil. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7665 |
oldPaint := paint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7666 |
self paint:viewBackground. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7667 |
self fillDeviceRectangleX:(width - margin) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7668 |
y:0 |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7669 |
width:margin |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7670 |
height:height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7671 |
self paint:oldPaint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7672 |
mustRepaintRight := true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7673 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7674 |
newHeight > height ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7675 |
self clippingRectangle:nil. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7676 |
oldPaint := paint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7677 |
self paint:viewBackground. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7678 |
self fillDeviceRectangleX:0 |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7679 |
y:(height - margin) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7680 |
width:width |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7681 |
height:margin. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7682 |
self paint:oldPaint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7683 |
mustRepaintBottom := true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7684 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7685 |
] |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7686 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7687 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7688 |
width := newWidth. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7689 |
height := newHeight. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7690 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7691 |
self setInnerClip. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7692 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7693 |
"if view becomes smaller, send sizeChanged first" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7694 |
true "(how == #smaller)" ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7695 |
self sizeChanged:how |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7696 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7697 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7698 |
"have to tell X, when extent of view is changed" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7699 |
sameOrigin ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7700 |
device resizeWindow:drawableId width:width height:height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7701 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7702 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7703 |
"claus: some xservers seem to do better when resizing |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7704 |
first ...." |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7705 |
" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7706 |
(how == #smaller) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7707 |
device resizeWindow:drawableId width:width height:height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7708 |
device moveWindow:drawableId x:left y:top |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7709 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7710 |
device moveResizeWindow:drawableId x:left y:top width:width height:height |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7711 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7712 |
" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7713 |
device moveResizeWindow:drawableId x:left y:top |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7714 |
width:width height:height. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7715 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7716 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7717 |
"if view becomes bigger, send sizeChanged after" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7718 |
false "(how ~~ #smaller)" ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7719 |
self sizeChanged:how |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7720 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7721 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7722 |
shown ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7723 |
(mustRedrawBottomEdge or:[mustRedrawRightEdge]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7724 |
self deviceClippingRectangle:nil. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7725 |
oldPaint := paint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7726 |
mustRedrawBottomEdge ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7727 |
self drawBottomEdge |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7728 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7729 |
mustRedrawRightEdge ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7730 |
self drawRightEdge |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7731 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7732 |
self paint:oldPaint. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7733 |
self deviceClippingRectangle:innerClipRect |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7734 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7735 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7736 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7737 |
mustRepaintRight ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7738 |
self invalidateDeviceRectangle:(((oldWidth - margin) @ 0) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7739 |
extent:margin@height) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7740 |
repairNow:false. |
2400
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7741 |
"/ self redrawDeviceX:(oldWidth - margin) |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7742 |
"/ y:0 |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7743 |
"/ width:margin |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7744 |
"/ height:height. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7745 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7746 |
mustRepaintBottom ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7747 |
self invalidateDeviceRectangle:((0 @ (oldHeight - margin)) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7748 |
extent:width@margin) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7749 |
repairNow:false. |
2400
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7750 |
"/ self redrawDeviceX:0 |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7751 |
"/ y:(oldHeight - margin) |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7752 |
"/ width:width |
13dc68f612fb
when resizing, invalidate instead of redrawing right away
Claus Gittinger <cg@exept.de>
parents:
2396
diff
changeset
|
7753 |
"/ height:margin. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7754 |
]. |
140 | 7755 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7756 |
"otherwise memorize the need for a sizeChanged message" |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7757 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7758 |
width := newWidth. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7759 |
height := newHeight. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7760 |
sameOrigin ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7761 |
self originChangedFlag:true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7762 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7763 |
self extentChangedFlag:true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7764 |
subViews size > 0 ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7765 |
self extentChangedBeforeCreatedFlag:true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7766 |
]. |
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
7767 |
]. |
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
7768 |
sameOrigin ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7769 |
self changed:#origin. |
3784
378456357157
added #frame for displayObject compatibility
Michael Beyl <mb@exept.de>
parents:
3781
diff
changeset
|
7770 |
]. |
739 | 7771 |
|
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7772 |
"Modified: / 25.5.1999 / 14:49:56 / cg" |
140 | 7773 |
! |
7774 |
||
7775 |
pointFromRelative:p |
|
7776 |
"compute absolute coordinate from p" |
|
7777 |
||
7778 |
|newX newY rel inRect bw superWidth superHeight superLeft superTop | |
|
7779 |
||
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7780 |
bw := self borderWidth ? 0. |
140 | 7781 |
|
7782 |
superView isNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7783 |
superWidth := device width + bw. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7784 |
superHeight := device height + bw. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7785 |
superLeft := superTop := 0. |
140 | 7786 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7787 |
inRect := superView viewRectangle. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7788 |
superWidth := inRect width. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7789 |
superHeight := inRect height. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7790 |
superLeft := inRect left. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7791 |
superTop := inRect top. |
140 | 7792 |
]. |
7793 |
||
7794 |
rel := p x. |
|
7795 |
rel isInteger ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7796 |
newX := rel |
140 | 7797 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7798 |
newX := (rel * superWidth) asInteger + superLeft. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7799 |
(bw ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7800 |
rel ~= 1.0 ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7801 |
newX := newX - bw |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7802 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7803 |
] |
140 | 7804 |
]. |
7805 |
||
7806 |
rel := p y. |
|
7807 |
rel isInteger ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7808 |
newY := rel |
140 | 7809 |
] ifFalse:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7810 |
newY := (rel * superHeight) asInteger + superTop. |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7811 |
(bw ~~ 0) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7812 |
rel ~= 1.0 ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7813 |
newY := newY - bw |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7814 |
] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
7815 |
] |
140 | 7816 |
]. |
7817 |
^ newX @ newY |
|
2382 | 7818 |
|
7819 |
"Modified: / 1.10.1998 / 13:21:14 / cg" |
|
140 | 7820 |
! |
7821 |
||
7822 |
setBorderColor |
|
5405 | 7823 |
"set my borderColor in the physical view (if supported by the device)" |
140 | 7824 |
|
7825 |
|id dither| |
|
7826 |
||
7827 |
drawableId notNil ifTrue:[ |
|
5405 | 7828 |
borderColor := borderColor onDevice:device. |
7829 |
id := borderColor colorId. |
|
7830 |
id notNil ifTrue:[ |
|
7831 |
device setWindowBorderColor:id in:drawableId |
|
7832 |
] ifFalse:[ |
|
7833 |
dither := borderColor ditherForm. |
|
7834 |
dither notNil ifTrue:[ |
|
7835 |
device setWindowBorderPixmap:(dither id) in:drawableId |
|
7836 |
] ifFalse:[ |
|
7837 |
'SimpleView [warning]: bad borderColor' errorPrintCR |
|
7838 |
] |
|
7839 |
] |
|
135 | 7840 |
] |
1172
a69398754511
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
7841 |
|
a69398754511
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
7842 |
"Modified: 10.1.1997 / 18:06:34 / cg" |
135 | 7843 |
! |
7844 |
||
269 | 7845 |
setInnerClip |
7846 |
"compute, and set the inside clip-area" |
|
7847 |
||
7848 |
self computeInnerClip. |
|
2726
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7849 |
self deviceClippingRectangle:innerClipRect. |
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7850 |
|
c0a05c874843
always use a deviceClipRect as innerClip;
Claus Gittinger <cg@exept.de>
parents:
2721
diff
changeset
|
7851 |
"Modified: / 25.5.1999 / 14:45:53 / cg" |
1903 | 7852 |
! |
7853 |
||
4139 | 7854 |
setShown:aState |
7855 |
shown := aState |
|
7856 |
||
7857 |
! |
|
7858 |
||
1903 | 7859 |
setViewShape |
7860 |
|form| |
|
7861 |
||
7862 |
(form := viewShape borderShapeForm) notNil ifTrue:[ |
|
3152 | 7863 |
device setWindowBorderShape:(form id) in:drawableId |
1903 | 7864 |
]. |
7865 |
(form := viewShape viewShapeForm) notNil ifTrue:[ |
|
3152 | 7866 |
device setWindowShape:(form id) in:drawableId |
1903 | 7867 |
]. |
7868 |
||
7869 |
"Created: 18.9.1997 / 11:09:00 / cg" |
|
4139 | 7870 |
! |
7871 |
||
7872 |
windowGroupClass |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7873 |
^ WindowGroup |
140 | 7874 |
! ! |
7875 |
||
269 | 7876 |
!SimpleView methodsFor:'queries'! |
7877 |
||
7878 |
canHandle:aKey |
|
7879 |
"return true, if I like to handle the key (from a keyPress event). |
|
7880 |
OBSOLETE: do not use & depend on this method, it is a historic |
|
7881 |
leftOver and will be removed. Use the delegation mechanism for this." |
|
7882 |
||
7883 |
^ false |
|
7884 |
! |
|
7885 |
||
7886 |
canHandle:aKey from:aView |
|
7887 |
"return true, if I like to handle the key (from a keyPress event) |
|
7888 |
in aView. |
|
7889 |
OBSOLETE: do not use & depend on this method, it is a historic |
|
7890 |
leftOver and will be removed. Use the delegation mechanism for this." |
|
7891 |
||
7892 |
^ self canHandle:aKey |
|
7893 |
! |
|
7894 |
||
4915
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7895 |
computePreferredExtent |
5060
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7896 |
"compute answer the preferred extent, disregarding |
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7897 |
an explicit or cached preferred extent for the computation" |
01bb459aaa8b
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
5050
diff
changeset
|
7898 |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7899 |
|savedPref savedExplicit computedPref| |
4915
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7900 |
|
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7901 |
savedPref := preferredExtent. |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7902 |
savedExplicit := explicitExtent. |
4915
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7903 |
[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7904 |
preferredExtent := explicitExtent := nil. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7905 |
computedPref := self preferredExtent. |
4915
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7906 |
] ensure:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7907 |
preferredExtent := savedPref. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
7908 |
explicitExtent := savedExplicit. |
4915
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7909 |
]. |
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7910 |
^ computedPref |
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7911 |
! |
440fb8ebb234
changed #computePreferredExtent (from cg)
Stefan Vogel <sv@exept.de>
parents:
4907
diff
changeset
|
7912 |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7913 |
cornerChangedFlag |
3375 | 7914 |
"/ ^ cornerChangedFlag == true |
7915 |
^ flagBits bitTest:FlagCornerChanged |
|
7916 |
! |
|
7917 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
7918 |
cornerChangedFlag:aBoolean |
3375 | 7919 |
"/ cornerChangedFlag := aBoolean |
7920 |
aBoolean ifTrue:[ |
|
7921 |
flagBits := flagBits bitOr:FlagCornerChanged |
|
7922 |
] ifFalse:[ |
|
7923 |
flagBits := flagBits bitClear:FlagCornerChanged |
|
7924 |
]. |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7925 |
! |
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7926 |
|
269 | 7927 |
delegatesTo:someone |
7928 |
"return true, if I delegate events to someone" |
|
7929 |
||
7930 |
delegate isNil ifTrue:[^ false]. |
|
7931 |
^ delegate delegatesTo:someone |
|
7932 |
! |
|
7933 |
||
3439 | 7934 |
escapeIsCancel |
7935 |
"return the escapeIsCancel setting - defaults to true for popupViews here." |
|
7936 |
||
7937 |
^ self isPopUpView |
|
7938 |
! |
|
7939 |
||
3394
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7940 |
extentChangedBeforeCreatedFlag |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7941 |
^ flagBits bitTest:FlagExtentChangedBeforeCreated |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7942 |
! |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7943 |
|
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7944 |
extentChangedBeforeCreatedFlag:aBoolean |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7945 |
aBoolean ifTrue:[ |
3762 | 7946 |
flagBits := flagBits bitOr:FlagExtentChangedBeforeCreated |
3394
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7947 |
] ifFalse:[ |
3762 | 7948 |
flagBits := flagBits bitClear:FlagExtentChangedBeforeCreated |
3394
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7949 |
]. |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7950 |
! |
56080b4ebce1
remember the fact, that the extent changed before the view
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
7951 |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7952 |
extentChangedFlag |
3375 | 7953 |
"/ ^ extentChangedFlag == true |
7954 |
^ flagBits bitTest:FlagExtentChanged |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7955 |
! |
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7956 |
|
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7957 |
extentChangedFlag:aBoolean |
3375 | 7958 |
"/ extentChangedFlag := aBoolean |
7959 |
aBoolean ifTrue:[ |
|
7960 |
flagBits := flagBits bitOr:FlagExtentChanged |
|
7961 |
] ifFalse:[ |
|
7962 |
flagBits := flagBits bitClear:FlagExtentChanged |
|
7963 |
]. |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7964 |
! |
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
7965 |
|
5140 | 7966 |
hasExplicitFocus |
7967 |
"return true, if the receiver has the keyboard focus |
|
7968 |
via the focusView mechanism in the windowGroup" |
|
7969 |
||
7970 |
windowGroup isNil ifTrue:[^ false]. |
|
7971 |
^ windowGroup explicitFocusView == self |
|
7972 |
! |
|
7973 |
||
269 | 7974 |
hasFocus |
7975 |
"return true, if the receiver has the keyboard focus |
|
7976 |
(either via the focusView mechanism in the windowGroup, |
|
7977 |
or via delegation)" |
|
7978 |
||
4675 | 7979 |
|focusViewToCheck focusViewInWindowGroup focusViewOnDisplay delegate| |
269 | 7980 |
|
7981 |
windowGroup isNil ifTrue:[^ false]. |
|
7982 |
||
4675 | 7983 |
"/ this is wrong (the old code). |
7984 |
"/ focusViewInWindowGroup := windowGroup focusView. |
|
7985 |
"/ focusViewToCheck := focusViewInWindowGroup. |
|
7986 |
||
7987 |
focusViewOnDisplay := device focusView. |
|
7988 |
focusViewToCheck := focusViewOnDisplay. |
|
4834 | 7989 |
|
4675 | 7990 |
focusViewToCheck == self ifTrue:[ |
5137 | 7991 |
^ true |
4675 | 7992 |
]. |
7993 |
||
7994 |
focusViewToCheck notNil ifTrue:[ |
|
5137 | 7995 |
"mhmh - is there a delegation to me ?" |
7996 |
(delegate := focusViewToCheck delegate) notNil ifTrue:[ |
|
7997 |
delegate == self ifTrue:[^ true]. |
|
7998 |
^ delegate askFor:#delegatesTo: with:self |
|
7999 |
] |
|
135 | 8000 |
]. |
269 | 8001 |
^ false |
4675 | 8002 |
|
8003 |
"Modified: / 08-11-2006 / 12:10:32 / cg" |
|
269 | 8004 |
! |
8005 |
||
370 | 8006 |
is3D |
8007 |
"return true, if my style is some kind of 3D style |
|
8008 |
This is OBSOLETE and will be removed." |
|
8009 |
||
8010 |
^ styleSheet is3D |
|
8011 |
! |
|
8012 |
||
794 | 8013 |
isBorderedWrapper |
8014 |
^ false |
|
8015 |
||
8016 |
"Created: 5.6.1996 / 14:11:15 / cg" |
|
8017 |
! |
|
8018 |
||
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8019 |
isComponentOf:aViewOrComponent |
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8020 |
"return true, if I am a (direct or indirect) component of aViewOrComponent" |
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8021 |
|
3362 | 8022 |
|sview| |
8023 |
||
8024 |
sview := self. |
|
8025 |
||
3616 | 8026 |
[ (sview := sview container) notNil ] whileTrue:[ |
3762 | 8027 |
sview == aViewOrComponent ifTrue:[^ true]. |
3362 | 8028 |
]. |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8029 |
^ false |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8030 |
! |
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8031 |
|
3711
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8032 |
isCursorKeyConsumer |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8033 |
"return true, if the receiver can be controlled by cursor keys; |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8034 |
i.e. it can handle some keyboard input, |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8035 |
isCursorKeyConsumer are potential candidates for getting the keyboard |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8036 |
focus initially within dialogBoxes, or when the focus-follows-pointer |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8037 |
mode is off. |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8038 |
Return false here, this is redefined in SelectionInListView." |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8039 |
|
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8040 |
^ false |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8041 |
! |
f74e461c8b31
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
3709
diff
changeset
|
8042 |
|
2496 | 8043 |
isDefault |
8044 |
"return true, if I am a default widget; |
|
8045 |
Used with autoAccept. Currently only default buttons are supposed to return |
|
8046 |
true here" |
|
8047 |
||
8048 |
^ false |
|
8049 |
! |
|
8050 |
||
2430
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8051 |
isExternalTopView |
2454 | 8052 |
"return true, if this is an external topView - always false here" |
8053 |
||
2430
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8054 |
^ false |
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8055 |
|
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8056 |
|
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8057 |
! |
fbce2378d686
added isExternalTopView query.
Claus Gittinger <cg@exept.de>
parents:
2425
diff
changeset
|
8058 |
|
497 | 8059 |
isInputField |
8060 |
"return true, if the receiver is some kind of input view, |
|
8061 |
i.e. it should (can) be part of an enterGroup. |
|
8062 |
Return false here, this is redefined in EnterField." |
|
8063 |
||
8064 |
^ false |
|
8065 |
||
8066 |
"Created: 4.3.1996 / 11:34:07 / cg" |
|
8067 |
! |
|
8068 |
||
2410 | 8069 |
isJavaView |
8070 |
^ false |
|
8071 |
||
8072 |
"Created: / 4.12.1998 / 14:10:06 / cg" |
|
8073 |
! |
|
8074 |
||
2588 | 8075 |
isKeyboardConsumer |
2727 | 8076 |
"return true, if the receiver is a keyboard consumer; |
2588 | 8077 |
i.e. it can handle (non-shortkey) keyboard input, |
8078 |
keyboardConsumer are potential candidates for getting the keyboard |
|
8079 |
focus initially within dialogBoxes, or when the focus-follows-pointer |
|
8080 |
mode is off. |
|
8081 |
Return false here, this is redefined in EditTextView and EditField." |
|
8082 |
||
8083 |
^ false |
|
2727 | 8084 |
|
8085 |
"Modified: / 22.5.1999 / 16:19:27 / cg" |
|
2588 | 8086 |
! |
8087 |
||
964 | 8088 |
isLayoutWrapper |
5229
3caaef23e005
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
5228
diff
changeset
|
8089 |
"answer true, if this view defines the layout of it's subviews" |
3caaef23e005
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
5228
diff
changeset
|
8090 |
|
3caaef23e005
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
5228
diff
changeset
|
8091 |
^ false |
964 | 8092 |
|
8093 |
"Created: 19.7.1996 / 17:51:04 / cg" |
|
8094 |
! |
|
8095 |
||
4497 | 8096 |
isMDIClientView |
8097 |
^false |
|
8098 |
! |
|
8099 |
||
4184 | 8100 |
isModal |
8101 |
"return true, if the receiver has been opened modal. |
|
8102 |
For compatibility with topView (if regular views are the window of an application), |
|
8103 |
return false here." |
|
8104 |
||
8105 |
^ false |
|
8106 |
! |
|
8107 |
||
3653 | 8108 |
isSameOrComponentOf:aView |
8109 |
"return true, if I am aView or a (direct or indirect) component of aView" |
|
8110 |
||
8111 |
^ self == aView or:[self isComponentOf:aView]. |
|
8112 |
! |
|
8113 |
||
2161
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8114 |
isScrollWrapper |
4918
4c804945889f
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
4915
diff
changeset
|
8115 |
"answer true if this view wraps a possibly larger view and has scroll bars" |
4c804945889f
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
4915
diff
changeset
|
8116 |
|
2161
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8117 |
^ false |
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8118 |
|
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8119 |
"Created: / 5.6.1996 / 14:11:15 / cg" |
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8120 |
"Modified: / 20.6.1998 / 14:15:29 / cg" |
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8121 |
! |
46940821c697
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
2159
diff
changeset
|
8122 |
|
269 | 8123 |
isSubViewOf:aView |
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8124 |
"return true, if I am a (direct or indirect) subview of aView" |
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8125 |
|
3434 | 8126 |
<resource:#obsolete> |
8127 |
||
791
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8128 |
self obsoleteMethodWarning:'use #isComponentOf:'. |
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8129 |
^ self isComponentOf:aView. |
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8130 |
|
e6adfb28e3bc
isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents:
782
diff
changeset
|
8131 |
"Modified: 5.6.1996 / 14:25:35 / cg" |
269 | 8132 |
! |
8133 |
||
3754 | 8134 |
isTextView |
8135 |
"I am not showing text (showing lines)" |
|
8136 |
||
8137 |
^ false |
|
8138 |
! |
|
8139 |
||
4151 | 8140 |
isTransparentBox |
8141 |
^ false |
|
8142 |
! |
|
8143 |
||
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8144 |
isWrapper |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8145 |
^ false |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8146 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8147 |
"Created: 5.6.1996 / 01:05:06 / cg" |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8148 |
! |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8149 |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8150 |
originChangedFlag |
3375 | 8151 |
"/ ^ originChangedFlag == true |
8152 |
^ flagBits bitTest:FlagOriginChanged |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8153 |
! |
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8154 |
|
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8155 |
originChangedFlag:aBoolean |
3375 | 8156 |
"/ originChangedFlag := aBoolean |
8157 |
aBoolean ifTrue:[ |
|
8158 |
flagBits := flagBits bitOr:FlagOriginChanged |
|
8159 |
] ifFalse:[ |
|
8160 |
flagBits := flagBits bitClear:FlagOriginChanged |
|
8161 |
]. |
|
3368
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8162 |
! |
57da0cceaf16
concentrated all accesses to originChanged, extentChanged and
Claus Gittinger <cg@exept.de>
parents:
3367
diff
changeset
|
8163 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8164 |
originOrExtentChanged |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8165 |
"/ ^ originChanged or:[extentChanged]. |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8166 |
^ flagBits bitTest:( FlagOriginChanged + FlagExtentChanged ) |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8167 |
! |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8168 |
|
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8169 |
originOrExtentOrCornerChanged |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8170 |
"/ ^ originChanged or:[extentChanged or:[cornerChanged]]. |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8171 |
^ flagBits bitTest:( FlagOriginChanged + FlagExtentChanged + FlagCornerChanged ) |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8172 |
! |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
8173 |
|
269 | 8174 |
preferredBounds |
8175 |
"ST-80 compatibility." |
|
8176 |
||
971 | 8177 |
^ 0@0 extent:(self preferredExtent) |
8178 |
||
8179 |
"Modified: 19.7.1996 / 20:41:36 / cg" |
|
269 | 8180 |
! |
8181 |
||
8182 |
preferredExtent |
|
8183 |
"return my preferred extent - this is the minimum size I would like to have. |
|
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8184 |
If the preferredExtent has been set, that one is returned. |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8185 |
Otherwise, if there are any components, a rectangle enclosing them |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8186 |
is returned. Otherwise, the actual extent is returned." |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8187 |
|
1063 | 8188 |
|maxX maxY| |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8189 |
|
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8190 |
"/ If I have an explicit preferredExtent.. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8191 |
explicitExtent notNil ifTrue:[ |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8192 |
^ explicitExtent |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8193 |
]. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8194 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8195 |
"/ If I have a cached preferredExtent value.. |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8196 |
preferredExtent notNil ifTrue:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8197 |
^ preferredExtent |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8198 |
]. |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8199 |
|
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8200 |
"/ mhmh - if I have subViews, collect their |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8201 |
"/ preferred bounds ... |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8202 |
|
269 | 8203 |
subViews notNil ifTrue:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8204 |
maxX := maxY := 0. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8205 |
subViews do:[:aSubView | |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8206 |
|org corn| |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8207 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8208 |
org := aSubView computeOrigin. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8209 |
corn := org + aSubView preferredExtent. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8210 |
maxX := maxX max:corn x. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8211 |
maxY := maxY max:corn y. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8212 |
] |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8213 |
]. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8214 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8215 |
"/ mhmh - if I have components, collect their preferred bounds ... |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8216 |
components notNil ifTrue:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8217 |
maxX isNil ifTrue:[ |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8218 |
maxX := maxY := 0. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8219 |
]. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8220 |
components do:[:aComponent | |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8221 |
|bounds org corn| |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8222 |
|
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8223 |
bounds := aComponent preferredBounds. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8224 |
corn := bounds corner. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8225 |
maxX := maxX max:corn x. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8226 |
maxY := maxY max:corn y. |
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8227 |
] |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8228 |
]. |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8229 |
|
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8230 |
"/ nothing found - return the actual size |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8231 |
|
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8232 |
maxX isNil ifTrue:[ |
5021
b35cef3e421d
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5017
diff
changeset
|
8233 |
^ self extent. |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8234 |
]. |
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8235 |
|
269 | 8236 |
^ maxX @ maxY. |
761
34d17118452a
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
8237 |
|
971 | 8238 |
"Modified: 19.7.1996 / 20:43:32 / cg" |
269 | 8239 |
! |
8240 |
||
4970
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8241 |
preferredHeight |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8242 |
^ self preferredExtent y |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8243 |
! |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8244 |
|
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8245 |
preferredWidth |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8246 |
^ self preferredExtent x |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8247 |
! |
6a58581288cc
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
4968
diff
changeset
|
8248 |
|
2956 | 8249 |
reallyRealized |
8250 |
"return true, if the receiver is realized and all containers |
|
8251 |
are realized." |
|
8252 |
||
8253 |
realized ifFalse:[^ false]. |
|
8254 |
superView isNil ifTrue:[^ true]. |
|
8255 |
^ superView reallyRealized |
|
8256 |
||
8257 |
||
8258 |
! |
|
8259 |
||
2130
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8260 |
resources |
5221 | 8261 |
"return the views resources - |
8262 |
that's a ResourcePack containing national language strings" |
|
8263 |
||
2130
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8264 |
^ resources |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8265 |
|
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8266 |
"Created: / 25.5.1998 / 13:00:02 / cg" |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8267 |
! |
5dbffd126b4a
added #resources class method for all views.
Claus Gittinger <cg@exept.de>
parents:
2128
diff
changeset
|
8268 |
|
269 | 8269 |
sizeFixed |
8270 |
"return true, if this vew wants its size to remain unchanged. |
|
8271 |
Used by panels, to check if their components want to keep their size." |
|
8272 |
||
8273 |
^ false |
|
8274 |
||
8275 |
"Created: 17.9.1995 / 20:29:20 / claus" |
|
3901 | 8276 |
! |
8277 |
||
8278 |
tabRequiresControl |
|
8279 |
"returns true, if a focus tabbing requires a control-key to be pressed. |
|
8280 |
The default is true for editTextView, false for other widgets, |
|
8281 |
to allow for easier text entry" |
|
8282 |
||
8283 |
^ false |
|
4191 | 8284 |
! |
8285 |
||
8286 |
window |
|
8287 |
"for compatibility with applicationModels ... return the receiver" |
|
8288 |
||
8289 |
^ self |
|
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8290 |
! ! |
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8291 |
|
5202
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8292 |
!SimpleView methodsFor:'queries-delegation'! |
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8293 |
|
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8294 |
handlesMouseWheelMotion:event inView:aView |
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8295 |
"we do not handle delegated mousewheel events - subclasses may handle them" |
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8296 |
|
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8297 |
^ false |
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8298 |
! ! |
966f7b304597
No longer scroll the focus view for mouseWheel events.
Stefan Vogel <sv@exept.de>
parents:
5154
diff
changeset
|
8299 |
|
3266 | 8300 |
!SimpleView methodsFor:'queries-events'! |
2802 | 8301 |
|
8302 |
buttonMotionEventPending |
|
8303 |
"return true, if a button motion event is pending. |
|
8304 |
Normally, you dont want to use this, since no polling is needed |
|
8305 |
(not even for mouse-tracking). |
|
8306 |
Actually, its a historical leftover" |
|
8307 |
||
8308 |
windowGroup notNil ifTrue:[ |
|
3152 | 8309 |
^ windowGroup sensor hasButtonMotionEventFor:self |
2802 | 8310 |
]. |
8311 |
^ super buttonMotionEventPending |
|
8312 |
||
8313 |
"Modified: 1.11.1996 / 17:04:38 / cg" |
|
8314 |
! ! |
|
8315 |
||
3266 | 8316 |
!SimpleView methodsFor:'queries-internal'! |
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8317 |
|
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8318 |
nativeWindowType |
1702 | 8319 |
"return a symbol describing my native window type - here, nil is returned |
8320 |
(may be used internally by the device as a native window creation hint)" |
|
8321 |
||
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8322 |
^ nil |
1354 | 8323 |
! |
8324 |
||
8325 |
specClass |
|
1943 | 8326 |
"fallback - heuristics to get a specClass for some viewClass. |
8327 |
Based upon my className, look for a corresponding Spec-class. |
|
8328 |
If there is none, return ArbiraryComponentSpec as a fallBack" |
|
8329 |
||
8330 |
|myClass myName cls| |
|
8331 |
||
4157 | 8332 |
myClass := self class. |
8333 |
(myClass == View or:[myClass == SimpleView]) ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8334 |
^ ViewSpec "/ CompositeSpecCollection |
1943 | 8335 |
]. |
8336 |
||
8337 |
"/ try: appending 'Spec' to my classes name |
|
1409
3818a8a85c16
use CompositeSpecCollection as specClass for
Claus Gittinger <cg@exept.de>
parents:
1402
diff
changeset
|
8338 |
|
1354 | 8339 |
myName := self class name. |
8340 |
cls := Smalltalk classNamed:(myName , 'Spec'). |
|
1943 | 8341 |
cls notNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8342 |
cls := cls autoload. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8343 |
(cls isSubclassOf:UISpecification) ifTrue:[^ cls]. |
1943 | 8344 |
]. |
1354 | 8345 |
|
8346 |
(myName endsWith:'View') ifTrue:[ |
|
1943 | 8347 |
"/ "/ try name without 'View' |
8348 |
"/ cls := Smalltalk classNamed:(myName copyWithoutLast:4). |
|
4157 | 8349 |
"/ cls notNil ifTrue:[ |
8350 |
"/ cls := cls autoload. |
|
8351 |
"/ (cls isSubclassOf:UISpecification) ifTrue:[^ cls]. |
|
1943 | 8352 |
"/ ]. |
4157 | 8353 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8354 |
"/ try with 'View' replaced by 'Spec' |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8355 |
cls := Smalltalk classNamed:((myName copyWithoutLast:4) , 'View'). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8356 |
cls notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8357 |
cls := cls autoload. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8358 |
(cls isSubclassOf:UISpecification) ifTrue:[^ cls]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8359 |
] |
4157 | 8360 |
]. |
8361 |
||
8362 |
"/ fall back for all others |
|
1356 | 8363 |
^ ArbitraryComponentSpec |
8364 |
||
1354 | 8365 |
|
8366 |
" |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8367 |
FramedBox new specClass |
1354 | 8368 |
" |
1409
3818a8a85c16
use CompositeSpecCollection as specClass for
Claus Gittinger <cg@exept.de>
parents:
1402
diff
changeset
|
8369 |
|
1943 | 8370 |
"Modified: / 31.10.1997 / 19:44:55 / cg" |
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8371 |
! |
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8372 |
|
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8373 |
windowStyle |
3715 | 8374 |
"return a symbol describing my style (one of: #dialog, #popUp or #normal)" |
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8375 |
|
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8376 |
self isPopUpView ifTrue:[ |
4834 | 8377 |
^ #popUp |
4497 | 8378 |
]. |
4501 | 8379 |
self isMDIChildView ifTrue:[ |
4834 | 8380 |
^ #mdiChild |
4501 | 8381 |
]. |
1699
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8382 |
^ #normal |
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8383 |
|
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8384 |
"Created: 2.5.1997 / 14:29:48 / cg" |
ae9986a1a97f
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
1696
diff
changeset
|
8385 |
"Modified: 2.5.1997 / 14:30:14 / cg" |
4494 | 8386 |
! |
8387 |
||
8388 |
windowType |
|
8389 |
"return a symbol describing my type (one of: #mdichild or nil)" |
|
8390 |
||
8391 |
^ nil |
|
140 | 8392 |
! ! |
8393 |
||
8394 |
!SimpleView methodsFor:'realization'! |
|
8395 |
||
3459
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8396 |
closeCancel |
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8397 |
"for protocol compatibility with modal dialogs" |
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8398 |
|
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8399 |
self hideRequest |
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8400 |
! |
d50728855052
optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents:
3439
diff
changeset
|
8401 |
|
269 | 8402 |
create |
8403 |
"create (i.e. tell my device about me) if not already created. |
|
8404 |
This does not make the view visible (needs a #map for that)" |
|
8405 |
||
8406 |
drawableId isNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8407 |
" |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8408 |
make certain that superview is created also |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8409 |
" |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8410 |
superView notNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8411 |
superView view create. |
269 | 8412 |
|
8413 |
"/ "and put my controller into the superviews controller list" |
|
8414 |
"/ controller notNil ifTrue:[ |
|
8415 |
"/ superView controller notNil ifTrue:[ |
|
8416 |
"/ controller manager:(superView controller manager) |
|
8417 |
"/ ] |
|
8418 |
"/ ] |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8419 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8420 |
"/ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8421 |
"/ if the display is not already dispatching events, |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8422 |
"/ this starts the event process. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8423 |
"/ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8424 |
device startDispatch |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8425 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8426 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8427 |
cursor notNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8428 |
cursor := cursor onDevice:device. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8429 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8430 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8431 |
self extentChangedBeforeCreatedFlag ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8432 |
"/ this is true, if the extent was changed before |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8433 |
"/ this view was created (and therefore, no sizeChangeEvent |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8434 |
"/ was sent to me, which would notify children.) |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8435 |
"/ have to do this here. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8436 |
self sizeChanged:nil. "/ must tell children (if any) |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8437 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8438 |
self hasExplicitExtent ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8439 |
self resize |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8440 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8441 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8442 |
self physicalCreate. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8443 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8444 |
viewBackground notNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8445 |
self setViewBackground |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8446 |
]. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8447 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8448 |
self initEvents. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8449 |
|
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8450 |
" |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8451 |
this is the first create, |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8452 |
force sizechange messages to be sent to the view |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8453 |
" |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8454 |
self extentChangedFlag:true. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
8455 |
self originChangedFlag:true |
151 | 8456 |
] |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8457 |
|
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1490
diff
changeset
|
8458 |
"Modified: 28.3.1997 / 13:50:17 / cg" |
151 | 8459 |
! |
8460 |
||
269 | 8461 |
createWithAllSubViews |
8462 |
"create, then create all subviews" |
|
8463 |
||
8464 |
drawableId isNil ifTrue:[self create]. |
|
8465 |
subViews notNil ifTrue:[ |
|
3152 | 8466 |
subViews do:[:subView | subView createWithAllSubViews] |
269 | 8467 |
] |
8468 |
! |
|
8469 |
||
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8470 |
fetchDeviceResources |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8471 |
"fetch all device specific resources. This is invoked, |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8472 |
when the view is made visible on some device for the very first |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8473 |
time, to allocate device specific colors, fonts, bitmaps etc. |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8474 |
The view may keep those in instance variables, to avoid reallocating |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8475 |
those with every redraw. |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8476 |
If you ommit to do this, the views will still be able to display themself, |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8477 |
but possibly slower, since resources are reallocated over and over. |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8478 |
If you redefine this method, make certain that 'super fetchDeviceResources' |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8479 |
is always sent." |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8480 |
|
2829 | 8481 |
shadowColor notNil ifTrue:[shadowColor := shadowColor onDevice:device]. |
8482 |
lightColor notNil ifTrue:[lightColor := lightColor onDevice:device]. |
|
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8483 |
|
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8484 |
"Created: 13.1.1997 / 21:51:59 / cg" |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8485 |
! |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8486 |
|
140 | 8487 |
fixSize |
8488 |
"This is called right before the view is made visible. |
|
8489 |
Adjust the size of the view according to either relative/abs or |
|
8490 |
block extent; also set origin. Also, subclasses may redefine this |
|
8491 |
method to adjust the size based on some extent (for example, PopUpMenus |
|
8492 |
do so to take care of changed number of menu entries)." |
|
8493 |
||
151 | 8494 |
|org ext r| |
8495 |
||
8496 |
" |
|
8497 |
slowly migrating to use layoutObjects ... |
|
8498 |
" |
|
8499 |
layout notNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8500 |
superView notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8501 |
(self originOrExtentOrCornerChanged) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8502 |
r := (layout rectangleRelativeTo:(superView viewRectangle) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8503 |
preferred:[self preferredBounds]). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8504 |
org := r origin rounded. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8505 |
ext := r extent rounded. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8506 |
self pixelOrigin:org extent:ext. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8507 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8508 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8509 |
^ self. |
151 | 8510 |
]. |
8511 |
||
140 | 8512 |
"if the extent is not the one we created the window with ..." |
3375 | 8513 |
"/ self extentChangedFlag ifTrue:[ |
890
f202a05da548
avoid sending sizeChanged: twice
Claus Gittinger <cg@exept.de>
parents:
867
diff
changeset
|
8514 |
"/ self sizeChanged:nil. |
3375 | 8515 |
"/ self extentChangedFlag:false |
890
f202a05da548
avoid sending sizeChanged: twice
Claus Gittinger <cg@exept.de>
parents:
867
diff
changeset
|
8516 |
"/ ]. |
140 | 8517 |
|
3375 | 8518 |
self originChangedFlag ifTrue:[ |
140 | 8519 |
"/ org := self computeOrigin. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8520 |
"/ self pixelOrigin:org. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8521 |
originRule notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8522 |
self pixelOrigin:self computeOrigin |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8523 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8524 |
relativeOrigin notNil ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8525 |
self originFromRelativeOrigin:relativeOrigin |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8526 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8527 |
shown ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8528 |
device moveWindow:drawableId x:left y:top. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8529 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8530 |
self pixelOrigin:left@top |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8531 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8532 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8533 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8534 |
self originChangedFlag:false |
140 | 8535 |
] |
890
f202a05da548
avoid sending sizeChanged: twice
Claus Gittinger <cg@exept.de>
parents:
867
diff
changeset
|
8536 |
|
f202a05da548
avoid sending sizeChanged: twice
Claus Gittinger <cg@exept.de>
parents:
867
diff
changeset
|
8537 |
"Modified: 18.6.1996 / 21:44:03 / cg" |
140 | 8538 |
! |
8539 |
||
4853 | 8540 |
forceResize |
8541 |
"force resizing - even if already done" |
|
8542 |
||
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
8543 |
self explicitExtent:false. |
4853 | 8544 |
self resize |
8545 |
! |
|
8546 |
||
393
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8547 |
hide |
1356 | 8548 |
"only useful with modal views: hide the view and return control |
8549 |
back to the suspended main view. Ignored for non-modal views." |
|
8550 |
||
2579 | 8551 |
|masterGroup| |
1356 | 8552 |
|
8553 |
realized ifFalse:[^ self]. |
|
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8554 |
(windowGroup notNil and:[windowGroup isModal]) ifTrue:[ |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8555 |
masterGroup := windowGroup previousGroup. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8556 |
windowGroup focusView:nil. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8557 |
]. |
1356 | 8558 |
|
8559 |
self unmap. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8560 |
device flush. |
1356 | 8561 |
|
2579 | 8562 |
masterGroup notNil ifTrue:[ |
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8563 |
" |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8564 |
this is a kludge for IRIS and others which do not provide backingstore: |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8565 |
when we hide a modalbox (such as a searchbox) which covered |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8566 |
a scrollbar, the scrollbars bitblt-method will copy from the |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8567 |
not-yet redrawn area - effectively clearing the scroller. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8568 |
We need a short delay here, since at this time, the expose event has |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8569 |
not yet arrived. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8570 |
" |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8571 |
Delay waitForSeconds:0.05. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
8572 |
masterGroup processExposeEvents |
2576 | 8573 |
]. |
8574 |
||
8575 |
"/ WindowGroup leaveSignal raise. |
|
8576 |
"/ "/ not reached |
|
8577 |
"/ ^ self |
|
393
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8578 |
! |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8579 |
|
3087 | 8580 |
hideForAction |
8581 |
"for popUpMenu compatibility; |
|
8582 |
this is invoked to hide a when it is going to perform its action |
|
8583 |
(in contrast to the generic hide)." |
|
8584 |
||
8585 |
^ self hide |
|
8586 |
! |
|
8587 |
||
393
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8588 |
hideRequest |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8589 |
"for protocol compatibility with modal dialogs; |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8590 |
ignored here." |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8591 |
|
3439 | 8592 |
self isPopUpView ifTrue:[ |
3762 | 8593 |
self hide |
3439 | 8594 |
]. |
393
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8595 |
^ self |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8596 |
! |
3504a0adbb2d
use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents:
385
diff
changeset
|
8597 |
|
269 | 8598 |
map |
1827 | 8599 |
"make the view visible on the screen. |
8600 |
For topViews, the windowManager will choose (or ask for) the |
|
2103
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8601 |
views position on the screen. |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8602 |
Notice: |
3152 | 8603 |
Actually, this method is only valid for topViews; |
8604 |
however, it is defined here to allow things like 'Button new realize'" |
|
1827 | 8605 |
|
8606 |
self mapAt:nil iconified:false |
|
8607 |
||
8608 |
"Modified: 24.7.1997 / 13:44:25 / cg" |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8609 |
! |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8610 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8611 |
mapAt:aPoint |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8612 |
"make the view visible on the screen. |
1827 | 8613 |
For topViews, if aPoint is nonNil, the views origin is located there |
2103
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8614 |
(unless you have a dictator as windowManager ;-) |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8615 |
Notice: |
3152 | 8616 |
Actually, this method is only valid for topViews; |
8617 |
however, it is defined here to allow things like 'Button new realize'" |
|
1827 | 8618 |
|
8619 |
self mapAt:aPoint iconified:false |
|
8620 |
||
8621 |
"Modified: 24.7.1997 / 13:45:02 / cg" |
|
8622 |
! |
|
8623 |
||
8624 |
mapAt:aPoint iconified:iconified |
|
8625 |
"make the view visible on the screen. |
|
8626 |
For topViews, if aPoint is nonNil, the views origin is located there |
|
8627 |
(unless you have a dictator as windowManager ;-). |
|
2103
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8628 |
If the iconified argument is true, the window is created as icon initially. |
dbe7a348084f
do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents:
2095
diff
changeset
|
8629 |
Notice: |
5358 | 8630 |
Actually, this method is only valid for topViews; |
8631 |
however, it is defined here to allow things like 'Button new realize'" |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8632 |
|
1809
fec93025e9e7
mapping trouble fixed (see mswindows scrollBar remap)
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
8633 |
|subs| |
fec93025e9e7
mapping trouble fixed (see mswindows scrollBar remap)
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
8634 |
|
269 | 8635 |
realized ifFalse:[ |
5358 | 8636 |
drawableId isNil ifTrue:[ |
8637 |
" |
|
8638 |
first time ? |
|
8639 |
yes, realize (implies a map) |
|
8640 |
" |
|
8641 |
self realizeKeepingGroup:false at:aPoint iconified:iconified |
|
8642 |
] ifFalse:[ |
|
8643 |
" |
|
8644 |
no, map only |
|
8645 |
" |
|
8646 |
realized := true. |
|
8647 |
aPoint isNil ifTrue:[ |
|
8648 |
iconified ifTrue:[ |
|
8649 |
device |
|
8650 |
mapView:self id:drawableId iconified:iconified |
|
8651 |
atX:0 y:0 |
|
8652 |
width:width height:height |
|
8653 |
minExtent:(self minExtent) maxExtent:(self maxExtent). |
|
8654 |
] ifFalse:[ |
|
8655 |
device mapWindow:drawableId. |
|
8656 |
] |
|
8657 |
] ifFalse:[ |
|
8658 |
left := aPoint x. |
|
8659 |
top := aPoint y. |
|
8660 |
device |
|
8661 |
mapView:self id:drawableId iconified:iconified |
|
8662 |
atX:left y:top |
|
8663 |
width:width height:height |
|
8664 |
minExtent:(self minExtent) maxExtent:(self maxExtent). |
|
8665 |
]. |
|
8666 |
||
8667 |
"/ |
|
8668 |
"/ implies that all realized subviews |
|
8669 |
"/ are now also mapped |
|
8670 |
"/ |
|
8671 |
"/ not needed for topViews - the mapped event does exactly the same |
|
8672 |
"/ however, X does not generate mapped events for non-topViews |
|
8673 |
"/ when a view gets deiconified. |
|
8674 |
||
8675 |
superView notNil ifTrue:[ |
|
8676 |
(subs := self subViews) notNil ifTrue:[ |
|
8677 |
subs do:[:v | |
|
8678 |
v realized "shown" ifFalse:[ |
|
8679 |
v mapped |
|
8680 |
] |
|
8681 |
] |
|
8682 |
] |
|
8683 |
] |
|
8684 |
]. |
|
140 | 8685 |
] |
654 | 8686 |
|
1039
ef2ded1798df
Send #realize to subviews even if hiddenOnRealize is set for myself.
Stefan Vogel <sv@exept.de>
parents:
1038
diff
changeset
|
8687 |
"Modified: 23.8.1996 / 14:53:55 / stefan" |
1827 | 8688 |
"Created: 24.7.1997 / 13:43:23 / cg" |
8689 |
"Modified: 24.7.1997 / 13:46:21 / cg" |
|
8690 |
! |
|
8691 |
||
8692 |
mapIconified |
|
8693 |
"make the view visible on the screen. |
|
8694 |
For topViews, the view is created in iconified state" |
|
8695 |
||
8696 |
self mapAt:nil iconified:true |
|
8697 |
||
8698 |
"Modified: 24.7.1997 / 13:44:25 / cg" |
|
8699 |
"Created: 24.7.1997 / 13:47:03 / cg" |
|
140 | 8700 |
! |
8701 |
||
269 | 8702 |
physicalCreate |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8703 |
"common code for create & recreate: |
269 | 8704 |
physically create (but do not map) the view on the device." |
8705 |
||
3642 | 8706 |
|sv isInputOnly| |
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8707 |
|
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8708 |
sv := superView isNil ifTrue:[superView] ifFalse:[superView view]. |
269 | 8709 |
|
3008
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8710 |
"/ give global eventListeners a chance to intercept windowCreation |
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8711 |
"/ and provide another origin (by payching my origin via setOrigin:). |
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8712 |
WindowSensor preViewCreateNotification:self. |
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8713 |
|
2088 | 8714 |
isInputOnly := self isInputOnly. |
8715 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8716 |
drawableId := device |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8717 |
createWindowFor:self |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8718 |
type:(self windowType) |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8719 |
origin:(left @ top) |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8720 |
extent:(width @ height) |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8721 |
minExtent:nil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8722 |
maxExtent:nil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8723 |
borderWidth:self borderWidth |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8724 |
subViewOf:sv |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8725 |
style:(self windowStyle) |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8726 |
inputOnly:isInputOnly |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8727 |
label:nil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8728 |
owner:nil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8729 |
icon:nil iconMask:nil |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8730 |
iconView:nil. |
269 | 8731 |
|
8732 |
Lobby registerChange:self. |
|
1716
d6bf8f0deb18
added werners eventListener hook for view creation
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
8733 |
|
3010
ea1a075505b4
Let #waitUntilVisible processExposeEvents
Stefan Vogel <sv@exept.de>
parents:
3008
diff
changeset
|
8734 |
"/ if there is a global eventListener, |
ea1a075505b4
Let #waitUntilVisible processExposeEvents
Stefan Vogel <sv@exept.de>
parents:
3008
diff
changeset
|
8735 |
"/ give it a chance to track views |
ea1a075505b4
Let #waitUntilVisible processExposeEvents
Stefan Vogel <sv@exept.de>
parents:
3008
diff
changeset
|
8736 |
|
3008
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8737 |
"/ give global listeners a chance to track views |
81987f198808
let WindowSensor perform the preViewCreation/postViewCreation
Claus Gittinger <cg@exept.de>
parents:
3007
diff
changeset
|
8738 |
WindowSensor postViewCreateNotification:self. |
1716
d6bf8f0deb18
added werners eventListener hook for view creation
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
8739 |
|
3375 | 8740 |
self extentChangedFlag:false. |
8741 |
self originChangedFlag:false. |
|
269 | 8742 |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8743 |
"/ (borderColor notNil and:[borderColor ~= Black]) ifTrue:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8744 |
"/ isInputOnly ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8745 |
"/ self setBorderColor |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8746 |
"/ ] |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8747 |
"/ ]. |
269 | 8748 |
(viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8749 |
device setWindowGravity:viewGravity in:drawableId |
269 | 8750 |
]. |
8751 |
(bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8752 |
isInputOnly ifFalse:[ |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8753 |
device setBitGravity:bitGravity in:drawableId |
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8754 |
] |
269 | 8755 |
]. |
8756 |
viewShape notNil ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8757 |
self setViewShape |
269 | 8758 |
]. |
8759 |
(backed notNil and:[backed ~~ false]) ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8760 |
device setBackingStore:backed in:drawableId |
3152 | 8761 |
]. |
8762 |
self saveUnder ifTrue:[ |
|
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8763 |
device setSaveUnder:true in:drawableId |
1903 | 8764 |
]. |
1960 | 8765 |
cursor notNil ifTrue:[ |
5390
9509eceb1348
no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents:
5366
diff
changeset
|
8766 |
self setCursor |
2088 | 8767 |
]. |
8768 |
||
8769 |
"Modified: / 9.4.1998 / 20:18:12 / cg" |
|
269 | 8770 |
! |
8771 |
||
1827 | 8772 |
postRealize |
8773 |
"invoked after a view was realized. |
|
8774 |
Can be redefined in subclasses to perform delayed actions." |
|
8775 |
||
8776 |
"/ nothing done here |
|
8777 |
||
8778 |
"Created: 24.7.1997 / 14:35:36 / cg" |
|
8779 |
! |
|
8780 |
||
4126 | 8781 |
preRealize |
8782 |
"invoked right before a view is realized. |
|
8783 |
Can be redefined in subclasses to perform delayed actions." |
|
8784 |
||
8785 |
"/ nothing done here |
|
8786 |
||
8787 |
"Created: 24.7.1997 / 14:35:36 / cg" |
|
8788 |
! |
|
8789 |
||
269 | 8790 |
realize |
8791 |
"realize - make visible; |
|
8792 |
realizing is done very late (after layout is fixed) to avoid |
|
8793 |
visible rearranging of windows on the screen" |
|
8794 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8795 |
self realizeKeepingGroup:false at:nil iconified:false |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8796 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8797 |
"Modified: 24.7.1997 / 13:14:28 / cg" |
269 | 8798 |
! |
8799 |
||
8800 |
realizeAllSubViews |
|
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8801 |
"realize all my subviews - but not myself." |
269 | 8802 |
|
8803 |
subViews notNil ifTrue:[ |
|
3762 | 8804 |
subViews do:[:subView | |
8805 |
subView realize |
|
8806 |
] |
|
792
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8807 |
]. |
177cfa66f2b8
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
791
diff
changeset
|
8808 |
components notNil ifTrue:[ |
3762 | 8809 |
components do:[:component | |
8810 |
component realize |
|
8811 |
] |
|
269 | 8812 |
]. |
8813 |
||
8814 |
"Modified: 5.9.1995 / 23:30:47 / claus" |
|
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
8815 |
"Modified: 13.1.1997 / 21:25:49 / cg" |
269 | 8816 |
! |
8817 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8818 |
realizeAt:aPoint |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8819 |
"realize - make visible; |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8820 |
realizing is done very late (after layout is fixed) to avoid |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8821 |
visible rearranging of windows on the screen" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8822 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8823 |
self realizeKeepingGroup:false at:aPoint iconified:false |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8824 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8825 |
"Modified: 24.7.1997 / 13:14:28 / cg" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8826 |
"Created: 24.7.1997 / 13:21:04 / cg" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8827 |
! |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8828 |
|
269 | 8829 |
realizeInGroup |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8830 |
"special realize - leave windowgroup as is; |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8831 |
This allows a view to be realized in any windowgroup; |
269 | 8832 |
for special applications, like the kill button in the Filebrowser which has |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8833 |
a windowGroup different from its superview's and is handled as a separate process." |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8834 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8835 |
windowGroup isForModalSubview:true. |
1877 | 8836 |
"/ self realize. |
8837 |
||
8838 |
self realizeKeepingGroup:true at:nil iconified:false |
|
8839 |
||
8840 |
"Modified: 20.8.1997 / 14:56:20 / cg" |
|
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8841 |
! |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8842 |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8843 |
realizeKeepingGroup:keepGroupAsIs at:position iconified:iconified |
151 | 8844 |
"common helper for realize and realizeInGroup. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8845 |
Create the view; if the keepGroupAsIs argument is not true, |
1877 | 8846 |
assign my windowGroup." |
140 | 8847 |
|
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8848 |
|superGroup groupChange keep| |
140 | 8849 |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8850 |
"/ fetch device colors, to avoid reallocation at redraw time |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8851 |
self fetchDeviceResources. |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8852 |
|
2189
86284985c4c0
care for non-creatable views.
Claus Gittinger <cg@exept.de>
parents:
2174
diff
changeset
|
8853 |
drawableId isNil ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8854 |
self create. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8855 |
drawableId isNil ifTrue:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8856 |
('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8857 |
^ self |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8858 |
] |
2189
86284985c4c0
care for non-creatable views.
Claus Gittinger <cg@exept.de>
parents:
2174
diff
changeset
|
8859 |
]. |
140 | 8860 |
|
372 | 8861 |
groupChange := false. |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8862 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8863 |
(windowGroup notNil |
1877 | 8864 |
and:[superView isNil |
8865 |
and:[windowGroup isForModalSubview]]) ifTrue:[ |
|
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8866 |
keep := true. |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8867 |
] ifFalse:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8868 |
keep := keepGroupAsIs |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8869 |
]. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8870 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
8871 |
keep ifFalse:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8872 |
" |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8873 |
put myself into superviews windowgroup if there is a superview |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8874 |
This is the default behavior, which may be suppressed by |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8875 |
passing true as keepGroupAsIs-argument. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8876 |
(it may be useful to assign a separate windowGroup to |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8877 |
a childView to have it execute independent of the parent |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8878 |
-> an example is found in the fileBrowsers kill-button) |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8879 |
" |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8880 |
superView notNil ifTrue:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8881 |
superGroup := superView windowGroup. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8882 |
(windowGroup notNil and:[superGroup ~~ windowGroup]) ifTrue:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8883 |
" |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8884 |
mhmh - seems that the windowgroup has changed .... |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8885 |
" |
145 | 8886 |
"/ 'oops - wgroup change on realize' printNL. |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8887 |
groupChange := true. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8888 |
|
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8889 |
"/ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8890 |
"/ recursively change the windowGroup of |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8891 |
"/ myself and all of my children |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8892 |
"/ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8893 |
self windowGroup:superGroup. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8894 |
] ifFalse:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8895 |
windowGroup isNil ifTrue:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8896 |
"/ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8897 |
"/ only change the group of myself - |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8898 |
"/ subviews will fetch it when realized. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8899 |
"/ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8900 |
windowGroup := superGroup. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8901 |
superGroup notNil ifTrue:[superGroup addView:self]. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8902 |
] |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8903 |
]. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8904 |
]. |
140 | 8905 |
]. |
8906 |
||
3375 | 8907 |
(self originOrExtentChanged) ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8908 |
self fixSize. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8909 |
self sizeChanged:nil. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8910 |
]. |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8911 |
position notNil ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8912 |
self origin:position. |
1039
ef2ded1798df
Send #realize to subviews even if hiddenOnRealize is set for myself.
Stefan Vogel <sv@exept.de>
parents:
1038
diff
changeset
|
8913 |
]. |
ef2ded1798df
Send #realize to subviews even if hiddenOnRealize is set for myself.
Stefan Vogel <sv@exept.de>
parents:
1038
diff
changeset
|
8914 |
|
ef2ded1798df
Send #realize to subviews even if hiddenOnRealize is set for myself.
Stefan Vogel <sv@exept.de>
parents:
1038
diff
changeset
|
8915 |
(subViews notNil or:[components notNil]) ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8916 |
(realized not or:[groupChange]) ifTrue:[ |
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
8917 |
self isHiddenOnRealize ifFalse:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8918 |
self realizeAllSubViews. |
2558 | 8919 |
]. |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8920 |
]. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8921 |
]. |
1874
a46a8c065050
recursively change the windowGroup of all children,
Claus Gittinger <cg@exept.de>
parents:
1860
diff
changeset
|
8922 |
|
4126 | 8923 |
self preRealize. |
8924 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8925 |
iconified ifTrue:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8926 |
realized ifFalse:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8927 |
self mapIconified |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8928 |
] |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
8929 |
] ifFalse:[ |
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8930 |
(self isHiddenOnRealize not |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8931 |
and:[visibilityChannel isNil or:[visibilityChannel value]]) ifTrue:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8932 |
self setInnerClip. |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8933 |
|
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8934 |
realized ifFalse:[ |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8935 |
" |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8936 |
now, make the view visible |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8937 |
" |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8938 |
self mapAt:position |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8939 |
] |
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8940 |
] |
140 | 8941 |
]. |
8942 |
||
8943 |
controller notNil ifTrue:[ |
|
5029
b9b004d17044
do not realize, if visibilityChannel says that the view should be invisible
Stefan Vogel <sv@exept.de>
parents:
5026
diff
changeset
|
8944 |
controller startUp |
1827 | 8945 |
]. |
8946 |
||
8947 |
self postRealize |
|
654 | 8948 |
|
2189
86284985c4c0
care for non-creatable views.
Claus Gittinger <cg@exept.de>
parents:
2174
diff
changeset
|
8949 |
"Modified: / 23.8.1996 / 15:07:16 / stefan" |
86284985c4c0
care for non-creatable views.
Claus Gittinger <cg@exept.de>
parents:
2174
diff
changeset
|
8950 |
"Created: / 24.7.1997 / 13:10:17 / cg" |
86284985c4c0
care for non-creatable views.
Claus Gittinger <cg@exept.de>
parents:
2174
diff
changeset
|
8951 |
"Modified: / 27.7.1998 / 20:01:02 / cg" |
140 | 8952 |
! |
8953 |
||
8954 |
recreate |
|
3301 | 8955 |
"recreate (i.e. tell X about me) after a snapin or a migration" |
140 | 8956 |
|
8957 |
drawableId isNil ifTrue:[ |
|
3762 | 8958 |
super recreate. |
8959 |
self physicalCreate. |
|
8960 |
||
8961 |
viewBackground notNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
8962 |
self setViewBackground |
3762 | 8963 |
]. |
8964 |
||
8965 |
" |
|
8966 |
XXX has to be changed: eventmasks are device specific - |
|
8967 |
XXX will not allow restart on another Workstation-type. |
|
8968 |
XXX event masks must become symbolic |
|
8969 |
" |
|
8970 |
eventMask isNil ifTrue:[ |
|
8971 |
eventMask := device defaultEventMask |
|
8972 |
]. |
|
8973 |
device setEventMask:eventMask in:drawableId |
|
140 | 8974 |
] |
8975 |
! |
|
8976 |
||
654 | 8977 |
remap |
8978 |
"make the view visible on the screen at its previous position. |
|
8979 |
In contrast to map, this asks the windowManager to show the view |
|
8980 |
immediately (instead of asking for a frame). However, some windowManagers |
|
8981 |
are known to ignore this ..." |
|
8982 |
||
8983 |
realized ifFalse:[ |
|
3152 | 8984 |
" |
8985 |
now, make the view visible |
|
8986 |
" |
|
8987 |
realized := true. |
|
8988 |
device |
|
8989 |
mapView:self id:drawableId iconified:false |
|
8990 |
atX:left y:top width:width height:height |
|
8991 |
minExtent:(self minExtent) maxExtent:(self maxExtent) |
|
654 | 8992 |
] |
8993 |
||
8994 |
"Created: 8.5.1996 / 09:33:06 / cg" |
|
1379 | 8995 |
"Modified: 25.2.1997 / 22:44:33 / cg" |
654 | 8996 |
! |
8997 |
||
1109 | 8998 |
rerealize |
8999 |
"rerealize at old position in (a possibly different) windowGroup." |
|
9000 |
||
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
9001 |
self fetchDeviceResources. |
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
9002 |
|
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
9003 |
self rerealizeInGroup:windowGroup. |
1109 | 9004 |
|
9005 |
"Created: 7.11.1996 / 16:27:09 / cg" |
|
1193
341a4265f5d6
added #fetchDeviceResources,
Claus Gittinger <cg@exept.de>
parents:
1190
diff
changeset
|
9006 |
"Modified: 13.1.1997 / 21:53:18 / cg" |
1109 | 9007 |
! |
9008 |
||
269 | 9009 |
rerealizeInGroup:aWindowGroup |
9010 |
"rerealize at old position in (a possibly different) windowGroup." |
|
9011 |
||
1837 | 9012 |
drawableId isNil ifTrue:[self create]. |
269 | 9013 |
drawableId notNil ifTrue:[ |
3152 | 9014 |
aWindowGroup ~~ windowGroup ifTrue:[ |
9015 |
windowGroup notNil ifTrue:[ |
|
9016 |
windowGroup removeView:self |
|
9017 |
]. |
|
9018 |
windowGroup := aWindowGroup. |
|
9019 |
aWindowGroup addTopView:self. |
|
9020 |
]. |
|
9021 |
self remap. |
|
269 | 9022 |
] |
646
0d2886a9ae38
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
640
diff
changeset
|
9023 |
|
0d2886a9ae38
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
640
diff
changeset
|
9024 |
"Modified: 3.5.1996 / 23:59:30 / stefan" |
1837 | 9025 |
"Modified: 28.7.1997 / 18:53:01 / cg" |
140 | 9026 |
! |
9027 |
||
9028 |
rerealizeWithAllSubViews |
|
9029 |
"rerealize myself with all subviews" |
|
9030 |
||
9031 |
drawableId notNil ifTrue:[ |
|
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9032 |
realized := true. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9033 |
self realizeAllSubViews. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9034 |
superView isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9035 |
device |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9036 |
mapView:self id:drawableId iconified:false |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9037 |
atX:left y:top width:width height:height |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9038 |
minExtent:(self minExtent) maxExtent:(self maxExtent) |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9039 |
] ifFalse:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9040 |
device |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9041 |
mapWindow:drawableId |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9042 |
]. |
140 | 9043 |
] |
1290
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
9044 |
|
1cc24cff6fe9
eliminated some references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
1261
diff
changeset
|
9045 |
"Modified: 28.1.1997 / 17:59:28 / cg" |
180 | 9046 |
! |
9047 |
||
269 | 9048 |
resize |
9049 |
"resize myself to make everything fit into me. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9050 |
Here, nothing special is done (except for setting my extent to the |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
9051 |
preferredExtent), but may be redefined in some subclasses." |
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
9052 |
|
4899
5d9393ff0aae
use accessors for hiddenOnRealize and explicitExtents;
Claus Gittinger <cg@exept.de>
parents:
4898
diff
changeset
|
9053 |
self hasExplicitExtent ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9054 |
layout isNil ifTrue:[ |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9055 |
self extent:(self preferredExtent). |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9056 |
self explicitExtent:false. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9057 |
]. |
947
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
9058 |
] |
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
9059 |
|
e8ff54bc0309
remember an explicit change of the extent;
Claus Gittinger <cg@exept.de>
parents:
946
diff
changeset
|
9060 |
"Modified: 15.7.1996 / 11:20:27 / cg" |
269 | 9061 |
! |
9062 |
||
9063 |
unmap |
|
2576 | 9064 |
"unmap the view - the view stays created (but invisible), and can be remapped again later." |
269 | 9065 |
|
9066 |
realized ifTrue:[ |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9067 |
realized := false. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9068 |
drawableId notNil ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9069 |
device unmapWindow:drawableId. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9070 |
|
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9071 |
"/ make it go away immediately |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9072 |
"/ (this hides the subview killing) |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9073 |
device flush. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9074 |
]. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9075 |
|
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9076 |
"/ Normally, this is not correct with X, where the |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9077 |
"/ unmap is an asynchronous operation. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9078 |
"/ (shown is cleared also in unmapped event) |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9079 |
"/ Do it anyway, to avoid synchronisation problems. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9080 |
|
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9081 |
shown ifTrue:[ |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9082 |
shown := false. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9083 |
self changed:#visibility. |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9084 |
] |
269 | 9085 |
]. |
190 | 9086 |
|
9087 |
" |
|
269 | 9088 |
|top sub| |
9089 |
||
9090 |
top := StandardSystemView new. |
|
9091 |
top extent:200@200. |
|
9092 |
||
9093 |
sub := View |
|
5087
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9094 |
origin:0.2@0.2 |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9095 |
corner:0.8@0.8 |
a66493cf7fdd
sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents:
5082
diff
changeset
|
9096 |
in:top. |
269 | 9097 |
|
9098 |
sub viewBackground:Color red. |
|
9099 |
sub hiddenOnRealize:true. |
|
9100 |
||
9101 |
top open. |
|
9102 |
(Delay forSeconds:5) wait. |
|
9103 |
sub map. |
|
9104 |
(Delay forSeconds:3) wait. |
|
9105 |
sub unmap. |
|
9106 |
sub viewBackground:(Color green). |
|
9107 |
(Delay forSeconds:3) wait. |
|
9108 |
sub map. |
|
151 | 9109 |
" |
1379 | 9110 |
|
2465
193a96bd94d7
clear shown when unmapped notification arrives
Claus Gittinger <cg@exept.de>
parents:
2454
diff
changeset
|
9111 |
"Modified: / 22.2.1999 / 20:10:58 / cg" |
269 | 9112 |
! |
9113 |
||
9114 |
unrealize |
|
9115 |
"alias for unmap, for historic reasons" |
|
9116 |
||
3434 | 9117 |
<resource:#obsolete> |
9118 |
||
4464 | 9119 |
self obsoleteMethodWarning:'use #unmap'. |
269 | 9120 |
self unmap. |
646
0d2886a9ae38
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
640
diff
changeset
|
9121 |
|
0d2886a9ae38
Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents:
640
diff
changeset
|
9122 |
"Modified: 4.5.1996 / 00:07:48 / stefan" |
151 | 9123 |
! ! |
9124 |
||
9125 |
!SimpleView methodsFor:'redrawing'! |
|
9126 |
||
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9127 |
clearExposedAreaInRedraw |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9128 |
"return true here, if the exposed area should be cleared here |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9129 |
or not. In almost every situation, it makes sense to do so..." |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9130 |
|
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9131 |
^ true |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9132 |
! |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9133 |
|
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9134 |
flash |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9135 |
"flash the view - fill it black, then white, finally |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9136 |
redraw completely. |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9137 |
Can be used to wakeup the user :-) |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9138 |
when problem or warning conditions arise. |
2174 | 9139 |
Someone may redefine this to flash its contents (instead of black/white)." |
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9140 |
|
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9141 |
self fill:Black. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9142 |
Delay waitForSeconds:0.1. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9143 |
self fill:White. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9144 |
Delay waitForSeconds:0.1. |
2173 | 9145 |
self fill:viewBackground. |
9146 |
"/ self clear. |
|
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9147 |
self invalidate |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9148 |
|
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9149 |
" |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9150 |
|v| |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9151 |
|
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9152 |
v := View new openAndWait. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9153 |
Delay waitForSeconds:2. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9154 |
v flash. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9155 |
Delay waitForSeconds:2. |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9156 |
v destroy |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9157 |
" |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9158 |
|
2174 | 9159 |
"Modified: / 16.7.1998 / 18:46:48 / cg" |
765
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9160 |
! |
f6c9c653e03f
removed useless superViewMapped/superViewUnmapped messages
Claus Gittinger <cg@exept.de>
parents:
763
diff
changeset
|
9161 |
|
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9162 |
invalidate |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9163 |
"add a damage to redraw the recevier to its input event queue. |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9164 |
This is preferable to calling redraw directly, in that the drawing is done by |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9165 |
the views process itself, and there is a possibilty to merge |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9166 |
multiple damage rectangles into single redraws. |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9167 |
However, be aware, that the redrawing may be delayed for some time, |
4057 | 9168 |
until the receivers windowGroupProcess gets rescheduled." |
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9169 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9170 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9171 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9172 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9173 |
^ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9174 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9175 |
self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9176 |
invalidateDeviceRectangle:(Rectangle left:0 top:0 width:width height:height) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9177 |
repairNow:false |
2394
cfb6434f1a9c
oops - invalidate must add deviceRectangles to the damage-list.
Claus Gittinger <cg@exept.de>
parents:
2382
diff
changeset
|
9178 |
|
cfb6434f1a9c
oops - invalidate must add deviceRectangles to the damage-list.
Claus Gittinger <cg@exept.de>
parents:
2382
diff
changeset
|
9179 |
"Modified: / 9.11.1998 / 21:04:16 / cg" |
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9180 |
! |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9181 |
|
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9182 |
invalidate:aRectangle |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9183 |
"add a damage to redraw part of the recevier, to its input event queue. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9184 |
This is preferable to calling redraw directly, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9185 |
in that the drawing is done by the views process itself, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9186 |
and there is a possibilty to merge multiple damage rectangles into |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9187 |
single redraws. |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9188 |
However, be aware, that the redrawing may be delayed for some time, |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9189 |
intil the receivers windowGroupProcess gets rescheduled." |
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9190 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9191 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9192 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9193 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9194 |
^ self |
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9195 |
]. |
2394
cfb6434f1a9c
oops - invalidate must add deviceRectangles to the damage-list.
Claus Gittinger <cg@exept.de>
parents:
2382
diff
changeset
|
9196 |
self invalidate:aRectangle repairNow:false |
cfb6434f1a9c
oops - invalidate must add deviceRectangles to the damage-list.
Claus Gittinger <cg@exept.de>
parents:
2382
diff
changeset
|
9197 |
|
cfb6434f1a9c
oops - invalidate must add deviceRectangles to the damage-list.
Claus Gittinger <cg@exept.de>
parents:
2382
diff
changeset
|
9198 |
"Modified: / 9.11.1998 / 21:03:14 / cg" |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9199 |
! |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9200 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9201 |
invalidate:aRectangle repairNow:doRepairNow |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9202 |
"add a damage to redraw part of the receiver, to its input event queue. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9203 |
and (if repairNow is true), force the receiver to repair all of its |
2451 | 9204 |
damaged areas right now. |
9205 |
The given rectangle is in logical coordinate space." |
|
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9206 |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
9207 |
|r| |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
9208 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9209 |
shown ifFalse:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9210 |
"/ no need to add damage - will get a full-redraw anyway, |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9211 |
"/ when I will be shown again. |
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9212 |
^ self |
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9213 |
]. |
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9214 |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
9215 |
r := aRectangle. |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3838
diff
changeset
|
9216 |
transformation notNil ifTrue:[ |
5008
468d1a62a90f
middleButtonMenu and keyCommands no longer held in instvars but in moreAttributes.
Claus Gittinger <cg@exept.de>
parents:
5004
diff
changeset
|
9217 |
r := transformation applyTo:r. |
4971 | 9218 |
]. |
4993
bf54a6128b78
oops - invalidate:repairNow: did not care for transformation !
Claus Gittinger <cg@exept.de>
parents:
4990
diff
changeset
|
9219 |
self invalidateDeviceRectangle:r repairNow:doRepairNow |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9220 |
|
2395 | 9221 |
"Modified: / 10.11.1998 / 01:55:03 / cg" |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9222 |
! |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9223 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9224 |
invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2396
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9225 |
"add a damage to redraw part of the receiver, to its input event queue. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9226 |
and (if repairNow is true), force the receiver to repair all of its |
2451 | 9227 |
damaged areas right now. |
9228 |
The given rectangle is in device coordinate space." |
|
2396
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9229 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9230 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9231 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9232 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9233 |
^ self |
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9234 |
]. |
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9235 |
|
4049 | 9236 |
self sensor addDamage:aRectangle view:self. |
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9237 |
doRepairNow ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9238 |
self repairDamage |
2396
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9239 |
] |
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9240 |
|
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9241 |
"Modified: / 10.11.1998 / 01:55:03 / cg" |
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9242 |
"Created: / 10.11.1998 / 19:02:01 / cg" |
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9243 |
! |
da3125ce46f1
oops - must invalidate deviceRectangle in scroll.
Claus Gittinger <cg@exept.de>
parents:
2395
diff
changeset
|
9244 |
|
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9245 |
invalidateRepairNow:doRepair |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9246 |
"add a damage to redraw all of the receiver, to its input event queue. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9247 |
and (if repairNow is true), force the receiver to repair all of its |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9248 |
damaged areas right now." |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9249 |
|
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9250 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9251 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9252 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9253 |
^ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9254 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9255 |
self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9256 |
invalidateDeviceRectangle:(Rectangle left:0 top:0 width:width height:height) |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9257 |
repairNow:doRepair |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9258 |
|
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9259 |
"Created: 19.4.1997 / 11:58:04 / cg" |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9260 |
"Modified: 19.4.1997 / 12:00:00 / cg" |
718
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9261 |
! |
4ff126c012b5
added #invalidate / #invalidate:
Claus Gittinger <cg@exept.de>
parents:
714
diff
changeset
|
9262 |
|
3704 | 9263 |
invalidateX:x y:y width:w height:h |
9264 |
"add a damage to redraw all of the receiver, to its input event queue." |
|
9265 |
||
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9266 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9267 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9268 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9269 |
^ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9270 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9271 |
self invalidate:(Rectangle left:x top:y width:w height:h) |
3704 | 9272 |
! |
9273 |
||
9274 |
invalidateX:x y:y width:w height:h repairNow:doRepair |
|
9275 |
"add a damage to redraw all of the receiver, to its input event queue. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9276 |
and (if repairNow is true), force the receiver to repair all of its |
3704 | 9277 |
damaged areas right now." |
9278 |
||
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9279 |
shown ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9280 |
"/ no need to add damage - will get a full-redraw anyway, |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9281 |
"/ when I will be shown again. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9282 |
^ self |
4047
622d06eca488
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
4038
diff
changeset
|
9283 |
]. |
3704 | 9284 |
self invalidate:(Rectangle left:x top:y width:w height:h) repairNow:doRepair |
9285 |
! |
|
9286 |
||
269 | 9287 |
redraw |
782 | 9288 |
"redraw myself completely - this is sent by redrawX:y:width:height: |
9289 |
as a fallback. |
|
9290 |
Cannot do much here - is redefined in subclasses which dont care for |
|
9291 |
updating regions but instead update everything." |
|
9292 |
||
9293 |
"Modified: 29.5.1996 / 18:02:52 / cg" |
|
269 | 9294 |
! |
9295 |
||
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9296 |
redraw:aRectangle |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9297 |
"redraw a part of the view immediately." |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9298 |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9299 |
self |
3152 | 9300 |
redrawX:(aRectangle left) |
9301 |
y:(aRectangle top) |
|
9302 |
width:(aRectangle width) |
|
9303 |
height:(aRectangle height) |
|
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9304 |
|
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9305 |
"Modified: 19.4.1997 / 11:54:23 / cg" |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9306 |
! |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9307 |
|
5250 | 9308 |
redrawComponentsIn:aRectangle |
9309 |
components notNil ifTrue:[ |
|
9310 |
components do:[:aComponent | |
|
9311 |
|thisFrame is| |
|
9312 |
||
9313 |
thisFrame := aComponent bounds. |
|
5258
a84265cb2456
changed #redrawComponentsIn:
Claus Gittinger <cg@exept.de>
parents:
5257
diff
changeset
|
9314 |
(thisFrame notNil and:[thisFrame intersects:aRectangle]) ifTrue:[ |
5250 | 9315 |
aComponent displayOn:self |
9316 |
] |
|
9317 |
] |
|
9318 |
]. |
|
9319 |
! |
|
9320 |
||
269 | 9321 |
redrawDeviceX:x y:y width:w height:h |
9322 |
"have to redraw part of the view. |
|
9323 |
The coordinates are in device space - if there is a transformation, |
|
9324 |
must inverse-transform back to logical coordinates. (since the view thinks |
|
9325 |
in its coordinate space)" |
|
9326 |
||
9327 |
|lx ly lw lh| |
|
9328 |
||
2822 | 9329 |
transformation isNil ifTrue:[ |
3152 | 9330 |
lx := x. |
9331 |
ly := y. |
|
9332 |
lw := w. |
|
9333 |
lh := h. |
|
2822 | 9334 |
] ifFalse:[ |
3152 | 9335 |
lx := transformation applyInverseToX:x. |
9336 |
ly := transformation applyInverseToY:y. |
|
9337 |
lw := transformation applyInverseScaleX:w. |
|
9338 |
lh := transformation applyInverseScaleY:h. |
|
269 | 9339 |
]. |
9340 |
self redrawX:lx y:ly width:lw height:lh |
|
9341 |
! |
|
9342 |
||
151 | 9343 |
redrawX:x y:y width:w height:h |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9344 |
"redraw part of myself immediately, given logical coordinates |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9345 |
(if transformation is nonNil) |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9346 |
The default here is to redraw everything |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9347 |
- subclasses usually redefine this, adding more intelligence" |
151 | 9348 |
|
738 | 9349 |
|area oldClip| |
151 | 9350 |
|
9351 |
shown ifFalse:[^ self]. |
|
9352 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9353 |
area := Rectangle left:x top:y width:w height:h. |
738 | 9354 |
oldClip := clipRect. |
9355 |
self clippingRectangle:area. |
|
9356 |
||
5263
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9357 |
self clearExposedAreaInRedraw ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9358 |
"/ win95 workaround: non-existing bg-pixmap support (obsolete) |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9359 |
(viewBackground isImageOrForm and:[ device supportsAnyViewBackgroundPixmaps not ]) ifTrue:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9360 |
self fillRectangleWithViewBackgroundX:x y:y width:w height:h |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9361 |
] ifFalse:[ |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9362 |
self clearRectangleX:x y:y width:w height:h. |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9363 |
] |
654f1779f5ed
changed redraw to always clear the exposed area, unless
Claus Gittinger <cg@exept.de>
parents:
5262
diff
changeset
|
9364 |
]. |
5250 | 9365 |
"/ redraw everything - a fallBack for lazy views. |
9366 |
self redraw. |
|
9367 |
||
9368 |
"/ draw them afterwards - they can be used to replace heavy-weight views. |
|
9369 |
self redrawComponentsIn:area. |
|
738 | 9370 |
self clippingRectangle:oldClip. |
9371 |
||
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9372 |
"Modified: 19.4.1997 / 11:55:08 / cg" |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9373 |
! |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9374 |
|
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9375 |
repairDamage |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9376 |
"force the receiver to repair all of its |
2095 | 9377 |
damaged areas right now." |
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9378 |
|
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9379 |
|wg| |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9380 |
|
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9381 |
shown ifTrue:[ |
3152 | 9382 |
(wg := self windowGroup) notNil ifTrue:[ |
9383 |
"/ wg processRealExposeEventsFor:self. "/ this ignores map/unmap |
|
9384 |
wg processExposeEventsFor:self. "/ this handles map/unmap |
|
9385 |
] |
|
1615
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9386 |
] |
24950d99a5c2
added #repairDamage & invalidate-with-repair
Claus Gittinger <cg@exept.de>
parents:
1614
diff
changeset
|
9387 |
|
2138
1800e9b5afe3
also handle map/unmap events in repairDamage.
Claus Gittinger <cg@exept.de>
parents:
2130
diff
changeset
|
9388 |
"Created: / 19.4.1997 / 12:01:13 / cg" |
2406 | 9389 |
"Modified: / 3.12.1998 / 14:02:06 / cg" |
151 | 9390 |
! |
9391 |
||
269 | 9392 |
showActive |
9393 |
"redraw myself as active (i.e. busy). |
|
9394 |
Nothing done here, but redefined in some classes." |
|
9395 |
||
9396 |
^ self |
|
135 | 9397 |
! |
9398 |
||
9399 |
showPassive |
|
9400 |
"redraw myself as inactive (i.e. nonbusy). |
|
151 | 9401 |
Nothing done here, but redefined in some classes." |
135 | 9402 |
|
9403 |
^ self |
|
9404 |
! ! |
|
9405 |
||
269 | 9406 |
!SimpleView methodsFor:'scrolling'! |
9407 |
||
2559
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9408 |
halfPageDown |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9409 |
"scroll down half a page |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9410 |
" |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9411 |
self scrollDown:(self innerHeight // 2) |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9412 |
|
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9413 |
|
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9414 |
! |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9415 |
|
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9416 |
halfPageUp |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9417 |
"scroll up half a page |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9418 |
" |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9419 |
self scrollUp:(self innerHeight // 2) |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9420 |
|
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9421 |
! |
6f5c5691475e
halfPage scroll methods moved to SimpleView
Claus Gittinger <cg@exept.de>
parents:
2558
diff
changeset
|
9422 |
|
269 | 9423 |
horizontalScrollStep |
9424 |
"return the amount to scroll when stepping left/right. |
|
9425 |
Subclasses may want to redefine this." |
|
9426 |
||
9427 |
^ (device horizontalPixelPerMillimeter * 20) asInteger |
|
9428 |
! |
|
9429 |
||
1052
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9430 |
pageDown |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9431 |
self scrollDown:(self innerHeight) |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9432 |
|
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9433 |
"Created: 13.9.1996 / 14:06:54 / cg" |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9434 |
! |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9435 |
|
4964
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9436 |
pageLeft |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9437 |
self scrollLeft:(self innerWidth) |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9438 |
|
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9439 |
"Created: 13.9.1996 / 14:06:54 / cg" |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9440 |
! |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9441 |
|
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9442 |
pageRight |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9443 |
self scrollRight:(self innerWidth) |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9444 |
! |
b059a14ce764
Define #pageLeft and #pageRight
Stefan Vogel <sv@exept.de>
parents:
4958
diff
changeset
|
9445 |
|
1052
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9446 |
pageUp |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9447 |
self scrollUp:(self innerHeight) |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9448 |
|
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9449 |
"Created: 13.9.1996 / 14:07:01 / cg" |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9450 |
! |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9451 |
|
269 | 9452 |
scrollDown |
9453 |
"scroll down by some amount; this is called when the scrollbars |
|
9454 |
scroll-step down button is pressed." |
|
9455 |
||
9456 |
self scrollDown:(self verticalScrollStep) |
|
9457 |
! |
|
9458 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9459 |
scrollDown:nPixels |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9460 |
"change origin to scroll down some pixels" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9461 |
|
1035
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9462 |
|viewOrigin| |
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9463 |
|
2703 | 9464 |
nPixels ~~ 0 ifTrue:[ |
3152 | 9465 |
viewOrigin := self viewOrigin. |
9466 |
self scrollTo:(viewOrigin x @ (viewOrigin y + nPixels)) |
|
2703 | 9467 |
] |
9468 |
||
9469 |
"Modified: / 20.8.1996 / 17:34:36 / stefan" |
|
9470 |
"Modified: / 21.5.1999 / 15:57:56 / cg" |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9471 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9472 |
|
269 | 9473 |
scrollHorizontalTo:aPixelOffset |
9474 |
"change origin to make aPixelOffset be the left col" |
|
9475 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9476 |
|orgY| |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9477 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9478 |
orgY := self viewOrigin y. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9479 |
^ self scrollTo:(aPixelOffset @ orgY). |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9480 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9481 |
"Modified: 8.7.1996 / 15:34:54 / stefan" |
140 | 9482 |
! |
9483 |
||
269 | 9484 |
scrollHorizontalToPercent:percent |
9485 |
"scroll to a position given in percent of total" |
|
9486 |
||
9487 |
|wCont| |
|
9488 |
||
9489 |
wCont := self widthOfContents. |
|
9490 |
transformation notNil ifTrue:[ |
|
3152 | 9491 |
wCont := transformation applyScaleX:wCont. |
269 | 9492 |
]. |
9493 |
self scrollHorizontalTo: |
|
3152 | 9494 |
((((wCont * percent) / 100.0) + 0.5) asInteger) |
269 | 9495 |
! |
9496 |
||
9497 |
scrollLeft |
|
9498 |
"scroll left by some amount; this is called when the scrollbars |
|
9499 |
scroll-step left button is pressed." |
|
9500 |
||
9501 |
self scrollLeft:(self horizontalScrollStep) |
|
9502 |
! |
|
9503 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9504 |
scrollLeft:nPixels |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9505 |
"change origin to scroll left some pixels" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9506 |
|
1035
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9507 |
|viewOrigin| |
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9508 |
|
2703 | 9509 |
nPixels ~~ 0 ifTrue:[ |
3152 | 9510 |
viewOrigin := self viewOrigin. |
9511 |
self scrollTo:((viewOrigin x - nPixels) @ viewOrigin y). |
|
2703 | 9512 |
] |
9513 |
||
9514 |
"Modified: / 20.8.1996 / 17:35:09 / stefan" |
|
9515 |
"Modified: / 21.5.1999 / 15:58:03 / cg" |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9516 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9517 |
|
269 | 9518 |
scrollRight |
9519 |
"scroll right by some amount; this is called when the scrollbars |
|
9520 |
scroll-step right button is pressed." |
|
9521 |
||
9522 |
self scrollRight:(self horizontalScrollStep) |
|
9523 |
! |
|
9524 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9525 |
scrollRight:nPixels |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9526 |
"change origin to scroll right some pixels" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9527 |
|
1035
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9528 |
|viewOrigin| |
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9529 |
|
2703 | 9530 |
nPixels ~~ 0 ifTrue:[ |
3152 | 9531 |
viewOrigin := self viewOrigin. |
9532 |
self scrollTo:((viewOrigin x + nPixels) @ viewOrigin y) |
|
2703 | 9533 |
] |
9534 |
||
9535 |
"Modified: / 20.8.1996 / 17:35:37 / stefan" |
|
9536 |
"Modified: / 21.5.1999 / 15:58:08 / cg" |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9537 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9538 |
|
1052
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9539 |
scrollToBottom |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9540 |
self scrollTo:0 @ (self heightOfContents - self innerHeight) |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9541 |
|
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9542 |
"Created: 13.9.1996 / 14:08:03 / cg" |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9543 |
"Modified: 13.9.1996 / 14:09:32 / cg" |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9544 |
! |
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9545 |
|
2371
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9546 |
scrollToLeft |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9547 |
"move viewOrigin to the left" |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9548 |
|
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9549 |
self scrollHorizontalTo:0 |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9550 |
! |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9551 |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9552 |
scrollToPercent:originAsPercent |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9553 |
"scroll to a position given in percent of total (x and y as a Point)" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9554 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9555 |
|wCont hCont percent| |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9556 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9557 |
percent := originAsPercent asPoint. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9558 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9559 |
wCont := self widthOfContents. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9560 |
hCont := self heightOfContents. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9561 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9562 |
transformation notNil ifTrue:[ |
3152 | 9563 |
wCont := transformation applyScaleX:wCont. |
9564 |
hCont := transformation applyScaleY:hCont. |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9565 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9566 |
self scrollTo: |
3152 | 9567 |
((((wCont * percent x) / 100.0) + 0.5) asInteger) @ |
9568 |
((((hCont * percent y) / 100.0) + 0.5) asInteger) |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9569 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9570 |
"Created: 5.8.1996 / 12:15:53 / stefan" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9571 |
"Modified: 5.8.1996 / 12:42:57 / stefan" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9572 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9573 |
|
2371
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9574 |
scrollToRight |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9575 |
"move viewOrigin to the right" |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9576 |
|
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9577 |
|wCont| |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9578 |
|
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9579 |
wCont := self widthOfContents. |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9580 |
transformation notNil ifTrue:[ |
3152 | 9581 |
wCont := transformation applyScaleX:wCont. |
2371
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9582 |
]. |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9583 |
self scrollHorizontalTo:((wCont - self innerWidth) max:0) |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9584 |
|
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9585 |
! |
fafba97d401c
added #scrollToLeft and #scrollToRight
Claus Gittinger <cg@exept.de>
parents:
2357
diff
changeset
|
9586 |
|
269 | 9587 |
scrollToTop |
9588 |
"move viewOrigin to top" |
|
9589 |
||
9590 |
self scrollVerticalTo:0 |
|
9591 |
! |
|
9592 |
||
9593 |
scrollToTopLeft |
|
9594 |
"move viewOrigin to top/left" |
|
9595 |
||
9596 |
self scrollTo:(0 @ 0). |
|
9597 |
! |
|
9598 |
||
9599 |
scrollUp |
|
9600 |
"scroll up by some amount; this is called when the scrollbars |
|
9601 |
scroll-step up button is pressed." |
|
9602 |
||
9603 |
self scrollUp:(self verticalScrollStep) |
|
9604 |
! |
|
9605 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9606 |
scrollUp:nPixels |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9607 |
"change origin to scroll up (towards the origin) by some pixels" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9608 |
|
1035
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9609 |
|viewOrigin| |
261c3ab854f0
Use #viewOrigin instead of translation transformation to get
Stefan Vogel <sv@exept.de>
parents:
1028
diff
changeset
|
9610 |
|
2703 | 9611 |
nPixels ~~ 0 ifTrue:[ |
3152 | 9612 |
viewOrigin := self viewOrigin. |
9613 |
self scrollTo:(viewOrigin x @ (viewOrigin y - nPixels)). |
|
2703 | 9614 |
] |
9615 |
||
9616 |
"Modified: / 20.8.1996 / 17:36:16 / stefan" |
|
9617 |
"Modified: / 21.5.1999 / 15:58:21 / cg" |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9618 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9619 |
|
269 | 9620 |
scrollVerticalTo:aPixelOffset |
9621 |
"change origin to make aPixelOffset be the top line" |
|
9622 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9623 |
|orgX| |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9624 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9625 |
orgX := self viewOrigin x. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9626 |
^ self scrollTo:(orgX @ aPixelOffset). |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9627 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9628 |
"Modified: 8.7.1996 / 15:35:40 / stefan" |
135 | 9629 |
! |
9630 |
||
269 | 9631 |
scrollVerticalToPercent:percent |
9632 |
"scroll to a position given in percent of total" |
|
9633 |
||
9634 |
|hCont| |
|
9635 |
||
9636 |
hCont := self heightOfContents. |
|
9637 |
transformation notNil ifTrue:[ |
|
3152 | 9638 |
hCont := transformation applyScaleY:hCont. |
140 | 9639 |
]. |
269 | 9640 |
self scrollVerticalTo: |
3152 | 9641 |
((((hCont * percent) / 100.0) + 0.5) asInteger) |
269 | 9642 |
! |
9643 |
||
9644 |
verticalScrollStep |
|
5026 | 9645 |
"return the amount to scroll when stepping up/down (also used for mouseWheel). |
269 | 9646 |
Subclasses may want to redefine this." |
9647 |
||
9648 |
^ (device verticalPixelPerMillimeter * 20) asInteger |
|
9649 |
! |
|
9650 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9651 |
widthForScrollBetween:yStart and:yEnd |
269 | 9652 |
"return the width in pixels for a scroll between yStart and yEnd |
9653 |
- return full width here since we do not know how wide contents is. |
|
9654 |
Views which only use part of their space (short lists, text) may redefine |
|
9655 |
this method and return the number of pixels that have to be scrolled. |
|
9656 |
On slow displays, this may make a difference; on fast ones you will probably |
|
9657 |
not notice any difference." |
|
9658 |
||
9659 |
^ (width - margin - margin) |
|
135 | 9660 |
! ! |
9661 |
||
9662 |
!SimpleView methodsFor:'scrolling-basic'! |
|
9663 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9664 |
scrollTo:newOrigin |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9665 |
"change origin to have newOrigin be visible at the top-left. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9666 |
The argument defines the integer device coordinates of the new top-left |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9667 |
point." |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9668 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9669 |
^ self scrollTo:newOrigin redraw:true |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9670 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9671 |
"Modified: 15.7.1996 / 11:35:08 / stefan" |
1052
c7e31a453192
added default implementations for pageUp / pageDown
Claus Gittinger <cg@exept.de>
parents:
1048
diff
changeset
|
9672 |
"Modified: 13.9.1996 / 14:09:19 / cg" |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9673 |
! |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9674 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9675 |
scrollTo:newOrigin redraw:doRedraw |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9676 |
"change origin to have newOrigin be visible at the top-left. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9677 |
The argument defines the integer device coordinates of the new top-left |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9678 |
point." |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9679 |
|
3704 | 9680 |
^ self |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9681 |
scrollTo:newOrigin |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9682 |
redraw:doRedraw |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9683 |
allowScrollBeyondContents:false |
3704 | 9684 |
! |
9685 |
||
9686 |
scrollTo:newOrigin redraw:doRedraw allowScrollBehondContents:allowScrollBehondContents |
|
5214 | 9687 |
<resource: #obsolete> |
3704 | 9688 |
"change origin to have newOrigin be visible at the top-left. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9689 |
The argument defines the integer device coordinates of the new top-left |
3704 | 9690 |
point." |
9691 |
||
4295 | 9692 |
self obsoleteMethodWarning:'use #scrollTo:redraw:allowScrollBehondContents:'. |
4294 | 9693 |
^ self |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9694 |
scrollTo:newOrigin redraw:doRedraw allowScrollBeyondContents:allowScrollBehondContents |
4294 | 9695 |
! |
9696 |
||
9697 |
scrollTo:newOrigin redraw:doRedraw allowScrollBeyondContents:allowScrollBehondContents |
|
9698 |
"change origin to have newOrigin be visible at the top-left. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9699 |
The argument defines the integer device coordinates of the new top-left |
4294 | 9700 |
point." |
9701 |
||
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9702 |
|dX "{ Class:SmallInteger }" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9703 |
dY "{ Class:SmallInteger }" |
4520 | 9704 |
orgX |
9705 |
orgY |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9706 |
x y iw ih |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9707 |
hCont wCont fromX toX fromY toY copyWidth copyHeight |
2649 | 9708 |
redrawX redrawY wg| |
135 | 9709 |
|
9710 |
hCont := self heightOfContents. |
|
9711 |
wCont := self widthOfContents. |
|
9712 |
transformation isNil ifTrue:[ |
|
4834 | 9713 |
orgY := orgX := 0 |
135 | 9714 |
] ifFalse:[ |
4834 | 9715 |
wCont := (transformation applyScaleX:wCont) rounded. |
9716 |
hCont := (transformation applyScaleY:hCont) rounded. |
|
9717 |
orgY := transformation translation y negated. |
|
9718 |
orgX := transformation translation x negated |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9719 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9720 |
|
135 | 9721 |
iw := self innerWidth. |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9722 |
ih := self innerHeight. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9723 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9724 |
"don't scroll outside of displayed area" |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9725 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9726 |
x := newOrigin x. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9727 |
y := newOrigin y. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9728 |
|
3704 | 9729 |
allowScrollBehondContents ifFalse:[ |
4834 | 9730 |
x + iw > wCont ifTrue:[ |
9731 |
x := (wCont - iw) asInteger. |
|
9732 |
]. |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9733 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9734 |
x < 0 ifTrue:[ |
4834 | 9735 |
x := 0 |
3704 | 9736 |
]. |
9737 |
allowScrollBehondContents ifFalse:[ |
|
4834 | 9738 |
y + ih > hCont ifTrue:[ |
9739 |
y := (hCont - ih) asInteger. |
|
9740 |
]. |
|
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9741 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9742 |
y < 0 ifTrue:[ |
4834 | 9743 |
y := 0. |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9744 |
]. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9745 |
|
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9746 |
dX := x - orgX. |
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9747 |
dY := y - orgY. |
135 | 9748 |
|
1066 | 9749 |
(dX == 0 and:[dY == 0]) ifTrue:[ |
9750 |
^ self |
|
9751 |
]. |
|
9752 |
||
2649 | 9753 |
(wg := self windowGroup) notNil ifTrue:[ |
4834 | 9754 |
wg processRealExposeEventsFor:self. |
2649 | 9755 |
]. |
2405
95e4a8e563d8
precess expose events before scroll
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
9756 |
|
135 | 9757 |
self originWillChange. |
1017
43bc3829dcc5
Make #scrollTo: the basic scroll action.
Stefan Vogel <sv@exept.de>
parents:
1005
diff
changeset
|
9758 |
(shown and:[doRedraw]) ifTrue:[ |
4834 | 9759 |
copyWidth := iw - dX abs. |
9760 |
copyHeight := ih - dY abs. |
|
9761 |
((copyWidth > 0) and:[copyHeight > 0]) ifTrue:[ |
|
9762 |
"/ some of the currently displayed pixels |
|
9763 |
"/ remain visible. Copy them |
|
9764 |
||
9765 |
dX < 0 ifTrue:[ |
|
9766 |
fromX := margin. |
|
9767 |
toX := margin - dX. |
|
9768 |
redrawX := margin |
|
9769 |
] ifFalse:[ |
|
9770 |
fromX := margin + dX. |
|
9771 |
toX := margin. |
|
9772 |
redrawX := margin + copyWidth. |
|
9773 |
]. |
|
9774 |
dY < 0 ifTrue:[ |
|
9775 |
fromY := margin. |
|
9776 |
toY := margin - dY. |
|
9777 |
redrawY := margin. |
|
9778 |
] ifFalse:[ |
|
9779 |
fromY := margin + dY. |
|
9780 |
toY := margin. |
|
9781 |
redrawY := margin + copyHeight. |
|
9782 |
]. |
|
9783 |
self catchExpose. |
|
9784 |
self setViewOrigin:(x @ y). |
|
9785 |
self |
|
9786 |
copyFrom:self |
|
9787 |
x:fromX y:fromY |
|
9788 |
toX:toX y:toY |
|
9789 |
width:copyWidth |
|
9790 |
height:copyHeight |
|
9791 |
async:true. |
|
9792 |
||
9793 |
self setInnerClip. |
|
9794 |
||
9795 |
"first redraw the rectangle above/below the |
|
9796 |
copied area (with full width)." |
|
9797 |
||
9798 |
copyHeight < ih ifTrue:[ |
|
9799 |
self invalidateDeviceRectangle:((margin@redrawY) extent:(iw@(ih - copyHeight))) repairNow:false. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9800 |
"/ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9801 |
"/ redrawDeviceX:margin y:redrawY |
2381
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9802 |
"/ width:iw height:(ih - copyHeight). |
4834 | 9803 |
]. |
9804 |
||
9805 |
"second redraw the rectangle left/right of the |
|
9806 |
copied area" |
|
9807 |
||
9808 |
copyWidth < iw ifTrue:[ |
|
9809 |
self invalidateDeviceRectangle:((redrawX@toY) extent:((iw-copyWidth)@copyHeight)) repairNow:false. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9810 |
"/ self redrawDeviceX:redrawX y:toY |
2381
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9811 |
"/ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9812 |
"/ width:iw - copyWidth |
2381
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9813 |
"/ height:copyHeight. |
4834 | 9814 |
]. |
9815 |
self waitForExpose. |
|
9816 |
] ifFalse:[ |
|
9817 |
"redraw everything" |
|
9818 |
||
9819 |
self setViewOrigin:(x @ y). |
|
9820 |
self invalidateDeviceRectangle:((margin@margin) extent:(iw@ih)) repairNow:false. |
|
2381
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9821 |
"/ self redrawDeviceX:margin y:margin |
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9822 |
"/ width:iw |
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9823 |
"/ height:ih. |
4834 | 9824 |
]. |
269 | 9825 |
] ifFalse:[ |
4834 | 9826 |
self setViewOrigin:(x @ y). |
2802 | 9827 |
]. |
9828 |
||
709 | 9829 |
self originChanged:(dX negated @ dY negated). |
9830 |
||
2381
9a365ce57a19
async redraw when scrolling (i.e. invalidate instead of redraw)
Claus Gittinger <cg@exept.de>
parents:
2376
diff
changeset
|
9831 |
"Modified: / 5.8.1996 / 11:57:09 / stefan" |
2405
95e4a8e563d8
precess expose events before scroll
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
9832 |
"Modified: / 1.12.1998 / 22:35:18 / cg" |
135 | 9833 |
! ! |
9834 |
||
269 | 9835 |
!SimpleView methodsFor:'startup'! |
9836 |
||
9837 |
open |
|
9838 |
"open up the view - for normal views, this is a modeless open |
|
9839 |
(i.e. the new view comes up as independent process). |
|
9840 |
Although #open is only to be sent to topviews (i.e. it could have been |
|
9841 |
implemented in TopView), it is implemented here - therefore, every view |
|
9842 |
can be opened as a topView. |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9843 |
This is redefined in ModalBox, which comes up modal (i.e. |
269 | 9844 |
control is under the current process, so that interaction with the |
4131 | 9845 |
current group is blocked while the modalBox is active). |
9846 |
||
9847 |
Notice: after the open, you cannot be sure that the view is really open and |
|
9848 |
visible, since #open forks a new process, which does the actual window opening. |
|
9849 |
To ensure visibility, use #openAndWait or waitUntilVisible after the open." |
|
269 | 9850 |
|
9851 |
^ self openModeless |
|
9852 |
||
9853 |
" |
|
9854 |
View new open |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9855 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9856 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9857 |
" |
269 | 9858 |
(Button label:'hello') open |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9859 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9860 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9861 |
" |
269 | 9862 |
|top| |
9863 |
top := StandardSystemView new. |
|
9864 |
top extent:200@200. |
|
9865 |
Button label:'hello' in:top. |
|
9866 |
top open |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9867 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9868 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9869 |
" |
269 | 9870 |
YesNoBox new open |
9871 |
" |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9872 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9873 |
"Modified: 24.7.1997 / 13:26:42 / cg" |
269 | 9874 |
! |
9875 |
||
9876 |
openAndWait |
|
9877 |
"open up the view - wait until it is visible. |
|
9878 |
In normal applications, you do not need to wait till the view is |
|
9879 |
open - it should do all of its drawing itself when it gets the |
|
9880 |
first expose event. |
|
9881 |
However, if you want to 'manually' draw into the view (for example, |
|
9882 |
in doIt expressions) the view must be visible (realized) before doing so. |
|
9883 |
Use this open in those situations." |
|
9884 |
||
9885 |
self open. |
|
9886 |
self waitUntilVisible. |
|
9887 |
||
9888 |
"does not work: |
|
9889 |
||
3152 | 9890 |
|v| |
9891 |
||
9892 |
v := View new open. |
|
9893 |
v displayLineFrom:0@0 to:50@50 |
|
269 | 9894 |
|
9895 |
does work: |
|
9896 |
||
3152 | 9897 |
|v| |
9898 |
||
9899 |
v := View new openAndWait. |
|
9900 |
v displayLineFrom:0@0 to:50@50 |
|
269 | 9901 |
" |
9902 |
! |
|
9903 |
||
9904 |
openAt:aPoint |
|
9905 |
"open up the view modeless - positions the view" |
|
9906 |
||
9907 |
^self openModelessAt:aPoint |
|
9908 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9909 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9910 |
(Button label:'hello') open |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9911 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9912 |
(Button label:'hello') openAt:(100@100) |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9913 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9914 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9915 |
"Modified: 24.7.1997 / 13:26:23 / cg" |
269 | 9916 |
! |
9917 |
||
9918 |
openAtCenter |
|
9919 |
"open up the view modeless - positions the view" |
|
9920 |
||
9921 |
^self openModelessAtCenter |
|
9922 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9923 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9924 |
(Button label:'hello') open |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9925 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9926 |
(Button label:'hello') openAtCenter |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9927 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9928 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9929 |
"Modified: 24.7.1997 / 13:01:12 / cg" |
269 | 9930 |
! |
9931 |
||
9932 |
openAutonomous |
|
9933 |
"create and schedule a new windowgroup for me and open the view. |
|
9934 |
The view will be handled by its own process, effectively running in |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9935 |
parallel. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
9936 |
Notice: |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9937 |
This entry is for NON-topviews, which want to be served |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9938 |
autonomous from their real topview. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9939 |
(see the fileBrowsers kill-button |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9940 |
when executing unix commands as an example)" |
269 | 9941 |
|
1877 | 9942 |
|wg mainGroup| |
269 | 9943 |
|
4139 | 9944 |
wg := self windowGroupClass new. |
763 | 9945 |
self windowGroup:wg. |
1877 | 9946 |
|
9947 |
mainGroup := WindowGroup activeGroup. |
|
9948 |
mainGroup notNil ifTrue:[ |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9949 |
mainGroup := mainGroup mainGroup. |
1877 | 9950 |
]. |
9951 |
||
9952 |
wg isForModalSubview:true. "/ make it handle update events for the main group |
|
9953 |
wg startupWith:[wg mainGroup:mainGroup. self realizeInGroup]. |
|
9954 |
||
9955 |
"/ wg startupModal:[true] forGroup:mainGroup |
|
9956 |
"/ self realizeInGroup. |
|
9957 |
||
9958 |
"Modified: 20.8.1997 / 17:57:38 / cg" |
|
269 | 9959 |
! |
9960 |
||
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9961 |
openInGroup:aGroup |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9962 |
"special open within another windowGroup. |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
9963 |
This allows a view to be realized in any windowgroup; |
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9964 |
for applications where multiple views act as a group |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9965 |
(i.e. close and iconify together)." |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9966 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9967 |
self windowGroup:aGroup. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9968 |
aGroup addTopView:self. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9969 |
|
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9970 |
"/ self realizeKeepingGroup:true |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9971 |
aGroup isForModalSubview:true. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9972 |
self realize. |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9973 |
! |
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9974 |
|
269 | 9975 |
openModal |
9976 |
"create a new windowgroup, but start processing in the current process |
|
9977 |
actually suspending event processing for the currently active group. |
|
420
9ad55eba79ac
allow opening subViews as modal;
Claus Gittinger <cg@exept.de>
parents:
415
diff
changeset
|
9978 |
Stay in the modalLoop while the view is visible. |
269 | 9979 |
(i.e. control is returned to the sender when the receiver is closed)" |
9980 |
||
9981 |
self openModal:[true] |
|
9982 |
||
9983 |
" |
|
9984 |
the same: |
|
3152 | 9985 |
YesNoBox new open |
9986 |
||
9987 |
YesNoBox new openModal |
|
269 | 9988 |
|
9989 |
different: |
|
3152 | 9990 |
(Button label:'hello') open |
9991 |
||
9992 |
(Button label:'hello') openModal |
|
269 | 9993 |
" |
9994 |
! |
|
9995 |
||
9996 |
openModal:aBlock |
|
9997 |
"create a new windowgroup, but start processing in the current process - |
|
9998 |
actually suspending event processing for the currently active group. |
|
9999 |
Stay in this modal loop while aBlock evaluates to true AND the receiver is |
|
10000 |
visible. |
|
10001 |
(i.e. control is returned to the sender when the receiver is closed) |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10002 |
This makes any interaction with the current window impossible - |
269 | 10003 |
however, other views (in other windowgroups) still work." |
10004 |
||
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10005 |
|masterGroup activeGroup| |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10006 |
|
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10007 |
activeGroup := WindowGroup activeGroup. |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10008 |
|
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10009 |
"/ cg - because we raise that window, we should avoid to raise the main-non-modal view, |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10010 |
"/ if a dialog is opend from another modal view (confirmation in a modal-box) |
2167
41e74cf73d7a
fixed modal popup from a modal view
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
10011 |
|
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10012 |
"/ mainGroup := activeGroup. |
2167
41e74cf73d7a
fixed modal popup from a modal view
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
10013 |
"/ mainGroup notNil ifTrue:[mainGroup := mainGroup mainGroup]. |
41e74cf73d7a
fixed modal popup from a modal view
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
10014 |
|
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10015 |
"/ masterGroup := activeGroup. |
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10016 |
"/ [masterGroup notNil and:[masterGroup isPopUp or:[masterGroup isModal]]] whileTrue:[ |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10017 |
"/ masterGroup := masterGroup previousGroup. |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10018 |
"/ ]. |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10019 |
^ self openModal:aBlock inGroup:activeGroup "/ masterGroup "/ mainGroup. |
2167
41e74cf73d7a
fixed modal popup from a modal view
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
10020 |
|
41e74cf73d7a
fixed modal popup from a modal view
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
10021 |
"Created: / 10.12.1995 / 14:06:45 / cg" |
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10022 |
"Modified: / 9.7.1998 / 01:20:57 / cg" |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10023 |
! |
299
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10024 |
|
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10025 |
openModal:aBlock inGroup:mainGroup |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10026 |
"create a new windowgroup, but start processing in the current process - |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10027 |
actually suspending event processing for the main group. |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10028 |
Stay in this modal loop while aBlock evaluates to true AND the receiver is |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10029 |
visible. |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10030 |
(i.e. control is returned to the sender when the receiver is closed) |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10031 |
This makes any interaction with the current window impossible - |
299
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10032 |
however, other views (in other windowgroups) still work." |
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10033 |
|
3345 | 10034 |
|tops mainView mainViewID previousGroup | |
1397
932c517ad29c
moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1393
diff
changeset
|
10035 |
|
1736 | 10036 |
self isPopUpView ifFalse:[ |
5296 | 10037 |
"/ the following allows for knowledgable programmers to suppress dialog boxes, |
5295 | 10038 |
"/ or to patch common controls right before opening... |
5294
4795889e1871
allow for aboutToOpenBoxNotification to abort the box opening.
Claus Gittinger <cg@exept.de>
parents:
5293
diff
changeset
|
10039 |
(Dialog aboutToOpenBoxNotificationSignal raiseRequestWith:self) == #abort ifTrue:[ |
4795889e1871
allow for aboutToOpenBoxNotification to abort the box opening.
Claus Gittinger <cg@exept.de>
parents:
5293
diff
changeset
|
10040 |
^ self |
4795889e1871
allow for aboutToOpenBoxNotification to abort the box opening.
Claus Gittinger <cg@exept.de>
parents:
5293
diff
changeset
|
10041 |
]. |
5293
3cfe2ac1b101
AboutToOpenBoxNotificationSignal moved to SimpleView and raised
Claus Gittinger <cg@exept.de>
parents:
5292
diff
changeset
|
10042 |
|
5153 | 10043 |
mainGroup notNil ifTrue:[ |
10044 |
(tops := mainGroup topViews) notNil ifTrue:[ |
|
10045 |
tops notEmpty ifTrue:[ |
|
10046 |
mainView := tops detect:[:v| v shown] ifNone:nil. |
|
10047 |
mainView notNil ifTrue:[ |
|
10048 |
mainViewID := mainView id. |
|
10049 |
] |
|
10050 |
] |
|
10051 |
]. |
|
10052 |
]. |
|
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10053 |
|
5153 | 10054 |
mainView notNil ifTrue:[ |
10055 |
mainView activate; setForegroundWindow. |
|
10056 |
]. |
|
10057 |
||
10058 |
ModalBox usingTransientViews ifTrue:[ |
|
10059 |
"make view only transient, if there is a visible topView. |
|
10060 |
If none of them is visible, we do want an icon for ourself" |
|
10061 |
||
10062 |
mainViewID isNil ifTrue:[ |
|
10063 |
self origin:(device center - (self extent//2)) |
|
10064 |
]. |
|
10065 |
||
10066 |
drawableId isNil ifTrue:[self create]. |
|
10067 |
mainView notNil ifTrue:[ |
|
10068 |
device setTransient:drawableId for:mainViewID. |
|
10069 |
]. |
|
10070 |
]. |
|
1397
932c517ad29c
moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1393
diff
changeset
|
10071 |
]. |
932c517ad29c
moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1393
diff
changeset
|
10072 |
|
932c517ad29c
moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents:
1393
diff
changeset
|
10073 |
self raise. |
299
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10074 |
|
269 | 10075 |
Processor activeProcessIsSystemProcess ifTrue:[ |
5153 | 10076 |
" |
10077 |
put myself into the modal group, let it handle events for |
|
10078 |
me as well. This is only a half way solution, since the view |
|
10079 |
is not modal at all ... however, the only situation |
|
10080 |
where this happens is with modal boxes popped while in a |
|
10081 |
modal browser. You will forgive me for that inconvenience. |
|
10082 |
" |
|
10083 |
windowGroup := mainGroup. |
|
10084 |
mainGroup notNil ifTrue:[mainGroup addTopView:self]. |
|
10085 |
self realize |
|
135 | 10086 |
] ifFalse:[ |
5153 | 10087 |
previousGroup := WindowGroup activeGroup. |
10088 |
||
10089 |
" |
|
10090 |
show a stop-cursor in the main group |
|
10091 |
" |
|
10092 |
mainGroup notNil ifTrue:[ |
|
10093 |
self isPopUpView ifFalse:[ |
|
10094 |
mainGroup showCursor:(Cursor stop). |
|
10095 |
(previousGroup notNil and:[previousGroup ~~ mainGroup]) ifTrue:[ |
|
10096 |
previousGroup showCursor:(Cursor stop). |
|
10097 |
]. |
|
10098 |
] |
|
10099 |
]. |
|
10100 |
||
10101 |
" |
|
10102 |
create a new window group and put myself into it |
|
10103 |
" |
|
10104 |
windowGroup := self windowGroupClass new. |
|
10105 |
windowGroup addTopView:self. |
|
10106 |
windowGroup setPreviousGroup:previousGroup. |
|
10107 |
||
10108 |
superView notNil ifTrue:[ |
|
10109 |
"/ |
|
10110 |
"/ special: this is a modal subview, |
|
10111 |
"/ prevent the view from reassigning its windowGroup when realized |
|
10112 |
"/ (subviews normally place themself into the superviews group) |
|
10113 |
"/ |
|
10114 |
windowGroup isForModalSubview:true. |
|
10115 |
]. |
|
10116 |
||
10117 |
" |
|
10118 |
go dispatch events in this new group |
|
10119 |
(thus current windowgroup is blocked from interaction) |
|
10120 |
" |
|
10121 |
AbortOperationRequest handle:[:ex | |
|
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10122 |
AbortOperationRequest handle:[:ex2 | |
5273
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10123 |
"/ an aborted hide (user confirmation ?) |
9c8813e5b7a1
handling of abort of a hide-operation
Claus Gittinger <cg@exept.de>
parents:
5271
diff
changeset
|
10124 |
self breakPoint:#cg. |
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10125 |
ex proceed |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10126 |
] do:[ |
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10127 |
self hide. |
5289 | 10128 |
self realized ifTrue:[ |
10129 |
"/ self halt. "/ hide handled and closeRequest not wanted: |
|
10130 |
ex proceed |
|
10131 |
]. |
|
5283
1ed049b57dc0
abort signal handling when hiding a modal box
Claus Gittinger <cg@exept.de>
parents:
5273
diff
changeset
|
10132 |
"/ ex return |
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10133 |
]. |
5153 | 10134 |
ex return. |
10135 |
] do:[ |
|
10136 |
[ |
|
10137 |
[ |
|
10138 |
windowGroup startupModal:[realized and:aBlock] forGroup:mainGroup |
|
10139 |
] ifCurtailed:[ |
|
10140 |
self hide. |
|
10141 |
] |
|
10142 |
] ensure:[ |
|
10143 |
mainGroup notNil ifTrue:[ |
|
10144 |
mainGroup graphicsDevice sync. "thats a round trip - make sure that all drawing has been processed" |
|
10145 |
"/ ensure that eventListener runs here ... |
|
10146 |
Delay waitForSeconds:0.05. |
|
10147 |
mainGroup processExposeEvents. |
|
10148 |
||
10149 |
ReturnFocusWhenClosingModalBoxes ifTrue:[ |
|
10150 |
" |
|
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10151 |
return the input focus to the previously active group's top. |
5153 | 10152 |
This helps with windowmanagers which need an explicit click |
10153 |
on the view for the focus. |
|
10154 |
" |
|
10155 |
tops := mainGroup topViews. |
|
10156 |
(tops notEmptyOrNil) ifTrue:[ |
|
10157 |
tops first getKeyboardFocus |
|
10158 |
]. |
|
10159 |
]. |
|
10160 |
||
10161 |
" |
|
5271
228c32bcdd37
mainGroup detection was wrong for modal-view-open;
Claus Gittinger <cg@exept.de>
parents:
5268
diff
changeset
|
10162 |
restore cursors in the main group |
5153 | 10163 |
" |
10164 |
mainGroup restoreCursors. |
|
10165 |
(previousGroup notNil and:[previousGroup ~~ mainGroup]) ifTrue:[ |
|
10166 |
previousGroup restoreCursors. |
|
10167 |
]. |
|
10168 |
] |
|
10169 |
] |
|
10170 |
]. |
|
135 | 10171 |
] |
299
e2c8fd828a64
passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
10172 |
|
4654 | 10173 |
"Created: / 10-12-1995 / 14:06:14 / cg" |
10174 |
"Modified: / 17-10-2006 / 18:21:07 / cg" |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10175 |
! |
135 | 10176 |
|
269 | 10177 |
openModalAt:aPoint |
10178 |
"open up the view modeless - positions the view |
|
10179 |
(i.e. circumvents window managers positioning)" |
|
10180 |
||
10181 |
self origin:aPoint. |
|
1837 | 10182 |
drawableId isNil ifTrue:[self create]. |
560
968d062c79cb
oops - openAt did set transient; definitely wrong ...
Claus Gittinger <cg@exept.de>
parents:
527
diff
changeset
|
10183 |
"/ device setTransient:drawableId for:0. |
269 | 10184 |
^ self openModal |
10185 |
||
10186 |
" |
|
10187 |
View new openModal |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10188 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10189 |
" |
269 | 10190 |
View new openModalAt:100@100 |
10191 |
" |
|
10192 |
||
10193 |
"Created: 18.9.1995 / 23:21:42 / claus" |
|
10194 |
"Modified: 18.9.1995 / 23:32:26 / claus" |
|
1837 | 10195 |
"Modified: 28.7.1997 / 18:52:29 / cg" |
269 | 10196 |
! |
10197 |
||
10198 |
openModalAtCenter |
|
10199 |
"open up the view modeless - positions the view |
|
10200 |
(i.e. circumvents window managers positioning)" |
|
10201 |
||
10202 |
^ self openModalAt:(device center - (self extent//2)). |
|
10203 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10204 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10205 |
View new openModal |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10206 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10207 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10208 |
View new openModalAtCenter |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10209 |
" |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10210 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10211 |
"Modified: 24.7.1997 / 13:27:37 / cg" |
269 | 10212 |
! |
10213 |
||
10214 |
openModeless |
|
10215 |
"create and schedule a new windowgroup for me and open the view. |
|
10216 |
The view will be handled by its own process, effectively running in |
|
10217 |
parallel (i.e. control is returned to the sender immediately)." |
|
10218 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10219 |
self openModelessAt:nil |
269 | 10220 |
|
10221 |
" |
|
10222 |
the same: |
|
3152 | 10223 |
(Button label:'hello') open |
10224 |
||
10225 |
(Button label:'hello') openModeless |
|
269 | 10226 |
|
10227 |
different: |
|
3152 | 10228 |
YesNoBox new open |
10229 |
||
10230 |
YesNoBox new openModeless |
|
269 | 10231 |
" |
10232 |
" |
|
10233 |
(almost) the same: |
|
3152 | 10234 |
YesNoBox new open |
10235 |
||
10236 |
YesNoBox new openModal |
|
269 | 10237 |
|
10238 |
different: |
|
3152 | 10239 |
(Button label:'hello') open |
10240 |
||
10241 |
(Button label:'hello') openModal |
|
269 | 10242 |
" |
503
c2b27766bb0a
dont create a new windowGroup if there is one (in #openModeless)
Claus Gittinger <cg@exept.de>
parents:
497
diff
changeset
|
10243 |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10244 |
"Modified: 24.7.1997 / 13:17:49 / cg" |
269 | 10245 |
! |
10246 |
||
10247 |
openModelessAt:aPoint |
|
10248 |
"open up the view modeless - positions the view |
|
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10249 |
(i.e. tries to circumvent the window managers positioning) |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10250 |
Notice: some windowManagers seem to ignore this and always |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10251 |
ask the user to position the view." |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10252 |
|
1827 | 10253 |
self openModelessAt:aPoint iconified:false |
10254 |
||
10255 |
" |
|
10256 |
View new openModeless |
|
10257 |
||
10258 |
View new openModelessAt:100@100 |
|
10259 |
" |
|
10260 |
||
10261 |
"Created: 18.9.1995 / 23:21:42 / claus" |
|
10262 |
"Modified: 24.7.1997 / 13:48:52 / cg" |
|
10263 |
! |
|
10264 |
||
10265 |
openModelessAt:aPoint iconified:iconified |
|
10266 |
"open up the view modeless - positions the view |
|
10267 |
(i.e. tries to circumvent the window managers positioning) |
|
10268 |
Notice: some windowManagers seem to ignore this and always |
|
10269 |
ask the user to position the view." |
|
10270 |
||
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10271 |
|newGroup| |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10272 |
|
1837 | 10273 |
drawableId isNil ifTrue:[self create]. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10274 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10275 |
windowGroup isNil ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10276 |
newGroup := true. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10277 |
windowGroup := self windowGroupClass new. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10278 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10279 |
newGroup := false. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10280 |
]. |
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10281 |
|
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10282 |
windowGroup addTopView:self. |
3745 | 10283 |
newGroup ifTrue:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10284 |
(aPoint isNil and:[iconified not]) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10285 |
windowGroup startupWith:[self realize]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10286 |
] ifFalse:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10287 |
windowGroup startupWith:[self realizeKeepingGroup:false at:aPoint iconified:iconified]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10288 |
]. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10289 |
] ifFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10290 |
self realizeInGroup. |
1823
56c9a8366a31
changes to support #openIconified.
Claus Gittinger <cg@exept.de>
parents:
1809
diff
changeset
|
10291 |
]. |
269 | 10292 |
|
10293 |
" |
|
1827 | 10294 |
StandardSystemView new openModeless |
10295 |
||
10296 |
StandardSystemView new openModelessAt:100@100 |
|
10297 |
||
10298 |
StandardSystemView new openModelessAt:100@100 iconified:true |
|
269 | 10299 |
" |
10300 |
||
10301 |
"Created: 18.9.1995 / 23:21:42 / claus" |
|
1837 | 10302 |
"Modified: 28.7.1997 / 18:52:26 / cg" |
269 | 10303 |
! |
10304 |
||
10305 |
openModelessAtCenter |
|
10306 |
"open up the view modeless - positions the view |
|
10307 |
(i.e. circumvents window managers positioning)" |
|
10308 |
||
10309 |
^ self openModelessAt:(device center - (self extent//2)). |
|
10310 |
||
10311 |
" |
|
10312 |
View new openModeless |
|
10313 |
||
10314 |
View new openModelessAtCenter |
|
10315 |
" |
|
10316 |
||
10317 |
"Created: 18.9.1995 / 23:21:42 / claus" |
|
10318 |
! |
|
10319 |
||
10320 |
waitUntilVisible |
|
10321 |
"wait until the receiver visible. |
|
10322 |
In normal applications, you do not need to wait till a view is |
|
10323 |
open - it should do all of its drawing itself when it gets the |
|
10324 |
first expose event. |
|
10325 |
However, if you want to 'manually' draw into the view (for example, |
|
10326 |
in doIt expressions), or subsequent views depend on some state of |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10327 |
another view (which is only available once visible), |
269 | 10328 |
use this to suspend the current process until the receiver is shown. |
10329 |
Caveat: |
|
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10330 |
we poll here for the view to be shown - we need a semaphore |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10331 |
which is raised by the view in order to do it right." |
3522
a98163edc25b
care for #waitUntilVisible to be called from within the event dispatcher
Claus Gittinger <cg@exept.de>
parents:
3518
diff
changeset
|
10332 |
|
a98163edc25b
care for #waitUntilVisible to be called from within the event dispatcher
Claus Gittinger <cg@exept.de>
parents:
3518
diff
changeset
|
10333 |
|wg n| |
a98163edc25b
care for #waitUntilVisible to be called from within the event dispatcher
Claus Gittinger <cg@exept.de>
parents:
3518
diff
changeset
|
10334 |
|
a98163edc25b
care for #waitUntilVisible to be called from within the event dispatcher
Claus Gittinger <cg@exept.de>
parents:
3518
diff
changeset
|
10335 |
n := 0. |
269 | 10336 |
[self shown] whileFalse:[ |
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10337 |
(device notNil and:[device isOpen not]) ifTrue:[^ self]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10338 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10339 |
"/ this was added to avoid a deadlock, when called from within |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10340 |
"/ the event dispatch process (as when doing foo inspect there). |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10341 |
n > (10 / 0.05) ifTrue:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10342 |
'SimpleView [info]: View not visible after 10 seconds - will not wait any longer in waitUntilVisible' infoPrintCR. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10343 |
^ self |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10344 |
]. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10345 |
n := n + 1. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10346 |
Delay waitForSeconds:0.05. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10347 |
(wg := self windowGroup) ifNotNil:[ |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10348 |
wg processExposeEvents. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10349 |
]. |
269 | 10350 |
]. |
10351 |
||
10352 |
"does not work (the view is in its opening phase, |
|
10353 |
when we attempt to draw a line - this gives an error, since |
|
10354 |
its internals are not yet correctly setup): |
|
10355 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10356 |
|v| |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10357 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10358 |
v := View new open. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10359 |
v displayLineFrom:0@0 to:50@50 |
269 | 10360 |
|
10361 |
does work (since we wait until the view has completely finished |
|
10362 |
its startup phase): |
|
10363 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10364 |
|v| |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10365 |
|
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10366 |
v := View new open. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10367 |
v waitUntilVisible. |
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10368 |
v displayLineFrom:0@0 to:50@50 |
269 | 10369 |
" |
135 | 10370 |
! ! |
10371 |
||
3276 | 10372 |
!SimpleView methodsFor:'user interaction & notifications'! |
135 | 10373 |
|
10374 |
warn:aString |
|
10375 |
"like Objects warn, but translates the string via the |
|
10376 |
resourcePack, thus giving a translated string automatically" |
|
10377 |
||
4452
0076d4427e51
remember the helpKey in the view - not in the builder
Claus Gittinger <cg@exept.de>
parents:
4447
diff
changeset
|
10378 |
super warn:(resources stringWithCRs:aString) |
135 | 10379 |
! |
10380 |
||
10381 |
warn:aString with:argument |
|
10382 |
"like Objects warn, but translates the string via the |
|
10383 |
resourcePack, thus giving a translated string automatically" |
|
10384 |
||
4406 | 10385 |
super warn:(resources stringWithCRs:aString with:argument) |
151 | 10386 |
! |
10387 |
||
10388 |
warn:aString with:arg1 with:arg2 |
|
10389 |
"like Objects warn, but translates the string via the |
|
10390 |
resourcePack, thus giving a translated string automatically" |
|
10391 |
||
4406 | 10392 |
super warn:(resources stringWithCRs:aString with:arg1 with:arg2) |
3182 | 10393 |
! |
10394 |
||
10395 |
warn:aString with:arg1 with:arg2 with:arg3 |
|
10396 |
"like Objects warn, but translates the string via the |
|
10397 |
resourcePack, thus giving a translated string automatically" |
|
10398 |
||
4406 | 10399 |
super warn:(resources stringWithCRs:aString with:arg1 with:arg2 with:arg3) |
135 | 10400 |
! ! |
10401 |
||
5340 | 10402 |
!SimpleView::AboutToOpenBoxNotificationSignal methodsFor:'accessing'! |
10403 |
||
10404 |
dialogBeingOpened |
|
10405 |
^ parameter |
|
10406 |
! ! |
|
10407 |
||
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
10408 |
!SimpleView::ViewShape methodsFor:'queries'! |
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
10409 |
|
3366 | 10410 |
isRoundShape |
10411 |
^ false |
|
10412 |
! ! |
|
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
10413 |
|
3377
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10414 |
!SimpleView::RoundViewShape methodsFor:'queries'! |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10415 |
|
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10416 |
isRoundShape |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10417 |
^ true |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10418 |
|
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10419 |
|
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10420 |
! ! |
9a9199a8bc3f
must invoke findGUIResources, when an spec array is converted to
Claus Gittinger <cg@exept.de>
parents:
3375
diff
changeset
|
10421 |
|
2750
36b1a4d30882
moved round-view shape computation code to simpleView
Claus Gittinger <cg@exept.de>
parents:
2741
diff
changeset
|
10422 |
!SimpleView::ArbitraryViewShape methodsFor:'accessing'! |
1903 | 10423 |
|
3366 | 10424 |
borderShapeForm |
10425 |
"return the value of the instance variable 'borderShapeForm' (automatically generated)" |
|
10426 |
||
10427 |
^ borderShapeForm |
|
10428 |
||
10429 |
"Created: 18.9.1997 / 11:04:29 / cg" |
|
10430 |
! |
|
10431 |
||
10432 |
borderShapeForm:something |
|
10433 |
"set the value of the instance variable 'borderShapeForm' (automatically generated)" |
|
10434 |
||
10435 |
borderShapeForm := something. |
|
10436 |
||
10437 |
"Created: 18.9.1997 / 11:04:29 / cg" |
|
10438 |
! |
|
10439 |
||
10440 |
viewShapeForm |
|
10441 |
"return the value of the instance variable 'viewShapeForm' (automatically generated)" |
|
10442 |
||
10443 |
^ viewShapeForm |
|
10444 |
||
10445 |
"Created: 18.9.1997 / 11:04:29 / cg" |
|
10446 |
! |
|
10447 |
||
10448 |
viewShapeForm:something |
|
10449 |
"set the value of the instance variable 'viewShapeForm' (automatically generated)" |
|
10450 |
||
10451 |
viewShapeForm := something. |
|
10452 |
||
10453 |
"Created: 18.9.1997 / 11:04:29 / cg" |
|
10454 |
! ! |
|
1903 | 10455 |
|
1101
ffeb697dd9e0
hasButtonMotionEventsFor -> hasButtonMotionEventFor
Claus Gittinger <cg@exept.de>
parents:
1066
diff
changeset
|
10456 |
!SimpleView class methodsFor:'documentation'! |
269 | 10457 |
|
10458 |
version |
|
5405 | 10459 |
^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.643 2009-10-23 15:52:50 cg Exp $' |
5354 | 10460 |
! |
10461 |
||
10462 |
version_CVS |
|
5405 | 10463 |
^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.643 2009-10-23 15:52:50 cg Exp $' |
135 | 10464 |
! ! |
3745 | 10465 |
|
135 | 10466 |
SimpleView initialize! |