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