[Etoys] [ENH]BookMorph buttons more visible

karl karl.ramberg at chello.se
Sat Dec 2 14:22:46 EST 2006


A enhancement that make the BookMorph buttons stand out a little more.

Karl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: book.jpeg
Type: image/jpeg
Size: 3188 bytes
Desc: not available
Url : http://mailman.laptop.org/pipermail/etoys/attachments/20061202/f17d88d5/book.jpeg
-------------- next part --------------
'From OLPC2.0 of ''24 October 2006'' [latest update: #1134] on 2 December 2006 at 8:19:11 pm'!

!BooklikeMorph methodsFor: 'page controls' stamp: 'kfr 11/19/2006 19:11'!
makePageControlsFrom: controlSpecs
	"From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver."

	| c col row b lastGuy |
	c _ (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker].
	col _ AlignmentMorph newColumn.
	col color: c; borderWidth: 0; layoutInset: 0.
	col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5 at 5.

	row _ AlignmentMorph newRow.
	row color: c; borderWidth: 0; layoutInset: 0.
	row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5 at 5.
	row on: #mouseDown send: #moveViaTitle to: self.
	controlSpecs do: [:spec |
		spec == #spacer
			ifTrue:
				[row addTransparentSpacerOfSize: (10 @ 0)]
			ifFalse:
				[spec == #variableSpacer
					ifTrue:
						[row addMorphBack: AlignmentMorph newVariableTransparentSpacer]
					ifFalse:
						[b _ SimpleButtonMorph new target: self; borderWidth: 2; 
								borderColor: Color black; color: c darker.
						b label: spec first font: Preferences standardMenuFont;
						actionSelector: spec second;
						borderWidth: 0;
	 					setBalloonText: spec third.
						row addMorphBack: b.
						(((lastGuy _ spec last asLowercase) includesSubString: 'menu') or:
								[lastGuy includesSubString: 'designations'])
							ifTrue: [b actWhen: #buttonDown]]]].  "pop up menu on mouseDown"
		col addMorphBack: row.
	^ col! !



More information about the Etoys mailing list