From: David Surovell Date: Wed, 23 Nov 2005 08:01:47 +0000 (+0000) Subject: Realize remap code cleanup X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bb86baea10afec3a7e4860c17b20edd485c628d6 Realize remap code cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 8e32ae39ed..174a4630ee 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -554,21 +554,18 @@ bool wxToolBar::Realize() const bool isVertical = HasFlag(wxTB_VERTICAL); bool doRemap, doRemapBg, doTransparent; -#ifdef __WXWINCE__ - doRemapBg = false; - doRemap = false; - doTransparent = false; -#else - if (wxSystemOptions::GetOptionInt(wxT("msw.remap")) == 2) + doRemapBg = doRemap = doTransparent = false; + +#ifndef __WXWINCE__ + int remapValue = (-1); + if (wxSystemOptions::HasOption(wxT("msw.remap"))) + remapValue = wxSystemOptions::GetOptionInt(wxT("msw.remap")); + + doTransparent = (remapValue == 2); + if (!doTransparent) { - doRemapBg = doRemap = false; - doTransparent = true; - } - else - { doRemap = !wxSystemOptions::HasOption(wxT("msw.remap")) - || wxSystemOptions::GetOptionInt(wxT("msw.remap")) == 1; + doRemap = (remapValue != 0); doRemapBg = !doRemap; - doTransparent = false; } #endif @@ -611,6 +608,7 @@ bool wxToolBar::Realize() wxMemoryDC dcAllButtons; wxBitmap bitmap(totalBitmapWidth, totalBitmapHeight); dcAllButtons.SelectObject(bitmap); + #ifdef __WXWINCE__ dcAllButtons.SetBackground(wxBrush(wxColour(192,192,192))); #else @@ -822,7 +820,6 @@ bool wxToolBar::Realize() continue; } - TBBUTTON& button = buttons[i]; wxZeroMemory(button);