X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eba99da4c0563e6508761272a1e1f1b791d0af6b..9cf4b4398d733123709f8319c13e52afd0f67ef7:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index a6df181a1a..253c31204d 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -816,25 +816,21 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn, hwnd, message, wParam, lParam); } -WXHRGN wxRadioBox::MSWCalculateClippingRegion() +WXHRGN wxRadioBox::MSWGetRegionWithoutChildren() { RECT rc; ::GetWindowRect(GetHwnd(), &rc); HRGN hrgn = ::CreateRectRgn(rc.left, rc.top, rc.right + 1, rc.bottom + 1); - size_t count = GetCount(); + const size_t count = GetCount(); for ( size_t i = 0; i < count; ++i ) { ::GetWindowRect((*m_radioButtons)[i], &rc); - HRGN hrgnchild = ::CreateRectRgnIndirect(&rc); + AutoHRGN hrgnchild(::CreateRectRgnIndirect(&rc)); ::CombineRgn(hrgn, hrgn, hrgnchild, RGN_DIFF); - ::DeleteObject(hrgnchild); } - ::GetWindowRect(GetHwnd(), &rc); - ::OffsetRgn(hrgn, -rc.left, -rc.top); - - return hrgn; + return (WXHRGN)hrgn; } WXLRESULT wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)