Audacity 3.2.0
Public Member Functions | List of all members
auStaticText Class Reference

is like wxStaticText, except it can be themed. wxStaticText can't be. More...

#include <auStaticText.h>

Inheritance diagram for auStaticText:
[legend]
Collaboration diagram for auStaticText:
[legend]

Public Member Functions

 auStaticText (wxWindow *parent, wxString text)
 
void OnPaint (wxPaintEvent &evt)
 
bool AcceptsFocus () const override
 
void OnErase (wxEraseEvent &event)
 
 DECLARE_EVENT_TABLE ()
 

Detailed Description

is like wxStaticText, except it can be themed. wxStaticText can't be.

Definition at line 19 of file auStaticText.h.

Constructor & Destructor Documentation

◆ auStaticText()

auStaticText::auStaticText ( wxWindow *  parent,
wxString  text 
)

Definition at line 29 of file auStaticText.cpp.

29 :
30 wxWindow(parent, wxID_ANY)
31{
32 int textWidth, textHeight;
33
34 int fontSize = 11;
35 #ifdef __WXMSW__
36 fontSize = 9;
37 #endif
38 wxFont font(fontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
39 GetTextExtent(textIn, &textWidth, &textHeight, NULL, NULL, &font);
40
41 SetFont( font );
42 SetMinSize( wxSize(textWidth, textHeight) );
43 SetBackgroundColour( theTheme.Colour( clrMedium));
44 SetForegroundColour( theTheme.Colour( clrTrackPanelText));
45 SetName(textIn);
46 SetLabel(textIn);
47}
THEME_API Theme theTheme
Definition: Theme.cpp:82
wxColour & Colour(int iIndex)

References ThemeBase::Colour(), and theTheme.

Here is the call graph for this function:

Member Function Documentation

◆ AcceptsFocus()

bool auStaticText::AcceptsFocus ( ) const
inlineoverride

Definition at line 24 of file auStaticText.h.

24{ return false; }

◆ DECLARE_EVENT_TABLE()

auStaticText::DECLARE_EVENT_TABLE ( )

◆ 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 49 of file auStaticText.cpp.

50{
51 wxPaintDC dc(this);
52 //dc.SetTextForeground( theTheme.Colour( clrTrackPanelText));
53 dc.Clear();
54 dc.DrawText( GetLabel(), 0,0);
55}

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