]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
Reverted part of rev 1.92. It causes probelms on Windows when
[wxWidgets.git] / src / msw / radiobox.cpp
index d1bc237dc58a51560c60a0a42e0d59140af9b5e2..66534b1e2ad23d0a99b148c7a07cf4be5db4a368 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
@@ -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
 // ----------------------------------------------------------------------------