OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PAPageHelpPanel Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/CalibrationWizardPage.hpp>

Inheritance diagram for Slic3r::GUI::PAPageHelpPanel:
Collaboration diagram for Slic3r::GUI::PAPageHelpPanel:

Public Member Functions

 PAPageHelpPanel (wxWindow *parent, bool ground_panel=true, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void msw_rescale ()

Protected Member Functions

void create_pop_window ()

Protected Attributes

ScalableButton * m_help_btn
PopupWindow * m_pop_win
ScalableBitmap m_bmp
wxStaticBitmap * m_img

Detailed Description

Constructor & Destructor Documentation

◆ PAPageHelpPanel()

Slic3r::GUI::PAPageHelpPanel::PAPageHelpPanel ( wxWindow * parent,
bool ground_panel = true,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL )
622 : wxPanel(parent, id, pos, size, style)
623{
624 if (ground_panel)
625 SetBackgroundColour(wxColour(238, 238, 238));
626 else
627 SetBackgroundColour(parent->GetBackgroundColour());
628 int left_align_padding = ground_panel ? FromDIP(20) : 0;
629
630 wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL);
631 top_sizer->AddSpacer(FromDIP(10));
632
633 auto help_text_title = new Label(this, _L("How can I use calibration results\?"));
634 help_text_title->SetFont(Label::Head_14);
635 top_sizer->Add(help_text_title, 0, wxLEFT | wxRIGHT, left_align_padding);
636
637 wxBoxSizer* help_text_sizer = new wxBoxSizer(wxHORIZONTAL);
638 auto help_text = new Label(this, _L("You could change the Flow Dynamics Calibration Factor in material editing"));
639 help_text->SetFont(Label::Body_14);
640 m_help_btn = new ScalableButton(this, wxID_ANY, "cali_page_caption_help", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 24);
641 m_help_btn->SetBackgroundColour(m_help_btn->GetParent()->GetBackgroundColour());
642 help_text_sizer->Add(help_text, 0, wxALIGN_CENTER | wxLEFT, left_align_padding);
643 help_text_sizer->Add(m_help_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(8));
644 help_text_sizer->AddSpacer(FromDIP(20));
645
646 top_sizer->Add(help_text_sizer);
647
648 top_sizer->AddSpacer(FromDIP(6));
649
651
652 SetSizer(top_sizer);
653 top_sizer->Fit(this);
654}
#define _L(s)
Definition OBJ.cpp:34
#define style
Definition WipeTowerDialog.cpp:101
static wxFont Head_14
Definition Label.hpp:45
static wxFont Body_14
Definition Label.hpp:53
void create_pop_window()
Definition CalibrationWizardPage.cpp:663
ScalableButton * m_help_btn
Definition CalibrationWizardPage.hpp:215

References _L, Label::Body_14, create_pop_window(), Label::Head_14, m_help_btn, and style.

Here is the call graph for this function:

Member Function Documentation

◆ create_pop_window()

void Slic3r::GUI::PAPageHelpPanel::create_pop_window ( )
protected
664{
665 m_pop_win = new PopupWindow(this);
666 m_pop_win->SetBackgroundColour(*wxWHITE);
667 wxBoxSizer* pop_sizer = new wxBoxSizer(wxVERTICAL);
668 m_pop_win->SetSizer(pop_sizer);
669
670 m_img = new wxStaticBitmap(m_pop_win, wxID_ANY, wxNullBitmap);
671 m_bmp = ScalableBitmap(this, "cali_fdc_editing_diagram", 206);
672 m_img->SetBitmap(m_bmp.bmp());
673 pop_sizer->Add(m_img, 1, wxEXPAND | wxALL, FromDIP(20));
674
675 m_pop_win->Layout();
676 m_pop_win->Fit();
677
678 m_pop_win->Bind(wxEVT_PAINT, [this](auto&) {
679 wxPaintDC dc(m_pop_win);
680 dc.SetPen({ 0xACACAC });
681 dc.SetBrush(*wxTRANSPARENT_BRUSH);
682 dc.DrawRectangle({ 0, 0 }, m_pop_win->GetSize());
683 });
684
685 m_help_btn->Bind(wxEVT_ENTER_WINDOW, [this](auto&) {
686 wxPoint pop_pos = m_help_btn->ClientToScreen(wxPoint(0, 0));
687 pop_pos.x -= FromDIP(60);
688 pop_pos.y -= m_pop_win->GetSize().y + FromDIP(10);
689
690 m_pop_win->Position(pop_pos, wxSize(0, 0));
691 m_pop_win->Popup();
692 });
693 m_help_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto&) {
694 m_pop_win->Dismiss();
695 });
696}
wxStaticBitmap * m_img
Definition CalibrationWizardPage.hpp:218
PopupWindow * m_pop_win
Definition CalibrationWizardPage.hpp:216
ScalableBitmap m_bmp
Definition CalibrationWizardPage.hpp:217

References m_bmp, m_help_btn, m_img, and m_pop_win.

Referenced by PAPageHelpPanel().

Here is the caller graph for this function:

◆ msw_rescale()

void Slic3r::GUI::PAPageHelpPanel::msw_rescale ( )
657{
658 m_help_btn->msw_rescale();
659 m_bmp.msw_rescale();
660 m_img->SetBitmap(m_bmp.bmp());
661}

References m_bmp, m_help_btn, and m_img.

Member Data Documentation

◆ m_bmp

ScalableBitmap Slic3r::GUI::PAPageHelpPanel::m_bmp
protected

Referenced by create_pop_window(), and msw_rescale().

◆ m_help_btn

ScalableButton* Slic3r::GUI::PAPageHelpPanel::m_help_btn
protected

◆ m_img

wxStaticBitmap* Slic3r::GUI::PAPageHelpPanel::m_img
protected

Referenced by create_pop_window(), and msw_rescale().

◆ m_pop_win

PopupWindow* Slic3r::GUI::PAPageHelpPanel::m_pop_win
protected

Referenced by create_pop_window().


The documentation for this class was generated from the following files: