Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
Ruler::Label Class Reference

An array of these created by the Ruler is used to determine what and where text annotations to the numbers on the Ruler get drawn. More...

Collaboration diagram for Ruler::Label:
[legend]

Public Member Functions

void Draw (wxDC &dc, bool twoTone, wxColour c) const
 

Public Attributes

double value
 
int pos
 
int lx
 
int ly
 
TranslatableString text
 

Detailed Description

An array of these created by the Ruler is used to determine what and where text annotations to the numbers on the Ruler get drawn.

Todo:
Check whether Ruler is costing too much time in allocation/free of array of Ruler::Label.

Definition at line 157 of file Ruler.h.

Member Function Documentation

◆ Draw()

void Ruler::Label::Draw ( wxDC &  dc,
bool  twoTone,
wxColour  c 
) const

Definition at line 1665 of file Ruler.cpp.

1666{
1667 if (!text.empty()) {
1668 bool altColor = twoTone && value < 0.0;
1669
1670#ifdef EXPERIMENTAL_THEMING
1671 dc.SetTextForeground(altColor ? theTheme.Colour( clrTextNegativeNumbers) : c);
1672#else
1673 dc.SetTextForeground(altColor ? *wxBLUE : *wxBLACK);
1674#endif
1675 dc.SetBackgroundMode(wxTRANSPARENT);
1676 dc.DrawText(text.Translation(), lx, ly);
1677 }
1678}
THEME_API Theme theTheme
Definition: Theme.cpp:82
int lx
Definition: Ruler.h:161
TranslatableString text
Definition: Ruler.h:162
double value
Definition: Ruler.h:159
int ly
Definition: Ruler.h:161
wxColour & Colour(int iIndex)
wxString Translation() const

References ThemeBase::Colour(), and theTheme.

Here is the call graph for this function:

Member Data Documentation

◆ lx

int Ruler::Label::lx

Definition at line 161 of file Ruler.h.

◆ ly

int Ruler::Label::ly

Definition at line 161 of file Ruler.h.

◆ pos

int Ruler::Label::pos

Definition at line 160 of file Ruler.h.

Referenced by Ruler::Updater::Tick().

◆ text

TranslatableString Ruler::Label::text

Definition at line 162 of file Ruler.h.

Referenced by Ruler::Updater::Tick().

◆ value

double Ruler::Label::value

Definition at line 159 of file Ruler.h.

Referenced by Ruler::Updater::Tick(), and Ruler::Updater::TickCustom().


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