main logo
Subject: Pb with cmenupadbuilder
Author: Michel Giustina
Posted: 2002/02/26 03:29:18
 
View Entire Thread
New Search


I am a pb with a menu buider when i click on the first or last pad.
I think i am find a pb and i propose this solution.

In a method cMenuPadBuilder.DragDropHorizontal
replace line
* See which side it's on.
llBefore = (nXCoord <= ((lnLeft + lnRight) / 2))
IF llBefore
-----------> lnNewPos = lnCnt
ELSE
lnNewPos = lnCnt + 1
ENDIF
* Need to check if the button is moving from the left.
* If so, all current buttons will be shifting down
* one position, so we need to adjust the new position
IF NOT ISNULL(lnOrigPos)
-----------> lnNewPos = lnNewPos - 1
* We've got all the info, so exit the loop.
EXIT
ENDIF

With
* See which side it's on.
llBefore = (nXCoord <= ((lnLeft + lnRight) / 2))
IF llBefore
-----------> lnNewPos = lnCnt - 1
ELSE
lnNewPos = lnCnt + 1
ENDIF
* Need to check if the button is moving from the left.
* If so, all current buttons will be shifting down
* one position, so we need to adjust the new position
IF NOT ISNULL(lnOrigPos)
-----------> * lnNewPos = lnNewPos - 1
* We've got all the info, so exit the loop.
EXIT
ENDIF

and line
IF ISNULL(lnNewPos)
* Must have been dropped after the last button
lnNewPos = lnButtons
ENDIF

With
IF ISNULL(lnNewPos) OR lnNewPos = 0
* Must have been dropped after the last button
lnNewPos = lnButtons
ENDIF

IF lnNewPos > lnButtons
* Must have been dropped before the first button
lnNewPos = 1
ENDIF

and put the same modification in the methode DragDropVertical

Michel

 
©2002 Michel Giustina
<-- Prior Message New Search Next Message -->