author | Claus Gittinger <cg@exept.de> |
Thu, 27 Feb 1997 12:50:58 +0100 | |
changeset 461 | bacef118f54a |
parent 373 | 66283cb455bf |
child 474 | c337e7ad2220 |
permissions | -rw-r--r-- |
88 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
100 | 3 |
All Rights Reserved |
88 | 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 |
WindowBuilder subclass:#UIBuilder |
223 | 14 |
instanceVariableNames:'view currentMenuSelector menuAspect spec' |
15 |
classVariableNames:'Verbose' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-Support-UI' |
|
66 | 18 |
! |
19 |
||
20 |
!UIBuilder class methodsFor:'documentation'! |
|
21 |
||
125 | 22 |
copyright |
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
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 |
" |
|
88 | 34 |
! |
35 |
||
66 | 36 |
documentation |
37 |
" |
|
38 |
this class will (eventually) allow parsing windowSpecs as |
|
39 |
created by ST-80's UIPainter, and thereby allow to run applications |
|
40 |
built with this tool. |
|
41 |
It was created to allow execution of PD applications which were |
|
42 |
written using that tool (and more and more are appearing ...). |
|
43 |
||
44 |
The class is not completed yet and certainly not bug free. |
|
45 |
Also, it is not quaranteed that all winSpecs are understood. |
|
223 | 46 |
|
373 | 47 |
Notice: |
48 |
this class was implemented using protocol information |
|
49 |
from alpha testers, literature and by read public domain code |
|
50 |
- it may not be complete or compatible to |
|
51 |
the corresponding ST-80 class. |
|
52 |
If you encounter any incompatibilities, please forward a note |
|
53 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
54 |
||
223 | 55 |
[author:] |
56 |
Claus Gittinger |
|
66 | 57 |
" |
58 |
! ! |
|
59 |
||
60 |
!UIBuilder class methodsFor:'initialization'! |
|
61 |
||
62 |
initialize |
|
63 |
Verbose := false "/ debugging flag |
|
64 |
! ! |
|
65 |
||
86 | 66 |
!UIBuilder methodsFor:'accessing'! |
67 |
||
68 |
menuAspect |
|
69 |
^ menuAspect |
|
70 |
! ! |
|
71 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
72 |
!UIBuilder methodsFor:'building'! |
66 | 73 |
|
367 | 74 |
add:aSpec |
75 |
view := aSpec buildViewFor:self. |
|
76 |
^ view |
|
77 |
||
78 |
"Modified: 16.1.1997 / 00:45:07 / cg" |
|
79 |
! |
|
80 |
||
100 | 81 |
buildFromSpec:aSpecArray |
82 |
|m spec| |
|
83 |
||
84 |
"/ old: |
|
85 |
"/ self readSpec:aSpecArray. |
|
86 |
||
87 |
spec := UISpecification from:aSpecArray. |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
88 |
window := view := spec buildViewFor:self. |
100 | 89 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
90 |
"/ menuAspect notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
91 |
"/ m := self componentAt:menuAspect. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
92 |
"/ m notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
93 |
"/ m := m value. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
94 |
"/ m notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
95 |
"/ m receiver:application. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
96 |
"/ window add:m. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
97 |
"/ view topInset:(m heightIncludingBorder). |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
98 |
"/ ] |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
99 |
"/ ] |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
100 |
"/ ]. |
86 | 101 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
102 |
^ window |
66 | 103 |
|
100 | 104 |
"Modified: 5.9.1995 / 21:43:29 / claus" |
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
105 |
"Modified: 17.1.1997 / 19:33:05 / cg" |
125 | 106 |
! |
107 |
||
108 |
buildFromSpec:aSpecArray in:aView |
|
109 |
|m spec| |
|
110 |
||
111 |
spec := UISpecification from:aSpecArray. |
|
112 |
||
113 |
view := spec buildViewFor:self in:aView. |
|
114 |
||
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
115 |
"/ menuAspect notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
116 |
"/ m := self componentAt:menuAspect. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
117 |
"/ m notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
118 |
"/ m := m value. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
119 |
"/ m notNil ifTrue:[ |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
120 |
"/ m receiver:application. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
121 |
"/ window add:m. |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
122 |
"/ view topInset:(m heightIncludingBorder). |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
123 |
"/ ] |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
124 |
"/ ] |
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
125 |
"/ ]. |
125 | 126 |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
127 |
^ view |
125 | 128 |
|
129 |
"Modified: 5.9.1995 / 21:48:09 / claus" |
|
372
6d7718f3d298
more ST-80 compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
367
diff
changeset
|
130 |
"Modified: 17.1.1997 / 19:33:48 / cg" |
363
c7a26a5ebaba
doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
131 |
! |
c7a26a5ebaba
doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
132 |
|
c7a26a5ebaba
doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
133 |
doFinalHookup |
c7a26a5ebaba
doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
134 |
|
c7a26a5ebaba
doFinalHookup (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
344
diff
changeset
|
135 |
"Created: 14.2.1997 / 14:52:27 / cg" |
100 | 136 |
! ! |
86 | 137 |
|
132 | 138 |
!UIBuilder class methodsFor:'documentation'! |
139 |
||
140 |
version |
|
373 | 141 |
^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.19 1997-01-17 20:36:49 cg Exp $' |
132 | 142 |
! ! |
100 | 143 |
UIBuilder initialize! |