diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 5644a0806..4d4de489e 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1048,9 +1048,8 @@ void ObjectList::add_object_to_list(size_t obj_idx) int errors = stats.degenerate_facets + stats.edges_fixed + stats.facets_removed + stats.facets_added + stats.facets_reversed + stats.backwards_edges; if (errors > 0) { - const PrusaDataViewBitmapText data(item_name, m_icon_manifold_warning); wxVariant variant; - variant << data; + variant << PrusaDataViewBitmapText(item_name, m_icon_manifold_warning); m_objects_model->SetValue(variant, item, 0); } diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 23ad288b8..9c9bcdaea 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -684,8 +684,7 @@ void PrusaObjectDataViewModel::GetValue(wxVariant &variant, const wxDataViewItem switch (col) { case 0:{ - const PrusaDataViewBitmapText data(node->m_name, node->m_bmp); - variant << data; + variant << PrusaDataViewBitmapText(node->m_name, node->m_bmp); break;} case 1: variant = node->m_copy; @@ -891,7 +890,14 @@ void PrusaObjectDataViewModel::UpdateSettingsDigest(const wxDataViewItem &item, ItemChanged(item); } +//----------------------------------------------------------------------------- +// PrusaDataViewBitmapText +//----------------------------------------------------------------------------- + +wxIMPLEMENT_DYNAMIC_CLASS(PrusaDataViewBitmapText, wxObject) + IMPLEMENT_VARIANT_OBJECT(PrusaDataViewBitmapText) + // --------------------------------------------------------- // PrusaIconTextRenderer // --------------------------------------------------------- diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index 33315880f..43e5756a4 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -184,6 +184,8 @@ public: private: wxString m_text; wxBitmap m_bmp; + + wxDECLARE_DYNAMIC_CLASS(PrusaDataViewBitmapText); }; DECLARE_VARIANT_OBJECT(PrusaDataViewBitmapText) @@ -476,7 +478,7 @@ class PrusaBitmapTextRenderer : public wxDataViewCustomRenderer public: PrusaBitmapTextRenderer( wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align = wxDVR_DEFAULT_ALIGNMENT): - wxDataViewCustomRenderer(wxT("wxObject"), mode, align) {} + wxDataViewCustomRenderer(wxT("PrusaDataViewBitmapText"), mode, align) {} bool SetValue(const wxVariant &value); bool GetValue(wxVariant &value) const; @@ -487,7 +489,6 @@ public: virtual bool HasEditorCtrl() const { return false; } private: -// wxDataViewIconText m_value; PrusaDataViewBitmapText m_value; };