X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..5fe256deb746d1a5b9151867ac48c3ad393c1a97:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 81467bcfb3..dcd27cbba2 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -116,7 +116,8 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, m_noRowsOrCols = majorDim; if (majorDim==0) m_majorDim = n ; - m_majorDim = majorDim ; + else // Seemed to make sense to put this 'else' here... (RD) + m_majorDim = majorDim ; long msStyle = GROUP_FLAGS; @@ -321,7 +322,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, wxRadioBox::~wxRadioBox(void) { m_isBeingDeleted = TRUE; - + if (m_radioButtons) { int i; @@ -409,6 +410,8 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) yy = currentY; + AdjustForParentClientOrigin(xx, yy, sizeFlags); + char buf[400]; int y_offset = yy; @@ -575,6 +578,15 @@ void wxRadioBox::GetPosition(int *x, int *y) const { ::ScreenToClient((HWND) parent->GetHWND(), &point); } + // We may be faking the client origin. + // So a window that's really at (0, 30) may appear + // (to wxWin apps) to be at (0, 0). + if (GetParent()) + { + wxPoint pt(GetParent()->GetClientAreaOrigin()); + point.x -= pt.x; + point.y -= pt.y; + } *x = point.x; *y = point.y; @@ -642,7 +654,7 @@ void wxRadioBox::Enable(int item, bool enable) void wxRadioBox::Enable(bool enable) { wxControl::Enable(enable); - + int i; for (i = 0; i < m_noItems; i++) ::EnableWindow((HWND) m_radioButtons[i], enable); @@ -733,7 +745,7 @@ void wxRadioBox::SetLabelFont(wxFont *font) if (font) { font->RealizeResource(); - + if (font->GetResourceHandle()) SendMessage(hWnd, WM_SETFONT, (WPARAM)font->GetResourceHandle(),TRUE);