author | Claus Gittinger <cg@exept.de> |
Sat, 11 Nov 1995 17:05:49 +0100 | |
changeset 114 | e577a2f332d0 |
parent 100 | 0300e64bb883 |
child 125 | fa5b5e4336bf |
permissions | -rw-r--r-- |
89 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
99 | 3 |
All Rights Reserved |
89 | 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 |
||
100 | 13 |
'From Smalltalk/X, Version:2.10.7 on 7-sep-1995 at 10:06:38 pm' ! |
89 | 14 |
|
100 | 15 |
Object subclass:#WindowBuilder |
75 | 16 |
instanceVariableNames:'topView application bindings aspects focusSequence' |
66 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
80 | 19 |
category:'Interface-Support-UI' |
66 | 20 |
! |
21 |
||
22 |
!WindowBuilder class methodsFor:'documentation'! |
|
23 |
||
89 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
99 | 27 |
All Rights Reserved |
89 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
version |
|
114
e577a2f332d0
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
39 |
^ '$Header: /cvs/stx/stx/libview2/Attic/WinBuilder.st,v 1.9 1995-11-11 16:05:30 cg Exp $' |
89 | 40 |
! |
41 |
||
66 | 42 |
documentation |
43 |
" |
|
69 | 44 |
a no-op class, for systems which do not use the UIBuilder. |
66 | 45 |
Concrete subclasses know how to create a view (with components) from |
46 |
some interface spec. Currently, an experimantal version of UIBuilder exists, |
|
47 |
and more may be added in the future (for example, to parse different UI |
|
48 |
specs - thinking of motifs UIL specs etc). |
|
49 |
" |
|
50 |
! ! |
|
51 |
||
52 |
!WindowBuilder methodsFor:'accessing'! |
|
53 |
||
100 | 54 |
window |
55 |
^ topView |
|
66 | 56 |
! |
57 |
||
100 | 58 |
application |
59 |
^ application |
|
66 | 60 |
! |
61 |
||
62 |
focusSequence |
|
63 |
^ focusSequence |
|
64 |
! |
|
65 |
||
66 |
aspectAt:aSymbol |
|
67 |
aspects isNil ifTrue:[^ nil]. |
|
68 |
^ aspects at:aSymbol ifAbsent:nil |
|
69 |
! |
|
70 |
||
100 | 71 |
application:anApplicationModel |
72 |
application := anApplicationModel |
|
73 |
! |
|
74 |
||
75 |
window:aView |
|
76 |
topView := aView |
|
77 |
! |
|
78 |
||
79 |
bindings |
|
80 |
^ bindings |
|
81 |
! |
|
82 |
||
83 |
bindings:aDictionary |
|
84 |
bindings := aDictionary |
|
85 |
! |
|
86 |
||
87 |
componentAt:name put:aComponent |
|
88 |
bindings isNil ifTrue:[ |
|
89 |
bindings := IdentityDictionary new. |
|
90 |
]. |
|
91 |
bindings at:name put:aComponent |
|
92 |
! |
|
93 |
||
66 | 94 |
aspectAt:aSymbol put:aModel |
95 |
aspects isNil ifTrue:[ |
|
96 |
aspects := IdentityDictionary new |
|
97 |
]. |
|
98 |
^ aspects at:aSymbol put:aModel |
|
99 |
! |
|
100 |
||
86 | 101 |
namedComponents |
102 |
^ bindings |
|
103 |
! |
|
104 |
||
66 | 105 |
componentAt:name |
86 | 106 |
bindings isNil ifTrue:[^ nil]. |
75 | 107 |
^ bindings at:name ifAbsent:nil |
66 | 108 |
! |
109 |
||
110 |
windowGroup |
|
111 |
^ topView windowGroup |
|
112 |
! |
|
113 |
||
114 |
source:anApplicationModel |
|
115 |
application := anApplicationModel |
|
116 |
! ! |
|
117 |
||
118 |
!WindowBuilder methodsFor:'operation'! |
|
119 |
||
80 | 120 |
openWithExtent:aPoint |
121 |
"open my topView, as previously created, but override |
|
122 |
the extent." |
|
123 |
||
124 |
self openWithExtent:aPoint andType:#normal |
|
125 |
! |
|
126 |
||
66 | 127 |
openWithExtent:ext andType:type |
80 | 128 |
"open my topView, as previously created. The type argument |
129 |
may be #dialog or #normal, and specifies if the view should |
|
130 |
be opened as a modal view, blocking interaction to the currently |
|
131 |
active view, or as a normal view." |
|
132 |
||
66 | 133 |
ext notNil ifTrue:[ |
134 |
topView extent:ext |
|
135 |
]. |
|
136 |
type == #dialog ifTrue:[ |
|
137 |
topView openModal. |
|
138 |
^ self |
|
139 |
]. |
|
140 |
||
141 |
type == #normal ifTrue:[ |
|
142 |
topView open. |
|
143 |
^ self |
|
144 |
]. |
|
80 | 145 |
" |
146 |
if ST-80 supports more types - these may be added later |
|
147 |
" |
|
66 | 148 |
self halt:'unimplemented' |
149 |
! |
|
150 |
||
100 | 151 |
buildFromSpec:aSpec |
152 |
self subclassResponsibility |
|
153 |
! |
|
154 |
||
155 |
open |
|
156 |
"open my topView, as previously created" |
|
157 |
||
158 |
self openWithExtent:nil andType:#normal |
|
159 |
! |
|
160 |
||
161 |
openDialog |
|
162 |
"open my topView, as previously created as a modal view, |
|
163 |
blocking interaction to the currently active view." |
|
164 |
||
165 |
self openWithExtent:nil andType:#dialog |
|
166 |
! |
|
167 |
||
168 |
openDialogWithExtent:ext |
|
169 |
"open my topView, as previously created as a modal view, |
|
170 |
blocking interaction to the currently active view." |
|
171 |
||
172 |
self openWithExtent:ext andType:#dialog |
|
173 |
! |
|
174 |
||
66 | 175 |
closeRequest |
176 |
topView destroy |
|
177 |
! ! |
|
100 | 178 |
|
179 |
!WindowBuilder methodsFor:'spec creation callbacks'! |
|
180 |
||
181 |
createdComponent:aView forSpec:spec |
|
182 |
||
183 |
"Modified: 5.9.1995 / 21:42:54 / claus" |
|
184 |
! ! |
|
185 |