#ifndef WX_PRECOMP
#include <windows.h>
#include "wx/msw/winundef.h"
+ #include "wx/window.h"
#include "wx/accel.h"
#include "wx/setup.h"
#include "wx/menu.h"
#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();
btn = panel->GetDefaultItem();
}
- if ( btn )
+ if ( btn && btn->IsEnabled() )
{
// if we do have a default button, do press it
btn->MSWCommand(BN_CLICKED, 0 /* unused */);
case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK:
{
- int x = LOWORD(lParam);
- int y = HIWORD(lParam);
+ short x = LOWORD(lParam);
+ short y = HIWORD(lParam);
processed = HandleMouseEvent(message, x, y, wParam);
}
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();