X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/73927f8bac6a9392855eb20def7cf2a0049c05e4..2356708db31b737c6eae53c2316b642aa5a2e68d:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5f6bf803cf..b9dfdd75e1 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -80,7 +80,7 @@ #include -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS) #include #include #endif @@ -89,13 +89,15 @@ #include #endif -#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) +#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) #include #endif #ifndef __TWIN32__ #ifdef __GNUWIN32__ - #include + #ifndef wxUSE_NORLANDER_HEADERS + #include + #endif #endif #endif @@ -297,7 +299,8 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, { wxCHECK_MSG( parent, FALSE, _T("can't create wxWindow without parent") ); - CreateBase(parent, id, pos, size, style, name); + if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) + return FALSE; parent->AddChild(this); @@ -856,7 +859,8 @@ WXDWORD wxWindow::MakeExtendedStyle(long style, bool eliminateBorders) // Determines whether native 3D effects or CTL3D should be used, // applying a default border style if required, and returning an extended // style to pass to CreateWindowEx. -WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) +WXDWORD wxWindow::Determine3DEffects(WXDWORD defaultBorderStyle, + bool *want3D) const { // If matches certain criteria, then assume no 3D effects // unless specifically requested (dealt with in MakeExtendedStyle) @@ -1113,12 +1117,9 @@ void wxWindow::DoGetPosition(int *x, int *y) const // We may be faking the client origin. So a window that's really at (0, // 30) may appear (to wxWin apps) to be at (0, 0). - if ( parent ) - { - wxPoint pt(parent->GetClientAreaOrigin()); - point.x -= pt.x; - point.y -= pt.y; - } + wxPoint pt(parent->GetClientAreaOrigin()); + point.x -= pt.x; + point.y -= pt.y; } if ( x ) @@ -1370,10 +1371,14 @@ void wxWindow::GetTextExtent(const wxString& string, ReleaseDC(hWnd, dc); - if ( x ) *x = sizeRect.cx; - if ( y ) *y = sizeRect.cy; - if ( descent ) *descent = tm.tmDescent; - if ( externalLeading ) *externalLeading = tm.tmExternalLeading; + if ( x ) + *x = sizeRect.cx; + if ( y ) + *y = sizeRect.cy; + if ( descent ) + *descent = tm.tmDescent; + if ( externalLeading ) + *externalLeading = tm.tmExternalLeading; } #if wxUSE_CARET && WXWIN_COMPATIBILITY @@ -1422,7 +1427,7 @@ void wxWindow::GetCaretPos(int *x, int *y) const // popup menu // --------------------------------------------------------------------------- -bool wxWindow::PopupMenu(wxMenu *menu, int x, int y) +bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) { menu->SetInvokingWindow(this); menu->UpdateUI(); @@ -2252,6 +2257,12 @@ bool wxWindow::MSWCreate(int id, if ( style & WS_CHILD ) controlId = id; + wxString className(wclass); + if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE ) + { + className += _T("NR"); + } + m_hWnd = (WXHWND)CreateWindowEx(extendedStyle, wclass, title ? title : _T(""), @@ -3311,8 +3322,11 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font) SelectObject(dc,was); } ReleaseDC((HWND)wnd, dc); - *x = tm.tmAveCharWidth; - *y = tm.tmHeight + tm.tmExternalLeading; + + if ( x ) + *x = tm.tmAveCharWidth; + if ( y ) + *y = tm.tmHeight + tm.tmExternalLeading; // if ( the_font ) // the_font->ReleaseResource();