author | Claus Gittinger <cg@exept.de> |
Tue, 09 Jul 2019 20:53:39 +0200 | |
changeset 6083 | 7a2c0a30e75c |
parent 2940 | a42b0b174ab9 |
child 4770 | 6634b540fea2 |
permissions | -rw-r--r-- |
2530 | 1 |
" |
2 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
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 |
"{ Package: 'stx:libwidg2' }" |
|
14 |
||
15 |
NoteBookView subclass:#TabControl |
|
16 |
instanceVariableNames:'' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Views-Layout' |
|
20 |
! |
|
21 |
||
22 |
!TabControl class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 2003 by eXept Software AG |
|
27 |
All Rights Reserved |
|
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 |
documentation |
|
39 |
" |
|
40 |
implements a tabControl - that is a NoteBook with a subCanvas. |
|
41 |
(it is more specific than a NoteBook, which allows for an arbitrary |
|
42 |
view to be used; here, a subCanvas is created right from the start). |
|
43 |
||
44 |
[author:] |
|
45 |
Claus Gittinger |
|
46 |
||
47 |
[see also:] |
|
48 |
NoteBook TabView |
|
49 |
" |
|
50 |
! |
|
51 |
||
52 |
examples |
|
53 |
" |
|
54 |
tabs at top ( default ) |
|
55 |
[exBegin] |
|
56 |
|specs spec1 spec2 spec3 top tab| |
|
57 |
||
58 |
' In a real world app, these would be provided by Spec-methods...' . |
|
59 |
spec1 := |
|
60 |
#(#FullSpec |
|
61 |
#window: |
|
62 |
#(#WindowSpec |
|
63 |
#label: 'Unlabeled Canvas' |
|
64 |
#bounds: #(#Rectangle 800 600 1000 800 ) ) |
|
65 |
#component: |
|
66 |
#(#SpecCollection |
|
67 |
#collection: #( |
|
68 |
#(#TextEditorSpec |
|
69 |
#layout: #(#LayoutFrame 2 0 2 0 -2 1 -29 1 ) |
|
70 |
#name: #text |
|
71 |
#model: #testHolder |
|
72 |
#tabRequiresControl: true ) |
|
73 |
#(#ActionButtonSpec |
|
74 |
#layout: #(#LayoutFrame 5 0 -27 1 105 0 -2 1 ) |
|
75 |
#name: #parse |
|
76 |
#model: #parse |
|
77 |
#label: 'Parse' |
|
78 |
#defaultable: true ) |
|
79 |
#(#ActionButtonSpec |
|
80 |
#layout: #(#LayoutFrame 110 0 -27 1 210 0 -2 1 ) |
|
81 |
#name: #parseAndInspect |
|
82 |
#model: #parseAndInspect |
|
83 |
#label: 'Parse and Inspect' |
|
84 |
#defaultable: true ) ) ) ). |
|
85 |
||
86 |
spec2 := |
|
87 |
#(#FullSpec |
|
88 |
#window: |
|
89 |
#(#WindowSpec |
|
90 |
#label: 'Unlabeled Canvas' |
|
91 |
#bounds: #(#Rectangle 576 432 776 632 ) ) |
|
92 |
#component: |
|
93 |
#(#SpecCollection |
|
94 |
#collection: #( |
|
95 |
#(#TextEditorSpec |
|
96 |
#layout: #(#LayoutFrame 2 0 2 0 -2 1 -2 1 ) |
|
97 |
#name: #text |
|
98 |
#model: #scannerHolder |
|
99 |
#tabRequiresControl: true ) ) ) ). |
|
100 |
||
101 |
spec3 := |
|
102 |
#(#FullSpec |
|
103 |
#window: |
|
104 |
#(#WindowSpec |
|
105 |
#label: 'Unlabeled Canvas' |
|
106 |
#bounds: #(#Rectangle 800 600 1000 800 ) ) |
|
107 |
#component: |
|
108 |
#(#SpecCollection |
|
109 |
#collection: #( |
|
110 |
#(#LabelSpec |
|
111 |
#layout: #(#AlignmentOrigin -5 0.4 5 0 1 0 ) |
|
112 |
#name: #Label2 |
|
113 |
#label: 'Scanner class:' ) |
|
114 |
#(#InputFieldSpec |
|
115 |
#layout: #(#LayoutFrame 6 0.4 5 0 -36 1 27 0 ) |
|
116 |
#name: #scannerClassName |
|
117 |
#model: #scannerClassNameHolder |
|
118 |
#type: #string ) |
|
119 |
#(#ActionButtonSpec |
|
120 |
#layout: #(#LayoutFrame -32 1 5 0 -10 1 27 0 ) |
|
121 |
#name: #findScannerClassButton |
|
122 |
#model: #findScannerClass |
|
123 |
#label: '...' |
|
124 |
#defaultable: true ) |
|
125 |
#(#LabelSpec |
|
126 |
#layout: #(#AlignmentOrigin -5 0.4 35 0 1 0 ) |
|
127 |
#name: #Label3 |
|
128 |
#label: 'Parser class:' ) |
|
129 |
#(#InputFieldSpec |
|
130 |
#layout: #(#LayoutFrame 6 0.4 35 0 -36 1 57 0 ) |
|
131 |
#name: #parserClassName |
|
132 |
#model: #parserClassNameHolder |
|
133 |
#type: #string ) |
|
134 |
#(#ActionButtonSpec |
|
135 |
#layout: #(#LayoutFrame -32 1 35 0 -10 1 57 0 ) |
|
136 |
#name: #findParserClassButton |
|
137 |
#model: #findParserClass |
|
138 |
#label: '...' |
|
139 |
#defaultable: true ) |
|
140 |
#(#ActionButtonSpec |
|
141 |
#layout: #(#LayoutFrame -50 0.333333 122 0 50 0.333333 144 0 ) |
|
142 |
#name: #compileLALR1 |
|
143 |
#model: #compileLALR1 |
|
144 |
#label: 'Compile LALR(1)' |
|
145 |
#isDefault: true |
|
146 |
#defaultable: true ) |
|
147 |
#(#ActionButtonSpec |
|
148 |
#layout: #(#LayoutFrame -50 0.666666 122 0 50 0.666666 144 0 ) |
|
149 |
#name: #compileLR1 |
|
150 |
#model: #compileLR1 |
|
151 |
#label: 'Compile LR(1)' |
|
152 |
#isDefault: false |
|
153 |
#defaultable: true ) |
|
154 |
#(#DividerSpec |
|
155 |
#layout: #(#LayoutFrame 5 0 150 0 -5 1 152 0 ) |
|
156 |
#name: #Divider1 ) |
|
157 |
#(#LabelSpec |
|
158 |
#layout: #(#Point 10 155 ) |
|
159 |
#name: #Label4 |
|
160 |
#label: 'Messages:' ) |
|
161 |
#(#TextEditorSpec |
|
162 |
#layout: #(#LayoutFrame 10 0 177 0 -10 1 -10 1 ) |
|
163 |
#name: #conflicts |
|
164 |
#model: #conflictHolder |
|
165 |
#tabRequiresControl: true ) |
|
166 |
#(#CheckBoxSpec |
|
167 |
#layout: #(#LayoutFrame 5 0.5 60 0 205 0.5 79 0 ) |
|
168 |
#name: #generateDefinitionComments |
|
169 |
#model: #generateDefinitionCommentsHolder |
|
170 |
#label: 'Generate definition comments' ) |
|
171 |
#(#CheckBoxSpec |
|
172 |
#layout: #(#LayoutFrame 5 0.5 80 0 205 0.5 103 0 ) |
|
173 |
#name: #generateSymbolComments |
|
174 |
#model: #generateSymbolCommentsHolder |
|
175 |
#label: 'Generate symbol comments' ) |
|
176 |
#(#CheckBoxSpec |
|
177 |
#layout: #(#LayoutFrame 5 0.5 100 0 205 0.5 123 0 ) |
|
178 |
#name: #generateItemSetComments |
|
179 |
#model: #generateItemSetCommentsHolder |
|
180 |
#label: 'Generate item set comments' ) |
|
181 |
#(#CheckBoxSpec |
|
182 |
#layout: #(#LayoutFrame -205 0.5 80 0 -5 0.5 103 0 ) |
|
183 |
#name: #allowUnicode |
|
184 |
#model: #allowUnicodeHolder |
|
185 |
#label: 'Allow Unicode Characters' ) |
|
186 |
#(#CheckBoxSpec |
|
187 |
#layout: #(#LayoutFrame -205 0.5 60 0 -5 0.5 83 0 ) |
|
188 |
#name: #ignoreCase |
|
189 |
#model: #ignoreCaseHolder |
|
190 |
#label: 'Ignore Case' ) ) ) ). |
|
191 |
||
192 |
specs := Array with:spec1 with:spec2 with:spec3. |
|
193 |
||
194 |
top := StandardSystemView extent:400@300. |
|
195 |
tab := TabControl origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top. |
|
196 |
tab list:#( 'Foo' 'Bar' 'Baz' ). |
|
197 |
tab action:[:index | |
|
198 |
tab |
|
199 |
client:(ApplicationModel new) |
|
200 |
spec:(specs at:index). |
|
201 |
]. |
|
202 |
top open. |
|
203 |
[exEnd] |
|
204 |
" |
|
205 |
! ! |
|
206 |
||
207 |
!TabControl methodsFor:'canvas access'! |
|
208 |
||
209 |
client:anApplication spec:anUISpec |
|
210 |
canvas client:anApplication spec:anUISpec |
|
2940
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
211 |
! |
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
212 |
|
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
213 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
214 |
canvas client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
215 |
! |
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
216 |
|
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
217 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenuBoolean |
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
218 |
canvas client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder withMenu:withMenuBoolean |
2530 | 219 |
! ! |
220 |
||
221 |
!TabControl methodsFor:'initialization'! |
|
222 |
||
223 |
initialize |
|
224 |
canvas := SubCanvas in:self. |
|
225 |
super initialize |
|
226 |
! ! |
|
227 |
||
228 |
!TabControl class methodsFor:'documentation'! |
|
229 |
||
230 |
version |
|
2940
a42b0b174ab9
more forwarding to the canvas
Claus Gittinger <cg@exept.de>
parents:
2530
diff
changeset
|
231 |
^ '$Header: /cvs/stx/stx/libwidg2/TabControl.st,v 1.2 2006-03-13 19:27:30 cg Exp $' |
2530 | 232 |
! ! |