#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/SideMenuPopup.hpp>
◆ SidePopup()
| SidePopup::SidePopup |
( |
wxWindow * | parent | ) |
|
◆ ~SidePopup()
| SidePopup::~SidePopup |
( |
| ) |
|
◆ append_button()
◆ Create() [1/2]
| 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}
#define style
Definition WipeTowerDialog.cpp:101
References GetTopParent(), and style.
Referenced by PopupWindow(), and DropDown::Create().
◆ Create() [2/2]
| void SidePopup::Create |
( |
| ) |
|
88{
89 wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
90
91 int max_width = 0;
94 {
95 max_width = std::max(btn->GetMinSize().x, max_width);
96 }
97
99 {
100 wxSize size = btn->GetMinSize();
102 size.x = max_width;
103 btn->SetMinSize(size);
104 btn->SetSize(size);
105 sizer->Add(btn, 0, 0, 0);
106 }
107
108 SetSize(wxSize(max_width, height));
109
110 SetSizer(sizer, true);
111
112 Layout();
113 Refresh();
114}
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185
References btn_list.
Referenced by Popup().
◆ OnDismiss()
| void SidePopup::OnDismiss |
( |
| ) |
|
|
virtual |
37{
38 Slic3r::GUI::wxGetApp().set_side_menu_popup_status(false);
39 PopupWindow::OnDismiss();
40}
◆ paintEvent()
| void SidePopup::paintEvent |
( |
wxPaintEvent & | evt | ) |
|
117{
118 wxPaintDC dc(this);
119 wxSize size = GetSize();
120 dc.SetBrush(wxTransparentColour);
121 dc.DrawRectangle(0, 0, size.x, size.y);
122}
Referenced by SidePopup(), and wxBEGIN_EVENT_TABLE().
◆ Popup()
| void SidePopup::Popup |
( |
wxWindow * | focus = NULL | ) |
|
|
virtual |
52{
54 auto drect = wxDisplay(GetParent()).GetGeometry();
55 int screenwidth = drect.x + drect.width;
56
57
58 int max_width = 0;
59
61 {
62 max_width = std::max(btn->GetMinSize().x, max_width);
63 }
64 if (focus) {
65 wxPoint
pos = focus->ClientToScreen(wxPoint(0, -6));
66 int anchor_h = focus->GetSize().y + 12;
67
68#ifdef __APPLE__
69 pos.x =
pos.x - FromDIP(20);
70
71
72
73
74 pos.y = focus->ClientToScreen(wxPoint(0, 0)).y;
75 anchor_h = focus->GetSize().y - 2;
76#endif
77
78 if (
pos.x + max_width > screenwidth)
79 Position({
pos.x - (
pos.x + max_width - screenwidth),
pos.y}, {0, anchor_h});
80 else
81 Position(pos, {0, anchor_h});
82 }
83 Slic3r::GUI::wxGetApp().set_side_menu_popup_status(true);
84 PopupWindow::Popup();
85}
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
References btn_list, and Create().
Referenced by Slic3r::GUI::MainFrame::create_side_tools().
◆ ProcessLeftDown()
| bool SidePopup::ProcessLeftDown |
( |
wxMouseEvent & | event | ) |
|
|
virtual |
43{
44 return PopupWindow::ProcessLeftDown(event);
45}
Referenced by SidePopup().
◆ ShouldDismissOnTopWindowDeactivate()
| virtual bool PopupWindow::ShouldDismissOnTopWindowDeactivate |
( |
| ) |
|
|
inlineprotectedvirtualinherited |
◆ Show()
| bool SidePopup::Show |
( |
bool | show = true | ) |
|
|
virtual |
47{
48 return PopupWindow::Show(show);
49}
Referenced by SidePopup().
◆ btn_list
The documentation for this class was generated from the following files: