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

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

#include <Theme.h>

Inheritance diagram for auStaticText:

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 177 of file Theme.h.

Constructor & Destructor Documentation

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

Definition at line 1306 of file Theme.cpp.

References ThemeBase::Colour(), and theTheme.

1306  :
1307  wxWindow(parent, wxID_ANY)
1308 {
1309  int textWidth, textHeight;
1310 
1311  int fontSize = 11;
1312  #ifdef __WXMSW__
1313  fontSize = 9;
1314  #endif
1315  wxFont font(fontSize, wxDEFAULT, wxNORMAL, wxNORMAL);
1316  GetTextExtent(textIn, &textWidth, &textHeight, NULL, NULL, &font);
1317 
1318  SetFont( font );
1319  SetMinSize( wxSize(textWidth, textHeight) );
1320  SetBackgroundColour( theTheme.Colour( clrMedium));
1321  SetForegroundColour( theTheme.Colour( clrTrackPanelText));
1322  SetName(textIn);
1323  SetLabel(textIn);
1324 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225

Member Function Documentation

bool auStaticText::AcceptsFocus ( ) const
inlineoverride

Definition at line 182 of file Theme.h.

182 { return false; }
auStaticText::DECLARE_EVENT_TABLE ( )
void auStaticText::OnErase ( wxEraseEvent &  event)
inline

Definition at line 183 of file Theme.h.

183  {
184  static_cast<void>(event);
185  };
void auStaticText::OnPaint ( wxPaintEvent &  evt)

Definition at line 1326 of file Theme.cpp.

1327 {
1328  wxPaintDC dc(this);
1329  //dc.SetTextForeground( theTheme.Colour( clrTrackPanelText));
1330  dc.Clear();
1331  dc.DrawText( GetLabel(), 0,0);
1332 }

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