diff options
Diffstat (limited to 'src/slic3r/GUI/wxExtensions.hpp')
-rw-r--r-- | src/slic3r/GUI/wxExtensions.hpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index f78621a5c..7e613cff9 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -374,6 +374,67 @@ private: bool show {false}; }; +// ---------------------------------------------------------------------------- +// Highlighter +// ---------------------------------------------------------------------------- + +namespace Slic3r { +namespace GUI { + +class OG_CustomCtrl; + +// Highlighter is used as an instrument to put attention to some UI control + +class Highlighter +{ + int m_blink_counter { 0 }; + wxTimer m_timer; + +public: + Highlighter() {} + ~Highlighter() {} + + void set_timer_owner(wxWindow* owner, int timerid = wxID_ANY); + virtual void bind_timer(wxWindow* owner) = 0; + bool init(bool input_failed); + void blink(); + void invalidate(); +}; + +class HighlighterForWx : public Highlighter +{ +// There are 2 possible cases to use HighlighterForWx: +// - using a BlinkingBitmap. Change state of this bitmap + BlinkingBitmap* m_blinking_bitmap { nullptr }; +// - using OG_CustomCtrl where arrow will be rendered and flag indicated "show/hide" state of this arrow + OG_CustomCtrl* m_custom_ctrl { nullptr }; + bool* m_show_blink_ptr { nullptr }; + +public: + HighlighterForWx() {} + ~HighlighterForWx() {} + + void bind_timer(wxWindow* owner) override; + void init(BlinkingBitmap* blinking_bitmap); + void init(std::pair<OG_CustomCtrl*, bool*>); + void blink(); + void invalidate(); +}; +/* +class HighlighterForImGUI : public Highlighter +{ + +public: + HighlighterForImGUI() {} + ~HighlighterForImGUI() {} + + void init(); + void blink(); + void invalidate(); +}; +*/ +} // GUI +} // Slic3r #endif // slic3r_GUI_wxExtensions_hpp_ |