Merge branch 'master' of https://github.com/prusa3d/Slic3r into dev
This commit is contained in:
commit
407aee9942
3 changed files with 17 additions and 9 deletions
|
@ -286,7 +286,7 @@ void stl_read(stl_file *stl, int first_facet, bool first) {
|
||||||
{
|
{
|
||||||
// skip solid/endsolid
|
// skip solid/endsolid
|
||||||
// (in this order, otherwise it won't work when they are paired in the middle of a file)
|
// (in this order, otherwise it won't work when they are paired in the middle of a file)
|
||||||
fscanf(stl->fp, "endsolid\n");
|
fscanf(stl->fp, "endsolid%*[^\n]\n");
|
||||||
fscanf(stl->fp, "solid%*[^\n]\n"); // name might contain spaces so %*s doesn't work and it also can be empty (just "solid")
|
fscanf(stl->fp, "solid%*[^\n]\n"); // name might contain spaces so %*s doesn't work and it also can be empty (just "solid")
|
||||||
// Leading space in the fscanf format skips all leading white spaces including numerous new lines and tabs.
|
// Leading space in the fscanf format skips all leading white spaces including numerous new lines and tabs.
|
||||||
int res_normal = fscanf(stl->fp, " facet normal %31s %31s %31s", normal_buf[0], normal_buf[1], normal_buf[2]);
|
int res_normal = fscanf(stl->fp, " facet normal %31s %31s %31s", normal_buf[0], normal_buf[1], normal_buf[2]);
|
||||||
|
|
|
@ -238,14 +238,10 @@ namespace Slic3r { namespace GUI {
|
||||||
}), temp->GetId());
|
}), temp->GetId());
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
temp->Bind(wxEVT_KEY_UP, [this](wxKeyEvent& event)
|
// to correct value update on GTK we should call on_change_field() on
|
||||||
{
|
// wxEVT_KEY_UP or wxEVT_TEXT_PASTE instead of wxEVT_TEXT
|
||||||
if (bChangedValueEvent) {
|
temp->Bind(wxEVT_KEY_UP, &TextCtrl::change_field_value, this);
|
||||||
on_change_field();
|
temp->Bind(wxEVT_TEXT_PASTE, &TextCtrl::change_field_value, this);
|
||||||
bChangedValueEvent = false;
|
|
||||||
}
|
|
||||||
event.Skip();
|
|
||||||
});
|
|
||||||
#endif //__WXGTK__
|
#endif //__WXGTK__
|
||||||
|
|
||||||
// select all text using Ctrl+A
|
// select all text using Ctrl+A
|
||||||
|
@ -271,6 +267,17 @@ namespace Slic3r { namespace GUI {
|
||||||
void TextCtrl::enable() { dynamic_cast<wxTextCtrl*>(window)->Enable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(true); }
|
void TextCtrl::enable() { dynamic_cast<wxTextCtrl*>(window)->Enable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(true); }
|
||||||
void TextCtrl::disable() { dynamic_cast<wxTextCtrl*>(window)->Disable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(false); }
|
void TextCtrl::disable() { dynamic_cast<wxTextCtrl*>(window)->Disable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(false); }
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
void TextCtrl::change_field_value(wxEvent& event)
|
||||||
|
{
|
||||||
|
if (bChangedValueEvent) {
|
||||||
|
on_change_field();
|
||||||
|
bChangedValueEvent = false;
|
||||||
|
}
|
||||||
|
event.Skip();
|
||||||
|
};
|
||||||
|
#endif //__WXGTK__
|
||||||
|
|
||||||
void CheckBox::BUILD() {
|
void CheckBox::BUILD() {
|
||||||
auto size = wxSize(wxDefaultSize);
|
auto size = wxSize(wxDefaultSize);
|
||||||
if (m_opt.height >= 0) size.SetHeight(m_opt.height);
|
if (m_opt.height >= 0) size.SetHeight(m_opt.height);
|
||||||
|
|
|
@ -236,6 +236,7 @@ class TextCtrl : public Field {
|
||||||
using Field::Field;
|
using Field::Field;
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
bool bChangedValueEvent = false;
|
bool bChangedValueEvent = false;
|
||||||
|
void change_field_value(wxEvent& event);
|
||||||
#endif //__WXGTK__
|
#endif //__WXGTK__
|
||||||
public:
|
public:
|
||||||
TextCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
TextCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue