250 #(#MenuItem |
250 #(#MenuItem |
251 #'label:' 'install aspects' |
251 #'label:' 'install aspects' |
252 #'value:' #doInstallAspects |
252 #'value:' #doInstallAspects |
253 ) |
253 ) |
254 #(#MenuItem |
254 #(#MenuItem |
255 #'label:' 'windowSpec' |
255 #'label:' 'show windowSpec' |
256 #'value:' #doWindowSpec |
256 #'value:' #doWindowSpec |
257 ) |
257 ) |
258 #(#MenuItem |
258 #(#MenuItem |
259 #'label:' 'browse application' |
259 #'label:' 'browse application' |
260 #'value:' #doBrowseAppClass |
260 #'value:' #doBrowseAppClass |
1123 |
1124 |
1124 |
1125 |
1125 ! |
1126 ! |
1126 |
1127 |
1127 doFromClass |
1128 doFromClass |
1128 |className methodName cls sel accepted failed spec s painter| |
1129 |className methodName cls sel accepted failed spec s painter| |
1129 |
1130 |
1130 className := '' asValue. |
1131 objectList painter isModified ifTrue:[ |
1131 methodName := '' asValue. |
1132 (self confirm:'edit another interface without saving your modifications ?') ifFalse:[ |
1132 painter := self painter. |
1133 ^ self |
1133 |
1134 ] |
1134 (s := painter className) notNil ifTrue:[ |
1135 ]. |
1135 className value:s |
1136 |
1136 ]. |
1137 className := '' asValue. |
1137 (s := painter methodName) notNil ifTrue:[ |
1138 methodName := '' asValue. |
1138 methodName value:s |
1139 painter := self painter. |
1139 ]. |
1140 |
1140 |
1141 (s := painter className) notNil ifTrue:[ |
1141 failed := false. |
1142 className value:s |
1142 [ |
1143 ]. |
1143 accepted := |
1144 (s := painter methodName) notNil ifTrue:[ |
1144 (DialogBox new |
1145 methodName value:s |
1145 addTextLabel:'Classes name:'; |
1146 ]. |
1146 addInputFieldOn:className; |
1147 |
1147 addVerticalSpace; |
1148 failed := false. |
1148 addTextLabel:'methods name:'; |
1149 [ |
1149 addInputFieldOn:methodName; |
1150 accepted := |
1150 addAbortButton; |
1151 (DialogBox new |
1151 addOkButton; |
1152 addTextLabel:'Classes name:'; |
1152 open |
1153 addInputFieldOn:className; |
1153 ) accepted. |
1154 addVerticalSpace; |
1154 |
1155 addTextLabel:'methods name:'; |
1155 accepted ifTrue:[ |
1156 addInputFieldOn:methodName; |
1156 cls := Smalltalk classNamed:className value. |
1157 addAbortButton; |
1157 cls isNil ifTrue:[ |
1158 addOkButton; |
|
1159 open |
|
1160 ) accepted. |
|
1161 |
|
1162 accepted ifTrue:[ |
|
1163 cls := Smalltalk classNamed:className value. |
|
1164 cls isNil ifTrue:[ |
|
1165 failed := true. |
|
1166 self warn:'no such class'. |
|
1167 ] ifFalse:[ |
|
1168 sel := methodName value asSymbol. |
|
1169 (cls respondsTo:sel ) ifFalse:[ |
1158 failed := true. |
1170 failed := true. |
1159 self warn:'no such class'. |
1171 self warn:'no such method' |
1160 ] ifFalse:[ |
1172 ] ifTrue:[ |
1161 sel := methodName value asSymbol. |
1173 spec := cls perform:sel. |
1162 (cls respondsTo:sel ) ifFalse:[ |
1174 spec isArray ifFalse:[ |
1163 failed := true. |
1175 failed := true. |
1164 self warn:'no such method' |
1176 self warn:'not a windowSpec method' |
1165 ] ifTrue:[ |
1177 ]. |
1166 spec := cls perform:sel. |
1178 "/ ok, got it |
1167 spec isArray ifFalse:[ |
1179 painter className:className value. |
1168 failed := true. |
1180 painter methodName:methodName value. |
1169 self warn:'not a windowSpec method' |
1181 painter setupFromSpec:spec. |
1170 ]. |
1182 ^ self |
1171 "/ ok, got it |
1183 ] |
1172 painter className:className value. |
1184 ] |
1173 painter methodName:methodName value. |
1185 ] |
1174 painter setupFromSpec:spec. |
1186 ] doWhile:[accepted and:[failed]]. |
1175 ^ self |
1187 |
1176 ] |
1188 "Modified: 17.6.1997 / 12:33:36 / cg" |
1177 ] |
|
1178 ] |
|
1179 ] doWhile:[accepted and:[failed]]. |
|
1180 |
|
1181 ! |
1189 ! |
1182 |
1190 |
1183 doInstallAspects |
1191 doInstallAspects |
1184 |code| |
1192 |code| |
1185 |
1193 |
1276 ! |
1296 ! |
1277 |
1297 |
1278 doPickAView |
1298 doPickAView |
1279 |painter view className methodName cls sel accepted spec s| |
1299 |painter view className methodName cls sel accepted spec s| |
1280 |
1300 |
|
1301 objectList painter isModified ifTrue:[ |
|
1302 (self confirm:'pick another interface without saving your modifications ?') ifFalse:[ |
|
1303 ^ self |
|
1304 ] |
|
1305 ]. |
|
1306 |
1281 (view := Display viewFromUser) notNil ifTrue:[ |
1307 (view := Display viewFromUser) notNil ifTrue:[ |
1282 painter := self painter. |
1308 painter := self painter. |
1283 |
1309 |
1284 spec := UISpecification fromView:view topView. |
1310 spec := UISpecification fromView:view topView. |
1285 |
1311 |
1286 "/ ok, got it |
1312 "/ ok, got it |
1287 painter setupFromSpec:spec. |
1313 painter setupFromSpec:spec. |
1288 painter className:view class name. |
1314 painter className:view class name. |
1289 painter methodName:#newSpec. |
1315 painter methodName:#newSpec. |
1290 ] |
1316 ] |
|
1317 |
|
1318 "Modified: 17.6.1997 / 12:33:23 / cg" |
1291 ! |
1319 ! |
1292 |
1320 |
1293 doRaise |
1321 doRaise |
1294 self painter topView raise. |
1322 self painter topView raise. |
1295 |
1323 |