MenuPanel.st
changeset 5515 f87f470e99c9
parent 5473 6015183249c7
child 5516 565035d19b67
equal deleted inserted replaced
5514:8f0a8c426831 5515:f87f470e99c9
  7503 !MenuPanel::Item methodsFor:'building'!
  7503 !MenuPanel::Item methodsFor:'building'!
  7504 
  7504 
  7505 aspectAt:aKey
  7505 aspectAt:aKey
  7506     "returns the value assigned to key or nil"
  7506     "returns the value assigned to key or nil"
  7507 
  7507 
  7508     |appl value|
  7508     |appl|
  7509 
  7509 
  7510     appl := menuPanel receiver.
  7510     appl := menuPanel receiver.
  7511     (appl isValueModel) ifTrue:[
       
  7512         ^ appl value:aKey
       
  7513     ].
       
  7514     appl isNil ifTrue:[
  7511     appl isNil ifTrue:[
  7515         appl := menuPanel application.
  7512         appl := menuPanel application.
  7516         appl isNil ifTrue:[ ^ nil].
  7513         appl isNil ifTrue:[ 
  7517     ].
  7514             ^ nil
  7518 
  7515         ].
  7519     MessageNotUnderstood handle:[:ex|
  7516     ] ifFalse:[appl isValueModel ifTrue:[
       
  7517         ^ appl value:aKey
       
  7518     ]].
       
  7519 
       
  7520     ^ [
       
  7521         aKey argumentCount == 1 ifTrue:[
       
  7522             appl perform:aKey with:(menuItem argument ? self).
       
  7523         ] ifFalse:[
       
  7524             (appl respondsTo:#aspectFor:) ifTrue:[
       
  7525                 appl aspectFor:aKey
       
  7526             ] ifFalse:[
       
  7527                 appl perform:aKey
       
  7528             ]
       
  7529         ]
       
  7530     ] on:MessageNotUnderstood do:[:ex|
  7520         ex selector ~~ aKey ifTrue:[
  7531         ex selector ~~ aKey ifTrue:[
  7521             ex reject
  7532             ex reject.
  7522         ].
  7533         ].
  7523         self ifNotInUIBuilderInfoPrintCR:
  7534         self ifNotInUIBuilderInfoPrintCR:
  7524             ('MenuPanel::Item [error]: application (%1) does not provide aspect: %2 (in %3)'
  7535             ('MenuPanel::Item [error]: application (%1) does not provide aspect: %2 (in %3)'
  7525              bindWith:appl classNameWithArticle
  7536              bindWith:appl classNameWithArticle
  7526              with:aKey
  7537              with:aKey
  7527              with:(label isString ifTrue:[label] ifFalse:[self nameKey ? self itemValue ? '???'])).
  7538              with:(label isString ifTrue:[label] ifFalse:[self nameKey ? self itemValue ? '???'])).
  7528     ] do:[
  7539         nil
  7529         aKey argumentCount == 1 ifTrue:[
  7540     ].
  7530             value := appl perform:aKey with:(menuItem argument ? self).
       
  7531         ] ifFalse:[
       
  7532             (appl respondsTo:#aspectFor:) ifTrue:[
       
  7533                 value := appl aspectFor:aKey
       
  7534             ] ifFalse:[
       
  7535                 value := appl perform:aKey
       
  7536             ]
       
  7537         ]
       
  7538     ].
       
  7539     ^ value
       
  7540 
  7541 
  7541     "Modified: / 02-08-2013 / 16:44:28 / cg"
  7542     "Modified: / 02-08-2013 / 16:44:28 / cg"
       
  7543     "Modified (format): / 15-03-2017 / 17:00:31 / stefan"
  7542 ! !
  7544 ! !
  7543 
  7545 
  7544 !MenuPanel::Item methodsFor:'change & update'!
  7546 !MenuPanel::Item methodsFor:'change & update'!
  7545 
  7547 
  7546 fontChanged
  7548 fontChanged