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

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

Inheritance diagram for Slic3r::GUI::AmsIntroducePopup:
Collaboration diagram for Slic3r::GUI::AmsIntroducePopup:

Public Member Functions

 AmsIntroducePopup (wxWindow *parent)
 ~AmsIntroducePopup ()
void set_mode (bool enable_ams)
void paintEvent (wxPaintEvent &evt)
virtual void OnDismiss () wxOVERRIDE
virtual bool ProcessLeftDown (wxMouseEvent &event) wxOVERRIDE
bool Create (wxWindow *parent, int flags=wxBORDER_NONE)

Public Attributes

bool is_enable_ams = {false}
Label * m_staticText_top
Label * m_staticText_bottom
wxStaticBitmap * m_img_enable_ams
wxStaticBitmap * m_img_disable_ams

Protected Member Functions

virtual bool ShouldDismissOnTopWindowDeactivate ()

Detailed Description

Constructor & Destructor Documentation

◆ AmsIntroducePopup()

Slic3r::GUI::AmsIntroducePopup::AmsIntroducePopup ( wxWindow * parent)
1949:PopupWindow(parent, wxBORDER_NONE)
1950{
1951 Bind(wxEVT_PAINT, &AmsIntroducePopup::paintEvent, this);
1952 SetBackgroundColour(*wxWHITE);
1953
1954 SetMinSize(wxSize(FromDIP(200), FromDIP(200)));
1955 SetMaxSize(wxSize(FromDIP(200), FromDIP(200)));
1956
1957 wxBoxSizer* bSizer4 = new wxBoxSizer(wxVERTICAL);
1958
1959 m_staticText_top = new Label(this, _L("Do not Enable AMS"));
1961 // m_staticText_top->SetForegroundColour(wxColour("#323A3D"));
1962 m_staticText_top->Wrap(-1);
1963 bSizer4->Add(m_staticText_top, 0, wxALL, 5);
1964
1965 m_staticText_bottom = new Label(this, _L("Print using filament on external spool.")); // Orca: kept string (existing translation)
1966 m_staticText_bottom->Wrap(-1);
1968 m_staticText_bottom->SetForegroundColour(wxColour("#6B6B6B"));
1969 bSizer4->Add(m_staticText_bottom, 0, wxALL, 5);
1970
1971 wxBoxSizer* bSizer5;
1972 bSizer5 = new wxBoxSizer(wxHORIZONTAL);
1973
1974 m_img_enable_ams = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("monitor_upgrade_ams", this, FromDIP(140)), wxDefaultPosition, wxDefaultSize, 0);
1975 m_img_disable_ams = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("disable_ams_demo_icon", this, FromDIP(110)), wxDefaultPosition, wxDefaultSize, 0);
1976
1977 m_img_enable_ams->SetMinSize(wxSize(FromDIP(96), FromDIP(110)));
1978 m_img_disable_ams->SetMinSize(wxSize(FromDIP(96), FromDIP(110)));
1979
1980 bSizer5->Add(m_img_enable_ams, 0, wxALIGN_CENTER, 0);
1981 bSizer5->Add(m_img_disable_ams, 0, wxALIGN_CENTER, 0);
1982
1983 m_img_disable_ams->Hide();
1984 m_img_disable_ams->Hide();
1985
1986
1987 bSizer4->Add(bSizer5, 0, wxALIGN_CENTER | wxBOTTOM, FromDIP(1));
1988
1989
1990 SetSizer(bSizer4);
1991 Layout();
1992 Fit();
1993
1994 wxGetApp().UpdateDarkUIWin(this);
1995}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_13
Definition Label.hpp:46
PopupWindow()
Definition PopupWindow.hpp:10
wxStaticBitmap * m_img_enable_ams
Definition AmsMappingPopup.hpp:503
void paintEvent(wxPaintEvent &evt)
Definition AmsMappingPopup.cpp:2017
Label * m_staticText_bottom
Definition AmsMappingPopup.hpp:502
wxStaticBitmap * m_img_disable_ams
Definition AmsMappingPopup.hpp:504
Label * m_staticText_top
Definition AmsMappingPopup.hpp:501
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References PopupWindow::PopupWindow(), _L, Label::Body_13, create_scaled_bitmap(), Label::Head_13, m_img_disable_ams, m_img_enable_ams, m_staticText_bottom, m_staticText_top, and paintEvent().

