// Testing FiveWin splitter controls
#include "FiveWin.ch"
#include "Splitter.ch"
//----------------------------------------------------------------------------//
function Main()
local cTitle := "Testing the Splitter controls"
local cText, oSplit, oWnd, oLbx, oGet
DEFINE WINDOW oWnd FROM 1, 1 TO 400, 600 PIXEL ;
TITLE cTitle ;
BORDER NONE
SELECT 1
USE EJEMPLO1.DBF
@ 20,20 LISTBOX oLbx FIELDS SIZE 200,300 PIXEL OF oWnd ;
ON CHANGE cText := Ejemplo1->Sintax
@ 20,225 GET oGet VAR cText TEXT SIZE 300,300 PIXEL OF oWnd
oLbx:bChange:={|| oGet:Refresh() }
@ 20, 220 SPLITTER oSplit ;
VERTICAL ;
PREVIOUS CONTROLS oLbx ;
HINDS CONTROLS oGet ;
LEFT MARGIN 100 ;
RIGHT MARGIN 140 ;
SIZE 4, 300 PIXEL ;
OF oWnd ;
_3DLOOK ;
UPDATE
oSplit:bChange := { | oSplit | MyChange( oSplit ) }
ACTIVATE WINDOW oWnd
return nil
STATIC FUNCTION MyChange( oSplit )
LOCAL nFirst := oSplit:nFirst, aMyPos := { 200, 300, 400 }, nPos
IF nFirst <= aMyPos[1]
nFirst := aMyPos[1]
ELSE
IF nFirst >= ATAIL( aMyPos )
nFirst := ATAIL( aMyPos )
ELSE
FOR nPos := 1 TO LEN( aMyPos ) - 1
IF nFirst > aMyPos[nPos] .AND. nFirst < aMyPos[nPos + 1]
IF (aMyPos[nPos + 1] - nFirst) < (nFirst - aMyPos[nPos])
nFirst := aMyPos[nPos + 1]
ELSE
nFirst := aMyPos[nPos]
ENDIF
EXIT
ENDIF
NEXT nPos
ENDIF
ENDIF
oSplit:SetPosition( nFirst )
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 98 guests