Summary: a widget to resize adjacent submorphs
Author: Jens Mönig
Owner: Jens Moenig (jens)
Co-maintainers: <None>
PackageInfo name: PaneResizerMorph
RSS feed:


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