is like wxStaticText, except it can be themed. wxStaticText can't be.
More...
#include <auStaticText.h>
is like wxStaticText, except it can be themed. wxStaticText can't be.
Definition at line 19 of file auStaticText.h.
◆ auStaticText()
auStaticText::auStaticText |
( |
wxWindow * |
parent, |
|
|
wxString |
text |
|
) |
| |
Definition at line 33 of file auStaticText.cpp.
33 :
34 wxWindow(parent, wxID_ANY)
35{
36 int textWidth, textHeight;
37
38 int fontSize = 11;
39 #ifdef __WXMSW__
40 fontSize = 9;
41 #endif
42 wxFont font(fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
43 GetTextExtent(textIn, &textWidth, &textHeight, NULL, NULL, &font);
44
45 SetFont( font );
46 SetMinSize( wxSize(textWidth, textHeight) );
49 SetName(textIn);
50 SetLabel(textIn);
51}
wxColour & Colour(int iIndex)
References ThemeBase::Colour(), and theTheme.
◆ AcceptsFocus()
bool auStaticText::AcceptsFocus |
( |
| ) |
const |
|
inlineoverride |
◆ DECLARE_EVENT_TABLE()
auStaticText::DECLARE_EVENT_TABLE |
( |
| ) |
|
|
private |
◆ GetSelected()
bool auStaticText::GetSelected |
( |
| ) |
const |
|
noexcept |
◆ OnErase()
void auStaticText::OnErase |
( |
wxEraseEvent & |
event | ) |
|
|
inline |
Definition at line 25 of file auStaticText.h.
25 {
26 static_cast<void>(event);
27 };
◆ OnPaint()
void auStaticText::OnPaint |
( |
wxPaintEvent & |
evt | ) |
|
Definition at line 53 of file auStaticText.cpp.
54{
55 wxPaintDC dc(this);
56
57 dc.Clear();
58 dc.DrawText( GetLabel(), 0,0);
59
61 {
62 auto rect = wxRect { GetSize() };
64 }
65}
static void DrawFocus(wxDC &dc, wxRect &r)
References AColor::DrawFocus(), and mIsSelected.
◆ ScaleFont()
void auStaticText::ScaleFont |
( |
double |
scale | ) |
|
- Precondition
- scale > 0. Function is a no-op if scale is not positive.
Definition at line 67 of file auStaticText.cpp.
68{
69 if (scale < 0.0)
70 {
71 assert(scale >= 0.0);
72 return;
73 }
74
75 int textWidth, textHeight;
76
77 auto font = GetFont();
78
79 const auto oldFontSize = font.GetPointSize();
80 const auto newFontSize = static_cast<int>(oldFontSize * scale);
81
82 if (newFontSize != oldFontSize)
83 {
84 font.SetPointSize(newFontSize);
85 GetTextExtent(GetLabel(), &textWidth, &textHeight, NULL, NULL, &font);
86 SetFont(font);
87 SetMinSize(wxSize(textWidth, textHeight));
88 }
89}
Referenced by TimeSignatureToolBar::AddTitle().
◆ SetSelected()
void auStaticText::SetSelected |
( |
bool |
selected | ) |
|
◆ mIsSelected
bool auStaticText::mIsSelected { false } |
|
private |
The documentation for this class was generated from the following files: