From 0ebb85418ba7589f556de29337f97bc6d8eae7cc Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 13 Nov 2023 09:50:09 +0100 Subject: [PATCH] OSX specific: WipeTowerDialog: Deleted code, which is not actual now and was cause a crash(see #11627) --- src/slic3r/GUI/WipeTowerDialog.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp index 664223c1d3..3b74c10910 100644 --- a/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/src/slic3r/GUI/WipeTowerDialog.cpp @@ -330,30 +330,6 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector& matrix, con ::SpinInput* spin_ctrl = new ::SpinInput(m_page_simple, "", wxEmptyString, wxDefaultPosition, wxSize(ITEM_WIDTH(), -1), style | wxALIGN_RIGHT, 0, 300, (int)initial); update_ui(spin_ctrl); vec.push_back(spin_ctrl); - -#ifdef __WXOSX__ - // On OSX / Cocoa, wxSpinCtrl::GetValue() doesn't return the new value - // when it was changed from the text control, so the on_change callback - // gets the old one, and on_kill_focus resets the control to the old value. - // As a workaround, we get the new value from $event->GetString and store - // here temporarily so that we can return it from get_value() - spin_ctrl->Bind(wxEVT_TEXT, ([spin_ctrl](wxCommandEvent e) - { - long value; - const bool parsed = e.GetString().ToLong(&value); - int tmp_value = parsed && value >= INT_MIN && value <= INT_MAX ? (int)value : INT_MIN; - - // Forcibly set the input value for SpinControl, since the value - // inserted from the keyboard or clipboard is not updated under OSX - if (tmp_value != INT_MIN) { - spin_ctrl->SetValue(tmp_value); - - // But in SetValue() is executed m_text_ctrl->SelectAll(), so - // discard this selection and set insertion point to the end of string - spin_ctrl->GetText()->SetInsertionPointEnd(); - } - }), spin_ctrl->GetId()); -#endif }; for (unsigned int i=0;i