06-18-2024 07:16 AM
Hi,
In my program, I have to constantly change the font size of my label. Before doing that, I want to make sure that the label is in the default label Classic position as specified in the options.
I can do the Quick-Drop Ctrl-T shortcut during edit time. But what I am looking is to replicate or do this behavior programmatically during run-time.
As a start, I checked in the resource\dialog\QuickDrop\plugins, the quick drop code Move Labels.vi. I haven't checked the code thoroughly but it seems complicated. Maybe someone already implemented a much simpler implementation to this problem.
06-19-2024 04:36 AM
It's just math and coordinate properties.
You can get a part of the code from the Move Labels.vi, it's not too bad. It might do more than you need though, it also moves captions, and considers cluster auto grow, etc.
The only trick it uses is to use the (scripting) property "Master Bounds Rect". This rectangle doesn't include the "increment\decrement". If you do want to include them, simply use the control's position property.