#include <string.h>
-#ifndef __GNUWIN32__
+#if !defined(__GNUWIN32__)|| defined(wxUSE_NORLANDER_HEADERS)
#include <shellapi.h>
#include <mmsystem.h>
#endif
#include <windowsx.h>
#endif
-#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ )
+#if ( defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS)
#include <commctrl.h>
#endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__
- #include <wx/msw/gnuwin32/extra.h>
+ #ifndef wxUSE_NORLANDER_HEADERS
+ #include <wx/msw/gnuwin32/extra.h>
+ #endif
#endif
#endif
{
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);
// 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)
// 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 )
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
// 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();
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(""),
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();