115 lines
3.0 KiB
Smalltalk
115 lines
3.0 KiB
Smalltalk
"
|
|
I define the Grafoscopio main menu presented in the Pharo World.
|
|
"
|
|
Class {
|
|
#name : #GfWorldMenu,
|
|
#superclass : #Object,
|
|
#classInstVars : [
|
|
'recentNotebooks'
|
|
],
|
|
#category : 'Grafoscopio-UI'
|
|
}
|
|
|
|
{ #category : #'world menu' }
|
|
GfWorldMenu class >> helpMenuOn: aBuilder [
|
|
<worldMenu>
|
|
|
|
(aBuilder item: #GfManual)
|
|
label: 'Manual';
|
|
order: 1;
|
|
parent: #GfHelpAndDocs;
|
|
action: [ GrafoscopioNotebook open: GrafoscopioDocs manual ].
|
|
(aBuilder item: #GfManualPDF)
|
|
label: 'Manual (PDF)';
|
|
order: 2;
|
|
parent: #GfHelpAndDocs;
|
|
action: [ GrafoscopioDocs openPDFManual ].
|
|
(aBuilder item: #GfHelpDataviz)
|
|
label: 'Dataviz';
|
|
order: 3;
|
|
parent: #GfHelpAndDocs;
|
|
action: [ GrafoscopioNotebook open: DatavizDocs introNotebook ].
|
|
(aBuilder item: #GfHelpDevNotes)
|
|
label: 'Devs''s notes';
|
|
order: 4;
|
|
parent: #GfHelpAndDocs;
|
|
action: [ GrafoscopioNotebook open: GrafoscopioDocs devNotes ].
|
|
(aBuilder item: #GfHelpAbout)
|
|
label: 'About Grafoscopio';
|
|
order: 5;
|
|
parent: #GfHelpAndDocs;
|
|
action: [ GfUIHelpers messageAbout ].
|
|
]
|
|
|
|
{ #category : #'world menu' }
|
|
GfWorldMenu class >> launchMenuOn: aBuilder [
|
|
<worldMenu>
|
|
|
|
(aBuilder item: #'New notebook')
|
|
label: 'New notebook';
|
|
order: 1;
|
|
parent: #GfLaunch;
|
|
action: [ GrafoscopioNotebook new openDefault ].
|
|
(aBuilder item: #'Notebook from file...')
|
|
label: 'Notebook from file...';
|
|
order: 2;
|
|
parent: #GfLaunch;
|
|
action: [ GrafoscopioNotebook new openFromFileSelector ].
|
|
(aBuilder item: #'Notebook from the Internet...')
|
|
label: 'Notebook from the Internet...';
|
|
order: 3;
|
|
parent: #GfLaunch;
|
|
action: [ GrafoscopioNotebook new openFromUrlUI ].
|
|
(aBuilder item: #recentNotebooks)
|
|
label: 'Recent notebooks...';
|
|
order: 4;
|
|
parent: #GfLaunch;
|
|
action: [ GfUIHelpers openFromRecentlyUsed ].
|
|
]
|
|
|
|
{ #category : #'world menu' }
|
|
GfWorldMenu class >> mainMenuItemsOn: aBuilder [
|
|
"I add the main Grafoscopio menu to the Pharo World."
|
|
<worldMenu>
|
|
|
|
(aBuilder item: #Grafoscopio)
|
|
label: 'Grafoscopio';
|
|
order: 1;
|
|
with: [
|
|
(aBuilder item: #GfLaunch; label: 'Launch') target: self.
|
|
(aBuilder item: #GfUpdate; label: 'Update') target: self.
|
|
(aBuilder item: #GfHelpAndDocs; label: 'Help & Docs') target: self. ]
|
|
]
|
|
|
|
{ #category : #'world menu' }
|
|
GfWorldMenu class >> updateMenuOn: aBuilder [
|
|
<worldMenu>
|
|
|
|
(aBuilder item: #GfUpdateGrafoscopio)
|
|
label: 'Grafoscopio';
|
|
order: 1;
|
|
parent: #GfUpdate;
|
|
action: [ GfUIHelpers updateGrafoscopioUI ].
|
|
(aBuilder item: #GfUpdateDocs)
|
|
label: 'Documentation';
|
|
order: 2;
|
|
parent: #GfUpdate;
|
|
action: [ GrafoscopioDocumentation updateAllUI ].
|
|
(aBuilder item: #GfUpdateDataviz)
|
|
label: 'DataViz package';
|
|
order: 3;
|
|
parent: #GfUpdate;
|
|
action: [ GfUIHelpers updateDatavizUI ].
|
|
(aBuilder item: #GfUpdateAll)
|
|
label: 'All the system';
|
|
order: 4;
|
|
parent: #GfUpdate;
|
|
action: [ GfUIHelpers updateSystem ].
|
|
]
|
|
|
|
{ #category : #updating }
|
|
GfWorldMenu class >> updateRecentNotebooksWith: aFileReference [
|
|
(self recentNotebooks includes: aFileReference)
|
|
ifFalse: [self recentNotebooks add: aFileReference].
|
|
]
|