X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1395ff56f4a8dd0fa400abc0faecc281c304caf7..34153050fe525ca6c46f259b638fae5590a87290:/src/mac/radiobox.cpp diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index d00911c8fd..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 ### @@ -123,18 +121,20 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, //------------------------------------------------------------------------------------- // Enables or disables the entire radiobox -void wxRadioBox::Enable(bool enable) +bool wxRadioBox::Enable(bool enable) { int i; wxRadioButton *current; - wxControl::Enable(enable); + if (!wxControl::Enable(enable)) + return (false); current=m_radioButtonCycle; for (i=0;iEnable(enable); current=current->NextInCycle(); } + return (true); } //------------------------------------------------------------------------------------- @@ -155,7 +155,6 @@ void wxRadioBox::Enable(int item, bool enable) i++; current=current->NextInCycle(); } - return current->Enable(enable); } @@ -419,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) { @@ -430,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; @@ -464,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); + // 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