Jump to content

Recommended Posts

Posted

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

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

> there are several examples under examples folder

 

which ones exactly, please.

I skimmed through all Demos directory with %DragDrop% search and did not find anything.

 

thanks in advance,

Dmitry

  • Upvote 1
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...