mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 08:05:55 +08:00
G=code substitutions: Debugger: Fixed wxWidgets assert when new substitution is added
+ Fixed representation of the gcode_substitution in DiffDialog and UnsavedChangesDialog
This commit is contained in:
parent
ddb14fa7f9
commit
ea84a46cdc
@ -4000,7 +4000,7 @@ void SubstitutionManager::add_substitution( int substitution_id,
|
|||||||
|
|
||||||
editor->SetFont(wxGetApp().normal_font());
|
editor->SetFont(wxGetApp().normal_font());
|
||||||
wxGetApp().UpdateDarkUI(editor);
|
wxGetApp().UpdateDarkUI(editor);
|
||||||
top_sizer->Add(editor, proportion, wxALIGN_CENTER_VERTICAL | wxEXPAND| wxRIGHT, m_em);
|
top_sizer->Add(editor, proportion, wxALIGN_CENTER_VERTICAL | wxRIGHT, m_em);
|
||||||
|
|
||||||
editor->Bind(wxEVT_TEXT_ENTER, [this, editor, substitution_id, opt_pos](wxEvent& e) {
|
editor->Bind(wxEVT_TEXT_ENTER, [this, editor, substitution_id, opt_pos](wxEvent& e) {
|
||||||
#if !defined(__WXGTK__)
|
#if !defined(__WXGTK__)
|
||||||
@ -4065,7 +4065,7 @@ void SubstitutionManager::add_substitution( int substitution_id,
|
|||||||
auto v_sizer = new wxBoxSizer(wxVERTICAL);
|
auto v_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
v_sizer->Add(top_sizer, 1, wxEXPAND);
|
v_sizer->Add(top_sizer, 1, wxEXPAND);
|
||||||
v_sizer->Add(params_sizer, 1, wxEXPAND|wxTOP|wxBOTTOM, int(0.5* m_em));
|
v_sizer->Add(params_sizer, 1, wxEXPAND|wxTOP|wxBOTTOM, int(0.5* m_em));
|
||||||
m_grid_sizer->Add(v_sizer, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND);
|
m_grid_sizer->Add(v_sizer, 1, wxEXPAND);
|
||||||
|
|
||||||
if (call_after_layout) {
|
if (call_after_layout) {
|
||||||
m_parent->GetParent()->Layout();
|
m_parent->GetParent()->Layout();
|
||||||
|
@ -1158,10 +1158,11 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig&
|
|||||||
}
|
}
|
||||||
if (opt_key == "gcode_substitutions") {
|
if (opt_key == "gcode_substitutions") {
|
||||||
if (!strings->empty())
|
if (!strings->empty())
|
||||||
for (size_t id = 0; id < strings->size(); id += 3)
|
for (size_t id = 0; id < strings->size(); id += 4)
|
||||||
out += from_u8(strings->get_at(id)) + ";\t" +
|
out += from_u8(strings->get_at(id)) + ";\t" +
|
||||||
from_u8(strings->get_at(id + 1)) + ";\t" +
|
from_u8(strings->get_at(id + 1)) + ";\t" +
|
||||||
from_u8(strings->get_at(id + 2)) + ";\n";
|
from_u8(strings->get_at(id + 2)) + ";\t" +
|
||||||
|
from_u8(strings->get_at(id + 3)) + ";\n";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
if (!strings->empty() && opt_idx < strings->values.size())
|
if (!strings->empty() && opt_idx < strings->values.size())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user