Merge branch 'window-create-disabled'

Make calling wxWindow::Disable() before wxWindow::Create() work.

See https://github.com/wxWidgets/wxWidgets/pull/1071

Closes #16385.
This commit is contained in:
Vadim Zeitlin
2018-12-12 18:24:10 +01:00
17 changed files with 88 additions and 42 deletions

View File

@@ -102,8 +102,21 @@ void ButtonTestCase::Disabled()
wxUIActionSimulator sim;
//In this test we disable the button and check events are not sent
m_button->Disable();
// In this test we disable the button and check events are not sent and we
// do it once by disabling the previously enabled button and once by
// creating the button in the disabled state.
SECTION("Disable after creation")
{
m_button->Disable();
}
SECTION("Create disabled")
{
delete m_button;
m_button = new wxButton();
m_button->Disable();
m_button->Create(wxTheApp->GetTopWindow(), wxID_ANY, "wxButton");
}
sim.MouseMove(m_button->GetScreenPosition() + wxPoint(10, 10));
wxYield();