Christoph Thiede uploaded a new version of ToolBuilder-Morphic to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.254.mcz ==================== Summary ==================== Name: ToolBuilder-Morphic-ct.254 Author: ct Time: 10 February 2020, 11:15:15.198089 am UUID: e95e688c-632c-7b40-b6ca-4e481bbe57fd Ancestors: ToolBuilder-Morphic-mt.251 Adds support for PluggableSliderSpec. Complements ToolBuilder-Kernel-ct.139. =============== Diff against ToolBuilder-Morphic-mt.251 =============== Item was added: + ----- Method: MorphicToolBuilder>>buildPluggableSlider: (in category 'widgets optional') ----- + buildPluggableSlider: spec + + | widget | + widget := self sliderClass + on: spec model + getValue: spec getValue + setValue: spec setValue + min: spec minValue + max: spec maxValue + quantum: spec quantum. + self register: widget id: spec name. + + spec color ifNotNil: [:color | widget color: color]. + spec thumbColor ifNotNil: [:color | widget sliderColor: color]. + self setFrame: spec frame in: widget. + self setLayoutHintsFor: widget spec: spec. + parent ifNotNil: [self add: widget to: parent]. + ^ widget! Item was added: + ----- Method: MorphicToolBuilder>>sliderClass (in category 'widget classes') ----- + sliderClass + + ^ Slider! |
Note this is still a quite simple implementation. Further improvements could include:
- #editValue(:) that is called while the slider is moved, but before it is dropped
- Click left/above the slider to reduce its value, or right/below the slider to increase it.
- #orientation(:) to override default orientation behavior (i. e., "longer dimension wins")?
- This is how a slider in widgets looks:
Pretty cool appearance, this would be a nice-to-have for Morphic as well.
I wonder whether we would want to subclass Slider again (PluggableSliderMorph) or rather change the base class implementation?
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Montag, 10. Februar 2020 11:15 Uhr An: [hidden email] Betreff: [squeak-dev] The Inbox: ToolBuilder-Morphic-ct.254.mcz Christoph Thiede uploaded a new version of ToolBuilder-Morphic to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-ct.254.mcz ==================== Summary ==================== Name: ToolBuilder-Morphic-ct.254 Author: ct Time: 10 February 2020, 11:15:15.198089 am UUID: e95e688c-632c-7b40-b6ca-4e481bbe57fd Ancestors: ToolBuilder-Morphic-mt.251 Adds support for PluggableSliderSpec. Complements ToolBuilder-Kernel-ct.139. =============== Diff against ToolBuilder-Morphic-mt.251 =============== Item was added: + ----- Method: MorphicToolBuilder>>buildPluggableSlider: (in category 'widgets optional') ----- + buildPluggableSlider: spec + + | widget | + widget := self sliderClass + on: spec model + getValue: spec getValue + setValue: spec setValue + min: spec minValue + max: spec maxValue + quantum: spec quantum. + self register: widget id: spec name. + + spec color ifNotNil: [:color | widget color: color]. + spec thumbColor ifNotNil: [:color | widget sliderColor: color]. + self setFrame: spec frame in: widget. + self setLayoutHintsFor: widget spec: spec. + parent ifNotNil: [self add: widget to: parent]. + ^ widget! Item was added: + ----- Method: MorphicToolBuilder>>sliderClass (in category 'widget classes') ----- + sliderClass + + ^ Slider!
Carpe Squeak!
|
Free forum by Nabble | Edit this page |