-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
124 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Class { | ||
#name : #SBCustomView, | ||
#superclass : #SBExploriantsView, | ||
#instVars : [ | ||
'viewOptions' | ||
], | ||
#category : #'Sandblocks-Babylonian' | ||
} | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> activeIndex [ | ||
|
||
^ self viewClasses indexOf: self selectedView class | ||
] | ||
|
||
{ #category : #building } | ||
SBCustomView >> buildViewOptions [ | ||
|
||
| options | | ||
options := self viewClasses collect: [:aClass | aClass new hasBeenRenamed: true]. | ||
|
||
^ SBComboBox new | ||
prefix: 'Current View: '; | ||
labels: (options collect: #name); | ||
values: options ; | ||
object: options first; | ||
when: #selectionChanged send: #switchView to: self | ||
] | ||
|
||
{ #category : #initialization } | ||
SBCustomView >> initialize [ | ||
|
||
super initialize. | ||
|
||
viewOptions := self buildViewOptions. | ||
self name: 'Results'. | ||
|
||
self block addMorphFront: viewOptions. | ||
self block addMorphBack: self selectedView | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> isOverview [ | ||
|
||
^ true | ||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> multiverse: aSBMultiverse [ | ||
|
||
super multiverse: aSBMultiverse. | ||
viewOptions values do: [:aSBNamedBlock | aSBNamedBlock multiverse: aSBMultiverse] | ||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> selectedView [ | ||
|
||
^ viewOptions object | ||
] | ||
|
||
{ #category : #updating } | ||
SBCustomView >> switchView [ | ||
|
||
self selectedView block = self block lastSubmorph ifTrue: [^ self]. | ||
|
||
self block lastSubmorph delete. | ||
self block addMorphBack: self selectedView block. | ||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> viewClasses [ | ||
|
||
^ {SBPermutationGridsView. | ||
SBExampleGridsView. | ||
SBLiveView.} | ||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> views [ | ||
|
||
^ viewOptions values | ||
] | ||
|
||
{ #category : #updating } | ||
SBCustomView >> visualize [ | ||
|
||
self block addMorphBack: self selectedView block. | ||
] | ||
|
||
{ #category : #accessing } | ||
SBCustomView >> wantsReloadOnSaveWhenOpen [ | ||
|
||
^ self selectedView wantsReloadOnSaveWhenOpen | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters