[ENH]PaintBoxMorph shapes tab

Karl Ramberg karl.ramberg at chello.se
Sat Sep 30 20:31:30 UTC 2000


The tab of the shapes got missaligned when pressed.

Karl
-------------- next part --------------
'From Squeak2.9alpha of 13 June 2000 [latest update: #2748] on 30 September 2000 at 10:20:08 pm'!

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 9/30/2000 22:16'!
toggleShapes
	| tab sh stamps |
	"The sub panel that has the shape tools on it.  Rect, line..."
	stamps _ self submorphNamed: 'stamps'.
	tab _ self submorphNamed: 'shapeTab'.
	(sh _ self submorphNamed: 'shapes') visible
		ifTrue: [sh hide.  tab top: stamps bottom-1]
		ifFalse: [sh comeToFront.tab comeToFront.  sh top: stamps bottom-9.  
				sh show.  tab top: sh bottom - tab height + 22].
	self layoutChanged.
! !

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 9/30/2000 22:12'!
toggleStamps
	| tab otherTab st shapes |
	"The sub panel that has the stamps in it.  For saving and moving parts of an image."
	shapes _ self submorphNamed: 'shapes'.
	otherTab _ self submorphNamed: 'shapeTab'.
	tab _ self submorphNamed: 'stampTab'.
	(st _ self submorphNamed: 'stamps') visible
		ifTrue: [st hide.  st bottom: self bottom.  tab top: self bottom-1.
				shapes top: self bottom-9.
				otherTab top: (shapes visible ifTrue: [shapes bottom - otherTab height + 22] 
									ifFalse: [self bottom-1])]
		ifFalse: [st top: self bottom-10.  st show.  tab top: st bottom-0.
				shapes top: st bottom-9.
				otherTab top: (shapes visible ifTrue: [shapes bottom - otherTab height + 22] 
									ifFalse: [st bottom-0])].
	self layoutChanged.! !



More information about the Squeak-dev mailing list