A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1690.mcz
==================== Summary ====================
Name: Morphic-ct.1690
Author: ct
Time: 1 October 2020, 2:42:17.443188 am
UUID: 58a1128e-5547-4236-bc03-0c1f1366bb7b
Ancestors: Morphic-eem.1686
Fixes display invalidation in PluggableListMorph when displayed during updating the list contents.
To avoid recursive #getList sends, since Morphic-mt.1576, the list variable has been cleaned up before sending #getFullList/#getFilteredList. However, in some cases the list morph is redrawn while the #getList operation is being performed, for example if the model code shows a system progress bar (e.g. when loading/refreshing code in Monticello). In the past, this led to drawing artifacts during the list update.
To avoid these artifacts, this version implements the list update as an atomic operation by storing the previous list contents in the variable previousStableList while recomputing the list. In addition, if #getList is curtailed, the previous list contents are restored (which is especially helpful during debugging).
=============== Diff against Morphic-eem.1686 ===============
Item was changed:
ScrollPane subclass: #PluggableListMorph
+ instanceVariableNames: 'list fullList modelToView viewToModel getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph keystrokePreviewSelector priorSelection getIconSelector getHelpSelector previousStableList'
- instanceVariableNames: 'list fullList modelToView viewToModel getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph keystrokePreviewSelector priorSelection getIconSelector getHelpSelector'
classVariableNames: 'ClearFilterAutomatically ClearFilterDelay FilterableLists FlashOnErrors HighlightHoveredRow HighlightPreSelection MenuRequestUpdatesSelection'
poolDictionaries: ''
category: 'Morphic-Pluggable Widgets'!
!PluggableListMorph commentStamp: 'mt 10/12/2019 11:04' prior: 0!
I am a list widget that uses the change/update mechanism to display model data as a vertical arrangement of (maybe formatted) strings and icons in a scroll pane.
When I am in keyboard focus, type in a letter (or several letters quickly) to go to the next item that begins with that letter. If you enabled the "filterable lists" preference, I will hide all items that do not match the filter.
Special keys (arrow up/down, page up/down, home, end) are also supported.!
Item was changed:
----- Method: PluggableListMorph>>getList (in category 'model access - cached') -----
getList
+ "Answer the (maybe filtered) list to be displayed. Cached result, see #updateList. If the list needs to be updated, do this atomically."
+
+ list = #locked ifTrue: [
+ "The list is already being updated at the moment but needs to be accessed again during the update. To avoid recursion, the update is implemented as an atomic operation. This can happen, for example, when the model fetches data that opens the system progress bar which then will redraw periodically."
+ ^ previousStableList ifNil: #()].
- "Answer the (maybe filtered) list to be displayed. Cached result, see #updateList."
-
^ list ifNil: [
+ list := #locked.
- list := #(). "To make this call safe when re-entering it while fetching the list. This can happen, for example, when the model fetches data that opens the system progress bar which then will redraw periodically."
list := self filterableList
ifTrue: [self getFilteredList]
ifFalse: [self getFullList].
self updateListMorph.
list]!
Item was changed:
----- Method: PluggableListMorph>>updateListFilter (in category 'updating') -----
updateListFilter
| selection |
selection := self selectionIndex = 0 "Avoid fetching #getList here."
ifTrue: [nil]
ifFalse: [self selection].
+ previousStableList := list.
+ [list := nil.
- list := nil.
modelToView := Dictionary new.
viewToModel := Dictionary new.
+ self getList] ensure: [
+ list ifNil: [list := previousStableList].
+ previousStableList := nil].
- self getList.
"Try to restore the last selection."
selection ifNotNil: [self selection: selection].!
Hi all,
SqueakMap does not work today:
[cid:b9abfb8b-0dc1-4fad-a145-74f3ad584c26]
<http://www.hpi.de/>
Is there anyone who could fix a server? :-)
Best,
Christoph
Hi all,
while loading a class (MyClass) with an attached pool dictionary (MyPool) today using Monticello, I encountered an error from MCPackageLoader which states:
Warning: This package depends on the following classes:
MyPool
This error message does not make sense to me since MyPool is not a class but a pool dictionary. But in MCClassDefinition >> #requirements, all #poolDictionaries are explicitly added to the list of required items. If I exclude them from this list, I get a warning "The pool dictionary MyPool does not exist. Do you want it automatically created?" later from Class >> #sharing:. Is this a bug?
I also tried to manually add the pool dictionary initialization (Smalltalk at: #MyPool put: Dictionary new) into the preamble of the package, but this preamble is also evaluated too late (i.e., not before the dependency warning is raised. Also, this feels a bit too redundant to me.
Do we need a new subclass of MCDefinition to create pool dictionaries automatically? Or could we just remove the confirmation dialog in Class >> #sharing: so that new pools will automatically be created, especially in non-interactive CI contexts?
Best,
Christoph
<http://www.hpi.de/>
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1774.mcz
==================== Summary ====================
Name: Morphic-ct.1774
Author: ct
Time: 15 June 2021, 6:50:38.559902 pm
UUID: f5614a67-386a-ee4c-9683-44b338df60dd
Ancestors: Morphic-mt.1773
Allows models to honor the currently hovered column position in a PluggableMultiColumnListMorph for mouse actions such as tool-tips or double-click events.
Usage examples:
multiColumnList getHelpSelector: #helpAtRow:atColumn:.
multiColumnList doubleClickSelector: #doubleClickColumn:.
=============== Diff against Morphic-mt.1773 ===============
Item was changed:
PluggableListMorph subclass: #PluggableMultiColumnListMorph
+ instanceVariableNames: 'listMorphs hoverColumn'
- instanceVariableNames: 'listMorphs'
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Pluggable Widgets'!
!PluggableMultiColumnListMorph commentStamp: '<historical>' prior: 0!
This morph can be used to show a list having multiple columns, The columns are self width sized to make the largest entry in each list fit. In some cases the pane may then be too narrow.
Use it like a regular PluggableListMorph except pass in an array of lists instead of a single list.
There are base assumptions made here that each list in the array of lists is the same size.
Also, the highlight color for the selection is easy to modify in the #highlightSelection method. I used blue
when testing just to see it work.!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>balloonText (in category 'accessing') -----
+ balloonText
+
+ | columnIndex modelIndex selector |
+ selector := self getHelpSelector ifNil: [^ super balloonText].
+ (self model respondsTo: selector) ifFalse: [^ nil].
+
+ modelIndex := self modelIndexFor: self hoverRow.
+ modelIndex > 0 ifFalse: [^ nil].
+ columnIndex := self hoverColumn.
+ columnIndex > 0 ifFalse: [^ nil].
+ ^ self model perform: selector withEnoughArguments: {modelIndex. columnIndex}!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>columnAtLocation: (in category 'accessing - items') -----
+ columnAtLocation: aPoint
+ "Return the index of the column at the given point or 0 if outside"
+
+ | pointInListMorphCoords |
+ pointInListMorphCoords := (self scroller transformFrom: self) transform: aPoint.
+
+ ^ listMorphs findFirst: [:listMorph |
+ pointInListMorphCoords x between: listMorph left and: listMorph right]!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>doubleClick: (in category 'event handling') -----
+ doubleClick: event
+
+ | rowIndex columnIndex |
+ doubleClickSelector ifNil: [^ super doubleClick: event].
+
+ rowIndex := self rowAtLocation: event position.
+ rowIndex = 0 ifTrue: [^ super doubleClick: event].
+ columnIndex := self columnAtLocation: event position.
+ "selectedMorph ifNil: [self setSelectedMorph: aMorph]."
+ ^ self model perform: doubleClickSelector withEnoughArguments: {columnIndex}!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>handleMouseMove: (in category 'events-processing') -----
+ handleMouseMove: anEvent
+
+ anEvent wasHandled ifTrue: [^ self].
+
+ super handleMouseMove: anEvent.
+
+ self hoverColumn: (self columnAtLocation: anEvent position).!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>hoverColumn (in category 'accessing') -----
+ hoverColumn
+
+ ^ hoverColumn ifNil: [0]!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph>>hoverColumn: (in category 'accessing') -----
+ hoverColumn: viewIndex
+
+ hoverColumn := viewIndex.
+
+ self wantsBalloon ifTrue: [
+ self activeHand
+ removePendingBalloonFor: self;
+ triggerBalloonFor: self after: self balloonHelpDelayTime].!
Item was changed:
----- Method: PluggableMultiColumnListMorph>>hoverRow: (in category 'accessing') -----
hoverRow: viewIndex
hoverRow = viewIndex ifTrue: [^ self].
+ hoverRow = 0 ifTrue: [self hoverColumn: 0].
listMorphs do: [:listMorph |
listMorph rowChanged: hoverRow with: viewIndex].
super hoverRow: viewIndex.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1773.mcz
==================== Summary ====================
Name: Morphic-mt.1773
Author: mt
Time: 14 June 2021, 8:31:51.352374 am
UUID: d4056dd6-8c5f-e045-9c9a-b6b4b34b42a3
Ancestors: Morphic-ct.1772
Adds explanation about why not sending super in the recent selectionIndex: fix.
=============== Diff against Morphic-ct.1772 ===============
Item was changed:
----- Method: PluggableMultiColumnListMorph>>selectionIndex: (in category 'selection') -----
selectionIndex: viewIndex
listMorphs do: [:listMorph | listMorph selectedRow: (viewIndex min: self listSize)].
+ "ct: As per the invariant defined in #setListParameters, listMorphs always includes listMorph. Subsequently, every super send in #selectionIndex: would be without effect because #selectionIndex already has been updated in the child class. Since selection highlighting is also not relevant for multi-column list morphs (this hook is only used by SimpleHierarchicalListMorph), we can refuse this bequest but send #scrollSelectionIntoView manually."
self scrollSelectionIntoView.!