#endif
#ifndef WX_PRECOMP
+ #include <windows.h>
+ #include "wx/msw/winundef.h"
+ #include "wx/accel.h"
#include "wx/setup.h"
#include "wx/menu.h"
#include "wx/dc.h"
#include "wx/menuitem.h"
#include "wx/log.h"
+#include "wx/msw/private.h"
+
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
#endif
#include "wx/intl.h"
#include "wx/log.h"
-#include "wx/msw/private.h"
#include "wx/textctrl.h"
#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
// ---------------------------------------------------------------------------
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
// ---------------------------------------------------------------------------
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.
// drag and drop
// ---------------------------------------------------------------------------
-#if wxUSE_DRAG_AND_DROP
+#if wxUSE_DRAG_AND_DROP
void wxWindow::SetDropTarget(wxDropTarget *pDropTarget)
{
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
{
if ( externalLeading ) *externalLeading = tm.tmExternalLeading;
}
-#if wxUSE_CARET
+#if wxUSE_CARET && WXWIN_COMPATIBILITY
// ---------------------------------------------------------------------------
// Caret manipulation
// ---------------------------------------------------------------------------
void wxWindow::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
{
- *control = (WXHWND)LOWORD(lParam);
+ *hwnd = (WXHWND)LOWORD(lParam);
*nCtlColor = (int)HIWORD(lParam);
*hdc = (WXHDC)wParam;
}
break;
case WM_PAINT:
+ wxStartPainting();
processed = HandlePaint();
+ wxEndPainting();
break;
case WM_CLOSE:
}
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).
break;
case WM_GETMINMAXINFO:
- processed = HandleGetMinMaxInfo((LPMINMAXINFO)lParam);
+ processed = HandleGetMinMaxInfo((MINMAXINFO*)lParam);
break;
case WM_SETCURSOR:
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();
return FALSE;
}
-#if wxUSE_OWNER_DRAWN
// ---------------------------------------------------------------------------
// owner drawn stuff
// ---------------------------------------------------------------------------
bool wxWindow::MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *itemStruct)
{
+#if wxUSE_OWNER_DRAWN
// is it a menu item?
if ( id == 0 )
{
return ((wxControl *)item)->MSWOnDraw(itemStruct);
}
else
+#endif
return FALSE;
+
}
bool wxWindow::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
{
+#if wxUSE_OWNER_DRAWN
// is it a menu item?
if ( id == 0 )
{
{
return ((wxControl *)item)->MSWOnMeasure(itemStruct);
}
-
+#endif // owner-drawn menus
return FALSE;
}
-#endif // owner-drawn menus
// ---------------------------------------------------------------------------
// colours and palettes