Audacity  3.0.3
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
RulerPanel Class Referencefinal

RulerPanel class allows you to work with a Ruler like any other wxWindow. More...

#include <Ruler.h>

Inheritance diagram for RulerPanel:
Collaboration diagram for RulerPanel:


struct  Options

Public Types

using Range = std::pair< double, double >

Public Member Functions

 RulerPanel (wxWindow *parent, wxWindowID id, wxOrientation orientation, const wxSize &bounds, const Range &range, Ruler::RulerFormat format, const TranslatableString &units, const Options &options={}, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~RulerPanel ()
void DoSetSize (int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO) override
void OnErase (wxEraseEvent &evt)
void OnPaint (wxPaintEvent &evt)
void OnSize (wxSizeEvent &evt)
void SetTickColour (wxColour &c)
bool AcceptsFocus () const override
bool AcceptsFocusFromKeyboard () const override
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
void SetLabel (const TranslatableString &label)
void SetName (const TranslatableString &name)
void SetToolTip (const TranslatableString &toolTip)
void SetName ()
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete

Public Attributes

Ruler ruler

Detailed Description

RulerPanel class allows you to work with a Ruler like any other wxWindow.

Definition at line 228 of file Ruler.h.

Member Typedef Documentation

◆ Range

using RulerPanel::Range = std::pair<double, double>

Definition at line 232 of file Ruler.h.

Constructor & Destructor Documentation

◆ RulerPanel()

RulerPanel::RulerPanel ( wxWindow *  parent,
wxWindowID  id,
wxOrientation  orientation,
const wxSize &  bounds,
const Range range,
Ruler::RulerFormat  format,
const TranslatableString units,
const Options options = {},
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 

Definition at line 1705 of file Ruler.cpp.

1713  :
1714  wxPanelWrapper(parent, id, pos, size)
1715 {
1716  ruler.SetBounds( 0, 0, bounds.x, bounds.y );
1717  ruler.SetOrientation(orientation);
1718  ruler.SetRange( range.first, range.second );
1719  ruler.SetLog( options.log );
1721  ruler.SetUnits( units );
1722  ruler.SetFlip( options.flip );
1723  ruler.SetLabelEdges( options.labelEdges );
1724  ruler.mbTicksAtExtremes = options.ticksAtExtremes;
1725  if (orientation == wxVERTICAL) {
1726  wxCoord w;
1727  ruler.GetMaxSize(&w, NULL);
1728  SetMinSize(wxSize(w, 150)); // height needed for wxGTK
1729  }
1730  else if (orientation == wxHORIZONTAL) {
1731  wxCoord h;
1732  ruler.GetMaxSize(NULL, &h);
1733  SetMinSize(wxSize(wxDefaultCoord, h));
1734  }
1735  if (options.hasTickColour)
1736  ruler.SetTickColour( options.tickColour );
1737 }

References format, Ruler::GetMaxSize(), Ruler::mbTicksAtExtremes, anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler(), Ruler::SetBounds(), Ruler::SetFlip(), Ruler::SetFormat(), Ruler::SetLabelEdges(), Ruler::SetLog(), Ruler::SetOrientation(), Ruler::SetRange(), Ruler::SetTickColour(), and Ruler::SetUnits().

Here is the call graph for this function:

◆ ~RulerPanel()

RulerPanel::~RulerPanel ( )

Definition at line 1739 of file Ruler.cpp.

1740 {
1741 }

Member Function Documentation

◆ AcceptsFocus()

bool RulerPanel::AcceptsFocus ( ) const

Definition at line 282 of file Ruler.h.

282 { return false; }

◆ AcceptsFocusFromKeyboard()

bool RulerPanel::AcceptsFocusFromKeyboard ( ) const

Definition at line 284 of file Ruler.h.

284 { return false; }

◆ DoSetSize()

void RulerPanel::DoSetSize ( int  x,
int  y,
int  width,
int  height,
int  sizeFlags = wxSIZE_AUTO 

Definition at line 1768 of file Ruler.cpp.

1771 {
1772  wxPanelWrapper::DoSetSize(x, y, width, height, sizeFlags);
1774  int w, h;
1775  GetClientSize(&w, &h);
1777  ruler.SetBounds(0, 0, w-1, h-1);
1778 }

References anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler(), and Ruler::SetBounds().

Here is the call graph for this function:

◆ OnErase()

void RulerPanel::OnErase ( wxEraseEvent &  evt)

Definition at line 1743 of file Ruler.cpp.

1744 {
1745  // Ignore it to prevent flashing
1746 }

◆ OnPaint()

void RulerPanel::OnPaint ( wxPaintEvent &  evt)

Definition at line 1748 of file Ruler.cpp.

1749 {
1750  wxPaintDC dc(this);
1752 #if defined(__WXMSW__)
1753  dc.Clear();
1754 #endif
1756  ruler.Draw(dc);
1757 }

References Ruler::Draw(), and anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler().

Here is the call graph for this function:

◆ OnSize()

void RulerPanel::OnSize ( wxSizeEvent &  evt)

Definition at line 1759 of file Ruler.cpp.

1760 {
1761  Refresh();
1762 }

◆ SetTickColour()

void RulerPanel::SetTickColour ( wxColour &  c)

Definition at line 279 of file Ruler.h.

279 { ruler.SetTickColour( c );}

References anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler(), and Ruler::SetTickColour().

Here is the call graph for this function:

Member Data Documentation

◆ ruler

Ruler RulerPanel::ruler

The documentation for this class was generated from the following files:
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
void SetLabelEdges(bool labelEdges)
Definition: Ruler.cpp:226
void SetLog(bool log)
Definition: Ruler.cpp:142
void SetTickColour(const wxColour &colour)
Definition: Ruler.h:148
void SetFormat(RulerFormat format)
Definition: Ruler.cpp:131
void Draw(wxDC &dc) const
Definition: Ruler.cpp:1428
void SetUnits(const TranslatableString &units)
Definition: Ruler.cpp:153
void SetFlip(bool flip)
Definition: Ruler.cpp:239
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: Ruler.cpp:1603
bool mbTicksAtExtremes
Definition: Ruler.h:178
int format
Definition: ExportPCM.cpp:56
void SetRange(double min, double max)
Definition: Ruler.cpp:188
void SetOrientation(int orient)
Definition: Ruler.cpp:174
void SetBounds(int left, int top, int right, int bottom)
Definition: Ruler.cpp:332
Definition: wxPanelWrapper.h:44
Ruler ruler
Definition: Ruler.h:288