]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
take pixel sizes into account as well when comparing fonts, not just point sizes...
[wxWidgets.git] / src / common / wincmn.cpp
index 9e8bc62c7c5837b766951c846ec59c9a8d9d85d2..7bf7177a6aa6d668803258e44f89cd2fd72b78d5 100644 (file)
     #include "wx/statusbr.h"
     #include "wx/toolbar.h"
     #include "wx/dcclient.h"
-#endif //WX_PRECOMP
-
-#if defined(__WXMAC__) && wxUSE_SCROLLBAR
     #include "wx/scrolbar.h"
-#endif
-
-#if wxUSE_CONSTRAINTS
     #include "wx/layout.h"
-#endif // wxUSE_CONSTRAINTS
-
-#include "wx/sizer.h"
+    #include "wx/sizer.h"
+#endif //WX_PRECOMP
 
 #if wxUSE_DRAG_AND_DROP
     #include "wx/dnd.h"
 // For reporting compile- and runtime version of GTK+ in the ctrl+alt+mclick dialog.
 // The gtk includes don't pull any other headers in, at least not on my system - MR
 #ifdef __WXGTK__
-    #include <gtk/gtkversion.h>
+    #ifdef __WXGTK20__
+        #include <gtk/gtkversion.h>
+    #else
+        #include <gtk/gtkfeatures.h>
+    #endif
     extern const unsigned int gtk_major_version;
     extern const unsigned int gtk_minor_version;
     extern const unsigned int gtk_micro_version;
@@ -1472,7 +1469,10 @@ void wxWindowBase::SetHelpTextForId(const wxString& text)
 }
 
 // get the help string associated with this window (may be empty)
-wxString wxWindowBase::GetHelpText() const
+// default implementation forwards calls to the help provider
+wxString
+wxWindowBase::GetHelpTextAtPoint(const wxPoint & WXUNUSED(pt),
+                                 wxHelpEvent::Origin WXUNUSED(origin)) const
 {
     wxString text;
     wxHelpProvider *helpProvider = wxHelpProvider::Get();
@@ -1490,7 +1490,7 @@ void wxWindowBase::OnHelp(wxHelpEvent& event)
     wxHelpProvider *helpProvider = wxHelpProvider::Get();
     if ( helpProvider )
     {
-        if ( helpProvider->ShowHelp(this) )
+        if ( helpProvider->ShowHelpAtPoint(this, event.GetPosition(), event.GetOrigin()) )
         {
             // skip the event.Skip() below
             return;
@@ -2804,7 +2804,7 @@ wxAccStatus wxWindowAccessible::GetDescription(int WXUNUSED(childId), wxString*
     if (!GetWindow())
         return wxACC_FAIL;
 
-    wxString ht(GetWindow()->GetHelpText());
+    wxString ht(GetWindow()->GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Keyboard));
     if (!ht.empty())
     {
         *description = ht;
@@ -2820,7 +2820,7 @@ wxAccStatus wxWindowAccessible::GetHelpText(int WXUNUSED(childId), wxString* hel
     if (!GetWindow())
         return wxACC_FAIL;
 
-    wxString ht(GetWindow()->GetHelpText());
+    wxString ht(GetWindow()->GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Keyboard));
     if (!ht.empty())
     {
         *helpText = ht;