mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Fix compilation on OSX & Linux
This commit is contained in:
parent
733c85936b
commit
d414c6e118
2 changed files with 8 additions and 6 deletions
|
@ -4,6 +4,7 @@
|
||||||
//#include <wx/event.h>
|
//#include <wx/event.h>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <wx/numformatter.h>
|
#include <wx/numformatter.h>
|
||||||
|
#include <wx/tooltip.h>
|
||||||
#include "PrintConfig.hpp"
|
#include "PrintConfig.hpp"
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
|
|
||||||
|
@ -295,7 +296,7 @@ void Choice::set_selection()
|
||||||
case coPercent: {
|
case coPercent: {
|
||||||
double val = m_opt.default_value->getFloat();
|
double val = m_opt.default_value->getFloat();
|
||||||
text_value = val - int(val) == 0 ? wxString::Format(_T("%i"), int(val)) : wxNumberFormatter::ToString(val, 1);
|
text_value = val - int(val) == 0 ? wxString::Format(_T("%i"), int(val)) : wxNumberFormatter::ToString(val, 1);
|
||||||
auto idx = 0;
|
size_t idx = 0;
|
||||||
for (auto el : m_opt.enum_values)
|
for (auto el : m_opt.enum_values)
|
||||||
{
|
{
|
||||||
if (el.compare(text_value) == 0)
|
if (el.compare(text_value) == 0)
|
||||||
|
@ -316,7 +317,7 @@ void Choice::set_selection()
|
||||||
case coInt:{
|
case coInt:{
|
||||||
int val = m_opt.default_value->getInt(); //!!
|
int val = m_opt.default_value->getInt(); //!!
|
||||||
text_value = wxString::Format(_T("%i"), int(val));
|
text_value = wxString::Format(_T("%i"), int(val));
|
||||||
auto idx = 0;
|
size_t idx = 0;
|
||||||
for (auto el : m_opt.enum_values)
|
for (auto el : m_opt.enum_values)
|
||||||
{
|
{
|
||||||
if (el.compare(text_value) == 0)
|
if (el.compare(text_value) == 0)
|
||||||
|
@ -331,7 +332,7 @@ void Choice::set_selection()
|
||||||
case coStrings:{
|
case coStrings:{
|
||||||
text_value = static_cast<const ConfigOptionStrings*>(m_opt.default_value)->values.at(0);
|
text_value = static_cast<const ConfigOptionStrings*>(m_opt.default_value)->values.at(0);
|
||||||
|
|
||||||
auto idx = 0;
|
size_t idx = 0;
|
||||||
for (auto el : m_opt.enum_values)
|
for (auto el : m_opt.enum_values)
|
||||||
{
|
{
|
||||||
if (el.compare(text_value) == 0)
|
if (el.compare(text_value) == 0)
|
||||||
|
@ -350,7 +351,7 @@ void Choice::set_value(const std::string value) //! Redundant?
|
||||||
{
|
{
|
||||||
m_disable_change_event = true;
|
m_disable_change_event = true;
|
||||||
|
|
||||||
auto idx=0;
|
size_t idx=0;
|
||||||
for (auto el : m_opt.enum_values)
|
for (auto el : m_opt.enum_values)
|
||||||
{
|
{
|
||||||
if (el.compare(value) == 0)
|
if (el.compare(value) == 0)
|
||||||
|
@ -535,7 +536,8 @@ void PointCtrl::set_value(boost::any value)
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
int i=0;
|
std::cerr << "Error! Can't cast PointCtrl value" << m_opt_id << "\n";
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_value(pt);
|
set_value(pt);
|
||||||
|
|
|
@ -87,7 +87,7 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle)
|
||||||
m_treectrl->Bind(wxEVT_COMBOBOX, &Tab::OnComboBox, this);
|
m_treectrl->Bind(wxEVT_COMBOBOX, &Tab::OnComboBox, this);
|
||||||
|
|
||||||
m_presets_choice->Bind(wxEVT_COMBOBOX, ([this](wxCommandEvent e){
|
m_presets_choice->Bind(wxEVT_COMBOBOX, ([this](wxCommandEvent e){
|
||||||
select_preset(static_cast<const wxComboBox*>(m_presets_choice)->GetStringSelection().ToStdString());
|
select_preset(static_cast<const wxBitmapComboBox*>(m_presets_choice)->GetStringSelection().ToStdString());
|
||||||
}));
|
}));
|
||||||
|
|
||||||
m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e){ save_preset(); }));
|
m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e){ save_preset(); }));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue