diff --git a/resources/icons/question_mark_01.png b/resources/icons/question_mark_01.png new file mode 100644 index 0000000000..25814a61d4 Binary files /dev/null and b/resources/icons/question_mark_01.png differ diff --git a/xs/src/slic3r/GUI/2DBed.hpp b/xs/src/slic3r/GUI/2DBed.hpp index a170b708ad..4b14986a2b 100644 --- a/xs/src/slic3r/GUI/2DBed.hpp +++ b/xs/src/slic3r/GUI/2DBed.hpp @@ -1,3 +1,6 @@ +#ifndef slic3r_2DBed_hpp_ +#define slic3r_2DBed_hpp_ + #include #include "Config.hpp" @@ -45,3 +48,5 @@ public: } // GUI } // Slic3r + +#endif /* slic3r_2DBed_hpp_ */ diff --git a/xs/src/slic3r/GUI/BedShapeDialog.hpp b/xs/src/slic3r/GUI/BedShapeDialog.hpp index f4614c3426..5ff4880637 100644 --- a/xs/src/slic3r/GUI/BedShapeDialog.hpp +++ b/xs/src/slic3r/GUI/BedShapeDialog.hpp @@ -1,3 +1,5 @@ +#ifndef slic3r_BedShapeDialog_hpp_ +#define slic3r_BedShapeDialog_hpp_ // The bed shape dialog. // The dialog opens from Print Settins tab->Bed Shape : Set... @@ -49,3 +51,6 @@ public: } // GUI } // Slic3r + + +#endif /* slic3r_BedShapeDialog_hpp_ */ diff --git a/xs/src/slic3r/GUI/Field.cpp b/xs/src/slic3r/GUI/Field.cpp index ff17a2ef8f..2527202879 100644 --- a/xs/src/slic3r/GUI/Field.cpp +++ b/xs/src/slic3r/GUI/Field.cpp @@ -22,7 +22,7 @@ namespace Slic3r { namespace GUI { auto color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); auto sz = 16; #ifdef __WXGTK__ - sz = 28 + sz = 28; #endif // __WXGTK__ m_Undo_btn = new wxButton(m_parent, wxID_ANY, "", wxDefaultPosition, wxSize(sz,sz), wxNO_BORDER); m_Undo_to_sys_btn = new wxButton(m_parent, wxID_ANY, "", wxDefaultPosition, wxSize(sz,sz), wxNO_BORDER); diff --git a/xs/src/slic3r/GUI/OptionsGroup.hpp b/xs/src/slic3r/GUI/OptionsGroup.hpp index 92ebb44881..6a00cbe0d7 100644 --- a/xs/src/slic3r/GUI/OptionsGroup.hpp +++ b/xs/src/slic3r/GUI/OptionsGroup.hpp @@ -1,3 +1,6 @@ +#ifndef slic3r_OptionsGroup_hpp_ +#define slic3r_OptionsGroup_hpp_ + #include #include #include @@ -204,3 +207,5 @@ public: }; }} + +#endif /* slic3r_OptionsGroup_hpp_ */ diff --git a/xs/src/slic3r/GUI/Preferences.hpp b/xs/src/slic3r/GUI/Preferences.hpp index c30e94d225..f94a1db69e 100644 --- a/xs/src/slic3r/GUI/Preferences.hpp +++ b/xs/src/slic3r/GUI/Preferences.hpp @@ -1,3 +1,6 @@ +#ifndef slic3r_Preferences_hpp_ +#define slic3r_Preferences_hpp_ + #include "GUI.hpp" #include @@ -25,3 +28,5 @@ public: } // GUI } // Slic3r + +#endif /* slic3r_Preferences_hpp_ */ diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 0491965990..48521461c3 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -8,6 +8,7 @@ #include "slic3r/Utils/OctoPrint.hpp" #include "BonjourDialog.hpp" #include "WipeTowerDialog.hpp" +#include "ButtonsDescription.hpp" #include #include @@ -103,38 +104,25 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle) m_undo_btn = new wxButton(panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT | wxNO_BORDER); m_undo_to_sys_btn = new wxButton(panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT | wxNO_BORDER); m_question_btn = new wxButton(panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT | wxNO_BORDER); - m_undo_btns_legent = new wxStaticText(panel, wxID_ANY, _(L("For more information about buttons hover the mouse cursor over them.")), wxDefaultPosition, wxDefaultSize); +// m_undo_btns_legent = new wxStaticText(panel, wxID_ANY, _(L("For more information about buttons hover the mouse cursor over them.")), wxDefaultPosition, wxDefaultSize); if (wxMSW) { m_undo_btn->SetBackgroundColour(color); m_undo_to_sys_btn->SetBackgroundColour(color); m_question_btn->SetBackgroundColour(color); } -#ifdef __WXMSW__ - m_undo_to_sys_btn->SetToolTip(_(L( "Unlocked lock icon indicates about some value changes compared with system values " + m_undo_to_sys_btn->SetToolTip(_(L( "UNLOCKED LOCK icon indicates about some value changes compared with system values " "in current option group.\n" - "Locked lock icon indicates about same values compared with system values " + "LOCKED LOCK icon indicates about same values compared with system values " "in current option group.\n" - "White bullet icon indicates about nonsystem preset.\n" - "Click the unlocked lock to revert all values in current option group to system values."))); -#else - // ToolTips to undo buttons - m_undo_btn_tip = new wxRichToolTip("Information about current button", - _(L("Unlocked lock icon indicates about some value changes compared with system values " - "in current option group.\n" - "Locked lock icon indicates about same values compared with system values " - "in current option group.\n" - "White bullet icon indicates about nonsystem preset.\n" - "Click the unlocked lock to revert all values in current option group to system values."))); - m_undo_btn_tip->SetIcon(wxICON_INFORMATION); - m_undo_btn_tip->ShowFor(m_undo_btn); -#endif //__WXMSW__ + "WHITE BULLET icon indicates about nonsystem preset.\n\n" + "Click the UNLOCKED LOCK to revert all values in current option group to system values."))); - m_undo_btn->SetToolTip(_(L( "Back arrow icon indicates about some value changes compared with last saved preset values " + m_undo_btn->SetToolTip(_(L( "BACK ARROW icon indicates about some value changes compared with last saved preset values " "in current option group.\n" - "White bullet icon indicates about same values compared with last saved preset values " - "in current option group.\n" - "Click the Back arrow to revert all values in current option group to last saved preset values."))); + "WHITE BULLET icon indicates about same values compared with last saved preset values " + "in current option group.\n\n" + "Click the BACK ARROW to revert all values in current option group to last saved preset values."))); m_question_btn->SetToolTip(_(L("Hover the cursor over buttons to find more information."))); @@ -147,11 +135,18 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle) m_bmp_white_bullet .LoadFile(from_u8(var("bullet_white.png")), wxBITMAP_TYPE_PNG); m_bmp_question .LoadFile(from_u8(var("question_mark_01.png")), wxBITMAP_TYPE_PNG); + fill_icon_descriptions(); + m_undo_btn->SetBitmap(m_bmp_white_bullet); m_undo_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent){ on_roll_back_value(); })); m_undo_to_sys_btn->SetBitmap(m_bmp_white_bullet); m_undo_to_sys_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent){ on_roll_back_value(true); })); m_question_btn->SetBitmap(m_bmp_question); + m_question_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent) + { + auto dlg = new ButtonsDescription(parent(), &m_icon_descriptions); + dlg->ShowModal(); + })); // Colors for ui "decoration" m_sys_label_clr = get_sys_label_clr(); @@ -170,9 +165,9 @@ void Tab::create_preset_tab(PresetBundle *preset_bundle) m_hsizer->AddSpacer(64); m_hsizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL); m_hsizer->Add(m_undo_btn, 0, wxALIGN_CENTER_VERTICAL); - m_hsizer->AddSpacer(16); + m_hsizer->AddSpacer(32); m_hsizer->Add(m_question_btn, 0, wxALIGN_CENTER_VERTICAL); - m_hsizer->Add(m_undo_btns_legent, 0, wxALIGN_CENTER_VERTICAL); +// m_hsizer->Add(m_undo_btns_legent, 0, wxALIGN_CENTER_VERTICAL); // m_hsizer->AddSpacer(64); // m_hsizer->Add(m_cc_presets_choice, 1, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, 3); @@ -2354,6 +2349,22 @@ void Tab::update_tab_presets(wxComboCtrl* ui, bool show_incompatible) ui->Thaw(); } +void Tab::fill_icon_descriptions() +{ + m_icon_descriptions.push_back(t_icon_description(&m_bmp_value_lock, L("LOCKED LOCK;" + "indicates about same values compared with system values in current option group"))); + + m_icon_descriptions.push_back(t_icon_description(&m_bmp_value_unlock, L("UNLOCKED LOCK;" + "indicates about some value changes compared with system values in current option group"))); + + m_icon_descriptions.push_back(t_icon_description(&m_bmp_white_bullet, L("WHITE BULLET;" + "indicates about : \n - nonsystem preset (on left button)" + "\n - same values compared with last saved preset values in current option group(on right button)"))); + + m_icon_descriptions.push_back(t_icon_description(&m_bmp_value_revert, L("BACK ARROW;" + "indicates about some value changes compared with last saved preset values in current option group"))); +} + void Page::reload_config() { for (auto group : m_optgroups) diff --git a/xs/src/slic3r/GUI/Tab.hpp b/xs/src/slic3r/GUI/Tab.hpp index 364608dc10..ba449c8c7e 100644 --- a/xs/src/slic3r/GUI/Tab.hpp +++ b/xs/src/slic3r/GUI/Tab.hpp @@ -1,3 +1,6 @@ +#ifndef slic3r_Tab_hpp_ +#define slic3r_Tab_hpp_ + // The "Expert" tab at the right of the main tabbed window. // // This file implements following packages: @@ -22,7 +25,6 @@ #include #include #include -#include #include #include @@ -35,6 +37,9 @@ namespace Slic3r { namespace GUI { +typedef std::pair t_icon_description; +typedef std::vector> t_icon_descriptions; + // Single Tab page containing a{ vsizer } of{ optgroups } // package Slic3r::GUI::Tab::Page; using ConfigOptionsGroupShp = std::shared_ptr; @@ -113,8 +118,7 @@ protected: wxButton* m_undo_btn; wxButton* m_undo_to_sys_btn; wxButton* m_question_btn; - wxStaticText* m_undo_btns_legent; - wxRichToolTip* m_undo_btn_tip; +// wxStaticText* m_undo_btns_legent; wxComboCtrl* m_cc_presets_choice; wxDataViewTreeCtrl* m_presetctrl; @@ -152,6 +156,8 @@ protected: std::map m_options_list; int m_opt_status_value; + t_icon_descriptions m_icon_descriptions = {}; + // The two following two event IDs are generated at Plater.pm by calling Wx::NewEventType. wxEventType m_event_value_change = 0; wxEventType m_event_presets_changed = 0; @@ -179,10 +185,6 @@ public: } ~Tab(){ delete_tab_from_list(this); - if (m_undo_btn_tip){ - delete m_undo_btn_tip; - m_undo_btn_tip = nullptr; - } } wxWindow* parent() const { return m_parent; } @@ -249,6 +251,7 @@ protected: void update_frequently_changed_parameters(); void update_wiping_button_visibility(); void update_tab_presets(wxComboCtrl* ui, bool show_incompatible); + void fill_icon_descriptions(); }; //Slic3r::GUI::Tab::Print; @@ -327,3 +330,5 @@ public: } // GUI } // Slic3r + +#endif /* slic3r_Tab_hpp_ */ diff --git a/xs/src/slic3r/GUI/TabIface.hpp b/xs/src/slic3r/GUI/TabIface.hpp index 0325c855c7..5622634e8f 100644 --- a/xs/src/slic3r/GUI/TabIface.hpp +++ b/xs/src/slic3r/GUI/TabIface.hpp @@ -1,3 +1,6 @@ +#ifndef slic3r_TabIface_hpp_ +#define slic3r_TabIface_hpp_ + #include #include @@ -30,6 +33,8 @@ public: protected: GUI::Tab *m_tab; -}; +}; // namespace GUI }; // namespace Slic3r + +#endif /* slic3r_TabIface_hpp_ */