|    26/02/06 ~ 9:34 -0500 :
|         " Re: Drag Handles? "


Drag into your window whatever control has a mousedown and a mousedrag avent, a small canvas containing some image being the best choice.

Create two window properties:
  vx as integer
  vy as integer

In the canvas.mousedown :
  vx = x
  vy = y
  //store starting coordinates
  return true
 //so the mousedrag event fires when you move mouse

In the canvas.mousedrag :
  me.left = me.left+x-vx
  me.top = me.top+y-vy

The canvas follows your mouse!

Level 2, in the mousedrag, put:
  dim xx,yy,maxx,maxy,minx,miny as integer
  xx = me.left+x-vx
  yy = me.top+y-vy
  // give appropriate values to these bounds:
  me.left = min(max(xx,minx),maxx)
  me.top = min(max(yy,miny,maxy)
  //assign to your listbox dimensions related to the canvas dimensions...

The canvas follows your mouse and stays within a specified rectangle, and you liveresize your canvas.

Level 3:
  dim xx,yy,maxx,maxy,minx,miny,xplusy,xminusy as integer
  xx = me.left+x-vx
  yy = me.top+y-vy
  xplusy = xx+yy
  xminusy = xx-yy
  xplusy = min(max(xplusy,minx),maxx)
  xminusy = min(max(xminusy,miny,maxy)
  me.left = (xplusy + xminusy)/2
  me.top = (xplusy - xminusy)/2

You handle stays within a rhombus!
This game has no ending...
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to