]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
Fixed wxexpr.cpp bug (quote wasn't being removed in new MB code);
[wxWidgets.git] / src / common / event.cpp
index 07c9462cfffaf6f434fb5afc447a037a77f04a1c..904178bc7b6445666a2d30d3c60c18c83d7e64ce 100644 (file)
@@ -171,7 +171,7 @@ bool wxMouseEvent::ButtonDClick(int but) const
         case 3:
             return RightDClick();
         default:
-            wxFAIL_MSG("invalid parameter in wxMouseEvent::ButtonDClick");
+            wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDClick"));
     }
 
     return FALSE;
@@ -192,7 +192,7 @@ bool wxMouseEvent::ButtonDown(int but) const
         case 3:
             return RightDown();
         default:
-            wxFAIL_MSG("invalid parameter in wxMouseEvent::ButtonDown");
+            wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDown"));
     }
 
     return FALSE;
@@ -212,7 +212,7 @@ bool wxMouseEvent::ButtonUp(int but) const
         case 3:
             return RightUp();
         default:
-            wxFAIL_MSG("invalid parameter in wxMouseEvent::ButtonUp");
+            wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonUp"));
     }
 
     return FALSE;
@@ -231,7 +231,7 @@ bool wxMouseEvent::Button(int but) const
         case 3:
             return (RightDown() || RightUp() || RightDClick());
         default:
-            wxFAIL_MSG("invalid parameter in wxMouseEvent::Button");
+            wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::Button"));
     }
 
     return FALSE;
@@ -249,7 +249,7 @@ bool wxMouseEvent::ButtonIsDown(int but) const
         case 3:
             return RightIsDown();
         default:
-            wxFAIL_MSG("invalid parameter in wxMouseEvent::ButtonIsDown");
+            wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonIsDown"));
     }
 
     return FALSE;
@@ -511,7 +511,7 @@ void wxEvtHandler::Connect( int id, int lastId,
 bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
 {
     wxCHECK_MSG( m_dynamicEvents, FALSE,
-                 "caller should check that we have dynamic events" );
+                 _T("caller should check that we have dynamic events") );
 
     int commandId = event.GetId();
 
@@ -555,3 +555,26 @@ bool wxEvtHandler::OnClose()
 }
 #endif // WXWIN_COMPATIBILITY
 
+// Find a window with the focus, that is also a descendant of the given window.
+// This is used to determine the window to initially send commands to.
+wxWindow* wxFindFocusDescendant(wxWindow* ancestor)
+{
+    // Process events starting with the window with the focus, if any.
+    wxWindow* focusWin = wxWindow::FindFocus();
+    wxWindow* win = focusWin;
+
+    // Check if this is a descendant of this frame.
+    // If not, win will be set to NULL.
+    while (win)
+    {
+        if (win == ancestor)
+            break;
+        else
+            win = win->GetParent();
+    }
+    if (win == (wxWindow*) NULL)
+        focusWin = (wxWindow*) NULL;
+
+    return focusWin;
+}
+