Forcing GetDDescription() refresh in ToolData plugin (EventAdd not working)
-
Hi,
I’m writing a ToolData plugin with the C++ SDK.
I see that GetDDescription() is automatically called when:
the tool is first activated (before InitTool()),the user interacts with the Attribute Manager (e.g. clicks on a choice control),and when parameters change.
That works fine.But I also need to refresh the Attribute Manager description when my tool state changes during runtime (for example inside MouseInput(), or after some internal state update).
I tried calling : EventAdd(EVENT_FORCEREDRAW);
…but this does not cause GetDDescription() to be called again for my tool.So my questions are:
What is the correct way to force GetDDescription() to run again for a ToolData plugin?
Is there a specific event or API call I should use to tell the Attribute Manager to rebuild the description?
Any best practices for dynamically updating tool descriptions at runtime?Thanks!
-
Hey @Viktor-Velicko I'm busy this week and I will be able to have a deeper look at it only next week.
With that's said here are few hints (at least what I would try first).
- Send COREMSG_CINEMA_FORCE_AM_UPDATE.
- Call GeUpdateUI.
- It may not be possible at all to do during a drag operation (but I will ask about it only once the two previous solutions are confirmed to not work, which I do not have the time to test right now).
Cheers,
Maxime -
Thank you, Maxim.
No further testing is needed—this works very well.
I’m calling it from the ToolData::MouseInput() callback at the end, which is sufficient. The panel updates nicely after the mouse event finishes (on mouse up).SendCoreMessage(COREMSG_CINEMA, BaseContainer(COREMSG_CINEMA_FORCE_AM_UPDATE));
GeUpdateUI();You can close this thread.
Thanks!
V.