Jump to content

run time moving object on form


ldb68

Recommended Posts

Is there a way to move memo and images (in web mode) on a form at run time by click down the mouse on the object?

 

I need to make a simple pubblisher editor (need to insert text box and images) with the ability to place these objects on the page.

 

thanks

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 2 weeks later...

Hi idb68,

 

try this:

1.Put on on Form a TUniPanel

2.In form's ClientEvents->ExtEvents->OnMouseMove write this code

function window.Onmouseup(sender, x, y)

{

ajaxRequest(sender, 'MyEvent', [ 'param0='+x, 'param1='+y ]);

}

3.On form OnAjaxEvent implement something like this

 

procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);

var

X,Y: Integer;

begin

if EventName='MyEvent' then

begin

TryStrToInt(Params.Values['param0'], X);

TryStrToInt(Params.Values['param1'], Y);

UniPanel1.Left:= X-(UniPanel1.Width div 2);

UniPanel1.Top:= Y-(UniPanel1.Height div 2);

end;

end;

 

Please do not criticize me for this code as it is rather experimental.

 

dima

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...