UIPainter.st
changeset 161 12a70f62f414
parent 160 622b88baeff6
child 166 cd5699643975
equal deleted inserted replaced
160:622b88baeff6 161:12a70f62f414
   981         (specSuperclass notNil ifTrue:[specSuperclass]
   981         (specSuperclass notNil ifTrue:[specSuperclass]
   982                          ifFalse:['ApplicationModel']) asValue
   982                          ifFalse:['ApplicationModel']) asValue
   983     ).
   983     ).
   984     aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue.
   984     aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue.
   985     aspects at:#methodNameChannel put:(
   985     aspects at:#methodNameChannel put:(
   986         (specSelector notNil ifTrue:[specSelector]
   986         (specSelector notNil ifTrue:[specSelector asValue]
   987                             ifFalse:[#windowSpec]) asValue
   987                             ifFalse:[#windowSpec]) asValue
   988     ).
   988     ).
   989 
   989 
   990     painterView := StandardSystemView new.
   990     painterView := StandardSystemView new.
   991     painterView label:'unnamed canvas'.
   991     painterView label:'unnamed canvas'.
  1015     selectionPanel window openInGroup:(topView windowGroup).
  1015     selectionPanel window openInGroup:(topView windowGroup).
  1016     selectionPanel window bePartner.
  1016     selectionPanel window bePartner.
  1017     selectionPanel openWindow.
  1017     selectionPanel openWindow.
  1018     selectionPanel window application:self.
  1018     selectionPanel window application:self.
  1019 
  1019 
  1020     "Modified: 17.6.1997 / 13:06:25 / cg"
  1020     "Modified: 17.6.1997 / 14:41:15 / cg"
  1021 !
  1021 !
  1022 
  1022 
  1023 openNewWindowCanvas
  1023 openNewWindowCanvas
  1024     "open new
  1024     "open new
  1025     "
  1025     "
  1052         specSuperclass := aClass superclass name.
  1052         specSuperclass := aClass superclass name.
  1053         specSelector   := aSelector.
  1053         specSelector   := aSelector.
  1054 
  1054 
  1055         (aspects at:#classNameChannel) value:specClass.
  1055         (aspects at:#classNameChannel) value:specClass.
  1056         (aspects at:#superclassNameChannel) value:specSuperclass.
  1056         (aspects at:#superclassNameChannel) value:specSuperclass.
  1057         (aspects at:#methodNameChannel) value:specSelector.
  1057         (aspects at:#methodNameChannel) value:specSelector asSymbol.
  1058 
  1058 
  1059         painter className:aClass name.
  1059         painter className:aClass name.
  1060         painter methodName:aSelector.
  1060         painter methodName:aSelector.
  1061         painter setupFromSpec:(aClass perform:aSelector).
  1061         painter setupFromSpec:(aClass perform:aSelector).
  1062     ]
  1062     ]
  1063 
  1063 
  1064     "Modified: 17.6.1997 / 13:04:48 / cg"
  1064     "Modified: 17.6.1997 / 14:41:25 / cg"
  1065 ! !
  1065 ! !
  1066 
  1066 
  1067 !UIPainter methodsFor:'user interaction - dialog'!
  1067 !UIPainter methodsFor:'user interaction - dialog'!
  1068 
  1068 
  1069 checkClassAndSelector
  1069 checkClassAndSelector
  1133 
  1133 
  1134         (self openDialogInterface:#nameAndSelectorSpec) ifTrue:[
  1134         (self openDialogInterface:#nameAndSelectorSpec) ifTrue:[
  1135 
  1135 
  1136             specClass := (self aspectFor:#classNameChannel) value.
  1136             specClass := (self aspectFor:#classNameChannel) value.
  1137             specSelector := (self aspectFor:#methodNameChannel) value.
  1137             specSelector := (self aspectFor:#methodNameChannel) value.
       
  1138             specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
  1138             specSuperclass := (self aspectFor:#superclassNameChannel) value.
  1139             specSuperclass := (self aspectFor:#superclassNameChannel) value.
  1139 
  1140 
  1140             (again := self checkClassAndSelector not) ifFalse:[
  1141             (again := self checkClassAndSelector not) ifFalse:[
  1141                 self painter className:specClass
  1142                 self painter className:specClass
  1142                         superclassName:specSuperclass
  1143                         superclassName:specSuperclass
  1144             ]
  1145             ]
  1145         ]
  1146         ]
  1146 
  1147 
  1147     ] doWhile:[again]
  1148     ] doWhile:[again]
  1148 
  1149 
  1149     "Modified: 17.6.1997 / 14:18:19 / cg"
  1150     "Modified: 17.6.1997 / 14:42:02 / cg"
  1150 ! !
  1151 ! !
  1151 
  1152 
  1152 !UIPainter methodsFor:'user interaction - pullDown'!
  1153 !UIPainter methodsFor:'user interaction - pullDown'!
  1153 
  1154 
  1154 doBrowseAppClass
  1155 doBrowseAppClass
  1414     cls isNil ifTrue:[
  1415     cls isNil ifTrue:[
  1415         ^ self information:'class not existant'.
  1416         ^ self information:'class not existant'.
  1416     ].
  1417     ].
  1417 
  1418 
  1418     (cls respondsTo:specSelector) ifFalse:[
  1419     (cls respondsTo:specSelector) ifFalse:[
  1419         ^ self information:'selector not defined'.
  1420 self halt.
       
  1421         ^ self information:('no method for: #' 
       
  1422                              , specSelector , ' in ' , cls name ,
       
  1423                              '\\(did you install the spec ?)') withCRs.
  1420     ].
  1424     ].
  1421     cls new openInterface:specSelector
  1425     cls new openInterface:specSelector
       
  1426 
       
  1427     "Modified: 17.6.1997 / 14:40:21 / cg"
  1422 !
  1428 !
  1423 
  1429 
  1424 doWindowSpec
  1430 doWindowSpec
  1425    |code code2 v|
  1431    |code code2 v|
  1426 
  1432