#include <windows.h>
+// undefine conflicting symbols which were defined in windows.h
+#include "wx/msw/winundef.h"
+
class WXDLLEXPORT wxFont;
+class WXDLLEXPORT wxWindow;
+
+// ---------------------------------------------------------------------------
+// private constants
+// ---------------------------------------------------------------------------
+
+// Conversion
+static const double METRIC_CONVERSION_CONSTANT = 0.0393700787;
+
+// Scaling factors for various unit conversions
+static const double mm2inches = (METRIC_CONVERSION_CONSTANT);
+static const double inches2mm = (1/METRIC_CONVERSION_CONSTANT);
+
+static const double mm2twips = (METRIC_CONVERSION_CONSTANT*1440);
+static const double twips2mm = (1/(METRIC_CONVERSION_CONSTANT*1440));
+
+static const double mm2pt = (METRIC_CONVERSION_CONSTANT*72);
+static const double pt2mm = (1/(METRIC_CONVERSION_CONSTANT*72));
// ---------------------------------------------------------------------------
// standard icons from the resources
// this defines a CASTWNDPROC macro which casts a pointer to the type of a
// window proc
// ---------------------------------------------------------------------------
-#ifdef __GNUWIN32__
+
+#if defined(__GNUWIN32__) && !defined(__MINGW32__)
# define CASTWNDPROC (long unsigned)
#else
# ifdef __BORLANDC__
typedef int (pascal * WndProcCast) ();
# define CASTWNDPROC (WndProcCast)
# else
- typedef int (PASCAL * WndProcCast) ();
-# define CASTWNDPROC (WndProcCast)
+# if defined(__VISUALC__) && defined(STRICT)
+# define CASTWNDPROC (WNDPROC)
+# else
+ typedef int (PASCAL * WndProcCast) ();
+# define CASTWNDPROC (WndProcCast)
+# endif
# endif
# else
# define CASTWNDPROC
#endif
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
+#ifndef STRICT
#define DLGPROC FARPROC
#endif
+#endif
#if wxUSE_PENWIN
WXDLLEXPORT void wxRegisterPenWin();
* for this combination of CTl3D/FAFA settings
*/
-#define STATIC_CLASS "STATIC"
+#define STATIC_CLASS _T("STATIC")
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
-#define CHECK_CLASS "BUTTON"
+#define CHECK_CLASS _T("BUTTON")
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
#define CHECK_IS_FAFA FALSE
-#define RADIO_CLASS "BUTTON"
+#define RADIO_CLASS _T("BUTTON")
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
#define RADIO_SIZE 20
#define RADIO_IS_FAFA FALSE
#define PURE_WINDOWS
-#define GROUP_CLASS "BUTTON"
+#define GROUP_CLASS _T("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
/*
#endif // USE_DBWIN32
// ---------------------------------------------------------------------------
-// macros to make casting between WXFOO and FOO a bit easier
+// macros to make casting between WXFOO and FOO a bit easier: the GetFoo()
+// returns Foo cast to the Windows type for oruselves, while GetFoosFoo() takes
+// an argument which should be a pointer to wxFoo (is this really clear?)
// ---------------------------------------------------------------------------
#define GetHwnd() ((HWND)GetHWND())
#define GetHdc() ((HDC)GetHDC())
+#define GetHicon() ((HICON)GetHICON())
+#define GetIconHicon(icon) ((HICON)(icon).GetHICON())
+
#define GetHaccel() ((HACCEL)GetHACCEL())
-#define GetTableHaccel(table) ((HACCEL)((table)->GetHACCEL()))
+#define GetTableHaccel(table) ((HACCEL)((table).GetHACCEL()))
// ---------------------------------------------------------------------------
// global data
// get the window class name
WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
-// get the window id
-WXDLLEXPORT extern wxWindowID wxGetWindowId(WXHWND hWnd);
+// get the window id (should be unsigned, hence this is not wxWindowID which
+// is, for mainly historical reasons, signed)
+WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
// Does this window style specify any border?
inline bool wxStyleHasBorder(long style)