Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1551.mcz
==================== Summary ====================
Name: Morphic-mt.1551
Author: mt
Time: 30 September 2019, 3:57:16.04771 pm
UUID: a496bd6a-f249-1d41-8989-e6383d6a0826
Ancestors: Morphic-mt.1550
Like Morphic-mt.1550, complement the change in Morphic-mt.1520.
Before 1520, using #contents: did set wrapFlag to "false", which effectively initializes every TextMorph with that value because "TextMorph new contents: 'foobar'" is kind of common. After 1520, that's not the case anymore. So, this commit really sets wrapFlag to "false" and finally adds autoFit to #initialize as well.
As long as the client configures text morphs with their #contents, wrapping makes no sense. Only if that configuration considers both #contents and #width, wrapping matters. Since that is the case for tool building, I will change the default treatment of PluggableTextSpec >> #softLineWrap directly after this commit.
=============== Diff against Morphic-mt.1550 ===============
Item was changed:
----- Method: MenuMorph>>displayFiltered: (in category 'keyboard control') -----
displayFiltered: evt
| matchStr allItems matches feedbackMorph |
matchStr := self valueOfProperty: #matchString.
allItems := self submorphs select: [:m | m isKindOf: MenuItemMorph].
matches := allItems select: [:m | | isMatch |
isMatch :=
matchStr isEmpty or: [
m contents includesSubstring: matchStr caseSensitive: false].
m isEnabled: isMatch.
isMatch].
feedbackMorph := self valueOfProperty: #feedbackMorph.
feedbackMorph ifNil: [
+ feedbackMorph := TextMorph new
+ color: Color darkGray;
+ yourself.
- feedbackMorph :=
- TextMorph new
- autoFit: true;
- wrapFlag: false;
- color: Color darkGray.
self
addLine;
addMorphBack: feedbackMorph lock.
self setProperty: #feedbackMorph toValue: feedbackMorph.
self fullBounds. "Lay out for submorph adjacency"].
feedbackMorph contents: '<', matchStr, '>'.
matchStr isEmpty ifTrue: [
feedbackMorph delete.
self submorphs last delete.
self removeProperty: #feedbackMorph].
" This method is invoked with evt = nil from MenuMorph >> removeMatchString.
The current implementation can't select an item without an event. "
(evt notNil and: [ matches size >= 1 ]) ifTrue: [
self selectItem: matches first event: evt]!
Item was changed:
----- Method: TextMorph>>initialize (in category 'initialization') -----
initialize
super initialize.
textStyle := TextStyle default copy.
+
+ wrapFlag := false.
+ autoFit := true.!
- wrapFlag := true.
- !
Item was changed:
----- Method: TextMorph>>isAutoFit (in category 'accessing') -----
isAutoFit
+ "For migrating old instances only. See #initialize."
+
-
^ autoFit ifNil: [autoFit := true]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1549.mcz
==================== Summary ====================
Name: Morphic-mt.1549
Author: mt
Time: 30 September 2019, 11:19:38.88371 am
UUID: 6bbc0287-72da-fe4c-889d-591c9bec9657
Ancestors: Morphic-mt.1548
Caches "fullList" in pluggable lists to speed up list filtering.
Note that we have now two kinds of caches in PluggableListMorph: (1) inst-var access to "list" with invalidation/update via #getList and (2) the accessor #fullList. In the future, we should harmonize that design ... Since the addition of list filters, we forgot to treat inst-var access to "list" as a cache. There are way too many sends of #getFullList at the moment. So that new cache makes sense.
=============== Diff against Morphic-mt.1548 ===============
Item was changed:
ScrollPane subclass: #PluggableListMorph
+ instanceVariableNames: 'list fullList getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph hScrollRangeCache keystrokePreviewSelector priorSelection getIconSelector getHelpSelector'
- instanceVariableNames: 'list getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph hScrollRangeCache keystrokePreviewSelector priorSelection getIconSelector getHelpSelector'
classVariableNames: 'ClearFilterAutomatically FilterableLists HighlightHoveredRow MenuRequestUpdatesSelection'
poolDictionaries: ''
category: 'Morphic-Pluggable Widgets'!
!PluggableListMorph commentStamp: 'cmm 8/21/2011 23:37' prior: 0!
When a PluggableListMorph is in focus, type in a letter (or several letters quickly) to go to the next item that begins with that letter (if FilterableLists is false).
Special keys (up, down, home, etc.) are also supported.!
Item was changed:
----- Method: PluggableListMorph>>getFullList (in category 'model access') -----
getFullList
"The full, unfiltered list."
+ ^ fullList ifNil: [fullList := model perform: getListSelector]!
- ^ model perform: getListSelector!
Item was changed:
----- Method: PluggableListMorph>>updateList (in category 'updating') -----
updateList
+
| index |
+ fullList := nil.
- "the list has changed -- update from the model"
self listMorph listChanged.
- self setScrollDeltas.
index := self getCurrentSelectionIndex.
self resetPotentialDropRow.
self selectionIndex: (self uiIndexFor: index).
!
Marcel Taeumel uploaded a new version of SUnitGUI to project The Trunk:
http://source.squeak.org/trunk/SUnitGUI-mt.76.mcz
==================== Summary ====================
Name: SUnitGUI-mt.76
Author: mt
Time: 30 September 2019, 11:12:00.84171 am
UUID: e740e7cc-b7e0-374b-a7ad-1a06e32fa176
Ancestors: SUnitGUI-mt.75
Fix oversight from last commit. Sorry for the noise.
=============== Diff against SUnitGUI-mt.75 ===============
Item was changed:
----- Method: TestRunner>>categorySelected (in category 'accessing-categories') -----
categorySelected
+ ^ categoryIndex ifNil: [0]!
- ^ categoryIndex!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1548.mcz
==================== Summary ====================
Name: Morphic-mt.1548
Author: mt
Time: 30 September 2019, 10:29:19.20171 am
UUID: 0cf91407-3c2e-724d-b444-6986a9ca91a7
Ancestors: Morphic-mt.1547
Some improvements for multi-selection lists:
- hit [space] key to toggle selection
- draw the current "selection" as outline to recognize multi-selection state
- do not reset current "selection" to 0 when deselecting a row in the multi-selection state --- to better support keyboard navigation and [space]
=============== Diff against Morphic-mt.1547 ===============
Item was changed:
----- Method: LazyListMorph>>drawBackgroundForMulti:on: (in category 'drawing') -----
drawBackgroundForMulti: row on: aCanvas
"shade the background paler, if this row is selected, but not the current selected row"
| selectionDrawBounds |
- selectedRow = row ifTrue: [^ self].
selectionDrawBounds := self drawBoundsForRow: row.
selectionDrawBounds := selectionDrawBounds intersect: self bounds.
aCanvas
fillRectangle: selectionDrawBounds
color: self multiSelectionColor!
Item was changed:
----- Method: LazyListMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| topRow bottomRow |
listItems ifEmpty: [ ^self ].
self drawPreSelectionOn: aCanvas.
topRow := self topVisibleRowForCanvas: aCanvas.
bottomRow := self bottomVisibleRowForCanvas: aCanvas.
"Draw multi-selection."
+ listSource hasMultiSelection ifTrue: [
+ topRow to: bottomRow do: [ :row |
+ (listSource itemSelectedAmongMultiple: row) ifTrue: [
+ self drawBackgroundForMulti: row on: aCanvas ] ] ].
- topRow to: bottomRow do: [ :row |
- (listSource itemSelectedAmongMultiple: row) ifTrue: [
- self drawBackgroundForMulti: row on: aCanvas ] ].
self drawSelectionOn: aCanvas.
"Draw hovered row if preference enabled."
PluggableListMorph highlightHoveredRow ifTrue: [
listSource hoverRow > 0 ifTrue: [
self highlightHoverRow: listSource hoverRow on: aCanvas ] ].
"Draw all visible rows."
topRow to: bottomRow do: [ :row |
self display: (self item: row) atRow: row on: aCanvas ].
"Finally, highlight drop row for drag/drop operations.."
listSource potentialDropRow > 0 ifTrue: [
self highlightPotentialDropRow: listSource potentialDropRow on: aCanvas ].!
Item was changed:
----- Method: LazyListMorph>>drawSelectionFor:withColor:on: (in category 'drawing') -----
drawSelectionFor: index withColor: color on: aCanvas
| selectionDrawBounds fill |
index ifNil: [ ^self ].
index = 0 ifTrue: [ ^self ].
selectionDrawBounds := self drawBoundsForRow: index.
selectionDrawBounds := selectionDrawBounds intersect: self bounds.
fill := color isColor
ifTrue: [SolidFillStyle color: color]
ifFalse: [color].
fill isGradientFill ifTrue: [
fill origin: selectionDrawBounds topLeft.
fill direction: 0@ selectionDrawBounds height].
+ listSource hasMultiSelection
+ ifFalse: [aCanvas fillRectangle: selectionDrawBounds fillStyle: fill]
+ ifTrue: [aCanvas frameRectangle: selectionDrawBounds color: fill asColor] .!
- aCanvas fillRectangle: selectionDrawBounds fillStyle: fill.!
Item was added:
+ ----- Method: PluggableListMorph>>hasMultiSelection (in category 'testing') -----
+ hasMultiSelection
+
+ ^ false!
Item was added:
+ ----- Method: PluggableListMorphOfMany>>basicKeyPressed: (in category 'model access') -----
+ basicKeyPressed: aCharacter
+
+ aCharacter = Character space
+ ifTrue: [self specialKeyPressed: aCharacter asciiValue]
+ ifFalse: [super basicKeyPressed: aCharacter].!
Item was added:
+ ----- Method: PluggableListMorphOfMany>>hasMultiSelection (in category 'testing') -----
+ hasMultiSelection
+
+ ^ true!
Item was changed:
----- Method: PluggableListMorphOfMany>>mouseDown: (in category 'event handling') -----
mouseDown: event
+ | row index |
- | oldIndex oldVal row index |
event yellowButtonPressed ifTrue: [^ self yellowButtonActivity: event shiftPressed].
row := self rowAtLocation: event position.
row = 0 ifTrue: [^super mouseDown: event].
index := self modelIndexFor: row.
model okToChange ifFalse: [^ self]. "No change if model is locked"
+ self changeModelSelection: index.
- "Set meaning for subsequent dragging of selection"
- dragOnOrOff := (self listSelectionAt: index) not.
- oldIndex := self getCurrentSelectionIndex.
- oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
+ "Set meaning for subsequent dragging of selection"
+ self
+ listSelectionAt: index
+ put: (dragOnOrOff := (self listSelectionAt: index) not)
- "Set or clear new primary selection (listIndex)"
- dragOnOrOff
- ifTrue: [self changeModelSelection: index]
- ifFalse: [self changeModelSelection: 0].
-
- "Need to restore the old one, due to how model works, and set new one."
- oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
- self listSelectionAt: index put: dragOnOrOff.
- "event hand releaseMouseFocus: aMorph."
!
Item was changed:
----- Method: PluggableListMorphOfMany>>mouseMove: (in category 'event handling') -----
mouseMove: event
"The mouse has moved, as characterized by the event provided. Adjust the scrollbar, and alter the selection as appropriate"
+ | row index |
- | oldIndex oldVal row index |
event position y < self top
ifTrue:
[scrollBar scrollUp: 1.
row := self rowAtLocation: scroller topLeft + (1 @ 1)]
ifFalse:
[row := event position y > self bottom
ifTrue:
[scrollBar scrollDown: 1.
self rowAtLocation: scroller bottomLeft + (1 @ -1)]
ifFalse: [ self rowAtLocation: event position]].
row = 0 ifTrue: [^super mouseDown: event].
index := self modelIndexFor: row.
model okToChange ifFalse: [^self]. "No change if model is locked"
+ dragOnOrOff ifNil: [
+ "Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"
+ dragOnOrOff := (self listSelectionAt: index) not].
- dragOnOrOff ifNil:
- ["Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"
- dragOnOrOff := (self listSelectionAt: index) not].
+ self changeModelSelection: index.
+ self listSelectionAt: index put: dragOnOrOff.!
- "Set meaning for subsequent dragging of selection"
- oldIndex := self getCurrentSelectionIndex.
- oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
-
- "Set or clear new primary selection (listIndex)"
- dragOnOrOff
- ifTrue: [self changeModelSelection: index]
- ifFalse: [self changeModelSelection: 0].
-
- "Need to restore the old one, due to how model works, and set new one."
- oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
- self listSelectionAt: index put: dragOnOrOff.
- !
Item was added:
+ ----- Method: PluggableListMorphOfMany>>specialKeyPressed: (in category 'model access') -----
+ specialKeyPressed: asciiValue
+
+ asciiValue = Character space asciiValue
+ ifTrue: [ | index |
+ index := self getCurrentSelectionIndex.
+ self
+ listSelectionAt: index
+ put: ((self listSelectionAt: index) not).
+ ^ self].
+
+ super specialKeyPressed: asciiValue.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1533.mcz
==================== Summary ====================
Name: Morphic-ct.1533
Author: ct
Time: 20 September 2019, 8:54:34.318726 pm
UUID: 38b7bc64-e4de-cf41-b55c-f9dcb6a83340
Ancestors: Morphic-ct.1532
Fix a bug in MorphicProject initialization. If the fill style is a GradientFill and does not get copied, later changes will affect both worlds, wich does not seem desirable to me in any manner.
=============== Diff against Morphic-ct.1532 ===============
Item was changed:
----- Method: MorphicProject>>setWorldBackground: (in category 'initialize') -----
setWorldBackground: force
((world hasProperty: #hasCustomBackground) and: [force not])
ifTrue: [^ self].
"If the user has a custom background, propagate it into the new project."
((Project current ~~ self and: [Project current isMorphic]) and: [Project current world hasProperty: #hasCustomBackground])
ifTrue: [
+ world fillStyle: Project current world fillStyle veryDeepCopy.
- world fillStyle: Project current world fillStyle.
world setProperty: #hasCustomBackground toValue: true]
ifFalse: [
world removeProperty: #hasCustomBackground.
world fillStyle: (self userInterfaceTheme background ifNil: [self class defaultFill])].!