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

merge latest #1565

Merged
merged 61 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
9aad399
fix removed selector
estebanlm Apr 29, 2024
a3f0205
add tree family of components (treelist. treecolumn, easy*), still no…
estebanlm Jun 10, 2024
1cf9ea2
this should not be here
estebanlm Jun 10, 2024
fcadd6c
add application accessor to the builder (because it may be needed)
estebanlm Jun 10, 2024
804523c
add creator
estebanlm Jun 10, 2024
71a0db1
label is just visible if actually used (because many times we don't)
estebanlm Jun 11, 2024
57e16f8
implement alternateRowColor (in gtk4, it just activates the row separ…
estebanlm Jun 11, 2024
d2887b4
pushed up
estebanlm Jun 11, 2024
60c1951
implement easy tree
estebanlm Jun 11, 2024
1678e39
add transmissions for trees
estebanlm Jun 11, 2024
63b841e
make actionbar able to be fillWith: commands
estebanlm Jun 12, 2024
c265eb2
add centerPresenter to action bars (this needs to be added to the mor…
estebanlm Jun 12, 2024
5e88149
add flat style
estebanlm Jun 12, 2024
d50c5e2
traverse needs to be applied also to child presenters
estebanlm Jun 12, 2024
da5e410
cleanup
estebanlm Jun 12, 2024
5520296
recategorize
estebanlm Jun 13, 2024
83a4c55
add test for label
estebanlm Jun 13, 2024
2852a75
Merge 2d6d6d5fccf7b7163a29d1a0c8665d79c254ab71
estebanlm Jun 13, 2024
640e5e2
fixes https://github.com/pharo-spec/Spec/issues/1524
estebanlm Jun 20, 2024
125fece
taskbarIcon needs to take into account the windowIcon defined by the …
estebanlm Jun 20, 2024
b284504
invert send order
estebanlm Jun 20, 2024
4b0e843
Merge 9288ae4f9cd03d6bc5953cdf9e8d74225db3d496
estebanlm Jun 20, 2024
24f99f9
add button decoration api for dialogs (show, not show)
estebanlm Jun 20, 2024
397d9b7
apply deprecations
estebanlm Jun 20, 2024
7466db0
extracted
estebanlm Jun 20, 2024
228fd92
label could be nil, in that case I do not want to show it
estebanlm Jun 20, 2024
2e33ef6
add some ways to configure commands as different kind of buttons (bec…
estebanlm Jun 21, 2024
bffc1b1
in fact this is the same as `asButtonPresenter`
estebanlm Jun 21, 2024
86bc695
refactor to reuse
estebanlm Jun 21, 2024
5384aff
verify label is not nil (because it can)
estebanlm Jun 21, 2024
c6d5477
add a switch presenter (in morphic backend it fallbacks to checkbox f…
estebanlm Jun 21, 2024
b6891d4
ensure aText is a Text :)
estebanlm Jun 21, 2024
cf527d8
add switchClass for gtk4 backend
estebanlm Jun 21, 2024
1f7b619
add missing method (probably to be removed later)
estebanlm Jun 21, 2024
19ef655
add method stubs (not doing anything for the moment)
estebanlm Jun 21, 2024
d120146
added for polymorphism for toolbars
estebanlm Jun 21, 2024
4cd5ab0
missing methods on the easy lists
estebanlm Jun 21, 2024
a7e2a90
add SpFileDialog builder to be able to execute some dialogs without a…
estebanlm Jun 24, 2024
ca04ee1
restore category
estebanlm Jun 28, 2024
a26663c
do not use directly
estebanlm Jun 28, 2024
3759362
more categorization
estebanlm Jun 28, 2024
28b9d4d
recategorize
estebanlm Jun 28, 2024
715810b
in factm switch can have its own adapter and it works (but it stills …
estebanlm Jun 28, 2024
096ff67
fixed unclassified methods
estebanlm Jun 28, 2024
0b2cf27
restore lost classifications
estebanlm Jun 28, 2024
756d4ed
again
estebanlm Jun 28, 2024
80d63ce
moved here
estebanlm Jul 1, 2024
e8abba0
fix
estebanlm Jul 2, 2024
e4a677a
re-added
estebanlm Jul 2, 2024
66d27dc
fix newar window : it cannot be root, since windows can be nested.
estebanlm Jul 2, 2024
7e48e91
item can be nil, check for it
estebanlm Jul 2, 2024
baead10
Add Spec2-ListView package to Core group
demarey Jul 3, 2024
f1843e2
Merge baead10bc4c1d3f677049b89c86ad8531e92a048
estebanlm Jul 3, 2024
8d94b79
add super call
estebanlm Jul 3, 2024
57d65a7
add unselectAll method
estebanlm Jul 3, 2024
c7e86e4
categorize
estebanlm Jul 3, 2024
84321da
fix alexandrie presenter
estebanlm Jul 19, 2024
23b2487
easy column view now use a visitor to correctly draw columns (and spe…
estebanlm Jul 19, 2024
a3bd8a8
remove some duplicated methods and fix some bad usages
estebanlm Jul 20, 2024
b5c7ceb
add test method
estebanlm Jul 20, 2024
9aae500
add parentWindow accessor
estebanlm Jul 20, 2024
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
6 changes: 4 additions & 2 deletions src/BaselineOfSpecCore/BaselineOfSpecCore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ BaselineOfSpecCore >> baseline: spec [
'Spec2-Core'
'Spec2-Dialogs'
'Spec2-CommandLine'
'Spec2-Adapters-Stub'
'Spec2-Adapters-Stub'
'Spec2-Adapters-Morphic-ListView'
'Spec2-ListView'
'Spec2-Interactions'
'Spec2-Commander2' ).
spec group: 'Code' with: #('Core' 'Spec2-Code-Commands' 'Spec2-Code' 'Spec2-Code-Diff').
spec group: 'CodeTests' with: #('Spec2-Code-Tests' 'Spec2-Code-Diff-Tests').
spec group: 'Support' with: #('Core' 'Spec2-Examples').
spec group: 'Tests' with: #('Core' 'Spec2-Tests' 'Spec2-Commander2-Tests').
spec group: 'Tests' with: #('Core' 'Spec2-Tests' 'Spec2-Commander2-Tests' 'Spec2-ListView-Tests').
spec group: 'SupportTests' with: #('Support').
spec group: 'Pillar' with: #('Spec2-Pillar' ).
spec group: 'Base' with: #('Core' 'Support').
Expand Down
35 changes: 20 additions & 15 deletions src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
Class {
#name : #SpAlexandrieMorph,
#superclass : #Morph,
#name : 'SpAlexandrieMorph',
#superclass : 'Morph',
#instVars : [
'surface',
'drawBlock',
'lastExtent'
],
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
#category : 'Spec2-Adapters-Morphic-Alexandrie-Base',
#package : 'Spec2-Adapters-Morphic-Alexandrie',
#tag : 'Base'
}

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

drawBlock := aBlock
]

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

self redraw.
self surface
displayOnMorphicCanvas: aMorphicCanvas
at: bounds origin
aMorphicCanvas
image: self surface asForm
at: self position
sourceRect: (0@0 extent: self extent)
rule: 34
]

{ #category : #drawing }
{ #category : 'drawing' }
SpAlexandrieMorph >> redraw [
| context |

self surface drawDuring: [ :canvas |
drawBlock
cull: canvas
cull: (0@0 extent: self extent) ]
context := self surface newContext.
drawBlock
cull: context
cull: (0@0 extent: self extent)
]

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

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

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

| instance |
instance := SpAthensMorph new.

instance := SpAlexandrieMorph new.
self presenter whenDrawBlockChangedDo: [ :newBlock |
instance drawBlock: newBlock ].
self presenter whenExtentChangedDo: [ :newExtent |
Expand All @@ -21,13 +23,13 @@ SpMorphicAlexandrieAdapter >> buildWidget [
^ instance
]

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

widget redraw
]

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

^ widget surface
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic-Alexandrie/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Spec2-Adapters-Morphic-Alexandrie' }
Package { #name : 'Spec2-Adapters-Morphic-Alexandrie' }
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,3 @@ SpMorphicListViewDataSource >> cellColumn: column row: rowIndex [

^ cell addMorphBack: contentPresenter build
]

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

column id ifNil: [ ^ nil ].
^ FTCellMorph new
listCentering: #left;
addMorph: column id asMorph asReadOnlyMorph;
yourself
]
31 changes: 23 additions & 8 deletions src/Spec2-Adapters-Morphic/SpDialogWindowMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Class {
#name : 'SpDialogWindowMorph',
#superclass : 'DialogWindowMorph',
#instVars : [
'toolbar'
'toolbar',
'toolbarMorph'
],
#category : 'Spec2-Adapters-Morphic-Support',
#package : 'Spec2-Adapters-Morphic',
Expand Down Expand Up @@ -75,6 +76,13 @@ SpDialogWindowMorph >> okAction: aBlock [
self toolbar okAction: aBlock
]

{ #category : 'accessing' }
SpDialogWindowMorph >> removeToolbar [

toolbarMorph ifNil: [ ^ self ].
self submorphs last removeMorph: toolbarMorph
]

{ #category : 'protocol' }
SpDialogWindowMorph >> setToolbarFrom: aBlock [
| newToolbar |
Expand All @@ -95,11 +103,18 @@ SpDialogWindowMorph >> toolbar: anObject [
| content |

toolbar := anObject.
self removeMorph: (content := self submorphs last).
self
addMorph: (self newDialogPanel
addMorphBack: content;
addMorphBack: self newButtonRow;
yourself)
frame: (0 @ 0 corner: 1 @ 1)
toolbarMorph
ifNotNil: [
self removeToolbar.
toolbarMorph := self newButtonRow.
self submorphs last addMorphBack: toolbarMorph ]
ifNil: [
toolbarMorph := self newButtonRow.
self removeMorph: (content := self submorphs last).
self
addMorph: (self newDialogPanel
addMorphBack: content;
addMorphBack: toolbarMorph;
yourself)
frame: (0 @ 0 corner: 1 @ 1) ]
]
92 changes: 81 additions & 11 deletions src/Spec2-Adapters-Morphic/SpMorphicBackend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,41 @@ SpMorphicBackend >> defer: aBlock [
UIManager default defer: aBlock
]

{ #category : 'accessing' }
SpMorphicBackend >> dropListClass [

^ SpDropListPresenter
]

{ #category : 'private - dialogs' }
SpMorphicBackend >> executeOpenDirectoryDialog: aFileDialog [

^ StOpenDirectoryPresenter new
defaultFolder: (aFileDialog path ifNil: [ StFileSystemModel defaultDirectory ]);
title: (aFileDialog title ifNil: [ 'Choose Directory' translated ]);
openModal;
selectedEntry
]

{ #category : 'private - dialogs' }
SpMorphicBackend >> executeOpenFileDialog: aFileDialog [
| dialog |

dialog := self newFileDialogFor: aFileDialog.
^ dialog openModal answer
ifNotNil: [ :aString | aString asFileReference ]
]

{ #category : 'private - dialogs' }
SpMorphicBackend >> executeSaveFileDialog: aFileDialog [
| dialog |

dialog := self newFileDialogFor: aFileDialog.
dialog answerSaveFile.
^ dialog openModal answer
ifNotNil: [ :aString | aString asFileReference ]
]

{ #category : 'deferred message' }
SpMorphicBackend >> forceDefer: aBlock [

Expand All @@ -48,6 +83,29 @@ SpMorphicBackend >> inform: aString [
contents: aString
]

{ #category : 'accessing' }
SpMorphicBackend >> listClass [

^ SpListPresenter
]

{ #category : 'private - dialogs' }
SpMorphicBackend >> newFileDialogFor: aFileDialog [
| dialog dialogClass |

dialogClass := aFileDialog isOpenFile
ifTrue: [ StOpenFilePresenter ]
ifFalse: [ StOpenDirectoryPresenter ].
dialog := dialogClass for: aFileDialog.

aFileDialog path ifNotNil: [ :folder | dialog openFolder: folder ].
aFileDialog filters ifNotEmpty: [ :filters |
dialog fileNavigationSystem
filter: (StCustomExtensionsFilter extensions: { filters }) ].

^ dialog
]

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

Expand All @@ -67,22 +125,34 @@ SpMorphicBackend >> notifyInfo: aSpecNotification [
]

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

^ UIManager default chooseDirectory: aString path: ''
]

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

^ UIManager default
chooseExistingFileReference: aString
extensions: nil
path: ''
aFileDialog isOpenFile ifTrue: [ ^ self executeOpenFileDialog: aFileDialog ].
aFileDialog isOpenDirectory ifTrue: [ ^ self executeOpenDirectoryDialog: aFileDialog ].

^ self executeSaveFileDialog: aFileDialog
]

{ #category : 'display' }
SpMorphicBackend >> showWaitCursorWhile: aBlock inApplication: anApplication [

Cursor wait showWhile: aBlock
]

{ #category : 'accessing' }
SpMorphicBackend >> tableClass [

^ SpTablePresenter
]

{ #category : 'accessing' }
SpMorphicBackend >> treeClass [

^ SpTreePresenter
]

{ #category : 'accessing' }
SpMorphicBackend >> treeTableClass [

^ SpTreeTablePresenter
]
6 changes: 5 additions & 1 deletion src/Spec2-Adapters-Morphic/SpMorphicButtonAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ SpMorphicButtonAdapter >> keyStroke: anEvent fromMorph: aMorph [

{ #category : 'widget API' }
SpMorphicButtonAdapter >> label [
| labelString |

labelString := self presenter label
ifNotNil: [ :aString | aString withAccentuatedCharacter: self presenter shortcutCharacter ].

^ self
buildLabel: (self presenter label withAccentuatedCharacter: self presenter shortcutCharacter)
buildLabel: labelString
withIcon: self presenter icon
]

Expand Down
19 changes: 15 additions & 4 deletions src/Spec2-Adapters-Morphic/SpMorphicDialogWindowAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,27 @@ Class {
#tag : 'Base'
}

{ #category : 'private' }
SpMorphicDialogWindowAdapter >> addButtonsDecorationTo: widgetToBuild [

widgetToBuild setToolbarFrom: [ self buildButtonBar ].
self model buttons ifNotEmpty: [
self presenter defaultButton
ifNotNil: [ :aButton | aButton adapter setAsDefault ] ]
]

{ #category : 'private' }
SpMorphicDialogWindowAdapter >> addPresenterIn: widgetToBuild withSpecLayout: aSpec [
"I replace the mainPanel (which contains contents and button bar) because like that I get the
status bar at the end (where it belongs)"

super addPresenterIn: widgetToBuild withSpecLayout: aSpec.
self model buttons ifNotEmpty: [
widgetToBuild setToolbarFrom: [ self buildButtonBar ].
self presenter defaultButton
ifNotNil: [ :aButton | aButton adapter setAsDefault ] ]
self presenter hasButtonDecorations
ifTrue: [ self addButtonsDecorationTo: widgetToBuild ].
self presenter whenButtonDecorationsChangedDo: [ :aBoolean |
aBoolean
ifTrue: [ self addButtonsDecorationTo: widgetToBuild ]
ifFalse: [ widgetToBuild removeToolbar ] ]
]

{ #category : 'factory' }
Expand Down
10 changes: 6 additions & 4 deletions src/Spec2-Adapters-Morphic/SpMorphicDiffUnifiedAdapter.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #SpMorphicDiffUnifiedAdapter,
#superclass : #SpMorphicDiffAdapter,
#category : #'Spec2-Adapters-Morphic-Base'
#name : 'SpMorphicDiffUnifiedAdapter',
#superclass : 'SpMorphicDiffAdapter',
#category : 'Spec2-Adapters-Morphic-Base',
#package : 'Spec2-Adapters-Morphic',
#tag : 'Base'
}

{ #category : #factory }
{ #category : 'factory' }
SpMorphicDiffUnifiedAdapter >> buildWidget [

^ StUnifiedDiffChangesMorph new
Expand Down
6 changes: 6 additions & 0 deletions src/Spec2-Adapters-Morphic/SpMorphicDropListAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ SpMorphicDropListAdapter >> setIndex: anIndex [
self presenter selectIndex: anIndex
]

{ #category : 'accessing' }
SpMorphicDropListAdapter >> styleName: aString [

"for compatibility with tool buttons, but not used at the moment"
]

{ #category : 'factory' }
SpMorphicDropListAdapter >> verifyInitialStatus [

Expand Down
Loading
Loading