TAdvSplitter component 1.1 - 97/11/14

by Charles Bedard (bedardc@mlink.net)

NOTE:
      I have developped this component with Delphi 3.0,
      but it should work under Delphi 2.0, after modifying
      TAdvSplitter.GetChildren, which is different in both 
      versions.

      You can distribute or modify this code at will, but
      please notify me about any change you make. The idea here
      is to see if i triggered thoughts and ideas on improving
      this kind of component.

      Comments and suggestions are also welcomed.


------ Changes from v1.0 --------------------------------------

     - added the ProportionalResize property                              
     - added OnPaneResize event
     - added OnResize event
     - fixed the drawing when both panels are hidden                      
     - fixed the CTL3D inconsistency                                      
     - improved the Pane updating                                         
     - SwapPanes now works properly (a swap made at design time
       remains at run-time)


------ Installation ------------------------------------------

Simply add the source file to a package (for Delphi 3.0),
or add to Component Library (Delphi 2.0)


------ Using TAdvSplitter ------------------------------------

**** Right Click on the Component Window at Design-time to
     Center the Splitter or to Swap Panes.

Key properties

    AllowResize   :  Determines if the Panes can be resized at
                     run-time or if they are fixed.

    AutoUpdate    :  Controls how the resizing process occurs.
                     
                     True  : The Panes are resized while 
                             dragging the splitter.
                     False : The Panes are resized once the
                             the splitter has been dragged
                             (when mouse button is released)

    BorderStyle   :  Allows to draw or not the Border around the
                     splitter control. You may want to set it
                     to bsNone if you will embed another splitter
                     inside the splitter window, so that final 
                     borders dont look too thick. The Panes
                     Frames can also help obtaining the right
                     look.

    Orientation   :  Used to set the splitting direction.

                     soVertical   : Panes are one over the other, 
                                    with Pane1 being the top Pane.
                     soHorizontal : Panes are one beside the other,
                                    with Pane1 begin the left Pane.

    PaneSettings1 :  Used to set the properties of the first Pane.

                     Color      : (self-explanatory)

                     FrameStyle : try them to see how they look

                     FrameWidth : width of the frame, which is 
                                  actually twice that value onscreen.
                                  the reason for this is that at least
                                  2 pixel lines are needed to create
                                  the frame styles. Setting it to
                                  0 will remove the frame (regardless
                                  of FrameStyle value).

                     MinSize    : Minimum Client area allowed. 
                                  Clientwidth of the Pane when 
                                  vertical, and ClientHeight when
                                  Horizontal.

                     Visible    : Used to hide or show the Pane,
                                  This setting doesn't look properly
                                  when used at design-time. That is,
                                  if both Panes are hidden at design
                                  time, one of them will not disappear.
                                  BUT WORKS PERFECTLY AT RUN-TIME.
                                  I will fix this soon.
                                   
    PaneSettings2 :  Used to set the properties of the first Pane.

    Position      :  Used to get of set the position of the Splitter.
                     Of course, it has no effect if one of the panes
                     is not visible.

    ProportionalResize : TRUE : When the splitter is resized,
                                the panes keep their fraction of 
                                the total ClientArea.
                         FALSE: The first pane keeps its size, while
                                the 2nd pane fills the rest of the
                                ClientArea.

    SplitterColor :  Sets the color of the spliter area, which is the
                     rectangle between both Panes.
    
    SplitterStyle :  Controls how the splitter area looks while
                     dragging it.

                     ssSolid      : draws a solid inverted rectangle
                     ssCheckrered : draws a checkered inverted 
                                    rectangle

    Thickness     :  Sets the thickness of the splitter area. Setting
                     it to 0 will not allow resizing.

Key Methods:

    procedure SwapPanes; -->  Will make the Panes exchange positions.

    procedure Center; ----->  Will resize panes evenly.

Key Events:

    OnPaneResize: TNotifyEvent;  -----> triggered when the Splitter 
                                        Position changes.

    OnResize    : TNotifyEvent;  -----> triggred when the the control 
                                        itself is resized;

-----------------------------------------------------------------------

