X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5008c64c321c39b498bbe5fb7f8bcc667cd41fe2..6ba636000f13b4bf7d3e7dcfad429713085f6700:/src/mac/radiobox.cpp diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index 492c93133a..1f74fae6d2 100644 --- a/src/mac/radiobox.cpp +++ b/src/mac/radiobox.cpp @@ -95,7 +95,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, Rect bounds ; Str255 title ; - MacPreControlCreate( parent , id , label , pos , size ,style, *((wxValidator*)NULL) , name , &bounds , title ) ; + MacPreControlCreate( parent , id , label , pos , size ,style, val , name , &bounds , title ) ; m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1, kControlGroupBoxTextTitleProc , (long) this ) ; @@ -420,7 +420,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,13 +431,15 @@ 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; GetPosition(&x_current, &y_current); - if ((x == -1) || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if ((x == -1) && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) x_offset = x_current; - if ((y == -1) || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) + if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y_offset = y_current; // define size @@ -465,7 +467,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 @@ -473,7 +492,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) x_start = charWidth; - y_start = charHeight*3/2; + y_start = 15 ; x_offset = x_start; y_offset = y_start; @@ -490,7 +509,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) else { x_offset = x_start; - y_offset += maxHeight + charHeight/2; + y_offset += maxHeight ; /*+ charHeight/2;*/ } } @@ -498,7 +517,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) current=current->NextInCycle(); if (m_windowStyle & wxRA_SPECIFY_ROWS) - y_offset += maxHeight + charHeight/2; + y_offset += maxHeight ; /*+ charHeight/2;*/ else x_offset += maxWidth + charWidth; }