Make wxDumpWindow() public and available in wxMSW too

This function was defined in wxGTK and wxOSX, but not in wxMSW or the
other ports, but it can be useful there too, so make it public and
define it in common code.
This commit is contained in:
Vadim Zeitlin
2021-10-20 23:11:40 +01:00
parent 85503d1dcd
commit 9e5c8eef24
7 changed files with 58 additions and 45 deletions

View File

@@ -201,3 +201,16 @@ TEST_CASE("GUI::FindWindowAtPoint", "[guifuncs]")
INFO("Point over disabled child controls still corresponds to this child");
CHECK( GetLabelOfWindowAtPoint(parent, 31, 111) == btn3->GetLabel() );
}
TEST_CASE("wxWindow::Dump", "[window]")
{
CHECK_NOTHROW( wxDumpWindow(NULL) );
wxScopedPtr<wxButton>
button(new wxButton(wxTheApp->GetTopWindow(), wxID_ANY, "bloordyblop"));
const std::string s = wxDumpWindow(button.get()).utf8_string();
CHECK_THAT( s, Catch::Contains("wxButton") );
CHECK_THAT( s, Catch::Contains("bloordyblop") );
}