FIX: modify the combo box selection value

Jira: 4529
Change-Id: Icdd3dc86fd3d08de5919edf7b3dfbdf1d8777962
This commit is contained in:
zhimin.zeng 2023-09-19 19:27:19 +08:00 committed by Lane.Wei
parent 0120387f26
commit 2870ed90c4
2 changed files with 12 additions and 3 deletions

View file

@ -5,8 +5,8 @@
#include "libslic3r/Print.hpp" #include "libslic3r/Print.hpp"
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
static wxString PA_LINE = _L("Line"); static int PA_LINE = 0;
static wxString PA_PATTERN = _L("Pattern"); static int PA_PATTERN = 1;
CaliPresetCaliStagePanel::CaliPresetCaliStagePanel( CaliPresetCaliStagePanel::CaliPresetCaliStagePanel(
wxWindow* parent, wxWindow* parent,
@ -166,6 +166,14 @@ CaliComboBox::CaliComboBox(wxWindow* parent,
m_combo_box->Bind(wxEVT_COMBOBOX, m_on_value_change_call_back); m_combo_box->Bind(wxEVT_COMBOBOX, m_on_value_change_call_back);
} }
int CaliComboBox::get_selection() const
{
if (m_combo_box)
return m_combo_box->GetSelection();
return 0;
}
wxString CaliComboBox::get_value() const wxString CaliComboBox::get_value() const
{ {
if (m_combo_box) if (m_combo_box)
@ -1964,7 +1972,7 @@ wxArrayString CalibrationPresetPage::get_custom_range_values()
CalibMode CalibrationPresetPage::get_pa_cali_method() CalibMode CalibrationPresetPage::get_pa_cali_method()
{ {
if (m_pa_cali_method_combox) { if (m_pa_cali_method_combox) {
wxString selected_mode = m_pa_cali_method_combox->get_value(); int selected_mode = m_pa_cali_method_combox->get_selection();
if (selected_mode == PA_LINE) { if (selected_mode == PA_LINE) {
return CalibMode::Calib_PA_Line; return CalibMode::Calib_PA_Line;
} }

View file

@ -53,6 +53,7 @@ public:
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL); long style = wxTAB_TRAVERSAL);
int get_selection() const;
wxString get_value() const; wxString get_value() const;
void set_values(const wxArrayString& values); void set_values(const wxArrayString& values);