Now I have a problem
On my dialog there are :
a big button on the top
ten small buttons down the big button
moving the scrollbar i want move the buttons but the button overwrite on the big button
How I can make to hide the button when they are on big button ?
look this the source test
- Code: Select all Expand view RUN
#include "FiveWin.ch"
Function test()
LOCAL oDlg
LOCAL i
Local abtn[10]
DEFINE DIALOG oDlg;
SIZE 800,600
@ 2,5 BUTTON OBTN1 PROMPT "move the scrollbar but the buttons must not overwrite here" SIZE 380,45 OF oDlg PIXEL
FOR i = 1 TO 10
CREAPULSANTI( aBtn, i )
NEXT
oDlg:nStyle = NOR( oDlg:nStyle, WS_VSCROLL )
ACTIVATE DIALOG oDlg;
ON INIT IMPOSTASCROLL( oDlg, 5 );
CENTER
STATIC FUNCTION IMPOSTASCROLL( oDlg,ntop )
LOCAL nStep := 30
oDlg:oVScroll:SetRange( 1, 10 )
oDlg:oVScroll:nPgStep = 1
oDlg:oVScroll:bGoUp = { || SpostaControlli( oDlg, nStep,ntop ) }
oDlg:oVScroll:bGoDown = { || SpostaControlli( oDlg, -nStep ,ntop) }
oDlg:oVScroll:bPageUp = { || SpostaControlli( oDlg, nStep ,ntop) }
oDlg:oVScroll:bPageDown = { || SpostaControlli( oDlg, -nStep,ntop ) }
RETURN NIL
STATIC FUNCTION SPOSTACONTROLLI( oDlg, nStep,ntop )
LOCAL i
Local len:=len(oDlg:aControls )
IF nStep < 0 .AND. oDlg:aControls[len]:nTop + nStep = ntop
RETURN NIL
ENDIF
IF nStep > 0 .AND. oDlg:aControls[ 4 ]:nTop - nStep = ntop
RETURN NIL
ENDIF
FOR i = 2 TO LEN( oDlg:aControls )
oDlg:aControls[ i ]:Move( oDlg:aControls[ i ]:nTop + nStep, oDlg:aControls[ i ]:nLeft )
NEXT
oDlg:Refresh()
RETURN NIL
STATIC FUNCTION CREAPULSANTI( aBtn, nBtn )
@ 40 + ( nBtn - 1 ) * 20, 120 BUTTON abtn[nBtn] PROMPT "TAVOLO" + STR( nBtn, 2 ) PIXEL
abtn[nBtn]:cToolTip :="TAVOLO" + STR( nBtn, 2 )
abtn[nBtn]:CARGO:= { 'Libero', nBtn }
RETURN NIL
thanks