#Widget Synchronicity Issue

1 messages · Page 1 of 1 (latest)

dusk knoll
#

Hi all,

I'm having some problems trying to synchronise a property on a widget in the editor, with my code in C++.

My widget (WBP_CCButtonWidget) consists of two of my own widgets named UCCButton and UCCTextBlock, named Button and ButtonLabel in the designer. In addition it has a property, ButtonText.

UCCButton and UCCTextBlock just extend UButton and UTextBlock, adding a delegate which is broadcast when PostEditChangeProperty() is called on either, to bubble up the change.

The hiearchy looks like this;

[WBP_CCButtonWidget]
 - Button
   - ButtonLabel

If the ButtonLabel (UCCButtonTextBlock) is select, and its Text property updated, I'm using PostEditChangeProperty() to detect the change, and then bubble up the change via the delegate.
CCButtonWidget is subscribed to this, and sets the widgets ButtonText property.

If the main widget is selected, and ButtonText is updated, this is detected within its own PostEditChangeProperty() implementation, and it then sets the Text property for the ButtonLabel.

There appears to be an issue however in doing the latter, the displayed text for the ButtonLabel in the Hiearchy doesn't get updated. If I select this widget and look in the Details panel, the Text value displayed what I set it to via the process mentioned above. Then, if I click Compile, it seems to use the old value (displayed in the Hiearchy) and reverts what is displayed in the Designer. If I then select the main widget, and view the Details panel, ButtonText has the next value. So I end up with the disconnect between the two.

I'm not entirely sure why I'm experiencing this behaviour, I've clearly missed something. Is there a way to effectively force a refresh of the widget in the editor so that the Hierarchy reflects the set value? It feels like its being held somewhere in the background and then used when I hit compile.