]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Applied [ 745533 ] implemented wxNotebook::DoGetBestSize
[wxWidgets.git] / src / msw / window.cpp
index babca8cf0052695c558aa5cec03516a3d27d7c72..f5db90dc550348a211e1c657c8bf0fd51fc08368 100644 (file)
@@ -60,6 +60,7 @@
 
 #if wxUSE_ACCESSIBILITY
     #include "wx/access.h"
 
 #if wxUSE_ACCESSIBILITY
     #include "wx/access.h"
+    #include <ole2.h>
     #include <oleacc.h>
     #ifndef WM_GETOBJECT
         #define WM_GETOBJECT 0x003D
     #include <oleacc.h>
     #ifndef WM_GETOBJECT
         #define WM_GETOBJECT 0x003D
     #include <windowsx.h>
 #endif
 
     #include <windowsx.h>
 #endif
 
-#if (!defined(__GNUWIN32_OLD__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__)) || defined(__CYGWIN10__)
+#if (!defined(__GNUWIN32_OLD__) && !defined(__WXMICROWIN__)) || defined(__CYGWIN10__)
     #ifdef __WIN95__
         #include <commctrl.h>
     #endif
 #elif !defined(__WXMICROWIN__) // broken compiler
     #ifdef __WIN95__
         #include <commctrl.h>
     #endif
 #elif !defined(__WXMICROWIN__) // broken compiler
-    #ifndef __TWIN32__
-        #include "wx/msw/gnuwin32/extra.h"
-    #endif
+    #include "wx/msw/gnuwin32/extra.h"
+#endif
+
+#if defined(__GNUG__)
+#include "wx/msw/missing.h"
 #endif
 
 // ----------------------------------------------------------------------------
 #endif
 
 // ----------------------------------------------------------------------------
 
 #ifndef VK_OEM_1
     #define VK_OEM_1        0xBA
 
 #ifndef VK_OEM_1
     #define VK_OEM_1        0xBA
-    #define VK_OEM_PLUS     0xBB
-    #define VK_OEM_COMMA    0xBC
-    #define VK_OEM_MINUS    0xBD
-    #define VK_OEM_PERIOD   0xBE
     #define VK_OEM_2        0xBF
     #define VK_OEM_3        0xC0
     #define VK_OEM_4        0xDB
     #define VK_OEM_2        0xBF
     #define VK_OEM_3        0xC0
     #define VK_OEM_4        0xDB
     #define VK_OEM_7        0xDE
 #endif
 
     #define VK_OEM_7        0xDE
 #endif
 
+#ifndef VK_OEM_COMMA
+    #define VK_OEM_PLUS     0xBB
+    #define VK_OEM_COMMA    0xBC
+    #define VK_OEM_MINUS    0xBD
+    #define VK_OEM_PERIOD   0xBE
+#endif
+
 // ---------------------------------------------------------------------------
 // global variables
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // global variables
 // ---------------------------------------------------------------------------
@@ -697,7 +703,7 @@ void wxWindowMSW::MSWDeviceToLogical (float *x, float *y) const
 // ---------------------------------------------------------------------------
 
 // convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
 // ---------------------------------------------------------------------------
 
 // convert wxHORIZONTAL/wxVERTICAL to SB_HORZ/SB_VERT
-static inline wxDirToWinStyle(int orient)
+static inline int wxDirToWinStyle(int orient)
 {
     return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
 }
 {
     return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
 }
@@ -1032,6 +1038,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
     // Windows XP. Instead we get the appropriate style for the theme.
 
     if (border == wxBORDER_DEFAULT && wxTheApp->GetAuto3D() && 
     // Windows XP. Instead we get the appropriate style for the theme.
 
     if (border == wxBORDER_DEFAULT && wxTheApp->GetAuto3D() && 
+        IsKindOf(CLASSINFO(wxControl)) &&
         GetParent() && (GetParent()->IsKindOf(CLASSINFO(wxPanel)) ||
                         GetParent()->IsKindOf(CLASSINFO(wxDialog))) &&
         ((GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
         GetParent() && (GetParent()->IsKindOf(CLASSINFO(wxPanel)) ||
                         GetParent()->IsKindOf(CLASSINFO(wxDialog))) &&
         ((GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
@@ -1067,7 +1074,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
                 break;
 
             case wxBORDER_RAISED:
                 break;
 
             case wxBORDER_RAISED:
-                *exstyle |= WS_EX_WINDOWEDGE;
+                *exstyle |= WS_EX_DLGMODALFRAME;
                 break;
 
             case wxBORDER_SUNKEN:
                 break;
 
             case wxBORDER_SUNKEN:
@@ -3962,7 +3969,10 @@ void wxWindowMSW::InitMouseEvent(wxMouseEvent& event,
     event.m_leftDown = (flags & MK_LBUTTON) != 0;
     event.m_middleDown = (flags & MK_MBUTTON) != 0;
     event.m_rightDown = (flags & MK_RBUTTON) != 0;
     event.m_leftDown = (flags & MK_LBUTTON) != 0;
     event.m_middleDown = (flags & MK_MBUTTON) != 0;
     event.m_rightDown = (flags & MK_RBUTTON) != 0;
-    event.m_altDown = (::GetKeyState(VK_MENU) & 0x80000000) != 0;
+ //   event.m_altDown = (::GetKeyState(VK_MENU) & 0x80000000) != 0;
+    // Returns different negative values on WinME and WinNT,
+    // so simply test for negative value.
+    event.m_altDown = ::GetKeyState(VK_MENU) < 0;
 
     event.SetTimestamp(s_currentMsg.time);
     event.m_eventObject = this;
 
     event.SetTimestamp(s_currentMsg.time);
     event.m_eventObject = this;
@@ -4817,7 +4827,7 @@ void wxSetKeyboardHook(bool doIt)
         wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance());
         wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
 
         wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance());
         wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
 
-#if defined(__WIN32__) && !defined(__TWIN32__)
+#if defined(__WIN32__)
             GetCurrentThreadId()
         //      (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
 #else
             GetCurrentThreadId()
         //      (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
 #else