Log in

View Full Version : OnStartDrag, function sender



ReadySteadyGo
06-24-2010, 09:34 PM
what are the parameters needed in my function sender when the event is OnStartDrag?

eg. procedure drag(sender: TObject, {What other parameters are needed?});

noidea
06-24-2010, 09:35 PM
functionname( ctrl+space

ReadySteadyGo
06-24-2010, 09:54 PM
code hints aren't there when making a procedure...

ReadySteadyGo
06-24-2010, 09:57 PM
i've looked it up on a pascal reference site.

TStartDragEvent = procedure (Sender: TObject; var DragObject: TDragObject) of object;

How do I create a TDragObject?

I am so confused.

MylesMadness
06-24-2010, 10:01 PM
in scar tools -> event handlers list

edit: Oh you got that part, but that still will help above.

Question 2:

procedure OnStartDrag(Sender: TObject; var DragObject: TDragObject);
var
P:TPoint;
begin
DragObject.Create;
P:=DragObject.DragPos;
DragObject.Free;
Writeln(IntToStr(P.x)+IntToStr(p.y));
end; or somthing like that

ReadySteadyGo
06-24-2010, 10:04 PM
thanks myles!!

Coh3n
06-24-2010, 10:09 PM
If you're working on the MSI location viewer (which I'm assuming you are), you don't need to use the OnDrag pointers, you can just reset the location of the image to the mouse position (if the mouse is clicked, of course). However, this is working for you, then great, just ignore me. :p

I'm saying this because I could never get the Drag pointers to work. :p

nielsie95
06-24-2010, 10:10 PM
In Simba you can see it from the object itself, for example "TPanel.OnStartDrag(" should show you the definition as well :)

ReadySteadyGo
06-24-2010, 10:33 PM
If you're working on the MSI location viewer (which I'm assuming you are), you don't need to use the OnDrag pointers, you can just reset the location of the image to the mouse position (if the mouse is clicked, of course). However, this is working for you, then great, just ignore me. :p

I'm saying this because I could never get the Drag pointers to work. :p

I started doing that then I saw the OnDrag pointers and presumed that's what I should be doing :) But yeh it's given me enough hassle.

noidea
06-24-2010, 10:50 PM
code hints aren't there when making a procedure...

sorry mate, alls I saw was what are the parameters :redface:

ReadySteadyGo
06-25-2010, 02:28 PM
no worries :) i'm terrible at explaining stuff.