Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XY Quadrant Form Splitter
Message
From
24/11/2006 20:09:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01171347
Message ID:
01172367
Views:
18
>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 &&MouseMove (nButton, nShift, nXCoord, nYCoord)
ENDDEFINE && cmdXClass as cmdSplitterClass && ======================

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 &&MouseMove (nButton, nShift, nXCoord, nYCoord)
ENDDEFINE && cmdYClass as cmdSplitterClass && ======================

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 &&MouseMove (nButton, nShift, nXCoord, nYCoord)
ENDDEFINE && cmdYClass as cmdSplitterClass && ======================
********************************************************************
*                      END SCREEN SPLITTER                         *
********************************************************************
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform