ENH: gizmo: use native string for snapshot name

to avoid possible crash issue(not sure)

Change-Id: I34f7859b5eb8d2b9b09093ac9b68d24fa1074612
This commit is contained in:
lane.wei 2022-11-19 16:43:06 +08:00 committed by Lane.Wei
parent ceae5fb0ed
commit fb4f30a4a4
5 changed files with 13 additions and 13 deletions

View File

@ -155,14 +155,14 @@ public:
virtual bool wants_enter_leave_snapshots() const { return false; } virtual bool wants_enter_leave_snapshots() const { return false; }
virtual std::string get_gizmo_entering_text() const { assert(false); return ""; } virtual std::string get_gizmo_entering_text() const { assert(false); return ""; }
virtual std::string get_gizmo_leaving_text() const { assert(false); return ""; } virtual std::string get_gizmo_leaving_text() const { assert(false); return ""; }
virtual std::string get_action_snapshot_name() { return _u8L("Gizmo action"); } virtual std::string get_action_snapshot_name() { return "Gizmo action"; }
void set_common_data_pool(CommonGizmosDataPool* ptr) { m_c = ptr; } void set_common_data_pool(CommonGizmosDataPool* ptr) { m_c = ptr; }
unsigned int get_sprite_id() const { return m_sprite_id; } unsigned int get_sprite_id() const { return m_sprite_id; }
int get_hover_id() const { return m_hover_id; } int get_hover_id() const { return m_hover_id; }
void set_hover_id(int id); void set_hover_id(int id);
void set_highlight_color(const std::array<float, 4>& color); void set_highlight_color(const std::array<float, 4>& color);
void enable_grabber(unsigned int id); void enable_grabber(unsigned int id);

View File

@ -34,9 +34,9 @@ protected:
void show_tooltip_information(float caption_max, float x, float y); void show_tooltip_information(float caption_max, float x, float y);
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering Paint-on supports"); } std::string get_gizmo_entering_text() const override { return "Entering Paint-on supports"; }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving Paint-on supports"); } std::string get_gizmo_leaving_text() const override { return "Leaving Paint-on supports"; }
std::string get_action_snapshot_name() override { return _u8L("Paint-on supports editing"); } std::string get_action_snapshot_name() override { return "Paint-on supports editing"; }
// BBS // BBS
wchar_t m_current_tool = 0; wchar_t m_current_tool = 0;

View File

@ -100,9 +100,9 @@ protected:
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering color painting"); } std::string get_gizmo_entering_text() const override { return "Entering color painting"; }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving color painting"); } std::string get_gizmo_leaving_text() const override { return "Leaving color painting"; }
std::string get_action_snapshot_name() override { return _u8L("Color painting editing"); } std::string get_action_snapshot_name() override { return "Color painting editing"; }
// BBS // BBS
size_t m_selected_extruder_idx = 0; size_t m_selected_extruder_idx = 0;

View File

@ -29,9 +29,9 @@ protected:
wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override; wxString handle_snapshot_action_name(bool shift_down, Button button_down) const override;
std::string get_gizmo_entering_text() const override { return _u8L("Entering Seam painting"); } std::string get_gizmo_entering_text() const override { return "Entering Seam painting"; }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving Seam painting"); } std::string get_gizmo_leaving_text() const override { return "Leaving Seam painting"; }
std::string get_action_snapshot_name() override { return _u8L("Paint-on seam editing"); } std::string get_action_snapshot_name() override { return "Paint-on seam editing"; }
private: private:
bool on_init() override; bool on_init() override;

View File

@ -68,8 +68,8 @@ public:
void reslice_SLA_supports(bool postpone_error_messages = false) const; void reslice_SLA_supports(bool postpone_error_messages = false) const;
bool wants_enter_leave_snapshots() const override { return true; } bool wants_enter_leave_snapshots() const override { return true; }
std::string get_gizmo_entering_text() const override { return _u8L("Entering SLA support points"); } std::string get_gizmo_entering_text() const override { return "Entering SLA support points"; }
std::string get_gizmo_leaving_text() const override { return _u8L("Leaving SLA support points"); } std::string get_gizmo_leaving_text() const override { return "Leaving SLA support points"; }
private: private:
bool on_init() override; bool on_init() override;