Hello, I would like to limit dragging of a button only to vertically.
Can someone please help me.
Thanks in advance
Otto
if Valtype( ::bDrag ) == 'B'
Eval( ::bDrag, ::nTop + nRow - nMRow, ::nLeft + nCol - nMCol )
endif
if lMoved .AND. valtype( ::bPostDrag ) == 'B'
Eval( ::bPostDrag, SELF )
endif
FUNCTION BTN_MOVE(oBtn3, x, y)
LOCAL nNewTop := x, nNewLeft := y, lNew := .F.
IF x < oGroup:nTop
nNewTop := oGroup:nTop
lNew := .T.
ENDIF
IF y < oGroup:nLeft
nNewLeft := oGroup:nLeft
lNew := .T.
ENDIF
IF x + oBtn3:nHeight > oGroup:nBottom
nNewTop := oGroup:nBottom - oBtn3:nHeight
lNew := .T.
ENDIF
IF y + oBtn3:nWidth > oGroup:nRight
nNewLeft := oGroup:nRight - oBtn3:nWidth
lNew := .T.
ENDIF
IF lNew = .T. // only moved on wrong area
oBtn3:Move( nNewTop, nNewLeft, , , .T. )
ENDIF
RETURN( NIL )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 94 guests