IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
#endif
-#pragma mark -
-#pragma mark ### Constructors & destructor ###
-
//-------------------------------------------------------------------------------------
// ¥ wxRadioBox()
//-------------------------------------------------------------------------------------
wxRadioBox::~wxRadioBox()
{
+ m_isBeingDeleted = TRUE;
+
wxRadioButton *next,*current;
current=m_radioButtonCycle->NextInCycle();
int majorDim, long style,
const wxValidator& val, const wxString& name)
{
+ if ( !wxControl::Create(parent, id, pos, size, style, val, name) )
+ return false;
+
int i;
m_noItems = n;
for (i = 0; i < n; i++)
{
- wxRadioButton *radBtn = new wxRadioButton(this, NewControlId(), wxStripMenuCodes(choices[i]),wxPoint(5,20*i+10),
- wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
+ wxRadioButton *radBtn = new wxRadioButton
+ (
+ this,
+ wxID_ANY,
+ wxStripMenuCodes(choices[i]),
+ wxPoint(5,20*i+10),
+ wxDefaultSize,
+ i == 0 ? wxRB_GROUP : 0
+ );
if ( i == 0 )
m_radioButtonCycle = radBtn ;
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
}
-#pragma mark -
-#pragma mark ### Specific functions (reference v2) ###
-
//-------------------------------------------------------------------------------------
// ¥ Enable(bool)
//-------------------------------------------------------------------------------------
wxRadioButton *current;
if ((item < 0) || (item >= m_noItems))
- return wxString("");
+ return wxEmptyString;
i = 0;
current = m_radioButtonCycle;
current->Show(show);
}
-#pragma mark -
-#pragma mark ### Other external functions ###
-
//-------------------------------------------------------------------------------------
// ¥ Command
//-------------------------------------------------------------------------------------
}
-#pragma mark -
-#pragma mark ### Internal functions ###
-
//-------------------------------------------------------------------------------------
// ¥ DoSetSize
//-------------------------------------------------------------------------------------
// Simulates the effect of the user issuing a command to the item
-#define RADIO_SIZE 40
+#define RADIO_SIZE 20
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
int totWidth,totHeight;
SetFont(GetParent()->GetFont());
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), &charWidth, &charHeight);
charWidth/=52;
maxWidth=-1;
if (maxHeight<eachHeight[i]) maxHeight = eachHeight[i];
}
- totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight*3/2;
+ totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight ;
totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth;
// only change our width/height if asked for
int totWidth, totHeight;
wxFont font = GetParent()->GetFont();
- GetTextExtent(wxString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ GetTextExtent(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),
&charWidth, &charHeight, NULL, NULL, &font);
charWidth /= 52;
if (maxHeight < eachHeight) maxHeight = eachHeight;
}
- totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight * 3/2;
+ totHeight = GetRowCount() * (maxHeight + charHeight/2) + charHeight ;
totWidth = GetColumnCount() * (maxWidth + charWidth) + charWidth;
// handle radio box title as well