VRSPLITB.DLL
Split-bar class for VX-REXX 2.1d.

The VX-REXX SplitBar class was provided by Watcom as sample code in the VX-REXX
Object Development Kit.  However, Watcom did not provide any precompiled
version.

This package is simply a pre-built version of that sample code, integrated into
the basic class framework.  (The ODK license terms are unclear, but there do not
appear to be any restrictions on the sample programs.)

The class libary (VRSPLITB.DLL) contains only this one object class.  The same
DLL acts as both the developer's library and the public runtime.


INSTALLATION

For End Users:
 - Put VRSPLITB.DLL into a directory on your LIBPATH.  You should now be able
   to run VX-REXX applications which use the SplitBar class.

For VX-REXX Developers:
 - Put VRSPLITB.DLL into a directory on your LIBPATH.
 - Put VRSPLIT.VXO into the VXREXX directory.  
 - Run VX-REXX and select 'Options' -> 'Object libraries' from the menubar.  
   Make sure that VRSPLIT.VXO appears in the list of registered libraries.  The
   SplitBar should show up on the objects toolbar.


USING THE SPLITBAR CLASS (FOR DEVELOPERS)

The SplitBar class is very simple.  Besides the standard object attributes, the
SplitBar class defines the following properties:

  DrawEnds:     0 or 1
    Visual style property which determines whether the ends of the splitbar will
    be drawn with closing lines.

  Mode:         'AutoMove', 'Manual' or 'Static'
    'AutoMove' causes the adjacent object to be automatically moved according to
    the position of the splitbar.  'Manual' requires you to handle the Move
    event yourself (including moving the splitbar to its new position, and
    resizing any other controls accordingly).  'Static' prevents the splitbar
    from being moved at all.

  Orientation:  'Horizontal' or 'Vertical'
    Controls the orientation of the splitbar.

When the user drags the splitbar, it generates a 'Move' event.  As the behaviour
of 'AutoMove' is rather crude, you will usually want to set the Mode to 'Manual'
and handle this event yourself.

Sample code for handling the 'Move' event is shown below.  This code assumes
that the main window contains three objects: a left container, a vertical
splitbar, and a right container.  The containers fill the main window on either
side of the splitbar; this code handles the layout whenever the splitbar is
moved.  (The splitbar Mode property in this example is set to 'Manual'.)


    /* 'Move' event handler */
    SPLIT_BAR_Move:
        split_x = VRInfo('Left')            /* Get the splitbar position */
        CALL ResizeWindow split_x              /* Redo the window layout */
    RETURN


    /* Resize the window contents */
    ResizeWindow: PROCEDURE
        ARG split_x                        /* Left edge of the split bar */

        /* Get the window client size */
        win_w = VRGet('Window1', 'InteriorWidth')
        win_h = VRGet('Window1', 'InteriorHeight')

        /* Coordinates of the left-hand container */
        cn1_x = 0
        cn1_y = 10              /* Leave a margin of 10 twips at the top */

        /* Width & height of the left-hand container */
        cn1_w = split_x
        cn1_h = win_h - cn1_y

        /* Coordinates of the right-hand container */
        cn2_x = split_x + VRGet('SPLIT_BAR', 'Width')
        cn2_y = 10

        /* Width & height of the right-hand container */
        cn2_w = win_w - cn2_x
        cn2_h = win_h - cn2_y

        /* Now position the controls */
        CALL VRSet 'CN_LEFT', 'Left',   cn1_x
        CALL VRSet 'CN_LEFT', 'Top',    cn1_y
        CALL VRSet 'CN_LEFT', 'Height', cn1_h
        CALL VRSet 'CN_LEFT', 'Width',  cn1_w

        CALL VRSet 'SPLIT_BAR', 'Left',   split_x
        CALL VRSet 'SPLIT_BAR', 'Height', win_h

        CALL VRSet 'CN_RIGHT',    'Left',   cn2_x
        CALL VRSet 'CN_RIGHT',    'Top',    cn2_y
        CALL VRSet 'CN_RIGHT',    'Width',  cn2_w
        CALL VRSet 'CN_RIGHT',    'Height', cn2_h

    RETURN

