Merge remote-tracking branch 'origin/dev_native' into ys_dev_native

This commit is contained in:
YuSanka 2018-10-05 23:39:51 +02:00
commit 42fd6bc7b5
13 changed files with 205 additions and 91 deletions

View file

@ -33,6 +33,12 @@
namespace Slic3r {
namespace GUI {
wxDEFINE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent);
wxDEFINE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent);
// sub new
void Tab::create_preset_tab()
{
m_preset_bundle = wxGetApp().preset_bundle;
@ -659,31 +665,28 @@ void Tab::load_key_value(const std::string& opt_key, const boost::any& value, bo
update();
}
// extern wxFrame *g_wxMainFrame; // #ys_FIXME
void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
{
if (m_event_value_change > 0) {
wxCommandEvent event(m_event_value_change);
std::string str_out = opt_key + " " + m_name;
event.SetString(str_out);
if (opt_key == "extruders_count")
{
int val = boost::any_cast<size_t>(value);
event.SetInt(val);
}
if (opt_key == "printer_technology")
{
int val = boost::any_cast<PrinterTechnology>(value);
event.SetInt(val);
// g_wxMainFrame->ProcessWindowEvent(event);// #ys_FIXME
return;
}
// g_wxMainFrame->ProcessWindowEvent(event);// #ys_FIXME
wxCommandEvent event(EVT_TAB_VALUE_CHANGED);
event.SetEventObject(this);
event.SetString(opt_key);
if (opt_key == "extruders_count")
{
int val = boost::any_cast<size_t>(value);
event.SetInt(val);
}
if (opt_key == "printer_technology")
{
int val = boost::any_cast<PrinterTechnology>(value);
event.SetInt(val);
wxPostEvent(this, event);
return;
}
wxPostEvent(this, event);
auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params();
if (opt_key == "fill_density")
{
@ -736,11 +739,9 @@ void Tab::update_wiping_button_visibility() {
// to uddate number of "filament" selection boxes when the number of extruders change.
void Tab::on_presets_changed()
{
if (m_event_presets_changed > 0) {
wxCommandEvent event(m_event_presets_changed);
event.SetString(m_name);
// g_wxMainFrame->ProcessWindowEvent(event); // #ys_FIXME
}
wxCommandEvent event(EVT_TAB_PRESETS_CHANGED);
event.SetEventObject(this);
wxPostEvent(this, event);
update_preset_description_line();
}