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

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

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

Name: ToolBuilder-Morphic-mt.143
Author: mt
Time: 3 May 2015, 10:34:22.75 am
UUID: 4ee679ac-c35a-7b4d-80eb-b138d4d84702
Ancestors: ToolBuilder-Morphic-mt.142

Honor custom resizing policies.

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

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggablePanel: (in category 'widgets required') -----
  buildPluggablePanel: aSpec
 
  | widget |
  widget := self panelClass new.
  self register: widget id: aSpec name.
 
  widget model: aSpec model.
 
  "Set child dependent layout properties."
  widget wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [false]).
+ self setLayoutHintsFor: widget spec: aSpec.
  widget layoutInset: (aSpec padding ifNil: [0]).
  widget cellInset: (aSpec spacing ifNil: [
  widget wantsPaneSplitters
  ifTrue: [ProportionalSplitterMorph gripThickness]
  ifFalse: [2]]).
 
  "Now create the children."
  aSpec children isSymbol
  ifTrue: [
  widget getChildrenSelector: aSpec children.
  widget update: aSpec children]
  ifFalse: [
  self buildAll: aSpec children in: widget].
 
  self setFrame: aSpec frame in: widget.
  self setLayout: aSpec layout in: widget.
- self setLayoutHintsFor: widget spec: aSpec.
 
  parent ifNotNil:[self add: widget to: parent].
 
  widget borderWidth: 0.
  self buildHelpFor: widget spec: aSpec.
  widget color: Color transparent.
 
  ^ widget!

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableWindow: (in category 'widgets required') -----
  buildPluggableWindow: aSpec
  | widget |
 
  aSpec layout == #proportional ifFalse:[
  "This needs to be implemented - probably by adding a single pane and then the rest"
  ^self error: 'Not implemented'.
  ].
 
  widget := (self windowClassFor: aSpec) new.
  self register: widget id: aSpec name.
 
  widget model: aSpec model.
 
  "Set child dependent layout properties."
  widget wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
+ self setLayoutHintsFor: widget spec: aSpec.
  widget layoutInset: (aSpec padding ifNil: [ProportionalSplitterMorph gripThickness]).
  widget cellInset: (aSpec spacing ifNil: [ProportionalSplitterMorph gripThickness]).
 
  "Now create the children."
  panes := OrderedCollection new.
  aSpec children isSymbol
  ifTrue: [
  widget getChildrenSelector: aSpec children.
  widget update: aSpec children]
  ifFalse: [
  self buildAll: aSpec children in: widget].
  widget setUpdatablePanesFrom: panes.
 
  aSpec label ifNotNil: [:label|
  label isSymbol
  ifTrue:[widget getLabelSelector: label]
  ifFalse:[widget setLabel: label]].
 
  aSpec multiWindowStyle notNil ifTrue:
  [widget savedMultiWindowState: (SavedMultiWindowState on: aSpec model)].
 
  widget closeWindowSelector: aSpec closeAction.
  self buildHelpFor: widget spec: aSpec.
 
  widget bounds: (RealEstateAgent
  initialFrameFor: widget
  initialExtent: (aSpec extent ifNil:[widget initialExtent])
  world: self currentWorld).
- self setLayoutHintsFor: widget spec: aSpec.
 
  ^ widget!

Item was changed:
  ----- Method: MorphicToolBuilder>>setLayout:in: (in category 'private') -----
  setLayout: layout in: widget
  layout == #proportional ifTrue:[
  widget layoutPolicy: ProportionalLayout new.
  ^self].
  layout == #horizontal ifTrue:[
  widget layoutPolicy: TableLayout new.
  widget listDirection: #leftToRight.
- widget submorphsDo:[:m| m hResizing: #spaceFill; vResizing: #spaceFill].
  "widget cellInset: 1@1.
  widget layoutInset: 1@1."
  widget color: Color transparent.
  "and then some..."
  ^self].
  layout == #vertical ifTrue:[
  widget layoutPolicy: TableLayout new.
  widget listDirection: #topToBottom.
- widget submorphsDo:[:m| m hResizing: #spaceFill; vResizing: #spaceFill].
  "widget cellInset: 1@1.
  widget layoutInset: 1@1."
  widget color: Color transparent.
  "and then some..."
  ^self].
  ^self error: 'Unknown layout: ', layout.!

Item was changed:
  ----- Method: MorphicToolBuilder>>setLayoutHintsFor:spec: (in category 'private') -----
  setLayoutHintsFor: widget spec: aSpec
 
  aSpec minimumWidth >= 0
  ifTrue: [widget minimumWidth: aSpec minimumWidth].
  aSpec minimumHeight >= 0
+ ifTrue: [widget minimumHeight: aSpec minimumHeight].
+ aSpec padding
+ ifNotNil: [:p | widget layoutInset: p].
+ "aSpec margin
+ ifNotNil: [:m | widget layoutOutset: m]."
+
+ widget hResizing: (aSpec horizontalResizing ifNil: [#spaceFill]).
+ widget vResizing: (aSpec verticalResizing ifNil: [#spaceFill]).!
- ifTrue: [widget minimumHeight: aSpec minimumHeight].!