test sample

test sample

Postby Silvio » Tue Aug 05, 2008 2:23 pm

Anyone have A test sample of a dialog
with many buttons and vscroll at the right to scroll they ?

thanks
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: test sample

Postby Enrico Maria Giordano » Tue Aug 05, 2008 3:08 pm

This is a very basic sample:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := SPACE( 30 )

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 GET cVar

    @ 3, 0 BUTTON "&Close";
           ACTION oDlg:End()

    oDlg:nStyle = NOR( oDlg:nStyle, WS_VSCROLL )

    ACTIVATE DIALOG oDlg;
             ON INIT IMPOSTASCROLL( oDlg );
             CENTER

    RETURN NIL


STATIC FUNCTION IMPOSTASCROLL( oDlg )

    oDlg:oVScroll:SetRange( 1, 10 )
    oDlg:oVScroll:nPgStep = 1

    oDlg:oVScroll:bGoUp     = { || SpostaControlli( oDlg, 30 ) }
    oDlg:oVScroll:bGoDown   = { || SpostaControlli( oDlg, -30 ) }
    oDlg:oVScroll:bPageUp   = { || SpostaControlli( oDlg, 30 ) }
    oDlg:oVScroll:bPageDown = { || SpostaControlli( oDlg, -30 ) }

    RETURN NIL


STATIC FUNCTION SPOSTACONTROLLI( oDlg, nStep )

    LOCAL i

    FOR i = 1 TO LEN( oDlg:aControls )
        oDlg:aControls[ i ]:Move( oDlg:aControls[ i ]:nTop + nStep, oDlg:aControls[ i ]:nLeft )
    NEXT

    oDlg:Refresh()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Silvio » Tue Aug 05, 2008 3:26 pm

thank I 'm trying it
I must implement it on my old class
remember of tmiadialog ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 56 guests