Login Page - Create Account

Support Board


Date/Time: Wed, 22 Oct 2025 12:29:16 +0000



[Programming Help] - Detecting mouse events for a specific Text tool in ACSIL

View Count: 68

[2025-10-17 06:54:00]
bozo_j - Posts: 30
Hi guys,

I want to detect the end of a drag event in ACSIL for a Text tool, so that I can reposition it to the new location on the chart. Exactly the same functionality as in "Clock - Real Time" built-in study where after the clock has been placed on the chart with the initial coordinates first, user can later move it by dragging it, and the new position will be stored in persistent variables.

I have investigated sc.ReceivePointerEvents option (and POINTER_BUTTON_UP event), but even if this is a correct way to implement it, I don't see how to limit it to only one tool (Text) I am interested in, or to detect that the POINTER_BUTTON_UP is indeed even related to the specific Text tool on the chart I am interested in (if it cannot be limited to a specific Tool).

Any ideas how to implement dragging of a Text tool to a new position?

Thanks in advance!
Date Time Of Last Edit: 2025-10-17 06:55:06
[2025-10-17 08:15:59]
bozo_j - Posts: 30
For future readers with the same issue. The solution is not to use mouse events, but just to remember the initial coordinates of the Tool and then when it moves (i.e. when Sierra calls the function next time) compare the new coordinates of the tool retrieved with e.g. sc.GetUserDrawnDrawingByLineNumber, with the old coordinates and persist them with some simple logic around when to initialize the coordinates and when to persist them.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account