Reconnect events to the widget after recreating it in the sample

This ensures that the expected events are given even after the widget is
recreated due to a change of some controls on its page (and not because
it's recreated by one of the menu commands in the parent frame).

We also don't need to connect to these events from WidgetsFrame any
longer (and, in fact, doing it would be wrong as we'd connect twice),
which simplifies its code.
This commit is contained in:
Vadim Zeitlin 2024-02-18 19:02:38 +01:00
parent 828b7ee844
commit a8b4753d1d
32 changed files with 105 additions and 25 deletions

View file

@ -288,6 +288,8 @@ void HyperlinkWidgetsPage::CreateHyperlink()
delete m_hyperlink;
m_hyperlink = hyp;
NotifyWidgetRecreation(m_hyperlink);
// relayout the sizer
GetSizer()->Layout();
}