Grafoscopio/src/Grafoscopio/SpSidebar.class.st

45 lines
907 B
Smalltalk

Class {
#name : #SpSidebar,
#superclass : #SpPresenter,
#instVars : [
'container'
],
#category : #'Grafoscopio-New-UI'
}
{ #category : #specs }
SpSidebar class >> defaultSpec [
^ SpBoxLayout newHorizontal
add: #container ;
yourself
]
{ #category : #initialization }
SpSidebar >> addAction: aBlock icon: anIcon [
container
addPresenter:
(self createDefaultPresenter
parent: self;
action: [ :state |
container unselectAll.
aBlock cull: state ];
icon: anIcon;
yourself)
]
{ #category : #'as yet unclassified' }
SpSidebar >> buttons [
^ container items
]
{ #category : #initialization }
SpSidebar >> createDefaultPresenter [
^ self instantiate: SpSquareButton.
]
{ #category : #initialization }
SpSidebar >> initializeWidgets [
super initializeWidgets.
container := self instantiate: SpComponentListPresenter.
]