[Pharo-dev] Card layout in Bloc?
alain.plantec at yahoo.com
Tue Jul 14 16:18:11 EDT 2015
> BlCardLayout>>layout: aMorph in: newBounds
> |offset maxHeight|
> offset := 0 at 0.
> maxHeight := 0.
> aMorph layoutComponentsDo: [ :component |
> offset x + component width > newBounds width ifTrue: [
> "start a new line"
> offset := 0@ (offset y + maxHeight).
> maxHeight := 0].
> component position: offset.
> maxHeight := maxHeight max: component height.
> offset := (offset x + component width) @ offset y].
> maxHeight + offset y > aMorph height ifTrue: [
> aMorph innerExtent: aMorph innerExtent x @ (maxHeight+ offset y)]
cool, can you commit your BlCardLayout into the bloc repo?
> For the card wall I'll need to add margin and inset.
A BlSolidRectangleBorder can have an inset and an outset (as a margin I guess).
More information about the Pharo-dev