X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4438caf41af49f00f3c8137ac801871f59cce386..8c3c31d4a544271ae70be958f050f70bab440597:/src/msw/radiobox.cpp?ds=sidebyside diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index f0ab1b8a2d..48d5ba171a 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -353,6 +353,9 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int currentX, currentY; GetPosition(¤tX, ¤tY); + int widthOld, heightOld; + GetSize(&widthOld, &heightOld); + int xx = x; int yy = y; @@ -418,21 +421,36 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) int extraHeight = cy1; -#if !CTL3D +#if defined(CTL3D) && !CTL3D // Requires a bigger group box in plain Windows extraHeight *= 3; extraHeight /= 2; #endif - MoveWindow(GetHwnd(), x_offset, y_offset, - totWidth+cx1, totHeight+extraHeight, - TRUE); + // only change our width/height if asked for + if ( width == -1 ) + { + if ( sizeFlags & wxSIZE_AUTO_WIDTH ) + width = totWidth + cx1; + else + width = widthOld; + } + + if ( height == -1 ) + { + if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) + height = totHeight + extraHeight; + else + height = heightOld; + } + + MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE); x_offset += cx1; y_offset += cy1; } -#if (!CTL3D) +#if defined(CTL3D) && (!CTL3D) y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label // JACS 2/12/93. CTL3D draws group label quite high. #endif @@ -664,37 +682,6 @@ void wxRadioBox::Command (wxCommandEvent & event) ProcessCommand (event); } -long wxRadioBox::MSWWindowProc(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) -{ - long rc = 0; - bool processed = FALSE; - - switch ( msg ) - { - 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 ) - { - rc = HTCLIENT; - processed = TRUE; - } - } - break; - } - - if ( !processed ) - rc = wxControl::MSWWindowProc(msg, wParam, lParam); - - return rc; -} - void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn) { #ifdef __WIN32__ @@ -713,6 +700,7 @@ void wxRadioBox::SendNotificationEvent() { wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId); event.SetInt( m_selectedButton ); + event.SetString( GetString(m_selectedButton) ); event.SetEventObject( this ); ProcessCommand(event); }