PaneResizerMorph

Release name: PaneResizerMorph
Release summary: a widget to resize adjacent submorphs
Automatic version: 1
Manual version: 1
Published by: Jens Moenig (jens)
Created: 5 April 2007 9:45:32 am
Last updated: 5 April 2007 9:52:05 am
Categories:
Release note:

PaneResizerMorph lets you resize two adjacent submorphs within any owner morph by dragging their common border with the mouse. By default, a PaneResizer is invisible ('transparent') and makes itself be noticed by changing the mouse cursor on 'fly over' indicating either horizontal or vertical 'draggability'.

Public protocol for this class is kept simple and straightforward. you must call either of

#leftPane: rightPane:
#topPane: bottomPane:

to specify the PaneResizer's properties. That's it. Now you can add all three morphs (both panes and the resizer) to the owner.

optionally you can further spedify a padding, i.e. 'fixed' unresizable area, and a gripColor, that will show up during the resizing process.

Note: the submorphs to be resized have to have a proportional layout and a complete layout frame each. Any offsets are kept untouched, so the subpanes don't actually have to 'touch' each other.

Have a look at the class examples to see how it is done and used:

'PaneResizerMorph demo'

I wrote this because various other Splitters, Dividers or Resizers I found in the Squeak image seem to work within SystemWindows only. Instead this will be fine for any kind of Morph containing any kind of submorphs.

One caveat: I recommend specifying a padding in case you use more than one resizer of the same kind (vertical or horizontal) within the same owner, e.g.between left, middle, and right panes, to prevent the resizers from overlapping, which may happen occasionally. Apart from that, the code is solid, simple and stable.

Have fun


Release homepage:
Download: http://map.squeak.org/accountbyid/9c9c23db-68a3-429b-b78c-dd76c31aac29/files/jens-PaneResizerMorph.1.st
SHA checksum: 1388407612160578886666644043399793357998104464958

Back