Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #1486

Merged
merged 93 commits into from
Dec 20, 2023
Merged

sync #1486

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
2b4e99e
labels can have menus (not working yet)
estebanlm May 11, 2023
ae2a881
working on list view
estebanlm May 17, 2023
d4ad43c
clean up
estebanlm Jun 26, 2023
4d93d44
cleanup
estebanlm Jun 26, 2023
476b8ff
let <meta+t> be defined in the presenter and not in the adapter
estebanlm Jun 26, 2023
e67e575
cleanups
estebanlm Jun 26, 2023
662601c
working with actions and with easy list view
estebanlm Jun 27, 2023
3b8d7d2
add a test to check the selection is updated even after open.
estebanlm Jul 3, 2023
62454ad
this should not be needed
estebanlm Jul 3, 2023
c35acb3
add multiselection api
estebanlm Jul 3, 2023
c2bacdc
add an example
estebanlm Jul 3, 2023
bc50940
added a morphic adapter for SpListViewPresenter
estebanlm Jul 4, 2023
0e1ea48
add a `selectItem:scrollToSelection:` API
estebanlm Jul 4, 2023
08e5136
add ports to easy list
estebanlm Jul 4, 2023
f378ea9
add a flag to rememeber to change list with easyList
estebanlm Jul 4, 2023
6eb4a22
fix and error while hiding component (the place in layout should not …
estebanlm Jul 8, 2023
7c7f0c4
fix call to event
estebanlm Jul 8, 2023
b73fead
add action to compatibility with adapter
estebanlm Jul 8, 2023
9b6efc6
use scroll to selection and play with search place
estebanlm Jul 8, 2023
503e34f
prevent divide by zero in some cases (like invisible calculations)
estebanlm Jul 8, 2023
7965527
no predefined search on listview (or default action)
estebanlm Jul 8, 2023
9169e1d
no search on list view
estebanlm Jul 8, 2023
8eaaa70
add some #doNotUse flags
estebanlm Jul 8, 2023
4184efe
oops
estebanlm Jul 8, 2023
1fce8f9
fix shortcuts when they have no name
estebanlm Jul 13, 2023
31b963c
moved to gtk package
estebanlm Jul 13, 2023
06573de
enhanced a bit
estebanlm Jul 13, 2023
456ff6d
adding a lot of warining comments to make people understand just the …
estebanlm Jul 13, 2023
0fd5a43
lot of work on SpDropListPresenter and SpDropDownPresenter
estebanlm Aug 1, 2023
fda23dd
add alexandrie presenter
estebanlm Aug 1, 2023
324c701
add an example
estebanlm Aug 1, 2023
262a329
remove gtk call
estebanlm Aug 1, 2023
5721842
moved
estebanlm Aug 18, 2023
348c2f3
windows can be "activated" (moved to the front and getting the focus)
estebanlm Sep 11, 2023
31ebec9
add a way to choose a different styleScheme (like background color, e…
estebanlm Sep 12, 2023
1f71b01
add some missing api methods
estebanlm Sep 28, 2023
d1cc66b
modes can answer if they have an icon and/or a label
estebanlm Sep 28, 2023
ded7c3c
fix box layout hide/show of presenters, it was not working correctly
estebanlm Sep 29, 2023
580f23a
add an example
estebanlm Sep 29, 2023
7485787
do not adjust size all the time because it causes a problem with over…
estebanlm Sep 30, 2023
c73c316
run tests
estebanlm Sep 30, 2023
074b71c
remove debug code
estebanlm Sep 30, 2023
9d2ea02
add actionMofifier idiom
estebanlm Sep 30, 2023
e688caa
fix
estebanlm Sep 30, 2023
ab3ed64
ensure exists
estebanlm Sep 30, 2023
e54b738
oops
estebanlm Sep 30, 2023
4069289
oops (2)
estebanlm Sep 30, 2023
c24af61
Merge branch 'dev-3.0' into merge-dev-3.0-p12-3
estebanlm Oct 19, 2023
c5e7fc9
fix package
estebanlm Oct 19, 2023
3e6fffd
fix missing trait
estebanlm Oct 19, 2023
924925e
fix missing trait
estebanlm Oct 19, 2023
a7a31b6
add missing method
estebanlm Oct 19, 2023
532be80
add missing methods
estebanlm Oct 19, 2023
65e5846
not used
estebanlm Oct 19, 2023
a7a7238
oops... typo
estebanlm Oct 19, 2023
7cbadf4
delegate basic inform to backend (since we can use different notific…
estebanlm Oct 19, 2023
929d04f
applying deprecations
estebanlm Oct 19, 2023
7856343
delegating to backend
estebanlm Oct 19, 2023
ab1861d
format
estebanlm Oct 19, 2023
b7b7495
moved to commander2 package to avoid a cyclic dependence
estebanlm Oct 20, 2023
828da25
format
estebanlm Oct 20, 2023
f4536e4
format
estebanlm Oct 20, 2023
1c49e5e
adda generic property changed output port (and use it for sliders)
estebanlm Oct 20, 2023
026ec5d
move SpTActionContainer to fix a cyclic dependency
estebanlm Oct 22, 2023
5710d7a
use default button
estebanlm Nov 7, 2023
1e0e4c1
format
estebanlm Nov 7, 2023
16c9f1d
add transmissions to new dropdown presenter
estebanlm Nov 7, 2023
0d57689
add new dropdown accessor
estebanlm Nov 7, 2023
8a5f891
add missing performAction
estebanlm Nov 7, 2023
30737a0
Merge a3c8db3d29cf1ec9fd8b12bca9022e1a26fd1b76
estebanlm Nov 14, 2023
86c54c1
format
estebanlm Nov 14, 2023
27b4453
apply deprecations
estebanlm Nov 24, 2023
0cdfa74
Merge 42f0c0aa6ea2fd13999f96328451a12f3802d82b
estebanlm Nov 24, 2023
d02005c
fix colimn alignment
estebanlm Nov 25, 2023
e2bd97c
format
estebanlm Nov 25, 2023
4a05478
add select index/item to select dialog
estebanlm Nov 28, 2023
2604fe2
listview work moved to separated package (so I can merge without incl…
estebanlm Nov 29, 2023
8584683
moved tests too
estebanlm Nov 29, 2023
1efd124
update baseline
estebanlm Nov 29, 2023
0c6f175
commenting the set of bounds to zero since it does not seems to be ne…
estebanlm Dec 7, 2023
2c6a345
Merge fdeba463e6a7383b1109a8dae424669441540379
estebanlm Dec 7, 2023
461d37e
Merge e17c2aa1ea55e558f6c1d1e1fc348806b6419246
estebanlm Dec 15, 2023
a8e44cb
remove (it was removed before)
estebanlm Dec 15, 2023
01ff23e
add mock
estebanlm Dec 15, 2023
da2d111
fix some tests
estebanlm Dec 18, 2023
af3cb10
fix pharo version
estebanlm Dec 18, 2023
8442560
remove test (it was testing a removed functionality)
estebanlm Dec 18, 2023
1eff529
move the factory method
estebanlm Dec 18, 2023
6cbe943
move examples to listview presenter package to fix dependency
estebanlm Dec 18, 2023
774b6e6
moving also the test
estebanlm Dec 18, 2023
11db99f
remove itemFilter
estebanlm Dec 18, 2023
4a41031
move to local package to avoid dependency complains
estebanlm Dec 19, 2023
7e61476
fix bad message sends
estebanlm Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:

on:
push:
branches: [ Pharo12, dev-1.0 ]
branches: [ Pharo12, dev-3.0 ]
pull_request:
branches: [ Pharo12, dev-1.0 ]
branches: [ Pharo12, dev-3.0 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -23,11 +23,11 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
smalltalk-version: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }}
timeout-minutes: 15
4 changes: 4 additions & 0 deletions src/BaselineOfSpecCore/BaselineOfSpecCore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ BaselineOfSpecCore >> baseline: spec [
package: 'Spec2-Transmission' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Interactions' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2' with: [ spec requires: #('Spec2-Core' 'Spec2-Interactions') ];
"ListView"
package: 'Spec2-ListView' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Adapters-Morphic-ListView' with: [ spec requires: #('Spec2-ListView') ];
package: 'Spec2-ListView-Tests' with: [ spec requires: #('Spec2-ListView') ];
"Code"
package: 'Spec2-Code' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
package: 'Spec2-Code-Commands' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
Expand Down
43 changes: 43 additions & 0 deletions src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Class {
#name : #SpAlexandrieMorph,
#superclass : #Morph,
#instVars : [
'surface',
'drawBlock',
'lastExtent'
],
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
}

{ #category : #accessing }
SpAlexandrieMorph >> drawBlock: aBlock [

drawBlock := aBlock
]

{ #category : #drawing }
SpAlexandrieMorph >> drawOn: aMorphicCanvas [

self redraw.
self surface
displayOnMorphicCanvas: aMorphicCanvas
at: bounds origin
]

{ #category : #drawing }
SpAlexandrieMorph >> redraw [

self surface drawDuring: [ :canvas |
drawBlock
cull: canvas
cull: (0@0 extent: self extent) ]
]

{ #category : #accessing }
SpAlexandrieMorph >> surface [

lastExtent = self extent ifFalse: [ surface := nil ].
^ surface ifNil: [
lastExtent := self extent.
surface := AthensCairoSurface extent: self extent ]
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Class {
#name : #SpMorphicAlexandrieAdapter,
#superclass : #SpAbstractMorphicAdapter,
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
}

{ #category : #factory }
SpMorphicAlexandrieAdapter >> buildWidget [

| instance |
instance := SpAthensMorph new.
self presenter whenDrawBlockChangedDo: [ :newBlock |
instance drawBlock: newBlock ].
self presenter whenExtentChangedDo: [ :newExtent |
instance extent: newExtent ].
instance extent: self presenter surfaceExtent.
instance drawBlock: self presenter drawBlock.
instance setBalloonText: self model help.
self presenter whenHelpChangedDo: [
instance setBalloonText: self model help ].
^ instance
]

{ #category : #drawing }
SpMorphicAlexandrieAdapter >> redraw [

widget redraw
]

{ #category : #accessing }
SpMorphicAlexandrieAdapter >> surface [

^ widget surface
]
1 change: 1 addition & 0 deletions src/Spec2-Adapters-Morphic-Alexandrie/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Spec2-Adapters-Morphic-Alexandrie' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"
A morphic adapter for `SpListViewPresenter`
"
Class {
#name : 'SpMorphicListViewAdapter',
#superclass : 'SpMorphicListAdapter',
#category : 'Spec2-Adapters-Morphic-ListView',
#package : 'Spec2-Adapters-Morphic-ListView'
}

{ #category : 'factory' }
SpMorphicListViewAdapter >> buildWidget [
| datasource |

datasource := self newDataSource.
datasource model: self model.
widget := self newTableWith: datasource.

self presenter whenModelChangedDo: [ widget refresh ].
self presenter whenSelectionChangedDo: [ self refreshWidgetSelection ].
self presenter selection whenChangedDo: [ self refreshWidgetSelection ].

self refreshWidgetSelection.
self configureScrolling.

^ widget
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newDataSource [

^ SpMorphicListViewDataSource new
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newTableWith: datasource [

^ SpFTTableMorph new
disableFunction;
dataSource: datasource;
hideColumnHeaders;
beResizable;
setMultipleSelection: self model isMultipleSelection;
dragEnabled: self dragEnabled;
dropEnabled: self dropEnabled;
setBalloonText: self help;
hResizing: #spaceFill;
vResizing: #spaceFill;
onAnnouncement: FTSelectionChanged send: #selectionChanged: to: self;
onAnnouncement: FTStrongSelectionChanged send: #strongSelectionChanged: to: self;
yourself
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"
A morphic datasource for `SpListViewPresenter`, to be used on the `SpMorphicListViewAdapter`.
"
Class {
#name : 'SpMorphicListViewDataSource',
#superclass : 'SpMorphicListDataSource',
#category : 'Spec2-Adapters-Morphic-ListView',
#package : 'Spec2-Adapters-Morphic-ListView'
}

{ #category : 'accessing' }
SpMorphicListViewDataSource >> cellColumn: column row: rowIndex [
| cell contentPresenter |

cell := FTCellMorph new.

contentPresenter := self model setupAction value: self model.
self model bindAction
value: contentPresenter
value: (self elementAt: rowIndex).

^ cell addMorphBack: contentPresenter build
]

{ #category : 'accessing' }
SpMorphicListViewDataSource >> headerColumn: column [

column id ifNil: [ ^ nil ].
^ FTCellMorph new
listCentering: #left;
addMorph: column id asMorph asReadOnlyMorph;
yourself
]
1 change: 1 addition & 0 deletions src/Spec2-Adapters-Morphic-ListView/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'Spec2-Adapters-Morphic-ListView' }
12 changes: 7 additions & 5 deletions src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ SpAbstractMorphicAdapter >> applyStyle: morph [
{ #category : 'initialization' }
SpAbstractMorphicAdapter >> applyVisibility [

"It may happen that some presenters use generic adapters and they do not have an associated presenter.
In that case, do not manage visibility..."
"It may happen that some presenters use generic adapters and they do not have an
associated presenter. In that case, do not manage visibility..."
self presenter ifNil: [ ^ self ].

self widget visible: self presenter isVisible.
Expand Down Expand Up @@ -335,7 +335,7 @@ SpAbstractMorphicAdapter >> installFocusReceivedEvent: anEvent to: aWidget [

aWidget announcer
when: MorphGotFocus
do: [ anEvent action value ]
do: [ anEvent action cull: anEvent ]
for: self
]

Expand Down Expand Up @@ -695,8 +695,10 @@ SpAbstractMorphicAdapter >> vSpaceFill [
{ #category : 'protocol' }
SpAbstractMorphicAdapter >> when: anAnnouncement do: aBlock [

self widgetDo: [ :w | w announcer
when: anAnnouncement do: aBlock ]
self widgetDo: [ :w |
w announcer
when: anAnnouncement
do: aBlock ]
]

{ #category : 'emulating' }
Expand Down
18 changes: 9 additions & 9 deletions src/Spec2-Adapters-Morphic/SpAbstractMorphicListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ SpAbstractMorphicListAdapter >> addKeyBindingsTo: aWidget [

{ #category : 'scrolling' }
SpAbstractMorphicListAdapter >> configureScrolling [
self presenter verticalAlignment
whenChangedDo: [ widget
scrollToIndex: self presenter verticalAlignment desiredVisibleRow ].
self presenter
whenDisplayDo: [ widget
scrollToIndex: self presenter verticalAlignment desiredVisibleRow.
self scrollingChanged ].
| vAlignment |

vAlignment := self presenter verticalAlignment.
vAlignment whenChangedDo: [
widget scrollToIndex: vAlignment desiredVisibleRow ].
self presenter whenDisplayDo: [
widget scrollToIndex: vAlignment desiredVisibleRow.
self scrollingChanged ].

widget
onAnnouncement: FTScrollingChanged
send: #scrollingChanged
to: self.
to: self
]

{ #category : 'widget API' }
Expand Down
13 changes: 11 additions & 2 deletions src/Spec2-Adapters-Morphic/SpMorphicBackend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ SpMorphicBackend >> forceDefer: aBlock [
UIManager default defer: aBlock
]

{ #category : 'ui - dialogs' }
SpMorphicBackend >> inform: aString [

(ProvideAnswerNotification signal: aString) ifNotNil: [ :answer | ^ true ].
GrowlMorph
openWithLabel: 'Information' translated
contents: aString
]

{ #category : 'private - notifying' }
SpMorphicBackend >> notifyError: aSpecNotification [

Expand All @@ -57,13 +66,13 @@ SpMorphicBackend >> notifyInfo: aSpecNotification [
contents: aSpecNotification message
]

{ #category : 'ui dialogs' }
{ #category : 'ui - dialogs' }
SpMorphicBackend >> selectDirectoryTitle: aString [

^ UIManager default chooseDirectory: aString path: ''
]

{ #category : 'ui dialogs' }
{ #category : 'ui - dialogs' }
SpMorphicBackend >> selectFileTitle: aString [

^ UIManager default
Expand Down
4 changes: 3 additions & 1 deletion src/Spec2-Adapters-Morphic/SpMorphicBaseBoxLayout.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ SpMorphicBaseBoxLayout >> applyVerticalHomogeneousLayout: aMorph in: aRect [
self error: 'It does not looks like a spec box panel' ].

allMorphs := aMorph submorphs flatCollect: [ :each | each submorphs ].
elementHeight := (aRect height - (self borderWidth * 2) - (self spacing * (allMorphs size - 1)) / (allMorphs size max: 1)) floor.
elementHeight := (aRect height
- (self borderWidth * 2)
- (self spacing * (allMorphs size - 1)) / (allMorphs size max: 1)) floor.

allMorphs do: [ :each |
each minHeight: elementHeight ]
Expand Down
Loading
Loading