Skip to content

Commit

Permalink
Merge pull request #6 from OpenSmock/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
labordep authored Jun 28, 2023
2 parents d32b326 + e0f146f commit 585ab1a
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/Pyramid-Bloc/PyramidSpacePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ PyramidSpacePresenter >> defaultLayout [
PyramidSpacePresenter >> initializePresenters [

overlaysManager := PyramidOverlaysManagerFactory editManager.
presenter := self makeSpacePresenter.
presenter inspect.
presenter := self makeSpacePresenter
]

{ #category : #initialization }
Expand Down
107 changes: 107 additions & 0 deletions src/Pyramid-IDE/PyramidWorld.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Class {
#name : #PyramidWorld,
#superclass : #Object,
#category : #'Pyramid-IDE-Menus'
}

{ #category : #menu }
PyramidWorld class >> menuBrowseSourcesOn: aBuilder [

<worldMenu>
(aBuilder item: #New)
parent: #PyramidDev;
order: 2.0;
action: [ self startBrowseSources ];
icon: (self iconNamed: #nautilus);
help: 'Open Pyramid sources packages in a browser';
label: 'Browse sources'
]

{ #category : #menu }
PyramidWorld class >> menuGithubOn: aBuilder [

<worldMenu>
(aBuilder item: #Github)
parent: #PyramidDev;
order: 3.0;
label: 'Github';
help: 'Open Pyramid Github page';
icon: (self iconNamed: #github);
action: [ WebBrowser openOn: 'https://github.com/OpenSmock/Pyramid' ]
]

{ #category : #menu }
PyramidWorld class >> menuNewOn: aBuilder [

<worldMenu>
(aBuilder item: #New)
parent: #PyramidUser;
order: 1.0;
action: [ self startNewDesign ];
icon: (self iconNamed: #page);
help: 'Create a new User-Interface';
label: 'New project'
]

{ #category : #'menu - root' }
PyramidWorld class >> menuPyramidOn: aBuilder [

<worldMenu>
(aBuilder item: #Pyramid)
parent: #Tools;
label: 'Pyramid';
help: 'A UI editor';
order: 777;

with:[
(aBuilder group: #PyramidUser)
order: 1;
withSeparatorAfter.
(aBuilder group: #PyramidDev)
order: 2.
]
]

{ #category : #menu }
PyramidWorld class >> menuRefreshPluginOn: aBuilder [

<worldMenu>
(aBuilder item: #New)
parent: #PyramidDev;
order: 1.0;
action: [ self startRefreshPlugins ];
icon: (self iconNamed: #refresh);
help: 'Reload all Pyramid plugins, use this to install a new plugin';
label: 'Refresh plugins'
]

{ #category : #menu }
PyramidWorld class >> menuReportABugOn: aBuilder [

<worldMenu>
(aBuilder item: #Github)
parent: #PyramidDev;
order: 4.0;
label: 'Report a Bug';
icon: (self iconNamed: #smallDebug);
help: 'Will open the github page to report an issue';
action: [ WebBrowser openOn: 'https://github.com/OpenSmock/Pyramid/issues/new' ]
]

{ #category : #actions }
PyramidWorld class >> startBrowseSources [

Smalltalk tools browser open packageView filterField setText: 'Pyramid'
]

{ #category : #actions }
PyramidWorld class >> startNewDesign [

PyramidPluginManager uniqueInstance makeEditor window open
]

{ #category : #actions }
PyramidWorld class >> startRefreshPlugins [

PyramidPluginManager reset
]
1 change: 1 addition & 0 deletions src/Pyramid-IDE/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Pyramid-IDE' }
17 changes: 17 additions & 0 deletions src/Pyramid-Tests/PyramidEditorTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Class {
#name : #PyramidEditorTest,
#superclass : #TestCase,
#category : #'Pyramid-Tests-Cases'
}

{ #category : #tests }
PyramidEditorTest >> testOpenNewEditor [

| editor |
editor := PyramidPluginManager uniqueInstance makeEditor.
editor window open.
self assert: editor window isOpen.

editor window close.
self assert: editor window isClosed.
]
8 changes: 1 addition & 7 deletions src/Pyramid/PyramidEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PyramidEditor >> commandPipeline [
^ commandPipeline
]

{ #category : #'as yet unclassified' }
{ #category : #initialization }
PyramidEditor >> initialize [

activeProject := PyramidProjectModel new.
Expand Down Expand Up @@ -53,12 +53,6 @@ PyramidEditor >> properties [
^ properties
]

{ #category : #'as yet unclassified' }
PyramidEditor >> test [

^ self iconNamed: #pharoBig
]

{ #category : #accessing }
PyramidEditor >> view [

Expand Down
48 changes: 40 additions & 8 deletions src/Pyramid/PyramidWindow.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ PyramidWindow >> at: aSymbol addItem: aBlock [
(self services at: aSymbol) addItem: aBlock
]

{ #category : #'api - showing' }
PyramidWindow >> close [

self isOpen ifFalse:[ ^ self ].
self presenter owner close
]

{ #category : #initialization }
PyramidWindow >> initialize [

Expand All @@ -22,24 +29,49 @@ PyramidWindow >> initialize [
PyramidPanelModel toolbarHorizontal installOn: self at: #topRight.

PyramidPanelModel presenter installOn: self at: #space.
PyramidPanelModel toolbarVertical
installOn: self
at: #spaceToolbarTop.
PyramidPanelModel toolbarVertical
installOn: self
at: #spaceToolbarBottom.

PyramidPanelModel toolbarVertical installOn: self at: #spaceToolbarTop.
PyramidPanelModel toolbarVertical installOn: self at: #spaceToolbarBottom.

PyramidPanelModel tab installOn: self at: #tabLeft.
PyramidPanelModel tab installOn: self at: #tabRight
]

{ #category : #initialization }
PyramidWindow >> initializePresenter [
"a Spec presenter using the services as an entry"

presenter := SpPresenter new layout: self layout; yourself.
^ presenter
]

{ #category : #'api - showing' }
PyramidWindow >> isClosed [

^ self presenter owner ifNotNil: [ :w | w isClosed ] ifNil: [ true ]
]

{ #category : #'api - showing' }
PyramidWindow >> isOpen [

^ self isClosed not
]

{ #category : #accessing }
PyramidWindow >> layout [

^ self shouldBeImplemented
]

{ #category : #'as yet unclassified' }
{ #category : #'api - showing' }
PyramidWindow >> open [

| spec |
spec := self presenter asWindow open.
spec maximize
]

{ #category : #private }
PyramidWindow >> panelUpdated [

self presenter layout: self layout
Expand All @@ -49,7 +81,7 @@ PyramidWindow >> panelUpdated [
PyramidWindow >> presenter [
"a Spec presenter using the services as an entry"

presenter ifNil: [ presenter := SpPresenter new layout: self layout; yourself ].
presenter ifNil: [ presenter := self initializePresenter ].
^ presenter
]

Expand Down

0 comments on commit 585ab1a

Please sign in to comment.