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:
Maarten Bent
2019-01-27 14:48:48 +01:00
parent 4fc38bc2c7
commit a377f0e5f0
4 changed files with 7 additions and 78 deletions

View File

@@ -140,28 +140,8 @@ bool wxRadioBox::Create(wxWindow *parent,
const wxValidator& wxVALIDATOR_PARAM(val),
const wxString& name)
{
// for compatibility with the other ports which don't handle (yet?)
// wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM flags, we add them ourselves if
// 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 ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) )
style |= wxRA_SPECIFY_COLS;
if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) )
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);
if ( GetWindowStyle() & wxRA_TOPTOBOTTOM )
if ( GetWindowStyle() & wxRA_SPECIFY_ROWS )
{
// from top to bottom
if ( (n + 1) % GetRowCount() )
@@ -462,7 +442,7 @@ void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height)
y = y0;
}
}
else // wxRA_LEFTTORIGHT: mirror the code above
else // wxRA_SPECIFY_COLS: mirror the code above
{
// from left to right
if ( (n + 1) % GetColumnCount() )