+ if (x == wxDefaultCoord)
+ x_offset = x_current;
+ if (y == wxDefaultCoord)
+ y_offset = y_current;
+ }
+
+ // define size
+ int charWidth, charHeight;
+ int maxWidth, maxHeight;
+ int eachWidth[128], eachHeight[128];
+ int totWidth, totHeight;
+
+ GetTextExtent(
+ wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ &charWidth, &charHeight );
+
+ charWidth /= 52;
+
+ maxWidth = -1;
+ maxHeight = -1;
+ for (unsigned int i = 0 ; i < m_noItems; i++)
+ {
+ GetTextExtent(GetString(i), &eachWidth[i], &eachHeight[i] );
+ eachWidth[i] = (int)(eachWidth[i] + RADIO_SIZE);
+ eachHeight[i] = (int)((3 * eachHeight[i]) / 2);
+
+ if (maxWidth < eachWidth[i])
+ maxWidth = eachWidth[i];
+ if (maxHeight < eachHeight[i])
+ maxHeight = eachHeight[i];
+ }
+
+ totHeight = GetRowCount() * maxHeight;
+ totWidth = GetColumnCount() * (maxWidth + charWidth);
+
+ wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) ) ;
+
+ // change the width / height only when specified
+ if ( width == wxDefaultCoord )
+ {
+ if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+ width = sz.x;
+ else
+ width = widthOld;
+ }
+
+ if ( height == wxDefaultCoord )
+ {
+ if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+ height = sz.y;
+ else
+ height = heightOld;
+ }
+
+ wxControl::DoSetSize( x_offset, y_offset, width, height, wxSIZE_AUTO );
+
+ // arrange radio buttons
+ int x_start, y_start;
+
+ x_start = 0;
+ y_start = 0;
+
+ x_offset = x_start;
+ y_offset = y_start;
+
+ current = m_radioButtonCycle;
+ for (i = 0 ; i < (int)m_noItems; i++)
+ {
+ // not to do for the zero button!
+ if ((i > 0) && ((i % GetMajorDim()) == 0))
+ {
+ if (m_windowStyle & wxRA_SPECIFY_ROWS)
+ {
+ x_offset += maxWidth + charWidth;
+ y_offset = y_start;
+ }
+ else
+ {
+ x_offset = x_start;
+ y_offset += maxHeight ; //+ charHeight / 2
+ }
+ }
+
+ current->SetSize( x_offset, y_offset, eachWidth[i], eachHeight[i]);
+ current = current->NextInCycle();
+
+ if (m_windowStyle & wxRA_SPECIFY_ROWS)
+ y_offset += maxHeight ; // + charHeight / 2
+ else
+ x_offset += maxWidth + charWidth;