From 18a6205738ce8a4a817533d70311aab30b0387f0 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 17 Dec 2018 08:37:50 +0100 Subject: [PATCH] Fixed build on OSX & Linux --- src/libslic3r/Technologies.hpp | 2 ++ src/slic3r/GUI/wxExtensions.cpp | 22 ++++++++++++---------- src/slic3r/GUI/wxExtensions.hpp | 19 +++++++++++++------ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index cef735db0..e0c35d55c 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -36,6 +36,8 @@ #define ENABLE_REMOVE_TABS_FROM_PLATER (1 && ENABLE_1_42_0) // Constrains the camera target into the scene bounding box #define ENABLE_CONSTRAINED_CAMERA_TARGET (1 && ENABLE_1_42_0) +// Use wxDataViewRender instead of wxDataViewCustomRenderer +#define ENABLE_NONCUSTOM_DATA_VIEW_RENDERING (0 && ENABLE_1_42_0) #endif // _technologies_h_ diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 710710913..98e758bc8 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -1228,14 +1228,6 @@ void PrusaObjectDataViewModel::SetVolumeType(const wxDataViewItem &item, const i ItemChanged(item); } -PrusaBitmapTextRenderer::PrusaBitmapTextRenderer(wxDataViewCellMode mode /*= wxDATAVIEW_CELL_EDITABLE*/, - int align /*= wxDVR_DEFAULT_ALIGNMENT*/): -wxDataViewRenderer(wxT("PrusaDataViewBitmapText"), mode, align) -{ - SetMode(mode); - SetAlignment(align); -} - //----------------------------------------------------------------------------- // PrusaDataViewBitmapText //----------------------------------------------------------------------------- @@ -1248,6 +1240,16 @@ IMPLEMENT_VARIANT_OBJECT(PrusaDataViewBitmapText) // PrusaIconTextRenderer // --------------------------------------------------------- +#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING +PrusaBitmapTextRenderer::PrusaBitmapTextRenderer(wxDataViewCellMode mode /*= wxDATAVIEW_CELL_EDITABLE*/, + int align /*= wxDVR_DEFAULT_ALIGNMENT*/): +wxDataViewRenderer(wxT("PrusaDataViewBitmapText"), mode, align) +{ + SetMode(mode); + SetAlignment(align); +} +#endif // ENABLE_NONCUSTOM_DATA_VIEW_RENDERING + bool PrusaBitmapTextRenderer::SetValue(const wxVariant &value) { m_value << value; @@ -1259,12 +1261,12 @@ bool PrusaBitmapTextRenderer::GetValue(wxVariant& WXUNUSED(value)) const return false; } -#if wxUSE_ACCESSIBILITY +#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING && wxUSE_ACCESSIBILITY wxString PrusaBitmapTextRenderer::GetAccessibleDescription() const { return m_value.GetText(); } -#endif // wxUSE_ACCESSIBILITY +#endif // wxUSE_ACCESSIBILITY && ENABLE_NONCUSTOM_DATA_VIEW_RENDERING bool PrusaBitmapTextRenderer::Render(wxRect rect, wxDC *dc, int state) { diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index e3fd1cbf6..637f1bcff 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -518,19 +518,26 @@ public: // ---------------------------------------------------------------------------- // PrusaBitmapTextRenderer // ---------------------------------------------------------------------------- - -class PrusaBitmapTextRenderer : public wxDataViewRenderer//CustomRenderer +#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING +class PrusaBitmapTextRenderer : public wxDataViewRenderer +#else +class PrusaBitmapTextRenderer : public wxDataViewCustomRenderer +#endif //ENABLE_NONCUSTOM_DATA_VIEW_RENDERING { public: PrusaBitmapTextRenderer(wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, - int align = wxDVR_DEFAULT_ALIGNMENT);//: -// wxDataViewRenderer/*CustomRenderer*/(wxT("PrusaDataViewBitmapText"), mode, align) {} + int align = wxDVR_DEFAULT_ALIGNMENT +#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING + ); +#else + ) : wxDataViewCustomRenderer(wxT("PrusaDataViewBitmapText"), mode, align) {} +#endif //ENABLE_NONCUSTOM_DATA_VIEW_RENDERING bool SetValue(const wxVariant &value); bool GetValue(wxVariant &value) const; -#if wxUSE_ACCESSIBILITY +#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING && wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const override; -#endif // wxUSE_ACCESSIBILITY +#endif // wxUSE_ACCESSIBILITY && ENABLE_NONCUSTOM_DATA_VIEW_RENDERING virtual bool Render(wxRect cell, wxDC *dc, int state); virtual wxSize GetSize() const;