From d9521fe733fa10c4d78d72a37722a1983d554379 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 1 Feb 2018 12:09:09 +0100 Subject: [PATCH] One more try to fix compilation on OSX --- xs/src/slic3r/GUI/Tab.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 832efb38c..6e8ecb21c 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -87,7 +86,15 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle) m_treectrl->Bind(wxEVT_KEY_DOWN, &Tab::OnKeyDown, this); m_presets_choice->Bind(wxEVT_COMBOBOX, ([this](wxCommandEvent e){ - select_preset(m_presets_choice->wxComboBox::GetStringSelection().ToStdString()); + //! Because of The MSW and GTK version of wxBitmapComboBox derived from wxComboBox, + //! but the OSX version derived from wxOwnerDrawnCombo, instead of: + //! select_preset(m_presets_choice->GetStringSelection().ToStdString()); + //! we doing next: + int selected_item = m_presets_choice->GetSelection(); + if (selected_item >= 0){ + std::string slected_string = m_presets_choice->GetString(selected_item).ToStdString(); + select_preset(slected_string); + } })); m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e){ save_preset(); }));