fix: avoid capturing C array in lambda for ixex_tool_layout combo

Arrays cannot be captured by value in C++ lambdas; replaced with a
static local declared inside the event handler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-04-06 14:57:39 -04:00
co-authored by Claude Sonnet 4.6
parent 5297417518
commit f4808ae7ba
+3 -2
View File
@@ -4983,9 +4983,10 @@ void TabPrinter::build_fff()
if (auto* o = m_config->option<ConfigOptionString>("ixex_tool_layout")) cur = o->value;
for (int i = 0; i < 4; ++i)
if (cur == values[i]) { m_ixex_layout_combo->SetSelection(i); break; }
m_ixex_layout_combo->Bind(wxEVT_COMBOBOX, [this, values](wxCommandEvent&) {
m_ixex_layout_combo->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent&) {
static const char* layout_vals[] = { "front-left", "front-right", "rear-left", "rear-right" };
int sel = m_ixex_layout_combo->GetSelection();
std::string val = (sel >= 0 && sel < 4) ? values[sel] : "front-left";
std::string val = (sel >= 0 && sel < 4) ? layout_vals[sel] : "front-left";
m_config->set_key_value("ixex_tool_layout", new ConfigOptionString(val));
on_value_change("ixex_tool_layout", val);
if (m_ixex_modes_ctrl)