diff --git a/interface/wx/button.h b/interface/wx/button.h index bbd040cc8a..15e77f48bb 100644 --- a/interface/wx/button.h +++ b/interface/wx/button.h @@ -42,7 +42,7 @@ @li @b current: bitmap shown when the mouse is over the button (but it is not pressed although it may have focus). Notice that if current bitmap is not specified but the current platform UI uses hover images for the - buttons (such as Windows XP or GTK+), then the focus bitmap is used for + buttons (such as Windows or GTK+), then the focus bitmap is used for hover state as well. This makes it possible to set focus bitmap only to get reasonably good behaviour on all platforms. diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index a1c99e9d47..9966d89ba4 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -747,6 +747,19 @@ void wxAnyButton::DoSetBitmap(const wxBitmap& bitmap, State which) else { m_imageData->SetBitmap(bitmap, which); + + // if the focus bitmap is specified but current one isn't, use + // the focus bitmap for hovering as well if this is consistent + // with the current Windows version look and feel. + // + // rationale: this is compatible with the old wxGTK behaviour + // and also makes it much easier to do "the right thing" for + // all platforms (some of them, such as Windows, have "hot" + // buttons while others don't) + if ( which == State_Focused && !m_imageData->GetBitmap(State_Current).IsOk() ) + { + m_imageData->SetBitmap(bitmap, State_Current); + } } // it should be enough to only invalidate the best size when the normal