Karl Ramberg uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-kfr.934.mcz ==================== Summary ==================== Name: Morphic-kfr.934 Author: kfr Time: 26 April 2015, 9:40:34.032 pm UUID: fd9f26f3-4ed1-eb4f-a8ee-0f0270153871 Ancestors: Morphic-kfr.933 Add a check for morphic environment =============== Diff against Morphic-kfr.933 =============== Item was changed: ----- Method: FontChooserTool>>buildWith: (in category 'toolbuilder') ----- buildWith: builder "Create the ui for the browser" "ToolBuilder open: self" | windowSpec | self offerStyleList ifTrue:[ windowSpec := self buildWindowWith: builder specs: { (0@0 corner: 0.4@0.4) -> [self buildFontListWith: builder]. (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]. (0.8@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. (0.0@0.4 corner: 1.0@0.88) -> [self buildPreviewPaneWith: builder]. (0.0@0.88 corner: 1@1) -> [self buildButtonBarWith: builder]. }. ] ifFalse:[ windowSpec := self buildWindowWith: builder specs: { (0@0 corner: 0.7@0.4) -> [self buildFontListWith: builder]. " (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]." (0.7@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. (0.0@0.4 corner: 1.0@0.8) -> [self buildPreviewPaneWith: builder]. (0.0@0.8 corner: 1@1) -> [self buildButtonBarWith: builder]. }. ]. windowSpec extent: self initialExtent. window := builder build: windowSpec. "Yes, that's a hack. But it looks ugly with line breaks." + Smalltalk isMorphic ifTrue:[(builder widgetAt: #preview) textMorph wrapFlag: false]. - (builder widgetAt: #preview) textMorph wrapFlag: false. (builder widgetAt: #fontList) scrollSelectionIntoView. ^window! |
This assumes I'm only ever building for the world I'm in. What if I'm
building MVC widgets to go inside a special window inside my Moprhic IDE environment? Maybe we should ask the 'builder' if he's a kind of MorphicToolBuilder rather than asking the global Smalltalk? On Sun, Apr 26, 2015 at 2:41 PM, <[hidden email]> wrote: > Karl Ramberg uploaded a new version of Morphic to project The Trunk: > http://source.squeak.org/trunk/Morphic-kfr.934.mcz > > ==================== Summary ==================== > > Name: Morphic-kfr.934 > Author: kfr > Time: 26 April 2015, 9:40:34.032 pm > UUID: fd9f26f3-4ed1-eb4f-a8ee-0f0270153871 > Ancestors: Morphic-kfr.933 > > Add a check for morphic environment > > =============== Diff against Morphic-kfr.933 =============== > > Item was changed: > ----- Method: FontChooserTool>>buildWith: (in category 'toolbuilder') ----- > buildWith: builder > "Create the ui for the browser" > "ToolBuilder open: self" > | windowSpec | > self offerStyleList ifTrue:[ > windowSpec := self buildWindowWith: builder specs: { > (0@0 corner: 0.4@0.4) -> [self buildFontListWith: builder]. > (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]. > (0.8@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. > (0.0@0.4 corner: 1.0@0.88) -> [self buildPreviewPaneWith: builder]. > (0.0@0.88 corner: 1@1) -> [self buildButtonBarWith: builder]. > }. > ] ifFalse:[ > windowSpec := self buildWindowWith: builder specs: { > (0@0 corner: 0.7@0.4) -> [self buildFontListWith: builder]. > " (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]." > (0.7@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. > (0.0@0.4 corner: 1.0@0.8) -> [self buildPreviewPaneWith: builder]. > (0.0@0.8 corner: 1@1) -> [self buildButtonBarWith: builder]. > }. > ]. > windowSpec extent: self initialExtent. > window := builder build: windowSpec. > "Yes, that's a hack. But it looks ugly with line breaks." > + Smalltalk isMorphic ifTrue:[(builder widgetAt: #preview) textMorph wrapFlag: false]. > - (builder widgetAt: #preview) textMorph wrapFlag: false. > (builder widgetAt: #fontList) scrollSelectionIntoView. > ^window! > > |
On Sun, Apr 26, 2015 at 04:43:15PM -0500, Chris Muller wrote:
> This assumes I'm only ever building for the world I'm in. What if I'm > building MVC widgets to go inside a special window inside my Moprhic > IDE environment? > > Maybe we should ask the 'builder' if he's a kind of MorphicToolBuilder > rather than asking the global Smalltalk? Presumably an MVC version of the font chooser tool would use a PluggableTextView, which AFAICT does not know how to turn off text wrapping. But implementing StringHolderView>>wrapFlag: as a no-op for Morphic compatibility would be harmless. So could we implement PluggableTextMorph>>wrapFlag: to pass the flag to its TextMorph for Morphic, and implement wrapFlag: as a no-op in StringHolderView for MVC? That would eliminate the need for an #isMorphic test in FontChooserTool>>buildWith: Dave > > On Sun, Apr 26, 2015 at 2:41 PM, <[hidden email]> wrote: > > Karl Ramberg uploaded a new version of Morphic to project The Trunk: > > http://source.squeak.org/trunk/Morphic-kfr.934.mcz > > > > ==================== Summary ==================== > > > > Name: Morphic-kfr.934 > > Author: kfr > > Time: 26 April 2015, 9:40:34.032 pm > > UUID: fd9f26f3-4ed1-eb4f-a8ee-0f0270153871 > > Ancestors: Morphic-kfr.933 > > > > Add a check for morphic environment > > > > =============== Diff against Morphic-kfr.933 =============== > > > > Item was changed: > > ----- Method: FontChooserTool>>buildWith: (in category 'toolbuilder') ----- > > buildWith: builder > > "Create the ui for the browser" > > "ToolBuilder open: self" > > | windowSpec | > > self offerStyleList ifTrue:[ > > windowSpec := self buildWindowWith: builder specs: { > > (0@0 corner: 0.4@0.4) -> [self buildFontListWith: builder]. > > (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]. > > (0.8@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. > > (0.0@0.4 corner: 1.0@0.88) -> [self buildPreviewPaneWith: builder]. > > (0.0@0.88 corner: 1@1) -> [self buildButtonBarWith: builder]. > > }. > > ] ifFalse:[ > > windowSpec := self buildWindowWith: builder specs: { > > (0@0 corner: 0.7@0.4) -> [self buildFontListWith: builder]. > > " (0.4@0 corner: 0.8@0.4) -> [self buildStyleListWith: builder]." > > (0.7@0 corner: 1.0@0.4) -> [self buildPointSizeListWith: builder]. > > (0.0@0.4 corner: 1.0@0.8) -> [self buildPreviewPaneWith: builder]. > > (0.0@0.8 corner: 1@1) -> [self buildButtonBarWith: builder]. > > }. > > ]. > > windowSpec extent: self initialExtent. > > window := builder build: windowSpec. > > "Yes, that's a hack. But it looks ugly with line breaks." > > + Smalltalk isMorphic ifTrue:[(builder widgetAt: #preview) textMorph wrapFlag: false]. > > - (builder widgetAt: #preview) textMorph wrapFlag: false. > > (builder widgetAt: #fontList) scrollSelectionIntoView. > > ^window! > > > > |
This sound good. Karl On Mon, Apr 27, 2015 at 12:34 AM, David T. Lewis <[hidden email]> wrote: On Sun, Apr 26, 2015 at 04:43:15PM -0500, Chris Muller wrote: |
In reply to this post by Chris Muller-3
Adding #isMorphic to the tool builder does not help because we *must not* write model/tool code that is dependent on particular widgets (views or morphs or X) because then new kinds of widgets have no easy way to provide the missing functionality.
ToolBuilderSpecs and changed/update are the way to go. Best, Marcel |
You have made really nice enhancements to fix this issue, Marcel :-) On Mon, Apr 27, 2015 at 1:01 PM, Marcel Taeumel <[hidden email]> wrote: Adding #isMorphic to the tool builder does not help because we *must not* |
Free forum by Nabble | Edit this page |