Here is the call graph for this function:

◆ ~AmsIntroducePopup()

Slic3r::GUI::AmsIntroducePopup::~AmsIntroducePopup ( )
inline
507{};

Member Function Documentation

◆ Create()

bool PopupWindow::Create ( wxWindow * parent,
int flags = wxBORDER_NONE )
inherited
22{
23 if (!wxPopupTransientWindow::Create(parent, style))
24 return false;
25#ifdef __WXGTK__
26 GetTopParent(parent)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
27#endif
28#ifdef __WXOSX__
29 if (style & wxPU_CONTAINS_CONTROLS)
30 for (auto evt : {wxEVT_LEFT_DOWN, wxEVT_LEFT_UP, wxEVT_LEFT_DCLICK, wxEVT_MOTION, wxEVT_MOUSEWHEEL})
31 Bind(evt, &PopupWindow::OnMouseEvent2, this);
32#endif
33 return true;
34}
static wxWindow * GetTopParent(wxWindow *pWindow)
Definition PopupWindow.cpp:10
#define style
Definition WipeTowerDialog.cpp:101

References GetTopParent(), and style.

Referenced by PopupWindow(), and DropDown::Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDismiss()

void Slic3r::GUI::AmsIntroducePopup::OnDismiss ( )
virtual
2026{}

◆ paintEvent()

void Slic3r::GUI::AmsIntroducePopup::paintEvent ( wxPaintEvent & evt)
2018{
2019 wxPaintDC dc(this);
2020 dc.SetPen(wxColour(0xAC, 0xAC, 0xAC));
2021 dc.SetBrush(*wxTRANSPARENT_BRUSH);
2022 dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
2023}

Referenced by AmsIntroducePopup().

Here is the caller graph for this function:

◆ ProcessLeftDown()

bool Slic3r::GUI::AmsIntroducePopup::ProcessLeftDown ( wxMouseEvent & event)
virtual
2028 {
2029 return PopupWindow::ProcessLeftDown(event);
2030}

References Slic3r::GUI::wxMouseEvent.

◆ set_mode()

void Slic3r::GUI::AmsIntroducePopup::set_mode ( bool enable_ams)
1998{
1999 if (enable_ams) {
2000 m_staticText_top->SetLabelText(_L("Enable AMS"));
2001 m_staticText_bottom->SetLabelText(_L("Print with filament in AMS")); // Orca: kept string (existing translation)
2002 m_img_enable_ams->Show();
2003 m_img_disable_ams->Hide();
2004 }
2005 else {
2006 m_staticText_top->SetLabelText(_L("Do not Enable AMS"));
2007 m_staticText_bottom->SetLabelText(_L("Print with filament on external spool")); // Orca: kept string (existing translation)
2008 m_staticText_bottom->SetMinSize(wxSize(FromDIP(180), -1));
2009 m_staticText_bottom->Wrap(FromDIP(180));
2010 m_img_enable_ams->Hide();
2011 m_img_disable_ams->Show();
2012 }
2013 Layout();
2014 Fit();
2015}

References _L, m_img_disable_ams, m_img_enable_ams, m_staticText_bottom, and m_staticText_top.

◆ ShouldDismissOnTopWindowDeactivate()

virtual bool PopupWindow::ShouldDismissOnTopWindowDeactivate ( )
inlineprotectedvirtualinherited

Reimplemented in DropDown.

28{ return true; }

Member Data Documentation

◆ is_enable_ams

bool Slic3r::GUI::AmsIntroducePopup::is_enable_ams = {false}
500{false};

◆ m_img_disable_ams

wxStaticBitmap* Slic3r::GUI::AmsIntroducePopup::m_img_disable_ams

Referenced by AmsIntroducePopup(), and set_mode().

◆ m_img_enable_ams

wxStaticBitmap* Slic3r::GUI::AmsIntroducePopup::m_img_enable_ams

Referenced by AmsIntroducePopup(), and set_mode().

◆ m_staticText_bottom

Label* Slic3r::GUI::AmsIntroducePopup::m_staticText_bottom

Referenced by AmsIntroducePopup(), and set_mode().

◆ m_staticText_top

Label* Slic3r::GUI::AmsIntroducePopup::m_staticText_top

Referenced by AmsIntroducePopup(), and set_mode().


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