-
- SetFont(GetParent()->GetFont());
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
- charWidth/=52;
-
- maxWidth=-1;
- maxHeight=-1;
- for (i = 0 ; i < m_noItems; i++)
- {
- GetTextExtent(GetLabel(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 = GetNumVer() * (maxHeight + charHeight/2) + charHeight*3/2;
- totWidth = GetNumHor() * (maxWidth + charWidth) + charWidth;
-
- wxControl::DoSetSize(x_offset,y_offset,totWidth,totHeight);
-
-// arrange radiobuttons
-
- int x_start,y_start;
-
-
- x_start = charWidth;
- y_start = charHeight*3/2;
- x_offset = x_start;
- y_offset = y_start;
-
- current=m_radioButtonCycle;
- for ( i = 0 ; i < m_noItems; i++)
- {
- if (i&&((i%m_majorDim)==0)) // not to do for the zero button!
- {
- if (m_windowStyle & wxRA_VERTICAL)
- {
- 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;
- }
+
+ SetFont(GetParent()->GetFont());
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
+ charWidth/=52;
+
+ maxWidth=-1;
+ maxHeight=-1;
+ for (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 + charHeight/2) + charHeight ;
+ totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth;
+
+ // 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
+
+ int x_start,y_start;
+
+
+ x_start = charWidth;
+ y_start = 15 ;
+ x_offset = x_start;
+ y_offset = y_start;
+
+ current=m_radioButtonCycle;
+ for ( i = 0 ; i < m_noItems; i++)
+ {
+ if (i&&((i%m_majorDim)==0)) // not to do for the zero button!
+ {
+ if (m_windowStyle & wxRA_VERTICAL)
+ {
+ 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;
+ }