From 9eca8c5733c5e6c5481b32bfb125596207dd8fad Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 10 Aug 2013 07:46:33 -0700 Subject: [PATCH] Correct custom labels for buttons with standard IDs --- aegisub/src/auto4_lua_dialog.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aegisub/src/auto4_lua_dialog.cpp b/aegisub/src/auto4_lua_dialog.cpp index a074e228d..7fb161f20 100644 --- a/aegisub/src/auto4_lua_dialog.cpp +++ b/aegisub/src/auto4_lua_dialog.cpp @@ -516,15 +516,15 @@ namespace Automation4 { return button; }; - bool only_wxID_buttons = true; - for (size_t i = 0; i < buttons.size(); ++i) { - bs->AddButton(make_button(buttons[i].first, i, buttons[i].second)); - if (buttons[i].first == -1) - only_wxID_buttons = false; - } - - if (only_wxID_buttons) + if (boost::count(buttons | boost::adaptors::map_keys, -1) == 0) { + for (size_t i = 0; i < buttons.size(); ++i) + bs->AddButton(make_button(buttons[i].first, i, buttons[i].second)); bs->Realize(); + } + else { + for (size_t i = 0; i < buttons.size(); ++i) + bs->Add(make_button(buttons[i].first, i, buttons[i].second)); + } auto ms = new wxBoxSizer(wxVERTICAL); ms->Add(s, 0, wxBOTTOM, 5);