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

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

Inheritance diagram for Slic3r::GUI::AMSExtText:
Collaboration diagram for Slic3r::GUI::AMSExtText:

Public Member Functions

void msw_rescale ()
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void doRender (wxDC &dc)
 AMSExtText (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~AMSExtText ()

Detailed Description

Constructor & Destructor Documentation

◆ AMSExtText()

Slic3r::GUI::AMSExtText::AMSExtText ( wxWindow * parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize )
286{
287 wxWindow::Create(parent, id, pos, AMS_REFRESH_SIZE);
289
290 Bind(wxEVT_PAINT, &AMSExtText::paintEvent, this);
291 SetSize(AMS_REFRESH_SIZE);
292 SetMinSize(AMS_REFRESH_SIZE);
293}
#define AMS_CONTROL_DEF_LIB_BK_COLOUR
Definition AMSItem.hpp:45
#define AMS_REFRESH_SIZE
Definition AMSItem.hpp:180
void paintEvent(wxPaintEvent &evt)
Definition AMSItem.cpp:304
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References AMS_CONTROL_DEF_LIB_BK_COLOUR, AMS_REFRESH_SIZE, StateColor::darkModeColorFor(), and paintEvent().

Here is the call graph for this function:

◆ ~AMSExtText()

Slic3r::GUI::AMSExtText::~AMSExtText ( )
295{}

Member Function Documentation

◆ doRender()

void Slic3r::GUI::AMSExtText::doRender ( wxDC & dc)
332{
333 auto size = GetSize();
334
335 dc.SetPen(wxPen(StateColor::darkModeColorFor(AMS_CONTROL_GRAY800), 2, wxPENSTYLE_SOLID));
337 dc.SetFont(Label::Body_13);
338 WxFontUtils::get_suitable_font_size(0.7 * size.GetHeight(), dc);
339
340 auto tsize = dc.GetMultiLineTextExtent(_L("Ext"));
341 wxPoint pot(FromDIP((size.x - tsize.x) / 2), FromDIP((size.y - tsize.y) / 2));
342 dc.DrawText(_L("Ext"), pot);
343}
#define AMS_CONTROL_GRAY800
Definition AMSItem.hpp:38
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_13
Definition Label.hpp:54
static void get_suitable_font_size(int max_height, wxDC &dc)
Definition WxFontUtils.cpp:309

References _L, AMS_CONTROL_GRAY800, Label::Body_13, StateColor::darkModeColorFor(), and Slic3r::GUI::WxFontUtils::get_suitable_font_size().

Referenced by render().

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

◆ msw_rescale()

void Slic3r::GUI::AMSExtText::msw_rescale ( )
298{
299 Layout();
300 Fit();
301 Refresh();
302}

◆ paintEvent()

void Slic3r::GUI::AMSExtText::paintEvent ( wxPaintEvent & evt)
305{
306 wxPaintDC dc(this);
307 render(dc);
308}
void render(wxDC &dc)
Definition AMSItem.cpp:310

References render().

Referenced by AMSExtText().

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

◆ render()

void Slic3r::GUI::AMSExtText::render ( wxDC & dc)
311{
312#ifdef __WXMSW__
313 wxSize size = GetSize();
314 wxMemoryDC memdc;
315 wxBitmap bmp(size.x, size.y);
316 memdc.SelectObject(bmp);
317 memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
318
319 {
320 wxGCDC dc2(memdc);
321 doRender(dc2);
322 }
323
324 memdc.SelectObject(wxNullBitmap);
325 dc.DrawBitmap(bmp, 0, 0);
326#else
327 doRender(dc);
328#endif
329}
void doRender(wxDC &dc)
Definition AMSItem.cpp:331

References doRender().

Referenced by paintEvent().

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

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/AMSItem.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/AMSItem.cpp