'================= QMAXSPLITTER ==================
'
' This one's a doozy. A splitter control that  emulates all of Delphi 6's splitter styles.
' It's based on a QPanel rather than QCanvas ' like the original for two reasons:
' 1. To get a handle
' 2. To improve drawing and aligning
' There are still some issues with this  component, and they are:
' 1. Mouse trapping - if you move the mouse too  fast, you leave the splitter behind. SetCapture
' doesn't seem to solve the problem, maybe sub-classing in the next version...
' 2. Setting MinSize to 0 sometimes causes  resizing problems, I'm sure this is an oversight
' in the math, but I can live with it for now.
' 3. There are stil problems with CREATE, most  notably the order in which ALIGNed components
' are created, as well as the order in which  properties are assigned to sibling windows
' (Uncomment the "Color" in Rich3 and run. See  what I mean? Now place the code for Rich3 AFTER
' the code for Split3. Problem solved!)
' Anyway, I had fun with it, I hope you will too.
' Psyclops )
' P.S. Sorry for the lack of comments, maybe in the
' next release...
 

'====================================================
'            Sample program
'====================================================

$include  "QMaxSplitter.inc"

CREATE Form AS QFORM
    Caption = "Normal QSPLITTER - Blah!"
    Visible = 1
    Visible = 0
    CREATE Splitter AS QSPLITTER
        Align = 3
        Width  = 10
        Beveled = 1
    END CREATE
        CREATE RichEd1 AS QRichEdit
        Align = 3
    END CREATE
    CREATE RichEd2 AS QRICHEDIT
        Align = 5
    END CREATE
END CREATE

CREATE Form2 AS QFORM
    Center
    Caption = "QMAXSPLITTER - Cool!"
    CREATE Pnl1 AS QPANEL
        Align = 1
        BevelOuter = 0
         CREATE Rich3 AS QRICHEDIT
            'Color = &HFF0000
            Align = 3
        END CREATE
        CREATE Split3 AS QMAXSPLITTER
            Style = rsNone
            Beveled = 1
            Align = 3
            Cursor = -14
            Hint = "Style: rsNone"
            ShowHint = 1
        END CREATE
        CREATE Rich5 AS QRICHEDIT
            Align = 5
        END CREATE
     END CREATE
     CREATE Split1 AS QMAXSPLITTER
        Align = 1
        Style = rsSolid
        Hint = "Style: rsSolid"
        ShowHint = 1
        MinSize = 0
     END CREATE
     CREATE Pnl5 AS QPANEL
        Align = 5
        BevelOuter = 0
        CREATE Rich4 AS QRICHEDIT
            Align = 4
        END CREATE
        CREATE Split4 AS QMAXSPLITTER
            Align = 4
            Cursor = -21
            Width = 20
            Style = rsUpdate
            MinSize = 0
            Hint = "Style: rsUpdate"
            Beveled = 1
            ShowHint = 1
        END CREATE
        CREATE Panel55 AS QPANEL
            Align = 5
            BevelOuter = 0
            CREATE Rich55 AS QRICHEDIT
                Align = 5
            END CREATE
            CREATE Split2 AS QMAXSPLITTER
                Align = 2
                Hint = "Style: rsPattern"
                ShowHint = 1
                Height = 5
                MinSize = 0
            END CREATE
            CREATE Rich2 AS QRICHEDIT
                Align = 2
            END CREATE
        END CREATE
    END CREATE
END CREATE



Form.Show
Form2.Show

DO
    DoEvents
LOOP UNTIL Form2.Visible = 0