mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Fix radiobuttons for multiple option groups.
This commit is contained in:
@@ -577,17 +577,23 @@ private:
|
|||||||
_formatNames[formatChoice->GetSelection()];
|
_formatNames[formatChoice->GetSelection()];
|
||||||
FlagGroup::parseConfigFile(formatName, formats);
|
FlagGroup::parseConfigFile(formatName, formats);
|
||||||
|
|
||||||
/* Add grouped radiobuttons for anything in an open group. */
|
|
||||||
|
|
||||||
for (auto& group : config.option_group())
|
for (auto& group : config.option_group())
|
||||||
{
|
{
|
||||||
|
sizer->Add(new wxStaticText(formatOptionsContainer,
|
||||||
|
wxID_ANY,
|
||||||
|
group.comment() + ":"));
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
bool valueSet = false;
|
bool valueSet = false;
|
||||||
wxRadioButton* defaultButton = nullptr;
|
wxRadioButton* defaultButton = nullptr;
|
||||||
for (auto& option : group.option())
|
for (auto& option : group.option())
|
||||||
{
|
{
|
||||||
auto* rb = new wxRadioButton(
|
auto* rb = new wxRadioButton(formatOptionsContainer,
|
||||||
formatOptionsContainer, wxID_ANY, option.comment());
|
wxID_ANY,
|
||||||
|
option.comment(),
|
||||||
|
wxDefaultPosition,
|
||||||
|
wxDefaultSize,
|
||||||
|
first ? wxRB_GROUP : 0);
|
||||||
auto key = std::make_pair(formatName, option.name());
|
auto key = std::make_pair(formatName, option.name());
|
||||||
sizer->Add(rb);
|
sizer->Add(rb);
|
||||||
|
|
||||||
@@ -614,8 +620,6 @@ private:
|
|||||||
if (option.set_by_default() || !defaultButton)
|
if (option.set_by_default() || !defaultButton)
|
||||||
defaultButton = rb;
|
defaultButton = rb;
|
||||||
|
|
||||||
if (first)
|
|
||||||
rb->SetExtraStyle(wxRB_GROUP);
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user