]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
*** empty log message ***
[wxWidgets.git] / src / msw / window.cpp
index 48cf53abc9e6a0402be325d763d70583ad7b200d..3f8c4085f70dc197b4611404d513ec03b8b82f91 100644 (file)
@@ -129,10 +129,6 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd);
 // mouse clicks
 static void TranslateKbdEventToMouse(wxWindow *win, int *x, int *y, WPARAM *flags);
 
 // mouse clicks
 static void TranslateKbdEventToMouse(wxWindow *win, int *x, int *y, WPARAM *flags);
 
-// get the current state of SHIFT/CTRL keys
-static inline bool IsShiftDown() { return (GetKeyState(VK_SHIFT) & 0x100) != 0; }
-static inline bool IsCtrlDown() { return (GetKeyState(VK_CONTROL) & 0x100) != 0; }
-
 // ---------------------------------------------------------------------------
 // event tables
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // event tables
 // ---------------------------------------------------------------------------
@@ -274,7 +270,8 @@ wxWindow::~wxWindow()
 
     if ( m_hWnd )
     {
 
     if ( m_hWnd )
     {
-        if (::IsWindow(GetHwnd()))
+        // VZ: test temp removed to understand what really happens here
+        //if (::IsWindow(GetHwnd()))
         {
             if ( !::DestroyWindow(GetHwnd()) )
                 wxLogLastError("DestroyWindow");
         {
             if ( !::DestroyWindow(GetHwnd()) )
                 wxLogLastError("DestroyWindow");
@@ -973,9 +970,9 @@ void wxWindow::OnIdle(wxIdleEvent& event)
             // by the time the OnIdle function is called, so 'state' may be
             // meaningless.
             int state = 0;
             // by the time the OnIdle function is called, so 'state' may be
             // meaningless.
             int state = 0;
-            if ( ::GetKeyState(VK_SHIFT) != 0 )
+            if ( wxIsShiftDown() )
                 state |= MK_SHIFT;
                 state |= MK_SHIFT;
-            if ( ::GetKeyState(VK_CONTROL) != 0 )
+            if ( wxIsCtrlDown() )
                 state |= MK_CONTROL;
 
             wxMouseEvent event(wxEVT_LEAVE_WINDOW);
                 state |= MK_CONTROL;
 
             wxMouseEvent event(wxEVT_LEAVE_WINDOW);
@@ -1482,8 +1479,8 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
 
         if ( bProcess )
         {
 
         if ( bProcess )
         {
-            bool bCtrlDown = IsCtrlDown();
-            bool bShiftDown = IsShiftDown();
+            bool bCtrlDown = wxIsCtrlDown();
+            bool bShiftDown = wxIsShiftDown();
 
             // WM_GETDLGCODE: ask the control if it wants the key for itself,
             // don't process it if it's the case (except for Ctrl-Tab/Enter
 
             // WM_GETDLGCODE: ask the control if it wants the key for itself,
             // don't process it if it's the case (except for Ctrl-Tab/Enter
@@ -1598,7 +1595,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
             // don't process system keys here
             if ( !(HIWORD(msg->lParam) & KF_ALTDOWN) )
             {
             // don't process system keys here
             if ( !(HIWORD(msg->lParam) & KF_ALTDOWN) )
             {
-                if ( (msg->wParam == VK_TAB) && IsCtrlDown() )
+                if ( (msg->wParam == VK_TAB) && wxIsCtrlDown() )
                 {
                     // find the first notebook parent and change its page
                     wxWindow *win = this;
                 {
                     // find the first notebook parent and change its page
                     wxWindow *win = this;
@@ -1611,7 +1608,7 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg)
 
                     if ( nbook )
                     {
 
                     if ( nbook )
                     {
-                        bool forward = !IsShiftDown();
+                        bool forward = !wxIsShiftDown();
 
                         nbook->AdvanceSelection(forward);
                     }
 
                         nbook->AdvanceSelection(forward);
                     }
@@ -3159,8 +3156,8 @@ wxKeyEvent wxWindow::CreateKeyEvent(wxEventType evType,
 {
     wxKeyEvent event(evType);
     event.SetId(GetId());
 {
     wxKeyEvent event(evType);
     event.SetId(GetId());
-    event.m_shiftDown = IsShiftDown();
-    event.m_controlDown = IsCtrlDown();
+    event.m_shiftDown = wxIsShiftDown();
+    event.m_controlDown = wxIsCtrlDown();
     event.m_altDown = (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN;
 
     event.m_eventObject = (wxWindow *)this; // const_cast
     event.m_altDown = (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN;
 
     event.m_eventObject = (wxWindow *)this; // const_cast
@@ -3714,8 +3711,8 @@ wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
 
             event.m_eventObject = NULL;
             event.m_keyCode = id;
 
             event.m_eventObject = NULL;
             event.m_keyCode = id;
-            event.m_shiftDown = IsShiftDown();
-            event.m_controlDown = IsCtrlDown();
+            event.m_shiftDown = wxIsShiftDown();
+            event.m_controlDown = wxIsCtrlDown();
             event.SetTimestamp(s_currentMsg.time);
 
             wxWindow *win = wxGetActiveWindow();
             event.SetTimestamp(s_currentMsg.time);
 
             wxWindow *win = wxGetActiveWindow();
@@ -4167,9 +4164,9 @@ static void TranslateKbdEventToMouse(wxWindow *win, int *x, int *y, WPARAM *flag
     WPARAM& fwKeys = *flags;
 
     fwKeys = MK_RBUTTON;
     WPARAM& fwKeys = *flags;
 
     fwKeys = MK_RBUTTON;
-    if ( (::GetKeyState(VK_CONTROL) & 0x100) != 0 )
+    if ( wxIsCtrlDown() )
         fwKeys |= MK_CONTROL;
         fwKeys |= MK_CONTROL;
-    if ( (::GetKeyState(VK_SHIFT) & 0x100) != 0 )
+    if ( wxIsShiftDown() )
         fwKeys |= MK_SHIFT;
 
     // simulate right mouse button click
         fwKeys |= MK_SHIFT;
 
     // simulate right mouse button click