Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move a toolbar by dragging on child control vs. border/t
Message
From
29/05/2005 15:50:59
 
 
To
29/05/2005 14:55:40
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018452
Message ID:
01018455
Views:
11
This message has been marked as the solution to the initial question of the thread.
Hello Malcom,

the flickering resulted due to a logic bug ..
this version seems to work nice, expect when the toolbar docks itself to the screen edges..
define class clsMover as Label

 Caption = "Click and drag me!"
 BackStyle = 0
 AutoSize = .T.
 * holds reference to object being moved
 oLinkedObject = .Null.
 * remember mouse position at start of drag
 OriginalXpos = 0
 OriginalYpos = 0
 * remember original object being moved's position
 OriginalLeft = 0
 OriginalTop = 0
 * clear linked object
 function Destroy()
  This.oLinkedObject = .Null.
 endfunc

 function MouseDown
  lparameters nButton, nShift, nXCoord, nYCoord
  if nButton = 1 and vartype( This.oLinkedObject ) == "O"
   with This
    .OriginalXPos = nXCoord
    .OriginalYPos = nYCoord
    .OriginalLeft = This.oLinkedObject.Left
    .OriginalTop = This.oLinkedObject.Top
   endwith
  endif
 endfunc

 function MouseMove
  lparameters nButton, nShift, nXCoord, nYCoord
  if nButton = 1 and vartype( This.oLinkedObject ) == "O"
   with this
    .OriginalLeft = .OriginalLeft + (nXCoord - .OriginalXPos)
    .OriginalTop = .OriginalTop + (nYCoord - .OriginalYPos)
    .oLinkedObject.Move(.OriginalLeft,.OriginalTop)
   endwith
  endif
 endfunc

enddefine
Regards
Christian

PS:
Thx for the great feedback on my struct compiler frontend!!!
I adopted most of your proposals.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform