The Trunk: ToolBuilder-Morphic-nice.195.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-nice.195.mcz

commits-2
Nicolas Cellier uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-nice.195.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-nice.195
Author: nice
Time: 10 June 2017, 5:59:37.517672 pm
UUID: 73e96169-edde-48e6-9b31-65a62ae9c88f
Ancestors: ToolBuilder-Morphic-pre.194

Massively replace ifNotNilDo: by ifNotNil:
We don't need two different selectors to do a single thing.

=============== Diff against ToolBuilder-Morphic-pre.194 ===============

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableButton: (in category 'widgets required') -----
  buildPluggableButton: aSpec
  | widget label state action enabled |
  label := aSpec label.
  state := aSpec state.
  action := aSpec action.
  widget := self buttonClass on: aSpec model
  getState: (state isSymbol ifTrue:[state])
  action: nil
  label: (label isSymbol ifTrue:[label]).
  widget style: aSpec style.
  aSpec changeLabelWhen
+ ifNotNil: [ :event | widget whenChanged: event update: aSpec label].
- ifNotNilDo: [ :event | widget whenChanged: event update: aSpec label].
  self register: widget id: aSpec name.
  enabled := aSpec enabled.
  enabled isSymbol
  ifTrue:[widget getEnabledSelector: enabled]
  ifFalse:[widget enabled:enabled].
  widget action: action.
  aSpec color isColor
  ifTrue: [widget offColor: aSpec color]
  ifFalse: [widget getColorSelector: aSpec color].
  self buildHelpFor: widget spec: aSpec.
  (label isSymbol or:[label == nil]) ifFalse:[widget label: label].
  self setFrame: aSpec frame in: widget.
  self setLayoutHintsFor: widget spec: aSpec.
  parent ifNotNil:[self add: widget to: parent].
  ^widget!

Item was changed:
  ----- Method: PluggableButtonMorphPlus>>update: (in category 'updating') -----
  update: what
 
  super update: what.
 
  getColorSelector ifNotNil: [:sel |
  what == sel ifTrue: [self offColor: (model perform: sel)]].
 
  getEnabledSelector ifNotNil: [:sel |
  what == sel ifTrue: [self enabled: (model perform: sel)]].
 
  updateMap ifNotNil:
  [(updateMap at: what ifAbsent: [])
+ ifNotNil: [ :newTarget | self update: newTarget]].
- ifNotNilDo: [ :newTarget | self update: newTarget]].
  !