In wxMSW, if the classic theme was used, read-only wxOwnerDrawnComboBox
had gray background, but native look should be the same for both
editable and read-only combo boxes: white text entry-like rectangle.
Apparently, a similar problem existed with non-classic themes too
before, as there was a workaround in place. Fixed by moving the
workaround into code used by both themed and classic rendering.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71367
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
// TODO: Convert drawing in this function to Windows API Code
{
// TODO: Convert drawing in this function to Windows API Code
+ const bool useVistaComboBox = ::wxGetWinVersion() >= wxWinVersion_Vista;
+
wxSize sz = GetClientSize();
wxDC* dcPtr = wxAutoBufferedPaintDCFactory(this);
wxDC& dc = *dcPtr;
wxSize sz = GetClientSize();
wxDC* dcPtr = wxAutoBufferedPaintDCFactory(this);
wxDC& dc = *dcPtr;
wxRect rectTextField = m_tcArea;
wxColour bgCol = GetBackgroundColour();
wxRect rectTextField = m_tcArea;
wxColour bgCol = GetBackgroundColour();
+ // FIXME: Either SetBackgroundColour or GetBackgroundColour
+ // doesn't work under Vista, so here's a temporary
+ // workaround.
+ // In the theme-less rendering code below, this fixes incorrect
+ // background on read-only comboboxes (they are gray, but should be
+ // white).
+ bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
+
#if wxUSE_UXTHEME
const bool isEnabled = IsThisEnabled();
#if wxUSE_UXTHEME
const bool isEnabled = IsThisEnabled();
#if wxUSE_UXTHEME
if ( hTheme )
{
#if wxUSE_UXTHEME
if ( hTheme )
{
- const bool useVistaComboBox = ::wxGetWinVersion() >= wxWinVersion_Vista;
-
RECT rFull;
wxCopyRectToRECT(borderRect, rFull);
RECT rFull;
wxCopyRectToRECT(borderRect, rFull);
if ( useVistaComboBox )
{
if ( useVistaComboBox )
{
- // FIXME: Either SetBackgroundColour or GetBackgroundColour
- // doesn't work under Vista, so here's a temporary
- // workaround.
- bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
-
// Draw the entire control as a single button?
if ( !isNonStdButton )
{
// Draw the entire control as a single button?
if ( !isNonStdButton )
{