]> 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 c088059ccf2751602789f5bc456ec5dc0022d761..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"
@@ -1476,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();
@@ -1494,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;
@@ -2808,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;
@@ -2824,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;