X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0edeeb6d96d31d342a6a283d2a9b625a1d0a7b96..34b1fdebbf3d40caaffad62b5bf89604213afb4a:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c41f9b1e61..cbacc08988 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1442,7 +1442,7 @@ void wxWindowMSW::OnInternalIdle() } #endif // !HAVE_TRACKMOUSEEVENT - if (wxUpdateUIEvent::CanUpdate(this)) + if (wxUpdateUIEvent::CanUpdate(this) && IsShown()) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); } @@ -3262,9 +3262,9 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l { rect = *((RECT*)lParam); } - wxUxThemeHandle hTheme(this, L"EDIT"); + wxUxThemeHandle hTheme((wxWindow *)this, L"EDIT"); RECT rcClient = { 0, 0, 0, 0 }; - wxClientDC dc(this); + wxClientDC dc((wxWindow *)this); if (theme->GetThemeBackgroundContentRect( hTheme, GetHdcOf(dc), EP_EDITTEXT, ETS_NORMAL, @@ -3290,8 +3290,8 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l rc.result = MSWDefWindowProc(message, wParam, lParam); processed = true; - wxUxThemeHandle hTheme(this, L"EDIT"); - wxWindowDC dc(this); + wxUxThemeHandle hTheme((wxWindow *)this, L"EDIT"); + wxWindowDC dc((wxWindow *)this); // Clip the DC so that you only draw on the non-client area RECT rcBorder; @@ -4506,6 +4506,10 @@ bool wxWindowMSW::HandlePaint() eventNc.SetEventObject(this); GetEventHandler()->ProcessEvent(eventNc); + // don't keep an HRGN we don't need any longer (GetUpdateRegion() can only + // be called from inside the event handlers called above) + m_updateRegion.Clear(); + return processed; } @@ -4551,20 +4555,29 @@ void wxWindowMSW::OnEraseBackground(wxEraseEvent& event) return; } - if ( GetBackgroundStyle() == wxBG_STYLE_CUSTOM ) + switch ( GetBackgroundStyle() ) { - // don't skip the event here, custom background means that the app - // is drawing it itself in its OnPaint(), so don't draw it at all - // now to avoid flicker - return; - } + default: + wxFAIL_MSG( _T("Unknown background style") ); + // fall through + case wxBG_STYLE_SYSTEM: + case wxBG_STYLE_COLOUR: + // do default background painting + if ( !DoEraseBackground(GetHdcOf(*event.GetDC())) ) + { + // let the system paint the background + event.Skip(); + } - // do default background painting - if ( !DoEraseBackground(GetHdcOf(*event.GetDC())) ) - { - // let the system paint the background - event.Skip(); + case wxBG_STYLE_CUSTOM: + // don't skip the event here, custom background means that the app + // is drawing it itself in its OnPaint(), so don't draw it at all + // now to avoid flicker + return; + + case wxBG_STYLE_TRANSPARENT: + event.Skip(); } } @@ -5935,10 +5948,18 @@ WXWORD wxCharCodeWXToMSW(int wxk, bool *isVirtual) break; default: - if ( isVirtual ) - *isVirtual = false; - vk = (WXWORD)wxk; - break; + // check to see if its one of the OEM key codes. + BYTE vks = LOBYTE(VkKeyScan(wxk)); + if ( vks != -1 ) + { + vk = vks; + } + else + { + if ( isVirtual ) + *isVirtual = false; + vk = (WXWORD)wxk; + } } return vk;