]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
don't include generic/statusbr.h directly
[wxWidgets.git] / src / msw / radiobox.cpp
index 9f0c6b131eb9638071897203c9c2541c46e4b3dc..94ffdaf7aa2572702732e7f955ef52158345d6cf 100644 (file)
 
 #if wxUSE_RADIOBOX
 
+#include "wx/radiobox.h"
+
 #ifndef WX_PRECOMP
     #include "wx/bitmap.h"
     #include "wx/brush.h"
-    #include "wx/radiobox.h"
     #include "wx/settings.h"
     #include "wx/log.h"
 #endif
@@ -494,7 +495,7 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
 
     // and also wide enough for its label
     int widthLabel;
-    GetTextExtent(wxStripMenuCodes(GetLabel()), &widthLabel, NULL);
+    GetTextExtent(GetLabelText(), &widthLabel, NULL);
     widthLabel += RADIO_SIZE; // FIXME this is bogus too
     if ( widthLabel > width )
         width = widthLabel;
@@ -655,6 +656,23 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
     }
 }
 
+int wxRadioBox::GetItemFromPoint(const wxPoint& pt) const
+{
+    const unsigned int count = GetCount();
+    for ( unsigned int i = 0; i < count; i++ )
+    {
+        RECT rect = wxGetWindowRect((*m_radioButtons)[i]);
+
+        if ( rect.left <= pt.x && pt.x < rect.right &&
+                rect.top  <= pt.y && pt.y < rect.bottom )
+        {
+            return i;
+        }
+    }
+
+    return wxNOT_FOUND;
+}
+
 // ----------------------------------------------------------------------------
 // radio box drawing
 // ----------------------------------------------------------------------------
@@ -706,32 +724,6 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
                 return lDlgCode | DLGC_WANTARROWS;
             }
 
-#if wxUSE_TOOLTIPS
-        case WM_NOTIFY:
-            {
-                NMHDR* hdr = (NMHDR *)lParam;
-                if ( hdr->code == TTN_NEEDTEXT )
-                {
-                    wxRadioBox *
-                        radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
-
-                    wxCHECK_MSG( radiobox, 0,
-                                 wxT("radio button without radio box?") );
-
-                    wxToolTip *tooltip = radiobox->GetToolTip();
-                    if ( tooltip )
-                    {
-                        TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
-                        ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
-                    }
-
-                    // processed
-                    return 0;
-                }
-            }
-            break;
-#endif // wxUSE_TOOLTIPS
-
         case WM_KEYDOWN:
             {
                 wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);