X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f480da37ca0840ddbe48b908d511d2e9fc20bf4..0b4c331f91428fa71510b2492345ec6d6a999c35:/src/msw/window.cpp?ds=sidebyside diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a1423f78e7..8da3bb78c9 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -29,6 +29,9 @@ #endif #ifndef WX_PRECOMP + #include + #include "wx/msw/winundef.h" + #include "wx/accel.h" #include "wx/setup.h" #include "wx/menu.h" #include "wx/dc.h" @@ -58,6 +61,8 @@ #include "wx/menuitem.h" #include "wx/log.h" +#include "wx/msw/private.h" + #if wxUSE_TOOLTIPS #include "wx/tooltip.h" #endif @@ -69,7 +74,6 @@ #include "wx/intl.h" #include "wx/log.h" -#include "wx/msw/private.h" #include "wx/textctrl.h" @@ -94,16 +98,14 @@ #endif #endif -#include "wx/msw/winundef.h" - // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- // standard macros missing from some compilers headers #ifndef GET_X_LPARAM - #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) - #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) + #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) + #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) #endif // GET_X_LPARAM // --------------------------------------------------------------------------- @@ -117,6 +119,17 @@ wxMenu *wxCurrentPopupMenu = NULL; extern wxList WXDLLEXPORT wxPendingDelete; extern char wxCanvasClassName[]; +#ifdef __WXDEBUG__ + // see comments in dcclient.cpp where g_isPainting is defined + extern bool g_isPainting; + + inline static void wxStartPainting() { g_isPainting = TRUE; } + inline static void wxEndPainting() { g_isPainting = FALSE; } +#else // !debug + inline static void wxStartPainting() { } + inline static void wxEndPainting() { } +#endif // debug/!debug + // --------------------------------------------------------------------------- // private functions // --------------------------------------------------------------------------- @@ -890,7 +903,7 @@ WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) return exStyle; } -#if WXWIN_COMPATIBILITY_2 +#if WXWIN_COMPATIBILITY // If nothing defined for this, try the parent. // E.g. we may be a button loaded from a resource, with no callback function // defined. @@ -1005,7 +1018,7 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect) // drag and drop // --------------------------------------------------------------------------- -#if wxUSE_DRAG_AND_DROP +#if wxUSE_DRAG_AND_DROP void wxWindow::SetDropTarget(wxDropTarget *pDropTarget) { @@ -1259,7 +1272,8 @@ int wxWindow::GetCharWidth() const return lpTextMetric.tmAveCharWidth; } -void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, +void wxWindow::GetTextExtent(const wxString& string, + int *x, int *y, int *descent, int *externalLeading, const wxFont *theFont) const { @@ -1295,7 +1309,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, if ( externalLeading ) *externalLeading = tm.tmExternalLeading; } -#if wxUSE_CARET +#if wxUSE_CARET && WXWIN_COMPATIBILITY // --------------------------------------------------------------------------- // Caret manipulation // --------------------------------------------------------------------------- @@ -1674,7 +1688,9 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) break; case WM_PAINT: + wxStartPainting(); processed = HandlePaint(); + wxEndPainting(); break; case WM_CLOSE: @@ -1763,6 +1779,14 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) } break; + case WM_GETDLGCODE: + if ( GetWindowStyleFlag() & wxWANTS_CHARS ) + { + rc.result = DLGC_WANTARROWS | DLGC_WANTCHARS | DLGC_WANTTAB; + processed = TRUE; + } + break; + case WM_KEYDOWN: // If this has been processed by an event handler, // return 0 now (we've handled it). @@ -2063,7 +2087,11 @@ bool wxWindow::MSWCreate(int id, if ( width > -1 ) width1 = width; if ( height > -1 ) height1 = height; +#ifdef __WXWINE__ + HWND hParent = (HWND)NULL; +#else HWND hParent = NULL; +#endif if ( parent ) hParent = (HWND) parent->GetHWND();