Patch #1771 2006-12-28 23:30

stahta01

Old wxSmith patch for wxListbook::HitTest protected wxW2.8
Download
1771-Old_wxSmith_pa.patch (712 bytes)
Category
Plugin::Refinement
Status
Closed
Close date
2007-02-25 21:59
Assigned to
 
Index: src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp
===================================================================
--- src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp    (revision 3438)
+++ src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp    (working copy)
@@ -204,7 +204,11 @@
     if ( GetPreview() && event.LeftDown() )
     {
         wxListbook* Preview = (wxListbook*)GetPreview();
+#if wxCHECK_VERSION(2, 8, 0)
+        int Hit = wxStaticCast(Preview, wxBookCtrlBase)->HitTest(wxPoint(event.GetX(),event.GetY()));
+#else
         int Hit = Preview->HitTest(wxPoint(event.GetX(),event.GetY()));
+#endif
         if ( Hit != wxNOT_FOUND )
         {
             CurrentSelection = GetChild(Hit);
stahta01 2006-12-28 23:34

This is a work around of a bug in wxWidgets 2.8.0; I would hold off applying it in hopes that the wxWidgets code will be patched.

Change: wxListbook::HitTest in protected in wx/listbook.h

Problem: The file src/plugins/contrib/wxSmith/defwidgets/wxslistbook.cpp uses it.

Solution: Cast to wxBookCtrlBase

Tim S

killerbot 2006-12-29 10:10

could you give some more information about the wx bug please.

stahta01 2006-12-29 17:46

They updated the header file wx/listbook.h and accidentally put the method HitTest in the protected section of the class methods. I posted to the newsgroup and one of the class maintainers agrees with this (Vadim Zeitlin). Tim S

Group(gmane.comp.lib.wxwindows.general) Subject(Class wxListbook in wx/listbook.h is HitTest protected by design?)

stahta01 2007-02-05 23:47

This is NO longer needed for the CVS Branch of 2.8, so if you want you can close it now or wait till after 2.8.2 is released.

Tim S