OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
CenteredStaticText Class Reference
Inheritance diagram for CenteredStaticText:
Collaboration diagram for CenteredStaticText:

Public Member Functions

 CenteredStaticText (wxWindow *parent, wxWindowID id, const wxString &label, const wxPoint &position, const wxSize &size=wxDefaultSize, long style=0)
void CenterOnPosition (const wxPoint &position)

Detailed Description

Constructor & Destructor Documentation

◆ CenteredStaticText()

CenteredStaticText::CenteredStaticText ( wxWindow * parent,
wxWindowID id,
const wxString & label,
const wxPoint & position,
const wxSize & size = wxDefaultSize,
long style = 0 )
inline
55 : wxStaticText(parent, id, label, position, size, style) {
56 CenterOnPosition(position);
57 }
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
#define style
Definition WipeTowerDialog.cpp:101
void CenterOnPosition(const wxPoint &position)
Definition StepMeshDialog.cpp:59

References CenterOnPosition(), and style.

Here is the call graph for this function:

Member Function Documentation

◆ CenterOnPosition()

void CenteredStaticText::CenterOnPosition ( const wxPoint & position)
inline
59 {
60 int textWidth, textHeight;
61 GetTextExtent(GetLabel(), &textWidth, &textHeight);
62 int x = position.x - textWidth / 2;
63 int y = position.y - textHeight / 2;
64 SetPosition(wxPoint(x, y));
65 }

Referenced by CenteredStaticText().

Here is the caller graph for this function:

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