[squeak-dev] The Trunk: ToolBuilder-Morphic-mt.296.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Feb 8 12:43:34 UTC 2022
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.296.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.296
Author: mt
Time: 8 February 2022, 1:43:34.336027 pm
UUID: 7bbea622-ff3a-9d4f-800b-276ccb54702d
Ancestors: ToolBuilder-Morphic-mt.295
Complements Morphic-mt.1876
=============== Diff against ToolBuilder-Morphic-mt.295 ===============
Item was changed:
----- Method: FileAbstractSelectionDialog>>buildWindowWith: (in category 'toolbuilder') -----
buildWindowWith: builder
"Since a file chooser is a modal dialog we over-ride the normal window build to use a dialog as the top component"
| windowSpec |
windowSpec := builder pluggableDialogSpec new.
windowSpec model: self;
label: #windowTitle;
message: #userMessage;
extent: self initialExtent;
- spacing: self viewSpacing;
children: OrderedCollection new;
buttons: OrderedCollection new.
^windowSpec!
Item was changed:
----- Method: FileAbstractSelectionDialog>>buttonHeight (in category 'ui details') -----
buttonHeight
+ ^ ToolBuilder default buttonRowHeight!
- ^ Preferences standardButtonFont height * 2!
Item was changed:
----- Method: FileAbstractSelectionDialog>>textViewFont (in category 'ui details') -----
textViewFont
+ ^ TextStyle defaultFont!
- ^ Preferences standardDefaultTextFont!
Item was changed:
----- Method: FileAbstractSelectionDialog>>textViewHeight (in category 'ui details') -----
textViewHeight
- " Take a whole font line and 50 % for space "
+ ^ ToolBuilder default inputFieldHeight!
- ^ (self textViewFont height * 1.5) ceiling!
Item was removed:
- ----- Method: FileAbstractSelectionDialog>>viewSpacing (in category 'ui details') -----
- viewSpacing
-
- ^ 5 "pixels"!
Item was changed:
----- Method: FileSaverDialog>>buildWith: (in category 'toolbuilder') -----
buildWith: builder
"assemble the spec for the saver dialog UI and build the window"
| window windowSpec |
windowSpec := self buildWindowWith: builder specs: {
+ (self topConstantHeightFrame: self textViewHeight
- (self topConstantHeightFrame: self textViewHeight + self viewSpacing
fromLeft: 0
width: 1) -> [self buildTextInputWith: builder].
+ (self frameOffsetFromTop: self textViewHeight
- (self frameOffsetFromTop: self textViewHeight + self viewSpacing
fromLeft: 0.35
width: 0.65
offsetFromBottom: 0) -> [self buildFileListWith: builder].
+ (self frameOffsetFromTop: self textViewHeight
- (self frameOffsetFromTop: self textViewHeight + self viewSpacing
fromLeft: 0
width: 0.35
offsetFromBottom: 0) -> [self buildDirectoryTreeWith: builder].
}.
windowSpec buttons addAll: ( self buildButtonsWith: builder ).
window := builder build: windowSpec.
window addKeyboardCaptureFilter: self.
self changed: #selectedPath.
self inputText: fileName.
window positionOverWidgetNamed: #inputText.
^window
!
Item was changed:
----- Method: ListChooser>>searchBarHeight (in category 'building') -----
searchBarHeight
+ ^ ToolBuilder default inputFieldHeight!
- ^ Preferences standardDefaultTextFont height * 1.75!
Item was changed:
----- Method: MorphicToolBuilder>>buildPluggableDialog: (in category 'widgets optional') -----
buildPluggableDialog: aSpec
| widget |
widget := self dialogClass new.
self register: widget id: aSpec name.
widget model: aSpec model.
"Set child dependent layout properties. The pane morph holds the special contents."
widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
self setLayoutHintsFor: widget paneMorph spec: aSpec.
+ widget paneMorph layoutInset: (aSpec padding ifNil: [self dialogPadding]).
- widget paneMorph layoutInset: (aSpec padding ifNil: [ProportionalSplitterMorph gripThickness]).
- widget paneMorph cellGap: (aSpec spacing ifNil: [ProportionalSplitterMorph gripThickness]).
widget morphicLayerNumber: widget class dialogLayer.
- widget paneMorph wantsPaneSplitters ifTrue: [
- widget paneMorph addCornerGrips"addEdgeGrips".
- widget paneMorph grips do: [:ea | ea showHandle: true]].
+ "Performance. Flip the #wantsPaneSplitters flag only after all children where added."
+ widget paneMorph cellGap: 0.
+ widget paneMorph wantsPaneSplitters: false; wantsGrips: false.
+ widget paneMorph removePaneSplitters; removeGrips.
+
"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 paneMorph].
+ "Avoid strange behavior in #addMorph:fullFrame:"
+ widget paneMorph cellGap: (aSpec spacing ifNil: [self dialogSpacing]).
+ widget paneMorph wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
+ widget paneMorph wantsPaneSplitters ifTrue: [
+ widget paneMorph wantsGrips: true.
+ widget paneMorph addPaneSplitters; addCornerGrips"; addEdgeGrips".
+ widget paneMorph grips do: [:ea | ea showHandle: true]].
+
"Now create the buttons."
aSpec buttons isSymbol
ifTrue: [
widget getButtonsSelector: aSpec buttons.
widget update: aSpec buttons]
ifFalse: [
self buildAll: aSpec buttons in: widget buttonRowMorph.
widget updateButtonProperties].
aSpec title ifNotNil: [:label |
label isSymbol
ifTrue:[widget getTitleSelector: label; update: label]
ifFalse:[widget title: label]].
aSpec message ifNotNil: [:label |
label isSymbol
ifTrue:[widget getMessageSelector: label; update: label]
ifFalse:[widget message: label]].
"Interaction behavior."
aSpec autoCancel ifNotNil: [:b | widget autoCancel: b].
aSpec exclusive ifNotNil: [:b | widget exclusive: b].
widget closeDialogSelector: aSpec closeAction.
self buildHelpFor: widget spec: aSpec.
"Everything is shrink-wrapped around the pane morph."
widget paneMorph extent: (aSpec extent ifNil:[widget initialExtent])
+ (widget paneMorph layoutInset * 2) asPoint.
^ widget!
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: [self panelPadding]).
- widget layoutInset: (aSpec padding ifNil: [0]).
- widget cellGap: (aSpec spacing ifNil: [
- widget wantsPaneSplitters
- ifTrue: [ProportionalSplitterMorph gripThickness]
- ifFalse: [(2 * RealEstateAgent scaleFactor) truncated]]).
+ "Flip the #wantsPaneSplitters flag only after all children where added."
+ widget cellGap: 0.
+ widget wantsPaneSplitters: false; wantsGrips: false.
+ widget removePaneSplitters; removeGrips.
+
"Now create the children."
aSpec children isSymbol
ifTrue: [
widget getChildrenSelector: aSpec children.
widget update: aSpec children]
ifFalse: [
self buildAll: aSpec children in: widget].
+ "Now that we have all children, let's add those splitters if necessary."
+ widget cellGap: (aSpec spacing ifNil: [
+ (aSpec wantsResizeHandles ifNil: [false])
+ ifTrue: [self windowSpacing]
+ ifFalse: [self panelSpacing]]).
+ widget wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
+ widget wantsPaneSplitters ifTrue: [widget addPaneSplitters].
+ "widget wantsGrips: true; addGrips."
+
self setFrame: aSpec frame in: widget.
self setLayout: aSpec layout in: widget.
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]).
MorphicProject worldGridEnabled ifTrue: [
"Snap both #position and #extent to grid."
aSpec horizontalResizing ifNil: [aSpec horizontalResizing: #spaceFill].
aSpec verticalResizing ifNil: [aSpec verticalResizing: #spaceFill]].
self setLayoutHintsFor: widget spec: aSpec.
+ widget layoutInset: (aSpec padding ifNil: [self windowPadding]).
- widget layoutInset: (aSpec padding ifNil: [ProportionalSplitterMorph gripThickness]).
- widget cellGap: (aSpec spacing ifNil: [ProportionalSplitterMorph gripThickness]).
widget morphicLayerNumber: widget class windowLayer.
+ "Performance. Flip the #wantsPaneSplitters flag only after all children where added."
+ widget cellGap: 0.
+ widget wantsPaneSplitters: false; wantsGrips: false.
+ widget removePaneSplitters; removeGrips.
+
"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.
+
+ "Now that we have all children, let's add those splitters if necessary."
+ widget cellGap: (aSpec spacing ifNil: [self windowSpacing]).
+ widget wantsPaneSplitters: (aSpec wantsResizeHandles ifNil: [true]).
+ widget wantsPaneSplitters ifTrue: [widget addPaneSplitters].
+ widget wantsGrips: true; addGrips.
+
aSpec defaultFocus ifNotNil: [:name |
widget defaultFocusMorph: name].
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).
widget refreshWindowColor.
^ widget!
More information about the Squeak-dev
mailing list
|