Tech ENABLE_WORLD_COORDINATE - Fixed visualization of sidebar hints when editing values in Object manipulation fields while using an MMU printer

This commit is contained in:
enricoturri1966 2021-10-27 13:29:50 +02:00
parent 977d530cce
commit d288cbfde5
2 changed files with 23 additions and 0 deletions

View File

@ -2542,7 +2542,13 @@ void ObjectList::part_selection_changed()
Sidebar& panel = wxGetApp().sidebar(); Sidebar& panel = wxGetApp().sidebar();
panel.Freeze(); panel.Freeze();
#if ENABLE_WORLD_COORDINATE
const ManipulationEditor* const editor = wxGetApp().obj_manipul()->get_focused_editor();
const std::string opt_key = (editor != nullptr) ? editor->get_full_opt_name() : "";
wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event(opt_key, !opt_key.empty());
#else
wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event("", false); wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event("", false);
#endif // ENABLE_WORLD_COORDINATE
wxGetApp().obj_manipul() ->UpdateAndShow(update_and_show_manipulations); wxGetApp().obj_manipul() ->UpdateAndShow(update_and_show_manipulations);
wxGetApp().obj_settings()->UpdateAndShow(update_and_show_settings); wxGetApp().obj_settings()->UpdateAndShow(update_and_show_settings);
wxGetApp().obj_layers() ->UpdateAndShow(update_and_show_layers); wxGetApp().obj_layers() ->UpdateAndShow(update_and_show_layers);

View File

@ -57,6 +57,10 @@ public:
void set_value(const wxString& new_value); void set_value(const wxString& new_value);
void kill_focus(ObjectManipulation *parent); void kill_focus(ObjectManipulation *parent);
#if ENABLE_WORLD_COORDINATE
const std::string& get_full_opt_name() const { return m_full_opt_name; }
#endif // ENABLE_WORLD_COORDINATE
private: private:
double get_value(); double get_value();
}; };
@ -152,10 +156,15 @@ private:
ScalableBitmap m_manifold_warning_bmp; ScalableBitmap m_manifold_warning_bmp;
wxStaticBitmap* m_fix_throught_netfab_bitmap; wxStaticBitmap* m_fix_throught_netfab_bitmap;
#if ENABLE_WORLD_COORDINATE
// Currently focused editor (nullptr if none)
ManipulationEditor* m_focused_editor{ nullptr };
#else
#ifndef __APPLE__ #ifndef __APPLE__
// Currently focused editor (nullptr if none) // Currently focused editor (nullptr if none)
ManipulationEditor* m_focused_editor {nullptr}; ManipulationEditor* m_focused_editor {nullptr};
#endif // __APPLE__ #endif // __APPLE__
#endif // ENABLE_WORLD_COORDINATE
wxFlexGridSizer* m_main_grid_sizer; wxFlexGridSizer* m_main_grid_sizer;
wxFlexGridSizer* m_labels_grid_sizer; wxFlexGridSizer* m_labels_grid_sizer;
@ -205,11 +214,19 @@ public:
void sys_color_changed(); void sys_color_changed();
void on_change(const std::string& opt_key, int axis, double new_value); void on_change(const std::string& opt_key, int axis, double new_value);
void set_focused_editor(ManipulationEditor* focused_editor) { void set_focused_editor(ManipulationEditor* focused_editor) {
#if ENABLE_WORLD_COORDINATE
m_focused_editor = focused_editor;
#else
#ifndef __APPLE__ #ifndef __APPLE__
m_focused_editor = focused_editor; m_focused_editor = focused_editor;
#endif // __APPLE__ #endif // __APPLE__
#endif // ENABLE_WORLD_COORDINATE
} }
#if ENABLE_WORLD_COORDINATE
ManipulationEditor* get_focused_editor() { return m_focused_editor; }
#endif // ENABLE_WORLD_COORDINATE
private: private:
void reset_settings_value(); void reset_settings_value();
void update_settings_value(const Selection& selection); void update_settings_value(const Selection& selection);