Remove unused variables from wxRadioBox
These variables never got assigned a value.
This commit is contained in:
@@ -172,11 +172,6 @@ protected:
|
|||||||
WXHWND m_dummyHwnd;
|
WXHWND m_dummyHwnd;
|
||||||
wxWindowIDRef m_dummyId;
|
wxWindowIDRef m_dummyId;
|
||||||
|
|
||||||
// array of widths and heights of the buttons, may be wxDefaultCoord if the
|
|
||||||
// corresponding quantity should be computed
|
|
||||||
int *m_radioWidth;
|
|
||||||
int *m_radioHeight;
|
|
||||||
|
|
||||||
// currently selected button or wxNOT_FOUND if none
|
// currently selected button or wxNOT_FOUND if none
|
||||||
int m_selectedButton;
|
int m_selectedButton;
|
||||||
|
|
||||||
|
@@ -147,8 +147,6 @@ void wxRadioBox::Init()
|
|||||||
m_selectedButton = wxNOT_FOUND;
|
m_selectedButton = wxNOT_FOUND;
|
||||||
m_radioButtons = NULL;
|
m_radioButtons = NULL;
|
||||||
m_dummyHwnd = NULL;
|
m_dummyHwnd = NULL;
|
||||||
m_radioWidth = NULL;
|
|
||||||
m_radioHeight = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRadioBox::Create(wxWindow *parent,
|
bool wxRadioBox::Create(wxWindow *parent,
|
||||||
@@ -187,13 +185,8 @@ bool wxRadioBox::Create(wxWindow *parent,
|
|||||||
// buttons to include the dummy button
|
// buttons to include the dummy button
|
||||||
m_radioButtons = new wxSubwindows(n);
|
m_radioButtons = new wxSubwindows(n);
|
||||||
|
|
||||||
m_radioWidth = new int[n];
|
|
||||||
m_radioHeight = new int[n];
|
|
||||||
|
|
||||||
for ( int i = 0; i < n; i++ )
|
for ( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
m_radioWidth[i] =
|
|
||||||
m_radioHeight[i] = wxDefaultCoord;
|
|
||||||
long styleBtn = BS_AUTORADIOBUTTON | WS_TABSTOP | WS_CHILD | WS_VISIBLE;
|
long styleBtn = BS_AUTORADIOBUTTON | WS_TABSTOP | WS_CHILD | WS_VISIBLE;
|
||||||
if ( i == 0 )
|
if ( i == 0 )
|
||||||
styleBtn |= WS_GROUP;
|
styleBtn |= WS_GROUP;
|
||||||
@@ -296,9 +289,6 @@ wxRadioBox::~wxRadioBox()
|
|||||||
|
|
||||||
if ( m_dummyHwnd )
|
if ( m_dummyHwnd )
|
||||||
DestroyWindow((HWND)m_dummyHwnd);
|
DestroyWindow((HWND)m_dummyHwnd);
|
||||||
|
|
||||||
delete[] m_radioWidth;
|
|
||||||
delete[] m_radioHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NB: if this code is changed, wxGetWindowForHWND() which relies on having the
|
// NB: if this code is changed, wxGetWindowForHWND() which relies on having the
|
||||||
@@ -398,9 +388,6 @@ void wxRadioBox::SetString(unsigned int item, const wxString& label)
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( IsValid(item), wxT("invalid radiobox index") );
|
wxCHECK_RET( IsValid(item), wxT("invalid radiobox index") );
|
||||||
|
|
||||||
m_radioWidth[item] =
|
|
||||||
m_radioHeight[item] = wxDefaultCoord;
|
|
||||||
|
|
||||||
::SetWindowText((*m_radioButtons)[item], label.c_str());
|
::SetWindowText((*m_radioButtons)[item], label.c_str());
|
||||||
|
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
@@ -566,20 +553,12 @@ wxSize wxRadioBox::GetMaxButtonSize() const
|
|||||||
for ( unsigned int i = 0 ; i < count; i++ )
|
for ( unsigned int i = 0 ; i < count; i++ )
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
if ( m_radioWidth[i] < 0 )
|
GetTextExtent(wxGetWindowText((*m_radioButtons)[i]), &width, &height);
|
||||||
{
|
|
||||||
GetTextExtent(wxGetWindowText((*m_radioButtons)[i]), &width, &height);
|
|
||||||
|
|
||||||
// adjust the size to take into account the radio box itself
|
// adjust the size to take into account the radio box itself
|
||||||
width += radioWidth;
|
width += radioWidth;
|
||||||
height *= 3;
|
height *= 3;
|
||||||
height /= 2;
|
height /= 2;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
width = m_radioWidth[i];
|
|
||||||
height = m_radioHeight[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( widthMax < width )
|
if ( widthMax < width )
|
||||||
widthMax = width;
|
widthMax = width;
|
||||||
@@ -717,8 +696,6 @@ wxRadioBox::PositionAllButtons(int x, int y, int width, int WXUNUSED(height))
|
|||||||
{
|
{
|
||||||
x_offset = startX;
|
x_offset = startX;
|
||||||
y_offset += maxHeight;
|
y_offset += maxHeight;
|
||||||
if (m_radioWidth[0]>0)
|
|
||||||
y_offset += cy1/2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -747,8 +724,6 @@ wxRadioBox::PositionAllButtons(int x, int y, int width, int WXUNUSED(height))
|
|||||||
{
|
{
|
||||||
// below this one
|
// below this one
|
||||||
y_offset += maxHeight;
|
y_offset += maxHeight;
|
||||||
if (m_radioWidth[0]>0)
|
|
||||||
y_offset += cy1/2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user