Jump to content

Recommended Posts

Hello everyone here. I have a VCL program which I would now like to convert to UniGui. It's an easy part here, at least I thought so in the beginning. There is a TImage in which I want to draw a rectangle, which is transparent as a TShape. I do my program like this Shape is a TShape; OnMouseDown Shape.Left := X; Shape.Top := Y; Shape.Width := 0; Shape.Height := 0; OnMouseMove Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; OnMouseUP Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; repaint; At the end I would also like to have the coordinates of the shape. There is no onMouseMove in TUniImage, but that wouldn't be so bad because the rectangle is mainly drawn at the end. Can someone help me here? Is there an alternative to TShape for UniGui? Thanks in advance for your help.

Tanja

Share this post


Link to post
On 5/7/2023 at 12:11 PM, Dumpfbacke said:

There is no onMouseMove in TUniImage

There is TUniImage.ClientEvents.ExtEvents.mousemouve where you can write some JavaScript.

In this script you can call to execute the TUniImage.OnAjaxEvent event calling ajaxRequest(sender, 'eventname', ['param1=value1']) from JavaScript

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×