Get rid of wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM styles
This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead. Do not remove them from the definitions, to not break user code. Closes #18100.
This commit is contained in:
@@ -1568,9 +1568,8 @@ enum wxBorder
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* wxRadioBox style flags
|
* wxRadioBox style flags
|
||||||
|
* These styles are not used in any port.
|
||||||
*/
|
*/
|
||||||
/* should we number the items from left to right or from top to bottom in a 2d */
|
|
||||||
/* radiobox? */
|
|
||||||
#define wxRA_LEFTTORIGHT 0x0001
|
#define wxRA_LEFTTORIGHT 0x0001
|
||||||
#define wxRA_TOPTOBOTTOM 0x0002
|
#define wxRA_TOPTOBOTTOM 0x0002
|
||||||
|
|
||||||
|
@@ -379,9 +379,8 @@ enum wxBorder
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* wxRadioBox style flags
|
* wxRadioBox style flags
|
||||||
|
* These styles are not used in any port.
|
||||||
*/
|
*/
|
||||||
/* should we number the items from left to right or from top to bottom in a 2d */
|
|
||||||
/* radiobox? */
|
|
||||||
#define wxRA_LEFTTORIGHT 0x0001
|
#define wxRA_LEFTTORIGHT 0x0001
|
||||||
#define wxRA_TOPTOBOTTOM 0x0002
|
#define wxRA_TOPTOBOTTOM 0x0002
|
||||||
|
|
||||||
|
@@ -60,14 +60,6 @@ enum
|
|||||||
RadioPage_Radio
|
RadioPage_Radio
|
||||||
};
|
};
|
||||||
|
|
||||||
// layout direction radiobox selections
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
RadioDir_Default,
|
|
||||||
RadioDir_LtoR,
|
|
||||||
RadioDir_TtoB
|
|
||||||
};
|
|
||||||
|
|
||||||
// default values for the number of radiobox items
|
// default values for the number of radiobox items
|
||||||
static const unsigned int DEFAULT_NUM_ENTRIES = 12;
|
static const unsigned int DEFAULT_NUM_ENTRIES = 12;
|
||||||
static const unsigned int DEFAULT_MAJOR_DIM = 3;
|
static const unsigned int DEFAULT_MAJOR_DIM = 3;
|
||||||
@@ -123,7 +115,6 @@ protected:
|
|||||||
wxCheckBox *m_chkSpecifyRows;
|
wxCheckBox *m_chkSpecifyRows;
|
||||||
wxCheckBox *m_chkEnableItem;
|
wxCheckBox *m_chkEnableItem;
|
||||||
wxCheckBox *m_chkShowItem;
|
wxCheckBox *m_chkShowItem;
|
||||||
wxRadioBox *m_radioDir;
|
|
||||||
|
|
||||||
// the gauge itself and the sizer it is in
|
// the gauge itself and the sizer it is in
|
||||||
wxRadioBox *m_radio;
|
wxRadioBox *m_radio;
|
||||||
@@ -197,8 +188,7 @@ RadioWidgetsPage::RadioWidgetsPage(WidgetsBookCtrl *book,
|
|||||||
m_textLabelBtns =
|
m_textLabelBtns =
|
||||||
m_textLabel = (wxTextCtrl *)NULL;
|
m_textLabel = (wxTextCtrl *)NULL;
|
||||||
|
|
||||||
m_radio =
|
m_radio = (wxRadioBox *)NULL;
|
||||||
m_radioDir = (wxRadioBox *)NULL;
|
|
||||||
m_sizerRadio = (wxSizer *)NULL;
|
m_sizerRadio = (wxSizer *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,24 +207,6 @@ void RadioWidgetsPage::CreateContent()
|
|||||||
"Major specifies &rows count"
|
"Major specifies &rows count"
|
||||||
);
|
);
|
||||||
|
|
||||||
static const wxString layoutDir[] =
|
|
||||||
{
|
|
||||||
"default",
|
|
||||||
"left to right",
|
|
||||||
"top to bottom"
|
|
||||||
};
|
|
||||||
|
|
||||||
m_radioDir = new wxRadioBox(this, wxID_ANY, "Numbering:",
|
|
||||||
wxDefaultPosition, wxDefaultSize,
|
|
||||||
WXSIZEOF(layoutDir), layoutDir,
|
|
||||||
1, wxRA_SPECIFY_COLS);
|
|
||||||
sizerLeft->Add(m_radioDir, 0, wxGROW | wxALL, 5);
|
|
||||||
|
|
||||||
// if it's not defined, we can't change the radiobox direction
|
|
||||||
#ifndef wxRA_LEFTTORIGHT
|
|
||||||
m_radioDir->Disable();
|
|
||||||
#endif // wxRA_LEFTTORIGHT
|
|
||||||
|
|
||||||
wxSizer *sizerRow;
|
wxSizer *sizerRow;
|
||||||
sizerRow = CreateSizerWithTextAndLabel("&Major dimension:",
|
sizerRow = CreateSizerWithTextAndLabel("&Major dimension:",
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
@@ -320,7 +292,6 @@ void RadioWidgetsPage::Reset()
|
|||||||
m_chkSpecifyRows->SetValue(false);
|
m_chkSpecifyRows->SetValue(false);
|
||||||
m_chkEnableItem->SetValue(true);
|
m_chkEnableItem->SetValue(true);
|
||||||
m_chkShowItem->SetValue(true);
|
m_chkShowItem->SetValue(true);
|
||||||
m_radioDir->SetSelection(RadioDir_Default);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioWidgetsPage::CreateRadio()
|
void RadioWidgetsPage::CreateRadio()
|
||||||
@@ -371,26 +342,6 @@ void RadioWidgetsPage::CreateRadio()
|
|||||||
|
|
||||||
flags |= GetAttrs().m_defaultFlags;
|
flags |= GetAttrs().m_defaultFlags;
|
||||||
|
|
||||||
#ifdef wxRA_LEFTTORIGHT
|
|
||||||
switch ( m_radioDir->GetSelection() )
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( "unexpected wxRadioBox layout direction" );
|
|
||||||
wxFALLTHROUGH;
|
|
||||||
|
|
||||||
case RadioDir_Default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RadioDir_LtoR:
|
|
||||||
flags |= wxRA_LEFTTORIGHT;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case RadioDir_TtoB:
|
|
||||||
flags |= wxRA_TOPTOBOTTOM;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif // wxRA_LEFTTORIGHT
|
|
||||||
|
|
||||||
m_radio = new wxRadioBox(this, RadioPage_Radio,
|
m_radio = new wxRadioBox(this, RadioPage_Radio,
|
||||||
m_textLabel->GetValue(),
|
m_textLabel->GetValue(),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
|
@@ -140,28 +140,8 @@ bool wxRadioBox::Create(wxWindow *parent,
|
|||||||
const wxValidator& wxVALIDATOR_PARAM(val),
|
const wxValidator& wxVALIDATOR_PARAM(val),
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// for compatibility with the other ports which don't handle (yet?)
|
if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) )
|
||||||
// wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM flags, we add them ourselves if
|
style |= wxRA_SPECIFY_COLS;
|
||||||
// not specified
|
|
||||||
if ( !(style & (wxRA_LEFTTORIGHT | wxRA_TOPTOBOTTOM)) )
|
|
||||||
{
|
|
||||||
// horizontal radiobox use left to right layout
|
|
||||||
if ( style & wxRA_SPECIFY_COLS )
|
|
||||||
{
|
|
||||||
style |= wxRA_LEFTTORIGHT;
|
|
||||||
}
|
|
||||||
else if ( style & wxRA_SPECIFY_ROWS )
|
|
||||||
{
|
|
||||||
style |= wxRA_TOPTOBOTTOM;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wxFAIL_MSG( wxT("you must specify wxRA_XXX style!") );
|
|
||||||
|
|
||||||
// use default
|
|
||||||
style = wxRA_SPECIFY_COLS | wxRA_LEFTTORIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
|
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
|
||||||
return false;
|
return false;
|
||||||
@@ -447,7 +427,7 @@ void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height)
|
|||||||
{
|
{
|
||||||
m_buttons[n]->SetSize(x, y, sizeBtn.x, sizeBtn.y);
|
m_buttons[n]->SetSize(x, y, sizeBtn.x, sizeBtn.y);
|
||||||
|
|
||||||
if ( GetWindowStyle() & wxRA_TOPTOBOTTOM )
|
if ( GetWindowStyle() & wxRA_SPECIFY_ROWS )
|
||||||
{
|
{
|
||||||
// from top to bottom
|
// from top to bottom
|
||||||
if ( (n + 1) % GetRowCount() )
|
if ( (n + 1) % GetRowCount() )
|
||||||
@@ -462,7 +442,7 @@ void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height)
|
|||||||
y = y0;
|
y = y0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // wxRA_LEFTTORIGHT: mirror the code above
|
else // wxRA_SPECIFY_COLS: mirror the code above
|
||||||
{
|
{
|
||||||
// from left to right
|
// from left to right
|
||||||
if ( (n + 1) % GetColumnCount() )
|
if ( (n + 1) % GetColumnCount() )
|
||||||
|
Reference in New Issue
Block a user