From 88b7ef2fabdaa38c86dae59e13772cb4573fca98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Tue, 16 Oct 2018 05:58:27 +0300 Subject: [PATCH] Fix wxRA_SPECIFY_{ROWS,COLS} handling in wxQt wxRadioBox Their meanings were previously reversed. Closes https://github.com/wxWidgets/wxWidgets/pull/978 --- src/qt/radiobox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/radiobox.cpp b/src/qt/radiobox.cpp index da8c90baa6..32ccb686b1 100644 --- a/src/qt/radiobox.cpp +++ b/src/qt/radiobox.cpp @@ -135,9 +135,13 @@ bool wxRadioBox::Create(wxWindow *parent, m_qtGroupBox->setTitle( wxQtConvertString( title ) ); m_qtButtonGroup = new wxQtButtonGroup( m_qtGroupBox, this ); - if ( style & wxRA_SPECIFY_ROWS ) + // wxRA_SPECIFY_COLS means that we arrange buttons in + // left to right order and GetMajorDim() is the number of columns while + // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and + // GetMajorDim() is the number of rows. + if ( style & wxRA_SPECIFY_COLS ) m_qtBoxLayout = new QHBoxLayout; - else if ( style & wxRA_SPECIFY_COLS ) + else if ( style & wxRA_SPECIFY_ROWS ) m_qtBoxLayout = new QVBoxLayout; AddChoices< QRadioButton >( m_qtButtonGroup, m_qtBoxLayout, n, choices );