+bool wxRadioBox::SetFont(const wxFont& font)
+{
+ if ( !wxControl::SetFont(font) )
+ {
+ // nothing to do
+ return FALSE;
+ }
+
+ // also set the font of our radio buttons
+ WXHFONT hfont = wxFont(font).GetResourceHandle();
+ for ( int n = 0; n < m_noItems; n++ )
+ {
+ ::SendMessage((HWND)m_radioButtons[n], WM_SETFONT, (WPARAM)hfont, 0L);
+ }
+
+ return TRUE;
+}
+
+long wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ switch ( nMsg )
+ {
+#ifndef __WIN16__
+ case WM_CTLCOLORSTATIC:
+ // set the colour of the radio buttons to be the same as ours
+ {
+ HDC hdc = (HDC)wParam;
+
+ const wxColour& colBack = GetBackgroundColour();
+ ::SetBkColor(hdc, wxColourToRGB(colBack));
+ ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
+
+ wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
+
+ return (WXHBRUSH)brush->GetResourceHandle();
+ }
+#endif
+
+ // This is required for the radiobox to be sensitive to mouse input,
+ // e.g. for Dialog Editor.
+ case WM_NCHITTEST:
+ {
+ int xPos = LOWORD(lParam); // horizontal position of cursor
+ int yPos = HIWORD(lParam); // vertical position of cursor
+
+ ScreenToClient(&xPos, &yPos);
+
+ // Make sure you can drag by the top of the groupbox, but let
+ // other (enclosed) controls get mouse events also
+ if (yPos < 10)
+ return (long)HTCLIENT;
+ }
+ // fall through
+
+ default:
+ return wxControl::MSWWindowProc(nMsg, wParam, lParam);
+ }
+}
+