Added reset buttons description

This commit is contained in:
YuSanka 2018-04-20 12:58:07 +02:00
parent 88dadcec78
commit 1e1bf03f61
9 changed files with 74 additions and 33 deletions

View file

@ -8,6 +8,7 @@
#include "slic3r/Utils/OctoPrint.hpp"
#include "BonjourDialog.hpp"
#include "WipeTowerDialog.hpp"
#include "ButtonsDescription.hpp"
#include <wx/app.h>
#include <wx/button.h>
@ -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)