]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Lineup features of all book driven events.
[wxWidgets.git] / include / wx / defs.h
index 2e933f17d07fb6e0f4557e4f1f6e1e3c4d872540..38f99915107517408884e782288b99e1360e5f98 100644 (file)
@@ -309,9 +309,24 @@ typedef int wxWindowID;
     }
 
     #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
-#else /* !__INTELC__ */
+
+#elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310
+    template <typename T, typename X>
+    inline T wx_truncate_cast_impl(X x)
+    {
+        #pragma warning(push)
+        /* conversion from 'X' to 'T', possible loss of data */
+        #pragma warning(disable: 4267)
+
+        return x;
+
+        #pragma warning(pop)
+    }
+
+    #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+#else
     #define wx_truncate_cast(t, x) ((t)(x))
-#endif /* __INTELC__/!__INTELC__ */
+#endif
 
 /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
 #define wxConstCast(obj, className) wx_const_cast(className *, obj)
@@ -1515,38 +1530,59 @@ enum wxBorder
 #define wxSP_ARROW_KEYS       0x1000
 #define wxSP_WRAP             0x2000
 
+/*
+ * wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook)
+ */
+
+#define wxBK_DEFAULT          0x0000
+#define wxBK_TOP              0x0010
+#define wxBK_BOTTOM           0x0020
+#define wxBK_LEFT             0x0040
+#define wxBK_RIGHT            0x0080
+#define wxBK_ALIGN_MASK       ( wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT )
+
 /*
  * wxNotebook flags
  */
-#define wxNB_FIXEDWIDTH       0x0010
-#define wxNB_TOP              0x0000    /*  default */
-#define wxNB_LEFT             0x0020
-#define wxNB_RIGHT            0x0040
-#define wxNB_BOTTOM           0x0080
-#define wxNB_MULTILINE        0x0100
-#define wxNB_NOPAGETHEME      0x0200
-#define wxNB_FLAT             0x0400
-#define wxNB_DEFAULT          wxNB_TOP
+#if WXWIN_COMPATIBILITY_2_6
+/* Use common book wxBK_* flags for describing alignment */
+#define wxNB_DEFAULT          wxBK_DEFAULT
+#define wxNB_TOP              wxBK_TOP
+#define wxNB_BOTTOM           wxBK_BOTTOM
+#define wxNB_LEFT             wxBK_LEFT
+#define wxNB_RIGHT            wxBK_RIGHT
+#endif
+
+#define wxNB_FIXEDWIDTH       0x0100
+#define wxNB_MULTILINE        0x0200
+#define wxNB_NOPAGETHEME      0x0400
+#define wxNB_FLAT             0x0800
 
 /*
  * wxListbook flags
  */
-#define wxLB_DEFAULT          0x0
-#define wxLB_TOP              0x1
-#define wxLB_BOTTOM           0x2
-#define wxLB_LEFT             0x4
-#define wxLB_RIGHT            0x8
-#define wxLB_ALIGN_MASK       0xf
+#if WXWIN_COMPATIBILITY_2_6
+/* Use common book wxBK_* flags for describing alignment */
+#define wxLB_DEFAULT          wxBK_DEFAULT
+#define wxLB_TOP              wxBK_TOP
+#define wxLB_BOTTOM           wxBK_BOTTOM
+#define wxLB_LEFT             wxBK_LEFT
+#define wxLB_RIGHT            wxBK_RIGHT
+#define wxLB_ALIGN_MASK       wxBK_ALIGN_MASK
+#endif
 
 /*
  * wxChoicebook flags
  */
-#define wxCHB_DEFAULT         0x0
-#define wxCHB_TOP             0x1
-#define wxCHB_BOTTOM          0x2
-#define wxCHB_LEFT            0x4
-#define wxCHB_RIGHT           0x8
-#define wxCHB_ALIGN_MASK      0xf
+#if WXWIN_COMPATIBILITY_2_6
+/* Use common book wxBK_* flags for describing alignment */
+#define wxCHB_DEFAULT          wxBK_DEFAULT
+#define wxCHB_TOP              wxBK_TOP
+#define wxCHB_BOTTOM           wxBK_BOTTOM
+#define wxCHB_LEFT             wxBK_LEFT
+#define wxCHB_RIGHT            wxBK_RIGHT
+#define wxCHB_ALIGN_MASK       wxBK_ALIGN_MASK
+#endif
 
 /*
  * wxTabCtrl flags
@@ -2114,16 +2150,23 @@ enum wxKeyCode
     WXK_SPECIAL20
 };
 
-#if wxUSE_HOTKEY
-enum wxHotkeyModifier
+/* This enum contains bit mask constants used in wxKeyEvent */
+enum wxKeyModifier
 {
-    wxMOD_NONE = 0,
-    wxMOD_ALT = 1,
-    wxMOD_CONTROL = 2,
-    wxMOD_SHIFT = 4,
-    wxMOD_WIN = 8
-};
+    wxMOD_NONE      = 0x0000,
+    wxMOD_ALT       = 0x0001,
+    wxMOD_CONTROL   = 0x0002,
+    wxMOD_ALTGR     = wxMOD_ALT | wxMOD_CONTROL,
+    wxMOD_SHIFT     = 0x0004,
+    wxMOD_META      = 0x0008,
+    wxMOD_WIN       = wxMOD_META,
+#if defined(__WXMAC__) || defined(__WXCOCOA__)
+    wxMOD_CMD       = wxMOD_META,
+#else
+    wxMOD_CMD       = wxMOD_CONTROL,
 #endif
+    wxMOD_ALL       = 0xffff
+};
 
 /*  Mapping modes (same values as used by Windows, don't change) */
 enum
@@ -2844,5 +2887,32 @@ typedef struct window_t *WXWidget;
     private:                                    \
         classname& operator=(const classname&);
 
+/*  --------------------------------------------------------------------------- */
+/*  If a manifest is being automatically generated, add common controls 6 to it */
+/*  --------------------------------------------------------------------------- */
+
+#if (!defined wxUSE_NO_MANIFEST || wxUSE_NO_MANIFEST == 0 ) && \
+    ( defined _MSC_FULL_VER && _MSC_FULL_VER >= 140040130 )
+
+#define WX_CC_MANIFEST(cpu)                     \
+    "/manifestdependency:\"type='win32'         \
+     name='Microsoft.Windows.Common-Controls'   \
+     version='6.0.0.0'                          \
+     processorArchitecture='"cpu"'              \
+     publicKeyToken='6595b64144ccf1df'          \
+     language='*'\""
+
+#if defined _M_IX86
+    #pragma comment(linker, WX_CC_MANIFEST("x86"))
+#elif defined _M_X64
+    #pragma comment(linker, WX_CC_MANIFEST("amd64"))
+#elif defined _M_IA64
+    #pragma comment(linker, WX_CC_MANIFEST("ia64"))
+#else
+    #pragma comment(linker, WX_CC_MANIFEST("*"))
+#endif
+
+#endif /* !wxUSE_NO_MANIFEST && _MSC_FULL_VER >= 140040130 */
+
 #endif
     /*  _WX_DEFS_H_ */