Page 1 of 1

What's the best way to force-trigger OnGeometryChanged() in Widget from LCB?

Posted: Thu Sep 10, 2020 5:46 pm
by PaulDaMacMan
The title says it all...
What's the best way to force-trigger OnGeometryChanged() in Widget from LCB?

So I've made a bunch of progress on my Piano Widget but hit another limitation, the doesn't seem to be any OnGeometryChanged() equivalent of "redraw all" that triggers OnPaint()'s handler. I have at least one idea of how to force OnGeometryChanged() that involves "execute script" to resize the widget's rect from LCS and then resize it back to what it was. Is there any better way?

Basically my Widget has a property that a scripter can set that changes the does some scaling on a bunch of paths inside the Widget, but there's no way to trigger OnGeometryChanged() from my property setter handler.

Re: What's the best way to force-trigger OnGeometryChanged() in Widget from LCB?

Posted: Thu Sep 10, 2020 6:00 pm
by trevordevore
@PaulDaMacmac - Is there a reason that OnGeometryChanged() has to fire? Can't you just perform the scaling internally by calling your own function? It sounds like you just need to have an internal handler which is called in OnGeometryChanged() or your property setter handler. I guess you could just try calling OnGeometryChanged() from your property setter as well.

Re: What's the best way to force-trigger OnGeometryChanged() in Widget from LCB?

Posted: Thu Sep 10, 2020 6:28 pm
by PaulDaMacMan
trevordevore wrote:
Thu Sep 10, 2020 6:00 pm
It sounds like you just need to have an internal handler which is called in OnGeometryChanged() or your property setter handler.
Ger...duhhh! Yes, I should've thought of that! There I go again making things way more complicated then it needs to be!
I guess you could just try calling OnGeometryChanged() from your property setter as well.
And for the record, YES! You can just call OnGeometryChanged() from another handler! For some reason I figured it would be a 'reserved' handler name only allowed to be called by the engine, but it's perfectly OK to call it directly.

Thanks Trevor

Re: What's the best way to force-trigger OnGeometryChanged() in Widget from LCB?

Posted: Thu Sep 10, 2020 6:29 pm
by trevordevore
You're welcome Paul.