equal
deleted
inserted
replaced
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
12 |
13 'From Smalltalk/X, Version:3.1.4 on 25-feb-1997 at 2:17:28 pm' ! |
|
14 |
|
15 SelectionInListView subclass:#UIPainterTreeView |
13 SelectionInListView subclass:#UIPainterTreeView |
16 instanceVariableNames:'builderView' |
14 instanceVariableNames:'builderView' |
17 classVariableNames:'' |
15 classVariableNames:'' |
18 poolDictionaries:'' |
16 poolDictionaries:'' |
19 category:'Interface-UIPainter' |
17 category:'Interface-UIPainter' |
76 |
74 |
77 |
75 |
78 ! ! |
76 ! ! |
79 |
77 |
80 !UIPainterTreeView methodsFor:'event handling'! |
78 !UIPainterTreeView methodsFor:'event handling'! |
|
79 |
|
80 builderViewChanged:what |
|
81 "something changed in the builder view |
|
82 " |
|
83 (what == #tree or:[what == #widgetName]) ifTrue:[ |
|
84 self updateTree |
|
85 ] ifFalse:[ |
|
86 what ~~ #selection ifTrue:[ |
|
87 ^ self |
|
88 ]. |
|
89 self disableMaster:selection. |
|
90 self setSelection:nil. |
|
91 ]. |
|
92 |
|
93 "update selection |
|
94 " |
|
95 builderView selectionDo:[:aView||idx| |
|
96 idx := self indexOf:(builderView variableNameOf:aView). |
|
97 |
|
98 idx ~~ 0 ifTrue:[ |
|
99 selection isNil ifTrue:[ |
|
100 |m i| |
|
101 |
|
102 m := list at:idx. |
|
103 i := m indexOfNonSeparatorStartingAt:1. |
|
104 i == 0 ifTrue:[ i := 1 ]. |
|
105 m := Text string:m. |
|
106 m emphasizeFrom:i with:#(#bold #underline). |
|
107 list at:idx put:m |
|
108 ]. |
|
109 self addToSelection:idx |
|
110 ] |
|
111 ]. |
|
112 selection isNil ifTrue:[ |
|
113 self setSelection:1 |
|
114 ] |
|
115 ! |
81 |
116 |
82 selectionChanged |
117 selectionChanged |
83 "selection has changed |
118 "selection has changed |
84 " |
119 " |
85 |sel| |
120 |sel| |
104 "redraw master |
139 "redraw master |
105 " |
140 " |
106 self disableMaster:oldSelection. |
141 self disableMaster:oldSelection. |
107 super selectionChangedFrom:oldSelection |
142 super selectionChangedFrom:oldSelection |
108 |
143 |
109 ! |
|
110 |
|
111 update:something |
|
112 |
|
113 (something == #tree or:[something == #widgetName]) ifTrue:[ |
|
114 self updateTree |
|
115 ] ifFalse:[ |
|
116 something ~~ #selection ifTrue:[ |
|
117 ^ self |
|
118 ]. |
|
119 self disableMaster:selection. |
|
120 self setSelection:nil. |
|
121 ]. |
|
122 |
|
123 "update selection |
|
124 " |
|
125 builderView selectionDo:[:aView||idx| |
|
126 idx := self indexOf:(builderView variableNameOf:aView). |
|
127 |
|
128 idx ~~ 0 ifTrue:[ |
|
129 selection isNil ifTrue:[ |
|
130 |m i| |
|
131 |
|
132 m := list at:idx. |
|
133 i := m indexOfNonSeparatorStartingAt:1. |
|
134 i == 0 ifTrue:[ i := 1 ]. |
|
135 m := Text string:m. |
|
136 m emphasizeFrom:i with:#(#bold #underline). |
|
137 list at:idx put:m |
|
138 ]. |
|
139 self addToSelection:idx |
|
140 ] |
|
141 ]. |
|
142 selection isNil ifTrue:[ |
|
143 self setSelection:1 |
|
144 ] |
|
145 ! ! |
144 ! ! |
146 |
145 |
147 !UIPainterTreeView methodsFor:'initialization'! |
146 !UIPainterTreeView methodsFor:'initialization'! |
148 |
147 |
149 initialize |
148 initialize |
170 inspectView |
169 inspectView |
171 builderView inspectSelection |
170 builderView inspectSelection |
172 ! |
171 ! |
173 |
172 |
174 menu |
173 menu |
175 |menu noSel| |
174 |menu| |
176 |
175 |
177 noSel := builderView numberOfSelections. |
176 (menu := builderView menu) notNil ifTrue:[ |
178 |
177 menu addLabels:( |
179 menu := PopUpMenu labels:( |
178 resources array:#( |
180 resources array:#( |
|
181 'cut' |
|
182 'undo' |
|
183 '-' |
179 '-' |
184 'misc' |
180 'treeMisc' |
185 ) |
181 ) |
186 ) |
182 ) |
187 selectors:#( |
183 selectors:#( |
188 #cut |
|
189 #undo |
|
190 nil |
184 nil |
191 #misc |
185 #treeMisc |
192 ) |
186 ). |
193 receiver:self. |
187 |
194 |
188 (builderView numberOfSelections) == 1 ifTrue:[ |
195 noSel == 1 ifTrue:[ menu subMenuAt:#misc put:(self menuMisc)] |
189 menu subMenuAt:#treeMisc put:(self menuMisc) |
196 ifFalse:[ menu disable:#misc]. |
190 ] ifFalse:[ |
197 |
191 menu disable:#treeMisc |
198 noSel == 0 ifTrue:[ menu disable:#cut] |
192 ] |
199 ifFalse:[ menu actionAt:#cut put:[builderView deleteSelection]]. |
193 ]. |
200 |
194 ^ menu |
201 builderView hasUndos ifFalse:[ menu disable:#undo] |
|
202 ifTrue:[ menu actionAt:#undo put:[builderView undoLast]]. |
|
203 |
|
204 |
|
205 |
|
206 ^ menu |
|
207 |
|
208 |
|
209 ! |
195 ! |
210 |
196 |
211 menuMisc |
197 menuMisc |
212 |
198 |
213 |menu ispMenu| |
199 |menu ispMenu| |
268 ]. |
254 ]. |
269 myIdx < index ifTrue:[ |
255 myIdx < index ifTrue:[ |
270 index := index - 1 |
256 index := index - 1 |
271 ]. |
257 ]. |
272 (spView changeSequenceOrderFor:view to:index) ifTrue:[ |
258 (spView changeSequenceOrderFor:view to:index) ifTrue:[ |
273 self update:#tree |
259 self builderViewChanged:#tree |
274 ] |
260 ] |
275 ! |
261 ! |
276 |
262 |
277 removeLayout |
263 removeLayout |
278 builderView selectionHiddenDo:[ |
264 builderView withSelectionHiddenDo:[ |
279 builderView selectionDo:[:aView| |
265 builderView selectionDo:[:aView| |
280 aView geometryLayout:nil. |
266 aView geometryLayout:nil. |
281 aView superView sizeChanged:nil |
267 builderView elementChangedSize:aView. |
282 ] |
268 ] |
283 ]. |
269 ]. |
284 ! ! |
270 ! ! |
285 |
271 |
286 !UIPainterTreeView methodsFor:'redrawing'! |
272 !UIPainterTreeView methodsFor:'redrawing'! |