MCPcopy Create free account
hub / github.com/audacity/audacity / RulerPanel

Method RulerPanel

src/widgets/RulerPanel.cpp:35–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33IMPLEMENT_CLASS(RulerPanel, wxPanelWrapper)
34
35RulerPanel::RulerPanel(wxWindow* parent, wxWindowID id,
36 wxOrientation orientation,
37 const wxSize& bounds,
38 const Range& range,
39 const RulerFormat &format,
40 const TranslatableString& units,
41 const Options& options,
42 const wxPoint& pos /*= wxDefaultPosition*/,
43 const wxSize& size /*= wxDefaultSize*/
44)
45 : wxPanelWrapper(parent, id, pos, size)
46 , ruler{
47 [&]() -> const RulerUpdater& {
48 if (options.log)
49 return LogarithmicUpdater::Instance();
50 else
51 return LinearUpdater::Instance();
52 }(),
53 format
54 }
55{
56 ruler.SetBounds( 0, 0, bounds.x, bounds.y );
57 ruler.SetOrientation(orientation);
58 ruler.SetRange( range.first, range.second );
59 ruler.SetUnits(units);
60 ruler.SetFlip(options.flip);
61 ruler.SetLabelEdges(options.labelEdges);
62 ruler.mbTicksAtExtremes = options.ticksAtExtremes;
63 if (orientation == wxVERTICAL) {
64 wxCoord w;
65 ruler.GetMaxSize(&w, NULL);
66 SetMinSize(wxSize(w, 150)); // height needed for wxGTK
67 }
68 else if (orientation == wxHORIZONTAL) {
69 wxCoord h;
70 ruler.GetMaxSize(NULL, &h);
71 SetMinSize(wxSize(wxDefaultCoord, h));
72 }
73 if (options.hasTickColour)
74 ruler.SetTickColour( options.tickColour );
75}
76
77RulerPanel::~RulerPanel()
78{

Callers

nothing calls this directly

Calls 9

SetOrientationMethod · 0.80
SetUnitsMethod · 0.80
SetFlipMethod · 0.80
SetLabelEdgesMethod · 0.80
wxSizeClass · 0.70
InstanceClass · 0.50
SetBoundsMethod · 0.45
SetRangeMethod · 0.45
GetMaxSizeMethod · 0.45

Tested by

no test coverage detected