[Pkg] The Trunk: ToolBuilder-Morphic-mt.142.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 29 16:11:45 UTC 2015
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.142.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.142
Author: mt
Time: 29 April 2015, 6:11:35.977 pm
UUID: e9144d76-2044-f848-974b-c1dbfbed17b3
Ancestors: ToolBuilder-Morphic-mt.141
Fixed some minor layout issues when building panes or windows.
=============== Diff against ToolBuilder-Morphic-mt.141 ===============
Item was changed:
----- Method: MorphicToolBuilder>>add:to: (in category 'private') -----
add: aMorph to: aParent
+
+ aMorph layoutFrame
+ ifNotNil: [aParent addMorph: aMorph fullFrame: aMorph layoutFrame]
+ ifNil: [aParent addMorphBack: aMorph].!
- aParent addMorphBack: aMorph.
- aParent isSystemWindow ifTrue:[
- aParent addPaneMorph: aMorph.
- ].!
Item was changed:
----- Method: MorphicToolBuilder>>buildPluggablePanel: (in category 'widgets required') -----
buildPluggablePanel: aSpec
+
+ | widget |
- | widget children frame |
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]).
+ 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].
+
- widget color: Color transparent.
- children := aSpec children.
- children isSymbol ifTrue:[
- widget getChildrenSelector: children.
- widget update: children.
- children := #().
- ].
- self buildAll: children in: widget.
- self buildHelpFor: widget spec: aSpec.
self setFrame: aSpec frame in: widget.
- parent ifNotNil:[self add: widget to: parent].
self setLayout: aSpec layout in: widget.
+ self setLayoutHintsFor: widget spec: aSpec.
+
+ parent ifNotNil:[self add: widget to: parent].
+
- widget layoutInset: 0.
widget borderWidth: 0.
+ self buildHelpFor: widget spec: aSpec.
- widget submorphsDo:[:sm|
- (frame := sm layoutFrame) ifNotNil:[
- (frame rightFraction = 0 or:[frame rightFraction = 1])
- ifFalse:[frame rightOffset:1].
- (frame bottomFraction = 0 or:[frame bottomFraction = 1])
- ifFalse:[frame bottomOffset: 1]]].
widget color: Color transparent.
- self setLayoutHintsFor: widget spec: aSpec.
+ ^ widget!
- ^widget!
Item was changed:
----- Method: MorphicToolBuilder>>buildPluggableWindow: (in category 'widgets required') -----
buildPluggableWindow: aSpec
+ | widget |
+
- | widget children |
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]).
+ 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|
- aSpec label ifNotNil:
- [:label|
label isSymbol
ifTrue:[widget getLabelSelector: label]
ifFalse:[widget setLabel: label]].
+
aSpec multiWindowStyle notNil ifTrue:
[widget savedMultiWindowState: (SavedMultiWindowState on: aSpec model)].
+
- children := aSpec children.
- children isSymbol ifTrue:[
- widget getChildrenSelector: children.
- widget update: children.
- children := #().
- ].
widget closeWindowSelector: aSpec closeAction.
- panes := OrderedCollection new.
- self buildAll: children in: widget.
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!
-
- widget setUpdatablePanesFrom: panes.
- ^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 at 1.
+ widget layoutInset: 1 at 1."
- widget cellInset: 1 at 1.
- widget layoutInset: 1 at 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 at 1.
+ widget layoutInset: 1 at 1."
- widget cellInset: 1 at 1.
- widget layoutInset: 1 at 1.
widget color: Color transparent.
"and then some..."
^self].
^self error: 'Unknown layout: ', layout.!
More information about the Packages
mailing list