>Darn it Cetin - help me out - you're there - in beautiful Izmir - on the "Med" - in the "grand central station" of "classic" civilization, history and humanity, using all those "old world" smarts to [perhaps] quantify the effect of certain snails on the the sea-weed that recently immigrated to the Mediterrian - surely in that gilded environment - you could find a moment to suggest to this heathen across the pond more specific advice on how to make it better!:-)
>
>Where is the world renouned intellectual charity of your homeland in my moment of need?:-)
>
>>Any critique? Too much dependant on object names is the first one I noticed.
>
>>Cetin
Terry,
This requires a bit translation for me:) I get it as "help me" in summary and hopefully I'm right. You can search years back (I don't know how to and moreover is not patient enough to do that myself) for code doing this with container or shape (which one I don't remember). As I remember I posted it around VFP5 days (1999-2000?). Also some others published splitter classes (one that I know was on Turkish site and burried into history after a server failure).
Anyway with your code here is what I can do (be warned, no VFP, no syntax coloring etc on this box and all I did was to check it on notepad - hard to follow code):
DEFINE CLASS cmdXClass as cmdSplitterClass
PROCEDURE MouseMove (nButton, nShift, nXCoord, nYCoord)
WITH this
.mousepointer=IIF(nXCoord<.left-1 or nXCoord>.left+2,0,9)
cmdSplitterClass::MouseMove (nButton, nShift, nXCoord, nYCoord,1)
ENDWITH
ENDPROC
ENDDEFINE
DEFINE CLASS cmdYClass as cmdSplitterClass
PROCEDURE MouseMove (nButton, nShift, nXCoord, nYCoord)
WITH this
.mousepointer=IIF(nYCoord<.top-1 or nYCoord>.top+2,0,7)
cmdSplitterClass::MouseMove (nButton, nShift, nXCoord, nYCoord,2)
ENDWITH
ENDPROC
ENDDEFINE
DEFINE CLASS cmdXYClass as cmdSplitterClass
PROCEDURE MouseMove (nButton, nShift, nXCoord, nYCoord)
WITH this
.mousepointer=IIF(nYCoord<.top-1 OR nYCoord>.top+2 ;
OR nXCoord<.left-1 or nXCoord>.left+2,0,5)
cmdSplitterClass::MouseMove (nButton, nShift, nXCoord, nYCoord,3)
ENDWITH
ENDPROC
ENDDEFINE
Here all I did is to add 5th parameter to specify direction as a bitmask.
Bit 0: X
Bit 1: Y
Like scrollbars setting.
And change name dependant part:
PROCEDURE MouseMove (nButton, nShift, nXCoord, nYCoord,nDirection)
WITH this
IF thisform.lMoveInProgress
IF bittest(m.nDirection,1)
nSplitterTop=nYCoord
IF nSplitterTop<4
nSplitterTop=4
ELSE
IF nSplitterTop>thisform.height-4
nSplitterTop=thisform.height-4
ENDIF
ENDIF
nSplitterLeft=thisform.cmdXY.left
ELSE
ENDIF
IF bittest(m.nDirection,0)
nSplitterLeft=nXCoord
IF nSplitterLeft<4
nSplitterLeft=4
ELSE
IF nSplitterleft>thisform.width-4
nSplitterLeft=thisform.width-4
ENDIF
ENDIF
nSplitterTop=IIF(bittest(m.nDirection,1),nSplitterTop,thisform.cmdXY.top)
ELSE
ENDIF
PS: Seeing code here syntax colored, it looks like it is only half of the way. Stilll there is too much dependancy on object existence and names/hierarchy.
Cetin