X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63f06c22b993b8ead320680ffa586d7c0b12ff2e..e044f6001e70d815f72d3911ce6bd01255847ecd:/src/univ/themes/win32.cpp diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index dc1a5005a6..3261e10239 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -600,7 +600,7 @@ public: wxWin32Theme(); virtual ~wxWin32Theme(); - virtual wxRenderer *GetRenderer() { return m_renderer; } + virtual wxRenderer *GetRenderer(); virtual wxInputHandler *GetInputHandler(const wxString& control); virtual wxColourScheme *GetColourScheme(); @@ -1111,8 +1111,8 @@ WX_IMPLEMENT_THEME(wxWin32Theme, win32, wxTRANSLATE("Win32 theme")); wxWin32Theme::wxWin32Theme() { - m_scheme = new wxWin32ColourScheme; - m_renderer = new wxWin32Renderer(m_scheme); + m_scheme = NULL; + m_renderer = NULL; m_handlerDefault = NULL; } @@ -1131,6 +1131,16 @@ wxWin32Theme::~wxWin32Theme() delete m_scheme; } +wxRenderer *wxWin32Theme::GetRenderer() +{ + if ( !m_renderer ) + { + m_renderer = new wxWin32Renderer(GetColourScheme()); + } + + return m_renderer; +} + wxInputHandler *wxWin32Theme::GetDefaultInputHandler() { if ( !m_handlerDefault ) @@ -1209,6 +1219,10 @@ wxInputHandler *wxWin32Theme::GetInputHandler(const wxString& control) wxColourScheme *wxWin32Theme::GetColourScheme() { + if ( !m_scheme ) + { + m_scheme = new wxWin32ColourScheme; + } return m_scheme; } @@ -1296,7 +1310,10 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const case TITLEBAR: return wxColour(GetSysColor(COLOR_INACTIVECAPTION)); case TITLEBAR_ACTIVE: return wxColour(GetSysColor(COLOR_ACTIVECAPTION)); - case TITLEBAR_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT)); + case TITLEBAR_TEXT: return wxColour(GetSysColor(COLOR_INACTIVECAPTIONTEXT)); + case TITLEBAR_ACTIVE_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT)); + + case DESKTOP: return wxColour(0x808000); #else // !__WXMSW__ // use the standard Windows colours elsewhere case WINDOW: return *wxWHITE; @@ -1325,7 +1342,10 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const case TITLEBAR: return wxColour(0xaeaaae); case TITLEBAR_ACTIVE: return wxColour(0x820300); - case TITLEBAR_TEXT: return *wxWHITE; + case TITLEBAR_TEXT: return wxColour(0xc0c0c0); + case TITLEBAR_ACTIVE_TEXT:return *wxWHITE; + + case DESKTOP: return wxColour(0x808000); #endif // __WXMSW__ case MAX: @@ -3358,6 +3378,10 @@ void wxWin32Renderer::DrawFrameTitle(wxDC& dc, const wxString& title, int flags) { + wxColour col = (flags & wxTOPLEVEL_ACTIVE) ? + wxSCHEME_COLOUR(m_scheme, TITLEBAR_ACTIVE_TEXT) : + wxSCHEME_COLOUR(m_scheme, TITLEBAR_TEXT); + wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); r.height = FRAME_TITLEBAR_HEIGHT; if ( flags & wxTOPLEVEL_ICON ) @@ -3366,7 +3390,7 @@ void wxWin32Renderer::DrawFrameTitle(wxDC& dc, r.x += 1; dc.SetFont(m_titlebarFont); - dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, TITLEBAR_TEXT)); + dc.SetTextForeground(col); dc.DrawLabel(title, wxNullBitmap, r, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); } @@ -4044,8 +4068,8 @@ bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar, { wxSize sizeSbar = statbar->GetSize(); - return (sizeSbar.x - pt.x) < STATUSBAR_GRIP_SIZE && - (sizeSbar.y - pt.y) < STATUSBAR_GRIP_SIZE; + return (sizeSbar.x - pt.x) < (wxCoord)STATUSBAR_GRIP_SIZE && + (sizeSbar.y - pt.y) < (wxCoord)STATUSBAR_GRIP_SIZE; } return FALSE;