X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5008c64c321c39b498bbe5fb7f8bcc667cd41fe2..8290d43d0d43369d007f1c47abf98a45da461a30:/src/mac/radiobox.cpp diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index 492c93133a..416ba0b18f 100644 --- a/src/mac/radiobox.cpp +++ b/src/mac/radiobox.cpp @@ -20,9 +20,7 @@ #include "wx/radiobox.h" #include -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif #pragma mark - #pragma mark ### Constructors & destructor ### @@ -420,7 +418,7 @@ void wxRadioBox::SetFocus() //------------------------------------------------------------------------------------- // Simulates the effect of the user issuing a command to the item -#define RADIO_SIZE 20 +#define RADIO_SIZE 40 void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) { @@ -431,6 +429,8 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) int x_current, y_current; int x_offset,y_offset; + int widthOld, heightOld; + GetSize(&widthOld, &heightOld); x_offset = x; y_offset = y; @@ -465,7 +465,24 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) totHeight = GetNumVer() * (maxHeight + charHeight/2) + charHeight*3/2; totWidth = GetNumHor() * (maxWidth + charWidth) + charWidth; - wxControl::DoSetSize(x_offset,y_offset,totWidth,totHeight,wxSIZE_AUTO); + // only change our width/height if asked for + if ( width == -1 ) + { + if ( sizeFlags & wxSIZE_AUTO_WIDTH ) + width = totWidth ; + else + width = widthOld; + } + + if ( height == -1 ) + { + if ( sizeFlags & wxSIZE_AUTO_HEIGHT ) + height = totHeight ; + else + height = heightOld; + } + + wxControl::DoSetSize(x_offset,y_offset,width,height,wxSIZE_AUTO); // arrange radiobuttons