![]() ![]() THIS.MOVE(THIS.LEFT + m.lnMovement, THIS.TOP, THIS.WIDTH, THIS.HEIGHT) IF BETWEEN(THIS.LEFT + m.lnMovement, This.minimumsize, – THIS.WIDTH – This.minimumsize) M.lnMovement = m.nXCoord – THIS.mousedownat IF m.nButton = 1 AND !(this.mousedownat = 0) M.loControl.TOP = m.loControl.TOP + m.lnMovementTopĭODEFAULT(m.nLeft, m.nTop, m.nWidth, m.nHeight) & Finally move the splitter M.loControl.HEIGHT = MAX(m.loControl.HEIGHT – m.lnMovementTop, 0) M.loControl.HEIGHT = MAX(m.loControl.HEIGHT + m.lnMovementTop, 0) IF (m.loControl.TOP + m.loControl.HEIGHT) <= (THIS.TOP + lnMarginOfError) AND !m.llIsSplitter IF m.loControl.TOP <= THIS.TOP & Control is above the splitter LnMarginOfError = INT(This.Top/2) & JIC the developer got the splitter a little too close M.loControl.LEFT = m.loControl.LEFT + m.lnMovementLeft M.loControl.WIDTH = MAX(m.loControl.WIDTH – m.lnMovementLeft, 0) M.loControl.WIDTH = MAX(m.loControl.WIDTH + m.lnMovementLeft, 0)ĮLSE & Control is to the right of splitter IF (m.loControl.LEFT + m.loControl.WIDTH) <= (THIS.LEFT + lnMarginOfError) AND !m.llIsSplitter IF m.loControl.LEFT <= THIS.LEFT & Control is to the left of splitter LnMarginOfError = INT(This.width/2) & JIC the developer got the splitter a little too close M.llIsSplitter = m.loControl.CLASS = “Splitter” IF m.loControl.TAG = lcUniqueTag & this splitter so just loop M.llLockScreenWas = THISFORM.LOCKSCREEN & JIC the screen was already lockedįOR EACH m.loControl IN M.lcUniqueTag = “DoN’t_MoVe_SpLiT” & Just something that is pretty well guaranteed to be unique *!* The following tag can be placed in controls you don’t want moved as well LOCAL loControl, llLockScreenWas, lnMovement, llIsSplitter, lcUniqueTag, lnMarginOfError, lnAnchorWasĭODEFAULT(m.nLeft, m.nTop, m.nWidth, m.nHeight) *!* remember to set mousedownat back to 0 when you are done moving the splitter *!* then set mousedownat != 0 and call this move method of the splitter *!* If you want to move the splitter during runtime and have it move the other controls LPARAMETERS nButton, nShift, nXCoord, nYCoord Minimumsize = 40 & This is how small (in pixels) the panels can get when moving the splitter Mousedownat = 0 & Tracks mouse and allows class to ignore moves caused by resizing form “can see that it handles the new Visual FoxPro 9.0 Anchors property with aplomb.” “horizontal and vertical splitters around on this form. “to worry about when distributing your application. “It is pure Visual FoxPro, so there aren’t any additional ActiveX or DLL dependencies ” + = “This is an example of a splitter class for use in Visual FoxPro 9.0 forms. And, if you’re not, then I encourage you to give Visual FoxPro ” + If you’re an avid Visual FoxPro developer like myself ” + “it also allows the developer to extend the actual language with new classes, ” + “Not only does it allow a developer to create great datacentric applications, ” + = “Visual FoxPro is an extremely versatile development tool. #Vfp define class code#*!* Cut-N-Paste the code below into a prg file and execute it to see and try out a working example of the splitter class If you are using a previous version then you will need to modify/delete a few things.ĭownload Splitter.vcx and Form Example (8 KB approx.) This splitter control is designed to work with Visual FoxPro 9.0. ![]() Now, if you want to try the splitter class out before you go to the trouble of downloading it, I’ve also created a cut-n-paste/execute example that you’ll find directly beneath the screen shot. #Vfp define class download#Below is a download link for the class library that I placed my splitter class in (based on shape) and an example form showing how the class is used (I’ve taken a screen shot of it so you can see what it looks like). I was convinced it couldn’t be too difficult, and Visual FoxPro didn’t disappoint me. A number of other languages have a splitter control of some sort, why not Visual FoxPro? To be fair, I have seen some splitter classes floating around from time to time, but I thought I’d try my hand at it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |