|
1 " |
|
2 COPYRIGHT (c) 1995 by Claus Gittinger |
|
3 All Rights Reserved |
|
4 |
|
5 This software is furnished under a license and may be used |
|
6 only in accordance with the terms of that license and with the |
|
7 inclusion of the above copyright notice. This software may not |
|
8 be provided or otherwise made available to, or used by, any |
|
9 other person. No title to or ownership of the software is |
|
10 hereby transferred. |
|
11 " |
|
12 |
|
13 View subclass:#TopView |
|
14 instanceVariableNames:'' |
|
15 classVariableNames: '' |
|
16 poolDictionaries:'' |
|
17 category:'Views-Basic' |
|
18 ! |
|
19 |
|
20 TopView comment:' |
|
21 COPYRIGHT (c) 1995 by Claus Gittinger |
|
22 All Rights Reserved |
|
23 |
|
24 $Header: /cvs/stx/stx/libview/TopView.st,v 1.1 1995-05-03 00:25:39 claus Exp $ |
|
25 '! |
|
26 |
|
27 !TopView class methodsFor:'documentation'! |
|
28 |
|
29 copyright |
|
30 " |
|
31 COPYRIGHT (c) 1995 by Claus Gittinger |
|
32 All Rights Reserved |
|
33 |
|
34 This software is furnished under a license and may be used |
|
35 only in accordance with the terms of that license and with the |
|
36 inclusion of the above copyright notice. This software may not |
|
37 be provided or otherwise made available to, or used by, any |
|
38 other person. No title to or ownership of the software is |
|
39 hereby transferred. |
|
40 " |
|
41 ! |
|
42 |
|
43 version |
|
44 " |
|
45 $Header: /cvs/stx/stx/libview/TopView.st,v 1.1 1995-05-03 00:25:39 claus Exp $ |
|
46 " |
|
47 ! |
|
48 |
|
49 documentation |
|
50 " |
|
51 I am an abstract superclass of StandardSystemView and PopUpView; |
|
52 i.e. views which have no superview. |
|
53 " |
|
54 ! ! |
|
55 |
|
56 !TopView class methodsFor:'defaults'! |
|
57 |
|
58 defaultExtent |
|
59 "topviews extent is (0.6 @ 0.6) of screen by default" |
|
60 |
|
61 ^ (Display width // 3 * 2) @ (Display height // 3 * 2) |
|
62 ! ! |
|
63 |
|
64 !TopView methodsFor:'initialization'! |
|
65 |
|
66 initialize |
|
67 |screenCenter| |
|
68 |
|
69 super initialize. |
|
70 |
|
71 screenCenter := device center. |
|
72 left := screenCenter x - (width // 2). |
|
73 top := screenCenter y - (height // 2). |
|
74 ! ! |
|
75 |
|
76 !TopView methodsFor:'misc'! |
|
77 |
|
78 withWaitCursorDo:aBlock |
|
79 "evaluate aBlock while showing a waitCursor in all my views" |
|
80 |
|
81 self withCursor:(Cursor wait) do:aBlock |
|
82 ! |
|
83 |
|
84 withCursor:aCursor do:aBlock |
|
85 "evaluate aBlock while showing aCursor in all my views" |
|
86 |
|
87 windowGroup notNil ifTrue:[ |
|
88 windowGroup withCursor:aCursor do:aBlock |
|
89 ] ifFalse:[ |
|
90 super withCursor:aCursor do:aBlock |
|
91 ] |
|
92 ! ! |
|
93 |
|
94 !TopView methodsFor:'accessing & queries'! |
|
95 |
|
96 preferedExtent |
|
97 "return my preferred extent - this is the minimum size I would like to have. |
|
98 The default here is the classes default extent, |
|
99 however many subclasses redefine this to compute the actual value |
|
100 depending on the sizes of the contents or subcomponents." |
|
101 |
|
102 ^ self class defaultExtent |
|
103 ! |
|
104 |
|
105 heightIncludingBorder |
|
106 "return the views overall-height" |
|
107 |
|
108 ^ height |
|
109 ! |
|
110 |
|
111 widthIncludingBorder |
|
112 "return the views overall-width" |
|
113 |
|
114 ^ width |
|
115 ! ! |
|
116 |