From 0f3d125b1a3183bfaf6683fc6fce523ea87075f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 14 Oct 2012 19:30:46 +0000 Subject: [PATCH] anybutton.cpp compilation fix for wxUSE_IMAGE=0. Disabled bitmaps are not rendered properly in this configuration, they look the same as normal ones. This is hardly ideal, but such degradations are to be expected when disabling something as widely used as wxImage. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/anybutton.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 6e4438b371..2bf1b41f4c 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -150,8 +150,9 @@ public: wxODButtonImageData(wxAnyButton *btn, const wxBitmap& bitmap) { SetBitmap(bitmap, wxAnyButton::State_Normal); +#if wxUSE_IMAGE SetBitmap(bitmap.ConvertToDisabled(), wxAnyButton::State_Disabled); - +#endif m_dir = wxLEFT; // we use margins when we have both bitmap and text, but when we have @@ -222,8 +223,12 @@ public: // initialize all bitmaps except for the disabled one to normal state for ( int n = 0; n < wxAnyButton::State_Max; n++ ) { +#if wxUSE_IMAGE m_iml.Add(n == wxAnyButton::State_Disabled ? bitmap.ConvertToDisabled() : bitmap); +#else + m_iml.Add(bitmap); +#endif } m_data.himl = GetHimagelistOf(&m_iml); -- 2.45.2