BuildingUIWithSpec icon indicating copy to clipboard operation
BuildingUIWithSpec copied to clipboard

Add documentation about spacers

Open jecisc opened this issue 5 years ago • 0 comments

In the new version of Spec I did a PR to add spacers to layouts.

If it is integrated we should add documentation about it.

https://github.com/pharo-spec/Spec/pull/65/files

Example of demo:

'From Pharo7.0.0alpha of 15 October 2018 [Build information: Pharo-7.0.0+alpha.build.1338.sha.d25686ea1679b7fc16788a719eca1b2c03cc5c67 (64 Bit)] on 15 October 2018 at 6:05:47.831106 pm'!
ComposablePresenter subclass: #SpacerDemo
	instanceVariableNames: 'inputText input2 input3 input4 button1 button2 button3 button4'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Spec-SpacerDemo'!

!SpacerDemo methodsFor: 'initialization' stamp: 'CyrilFerlicot 10/15/2018 17:51'!
initializeWidgets
	
	inputText := self newTextInput.
	input2 := self newTextInput.
	input3 := self newTextInput.
	input4 := self newTextInput.
	
	button1 := button2 := button3 := button4 := self newButton label: 'button'; yourself! !


!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:50'!
input4
	^ input4! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:49'!
input3
	^ input3! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:39'!
inputText: anObject
	inputText := anObject! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:49'!
input2
	^ input2! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:52'!
button2
	^ button2! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:39'!
inputText
	^ inputText! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:52'!
button1
	^ button1! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:52'!
button3
	^ button3! !

!SpacerDemo methodsFor: 'accessing' stamp: 'CyrilFerlicot 10/15/2018 17:52'!
button4
	^ button4! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

SpacerDemo class
	slots: {  }!

!SpacerDemo class methodsFor: 'specs' stamp: 'CyrilFerlicot 10/15/2018 17:56'!
defaultSpec
	^ SpecLayout composed
		newColumn: [ :c | 
			c
				newRow: #inputText height: 30;
				addSpacer;
				newRow: #input2 height: 30;
				addSpacer;
				newRow: #input3 height: 30;
				addSpacer;
				newRow: #input4 height: 30;
				addSpacer;
				newRow: [ :r | 
					r
						add: #button1;
						addSpacer;
						add: #button2;
						addSpacer;
						add: #button3;
						addSpacer;
						add: #button4 ]
					height: 30 ];
		yourself! !

!SpacerDemo class methodsFor: 'specs' stamp: 'CyrilFerlicot 10/15/2018 17:55'!
title
	^ 'Spacer demo'! !

jecisc avatar Oct 15 '18 16:10 jecisc