The Trunk: ToolBuilder-Morphic-mt.167.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-mt.167.mcz

commits-2
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.167.mcz

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

Name: ToolBuilder-Morphic-mt.167
Author: mt
Time: 5 June 2016, 1:29:37.065092 pm
UUID: d6d3ad9e-f82f-c44d-b2a6-6d907e129fa1
Ancestors: ToolBuilder-Morphic-mt.166

Appendix to Morphic-mt.1167.

Fixes construction of pluggable scroll panes and update of pluggable panel morphs, which are used in pluggable scroll panes.

=============== Diff against ToolBuilder-Morphic-mt.166 ===============

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableScrollPane: (in category 'widgets optional') -----
  buildPluggableScrollPane: spec
 
+ | widget panel |
- | widget |
  widget := self scrollPaneClass new.
  widget model: spec model.
  self register: widget id: spec name.
 
  spec children
  ifNotNil: [:obj |
  "Create panel morph to scroll it."
+ panel := self pluggablePanelSpec new
+ model: spec model;
- widget morph: (self pluggablePanelSpec new
  children: obj;
  layout: spec layout;
+ horizontalResizing: (spec layout == #proportional ifTrue: [#rigid] ifFalse: [#shrinkWrap]);
+ verticalResizing: (spec layout == #proportional ifTrue: [#rigid] ifFalse: [#shrinkWrap]);
+ buildWith: self.
+ widget morph: panel.
+ ]
- frame: (0@0 corner: 1@1);
- buildWith: self).
- spec layout ~~ #proportional ifTrue: [
- "Fix #spaceFill resizing because it does not make sense in scroll pane."
- widget morph
- hResizing: #shrinkWrap;
- vResizing: #shrinkWrap.
- widget morph submorphsDo: [:m |
- m
- extent: 100@100;
- flag: #refactor; "mt: Restore orginial properties?"
- hResizing: #rigid;
- vResizing: #rigid]
- ]]
  ifNil: [spec morph
  ifNotNil: [:m | widget morph: m]
  ifNil: [widget morphClass: spec morphClass]].
 
  self setFrame: spec frame in: widget.
  self setLayoutHintsFor: widget spec: spec.
 
  parent ifNotNil: [self add: widget to: parent].
 
  widget borderWidth: spec borderWidth.
 
+ "Override default scroll bar policies if needed. Widget will use preference values otherwise."
+ spec hScrollBarPolicy ifNotNil: [:policy |
+ policy caseOf: {
+ [#always] -> [widget alwaysShowHScrollBar].
+ [#never] -> [widget hideHScrollBarIndefinitely].
+ [#whenNeeded] -> [widget showHScrollBarOnlyWhenNeeded]}].
+ spec vScrollBarPolicy ifNotNil: [:policy |
+ policy caseOf: {
+ [#always] -> [widget alwaysShowVScrollBar].
+ [#never] -> [widget hideVScrollBarIndefinitely].
+ [#whenNeeded] -> [widget showVScrollBarOnlyWhenNeeded]}].
- spec hScrollBarPolicy caseOf: {
- [#always] -> [widget alwaysShowHScrollBar].
- [#never] -> [widget hideHScrollBarIndefinitely].
- [#whenNeeded] -> [widget showHScrollBarOnlyWhenNeeded]}.
- spec vScrollBarPolicy caseOf: {
- [#always] -> [widget alwaysShowVScrollBar].
- [#never] -> [widget hideVScrollBarIndefinitely].
- [#whenNeeded] -> [widget showVScrollBarOnlyWhenNeeded]}.
 
  ^ widget!

Item was changed:
  ----- Method: PluggablePanelMorph>>update: (in category 'update') -----
  update: selectorSymbolOrNil
  selectorSymbolOrNil ifNil: [ ^ self ].
  selectorSymbolOrNil = getChildrenSelector ifTrue:
  [ self
  removeAllMorphs ;
+ addAllMorphs: self children .
+
+ "Let my children take all the place unless my extent is described by them."
+ self hResizing ~~ #shrinkWrap ifTrue:
+ [ self submorphsDo: [ : m | m hResizing: #spaceFill ] ].
+ self vResizing ~~ #shrinkWrap ifTrue:
+ [ self submorphsDo: [ : m | m vResizing: #spaceFill ] ].
+
+ "Tell dependents about this update. There is no pluggable notification for changed submorphs."
+ self changed: #submorphs ].!
- addAllMorphs: self children ;
- submorphsDo:
- [ : m | m
- hResizing: #spaceFill ;
- vResizing: #spaceFill ] ]!