11#ifndef __AUDACITY_RULER__
12#define __AUDACITY_RULER__
48 void SetBounds(
int left,
int top,
int right,
int bottom);
51 void SetOrientation(
int orient);
56 void SetRange(
double min,
double max);
63 void SetRange(
double min,
double max,
double hiddenMin,
double hiddenMax);
70 void SetTwoTone(
bool twoTone);
73 void SetFormat(RulerFormat
format);
78 void SetDbMirrorValue(
const double d );
81 void SetLog(
bool log);
84 void SetSpacing(
int spacing);
89 void SetLabelEdges(
bool labelEdges);
93 void SetFlip(
bool flip);
96 void SetMinor(
bool value);
99 void SetFonts(
const wxFont &minorFont,
const wxFont &majorFont,
const wxFont &minorMinorFont);
104 Fonts GetFonts()
const;
112 void OfflimitsPixels(
int start,
int end);
117 void GetMaxSize(wxCoord *width, wxCoord *height);
124 void SetCustomMode(
bool value);
133 void SetUseZoomInfo(
int leftOffset,
const ZoomInfo *zoomInfo);
140 void Draw(wxDC& dc)
const;
141 void Draw(wxDC& dc,
const Envelope* envelope)
const;
145 void DrawGrid(wxDC& dc,
int length,
bool minor =
true,
bool major =
true,
int xOffset = 0,
int yOffset = 0)
const;
149 { mTickColour = colour; mPen.SetColour( colour );}
164 void Draw(wxDC &dc,
bool twoTone, wxColour c)
const;
168 using Bits = std::vector< bool >;
170 void ChooseFonts( wxDC &dc )
const;
172 void UpdateCache( wxDC &dc,
const Envelope* envelope )
const;
195 static std::pair< wxRect, Label > MakeTick(
197 wxDC &dc, wxFont font,
198 std::vector<bool> &bits,
199 int left,
int top,
int spacing,
int lead,
200 bool flip,
int orientation );
206 int FindZero(
const Labels &labels )
const;
208 int GetZeroPosition()
const;
232 using Range = std::pair<double, double>;
237 bool labelEdges {
false };
238 bool ticksAtExtremes {
false };
239 bool hasTickColour{
false };
245 { log = l;
return *
this; }
248 { flip = f;
return *
this; }
251 { labelEdges = l;
return *
this; }
254 { ticksAtExtremes = t;
return *
this; }
257 { tickColour = c; hasTickColour =
true;
return *
this; }
261 wxOrientation orientation,
262 const wxSize &bounds,
267 const wxPoint& pos = wxDefaultPosition,
268 const wxSize&
size = wxDefaultSize);
272 void DoSetSize(
int x,
int y,
273 int width,
int height,
274 int sizeFlags = wxSIZE_AUTO)
override;
276 void OnErase(wxEraseEvent &evt);
277 void OnPaint(wxPaintEvent &evt);
278 void OnSize(wxSizeEvent &evt);
291 DECLARE_EVENT_TABLE()
std::vector< TranslatableString > TranslatableStrings
static void OnSize(wxSizeEvent &evt)
Piecewise linear or piecewise exponential function from double to double.
An array of these created by the Ruler is used to determine what and where text annotations to the nu...
void SetTickColour(const wxColour &colour)
TranslatableString mUnits
std::unique_ptr< Cache > mpCache
std::vector< Label > Labels
const ZoomInfo * mUseZoomInfo
void SetCustomMinorLabels(const TranslatableStrings &labels, int start, int step)
std::unique_ptr< Fonts > mpUserFonts
std::unique_ptr< Fonts > mpFonts
void SetCustomMajorLabels(const TranslatableStrings &labels, int start, int step)
RulerPanel class allows you to work with a Ruler like any other wxWindow.
void SetTickColour(wxColour &c)
bool AcceptsFocusFromKeyboard() const override
std::pair< double, double > Range
bool AcceptsFocus() const override
Holds a msgid for the translation catalog; may also bind format arguments.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
CommandManager::Options Options
Options & TickColour(const wxColour c)
Options & TicksAtExtremes(bool t)
Options & LabelEdges(bool l)