Return empty bitmaps from wxButton if not explicitly set in wxMSW
Do this for consistency with the other ports and because this seems more useful anyhow. Update the documentation to make this behaviour more clear and document this change as a (minor) incompatibility in wxMSW. Also add more unit tests to check for this behaviour. Note this also fixes the problem with the unit test added in the grandparent commit under MSW.
This commit is contained in:
@@ -156,6 +156,17 @@ TEST_CASE_METHOD(ButtonTestCase, "Button::Bitmap", "[button]")
|
||||
|
||||
CHECK(m_button->GetBitmap().IsOk());
|
||||
|
||||
// The call above shouldn't affect any other bitmaps as returned by the API
|
||||
// even though the same (normal) bitmap does appear for all the states.
|
||||
CHECK( !m_button->GetBitmapCurrent().IsOk() );
|
||||
CHECK( !m_button->GetBitmapDisabled().IsOk() );
|
||||
CHECK( !m_button->GetBitmapFocus().IsOk() );
|
||||
CHECK( !m_button->GetBitmapPressed().IsOk() );
|
||||
|
||||
// Do set one of the bitmaps now.
|
||||
m_button->SetBitmapPressed(wxArtProvider::GetBitmap(wxART_ERROR));
|
||||
CHECK( m_button->GetBitmapPressed().IsOk() );
|
||||
|
||||
// Check that resetting the button label doesn't result in problems when
|
||||
// updating the bitmap later, as it used to be the case in wxGTK (#18898).
|
||||
m_button->SetLabel(wxString());
|
||||
|
Reference in New Issue
Block a user