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

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

Inheritance diagram for Slic3r::GUI::AmsHumidityLevelList:
Collaboration diagram for Slic3r::GUI::AmsHumidityLevelList:

Public Member Functions

 AmsHumidityLevelList (wxWindow *parent)
 ~AmsHumidityLevelList ()
void msw_rescale ()

Private Member Functions

void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void doRender (wxDC &dc)

Private Attributes

ScalableBitmap background_img
std::vector< ScalableBitmap > hum_level_img_light
std::vector< ScalableBitmap > hum_level_img_dark

Detailed Description

Constructor & Destructor Documentation

◆ AmsHumidityLevelList()

Slic3r::GUI::AmsHumidityLevelList::AmsHumidityLevelList ( wxWindow * parent)
2613 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
2614{
2615#ifdef __WINDOWS__
2616 SetDoubleBuffered(true);
2617#endif //__WINDOWS__
2618
2619 SetSize(wxSize(FromDIP(680), FromDIP(104)));
2620 SetMinSize(wxSize(FromDIP(680), FromDIP(104)));
2621 SetMaxSize(wxSize(FromDIP(680), FromDIP(104)));
2622 SetBackgroundColour(*wxWHITE);
2623
2624 background_img = ScalableBitmap(this, "humidity_list_background", 104);
2625
2626 for (int i = 5; i > 0; i--) {
2627 hum_level_img_light.push_back(ScalableBitmap(this, ("hum_level" + std::to_string(i) + "_light"), 54));
2628 hum_level_img_dark.push_back(ScalableBitmap(this, ("hum_level" + std::to_string(i) + "_dark"), 54));
2629 }
2630
2631 Bind(wxEVT_PAINT, &AmsHumidityLevelList::paintEvent, this);
2632 wxGetApp().UpdateDarkUI(this);
2633}
void paintEvent(wxPaintEvent &evt)
Definition AmsMappingPopup.cpp:2652
ScalableBitmap background_img
Definition AmsMappingPopup.hpp:439
std::vector< ScalableBitmap > hum_level_img_dark
Definition AmsMappingPopup.hpp:441
std::vector< ScalableBitmap > hum_level_img_light
Definition AmsMappingPopup.hpp:440

References background_img, hum_level_img_dark, hum_level_img_light, and paintEvent().

Here is the call graph for this function:

◆ ~AmsHumidityLevelList()

Slic3r::GUI::AmsHumidityLevelList::~AmsHumidityLevelList ( )
inline
428{};

Member Function Documentation

◆ doRender()

void Slic3r::GUI::AmsHumidityLevelList::doRender ( wxDC & dc)
private
2680{
2681 dc.DrawBitmap(background_img.bmp(), 0,0);
2682
2683 auto width_center = GetSize().x / 2;
2684 auto left = width_center - FromDIP(27) - FromDIP(46) * 2 - FromDIP(54) * 2;
2685
2686
2687 //dry / wet
2688 dc.SetTextForeground(wxColour("#989898"));
2689 dc.SetFont(::Label::Head_20);
2690
2691 auto font_top = GetSize().y - dc.GetTextExtent(_L("DRY")).GetHeight();
2692 dc.DrawText(_L("DRY"), wxPoint(FromDIP(38), font_top / 2));
2693 dc.DrawText(_L("WET"), wxPoint(( GetSize().x - FromDIP(38) - dc.GetTextExtent(_L("DRY")).GetWidth()), font_top / 2));
2694
2695
2696 //level list
2697
2698 for (int i = 0; i < hum_level_img_light.size(); i++) {
2699 if (wxGetApp().dark_mode()) {
2700 dc.DrawBitmap(hum_level_img_dark[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
2701 }
2702 else {
2703 dc.DrawBitmap(hum_level_img_light[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
2704 }
2705
2706 left += FromDIP(46) + FromDIP(54);
2707 }
2708}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Head_20
Definition Label.hpp:41
@ left
Definition MarchingSquares.hpp:188

References _L, background_img, Label::Head_20, hum_level_img_dark, and hum_level_img_light.

Referenced by render().

Here is the caller graph for this function:

◆ msw_rescale()

void Slic3r::GUI::AmsHumidityLevelList::msw_rescale ( )
2636{
2637 background_img.msw_rescale();
2638
2639 for (int i = 0; i < hum_level_img_light.size(); i++)
2640 {
2641 hum_level_img_light[i].msw_rescale();
2642 }
2643
2644 for (int i = 0; i < hum_level_img_dark.size(); i++)
2645 {
2646 hum_level_img_dark[i].msw_rescale();
2647 }
2648
2649 Refresh();
2650}

References background_img, hum_level_img_dark, and hum_level_img_light.

◆ paintEvent()

void Slic3r::GUI::AmsHumidityLevelList::paintEvent ( wxPaintEvent & evt)
private
2653{
2654 wxPaintDC dc(this);
2655 render(dc);
2656}
void render(wxDC &dc)
Definition AmsMappingPopup.cpp:2658

References render().

Referenced by AmsHumidityLevelList().

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

◆ render()

void Slic3r::GUI::AmsHumidityLevelList::render ( wxDC & dc)
private
2659{
2660#ifdef __WXMSW__
2661 wxSize size = GetSize();
2662 wxMemoryDC memdc;
2663 wxBitmap bmp(size.x, size.y);
2664 memdc.SelectObject(bmp);
2665 memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
2666
2667 {
2668 wxGCDC dc2(memdc);
2669 doRender(dc2);
2670 }
2671
2672 memdc.SelectObject(wxNullBitmap);
2673 dc.DrawBitmap(bmp, 0, 0);
2674#else
2675 doRender(dc);
2676#endif
2677}
void doRender(wxDC &dc)
Definition AmsMappingPopup.cpp:2679

References doRender().

Referenced by paintEvent().

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

Member Data Documentation

◆ background_img

ScalableBitmap Slic3r::GUI::AmsHumidityLevelList::background_img
private

◆ hum_level_img_dark

std::vector<ScalableBitmap> Slic3r::GUI::AmsHumidityLevelList::hum_level_img_dark
private

◆ hum_level_img_light

std::vector<ScalableBitmap> Slic3r::GUI::AmsHumidityLevelList::hum_level_img_light
private

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