]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
more backwards compatible kbd handling in wxScrolledWindow
[wxWidgets.git] / src / msw / app.cpp
index 5f32a13e2041707c2ed66d91e153c0543a7ee48a..1be88f6a6eb0f08a7a33f50c0e58a02d78d00cf2 100644 (file)
     #include "wx/resource.h"
 #endif
 
+#if wxUSE_TOOLTIPS
+    #include "wx/tooltip.h"
+#endif // wxUSE_TOOLTIPS
+
 // OLE is used for drag-and-drop, clipboard, OLE Automation...
 #ifndef wxUSE_NORLANDER_HEADERS
 #if defined(__GNUWIN32__) || defined(__SC__) || defined(__SALFORDC__)
@@ -959,19 +963,24 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg)
 {
     MSG *msg = (MSG *)wxmsg;
     HWND hWnd = msg->hwnd;
-    wxWindow *wndThis = wxFindWinFromHandle((WXHWND)hWnd), *wnd;
+    wxWindow *wndThis = wxGetWindowFromHWND((WXHWND)hWnd);
 
-    // for some composite controls (like a combobox), wndThis might be NULL
-    // because the subcontrol is not a wxWindow, but only the control itself
-    // is - try to catch this case
-    while ( hWnd && !wndThis )
+#if wxUSE_TOOLTIPS
+    // we must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to
+    // popup the tooltip bubbles
+    if ( wndThis && (msg->message == WM_MOUSEMOVE) )
     {
-        hWnd = ::GetParent(hWnd);
-        wndThis = wxFindWinFromHandle((WXHWND)hWnd);
+        wxToolTip *tt = wndThis->GetToolTip();
+        if ( tt )
+        {
+            tt->RelayEvent(wxmsg);
+        }
     }
+#endif // wxUSE_TOOLTIPS
 
     // Try translations first; find the youngest window with
     // a translation table.
+    wxWindow *wnd;
     for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
     {
         if ( wnd->MSWTranslateMessage(wxmsg) )
@@ -1152,7 +1161,11 @@ int wxApp::GetComCtl32Version()
                     FARPROC theProc = ::GetProcAddress
                                         (
                                          hModuleComCtl32,
+#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x520)
+                                         "InitCommonControlsEx"
+#else
                                          _T("InitCommonControlsEx")
+#endif
                                         );
 
                     if ( !theProc )
@@ -1167,7 +1180,11 @@ int wxApp::GetComCtl32Version()
                         theProc = ::GetProcAddress
                                     (
                                      hModuleComCtl32,
+#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x520)
+                                     "InitializeFlatSB"
+#else
                                      _T("InitializeFlatSB")
+#endif
                                     );
                         if ( !theProc )
                         {
@@ -1262,6 +1279,6 @@ wxApp::GetStdIcon(int which) const
 
 // For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
 // if in a separate file. So include it here to ensure it's linked.
-#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__))
+#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__) && !defined(WXMAKINGDLL))
 #include "main.cpp"
 #endif