]> git.saurik.com Git - wxWidgets.git/commitdiff
Enabling the Pop Menu fix to peek at all the command messages. Required adding a...
authorDavid Webster <Dave.Webster@bhmi.com>
Fri, 8 Jun 2001 15:24:37 +0000 (15:24 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Fri, 8 Jun 2001 15:24:37 +0000 (15:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/accel.cpp
src/os2/app.cpp
src/os2/frame.cpp
src/os2/window.cpp
src/os2/wx23.def

index 611f53c95985557305158c9a98b50e1738a28121..a93f7f1af67c6493a25277ffdc68e6284b3fe8e9 100644 (file)
@@ -120,11 +120,20 @@ wxAcceleratorTable::wxAcceleratorTable(
         USHORT                      uVirt = AF_CHAR;
 
         if (vaEntries[i].GetFlags() & wxACCEL_ALT)
+        {
             uVirt |= AF_ALT;
+            uVirt |= AF_VIRTUALKEY;
+        }
         if (vaEntries[i].GetFlags() & wxACCEL_SHIFT)
+        {
             uVirt |= AF_SHIFT;
+            uVirt |= AF_VIRTUALKEY;
+        }
         if (vaEntries[i].GetFlags() & wxACCEL_CTRL)
+        {
             uVirt |= AF_CONTROL;
+            uVirt |= AF_VIRTUALKEY;
+        }
 
         bool                        bIsVirtual;
         USHORT                      uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
index bd4b47a6cfe26610e2e3b41c2a5f70a4be9e18e5..61d3cdc3c689cb1cae4c1a7ebb6b3ead8c89b26b 100644 (file)
@@ -787,15 +787,24 @@ bool wxApp::DoMessage()
         }
 #endif // wxUSE_THREADS
 
+        //
         // Process the message
-        if (!ProcessMessage((WXMSG *)&svCurrentMsg))
-        {
-            ::WinDispatchMsg(vHabmain, (PQMSG)&svCurrentMsg);
-        }
+        //
+        DoMessage((WXMSG *)&svCurrentMsg);
     }
     return TRUE;
 } // end of wxApp::DoMessage
 
+void wxApp::DoMessage(
+  WXMSG*                            pMsg
+)
+{
+    if (!ProcessMessage((WXMSG *)&svCurrentMsg))
+    {
+        ::WinDispatchMsg(vHabmain, (PQMSG)&svCurrentMsg);
+    }
+} // end of wxApp::DoMessage
+
 //////////////////////////////////////////////////////////////////////////////
 //
 // Keep trying to process messages until WM_QUIT
index dbc1e6be9811e0737f368cf323278dc4001fb065..838197f4d40cb3df3eb1d6b03c085c9500d8782a 100644 (file)
@@ -341,15 +341,9 @@ void wxFrame::DoGetPosition(
     POINTL                          vPoint;
 
     ::WinQueryWindowRect(m_hFrame, &vRect);
-    vPoint.x = vRect.xLeft;
 
-    //
-    // OS/2 is backwards [WIN32 it is vRect.yTop]
-    //
-    vPoint.y = vRect.yBottom;
-
-    *pX = vPoint.x;
-    *pY = vPoint.y;
+    *pX = vRect.xRight - vRect.xLeft;
+    *pY = vRect.yTop - vRect.yBottom;
 } // end of wxFrame::DoGetPosition
 
 // ----------------------------------------------------------------------------
@@ -1356,6 +1350,7 @@ bool wxFrame::HandleSize(
             // restore all child frames too
             //
             IconizeChildFrames(FALSE);
+            (void)SendIconizeEvent(FALSE);
 
             //
             // fall through
@@ -1370,6 +1365,7 @@ bool wxFrame::HandleSize(
             // Iconize all child frames too
             //
             IconizeChildFrames(TRUE);
+            (void)SendIconizeEvent();
             m_bIconized = TRUE;
             break;
     }
index 8da4f9c1a7a5532a56b0dd2d9032c30727f73731..26e94bc0cc10c6e7ea3114bde094d5b9ee2020de 100644 (file)
@@ -1810,6 +1810,26 @@ void wxWindow::GetCaretPos(
 // popup menu
 // ---------------------------------------------------------------------------
 
+static void wxYieldForCommandsOnly()
+{
+    //
+    // Peek all WM_COMMANDs (it will always return WM_QUIT too but we don't
+    // want to process it here)
+    //
+    QMSG                            vMsg;
+
+    while (::WinPeekMsg( vHabmain
+                        ,&vMsg
+                        ,(HWND)0
+                        ,WM_COMMAND
+                        ,WM_COMMAND
+                        ,PM_REMOVE
+                       ) && vMsg.msg != WM_QUIT)
+    {
+        wxTheApp->DoMessage((WXMSG*)&vMsg);
+    }
+}
+
 bool wxWindow::DoPopupMenu(
   wxMenu*                           pMenu
 , int                               nX
@@ -1836,7 +1856,14 @@ bool wxWindow::DoPopupMenu(
                    ,0L
                    ,PU_MOUSEBUTTON2DOWN | PU_MOUSEBUTTON2 | PU_KEYBOARD
                   );
-    wxYield();
+    // we need to do it righ now as otherwise the events are never going to be
+    // sent to wxCurrentPopupMenu from HandleCommand()
+    //
+    // note that even eliminating (ugly) wxCurrentPopupMenu global wouldn't
+    // help and we'd still need wxYieldForCommandsOnly() as the menu may be
+    // destroyed as soon as we return (it can be a local variable in the caller
+    // for example) and so we do need to process the event immediately
+    wxYieldForCommandsOnly();
     wxCurrentPopupMenu = NULL;
 
     pMenu->SetInvokingWindow(NULL);
index 6d128609f808a03fc75de099930bfafffa4a7318..80f73e8df43592fee4321e38deae2ebcfa3ee8bd 100644 (file)
@@ -11163,6 +11163,8 @@ EXPORTS
       DoMessage__5wxAppFv
       ;wxExit()
       wxExit__Fv
+      ;wxApp::DoMessage(void**)
+      DoMessage__5wxAppFPPv
       ;wxApp::Dispatch()
       Dispatch__5wxAppFv
       ;wxEntry(int,char**)