#include <IntFormat.h>
|
| ~IntFormat () override |
|
void | SetTickSizes (double units, double &major, double &minor, double &minorMinor, int &mDigits) const override |
|
void | SetLabelString (wxString &s, double d, double units, double minor, int mDigits, TickType tickType) const override |
|
| RulerFormat () |
|
virtual | ~RulerFormat () |
|
virtual void | SetTickSizes (double units, double &major, double &minor, double &minorMinor, int &mDigits) const =0 |
|
virtual void | SetLabelString (wxString &s, double d, double units, double minor, int mDigits, TickType tickType) const =0 |
|
Definition at line 17 of file IntFormat.h.
◆ ~IntFormat()
IntFormat::~IntFormat |
( |
| ) |
|
|
overridedefault |
◆ Instance()
◆ RulerFormat()
RulerFormat::RulerFormat |
( |
| ) |
|
|
inlineexplicitprivate |
◆ SetLabelString()
void IntFormat::SetLabelString |
( |
wxString & |
s, |
|
|
double |
d, |
|
|
double |
units, |
|
|
double |
minor, |
|
|
int |
mDigits, |
|
|
TickType |
tickType |
|
) |
| const |
|
overridevirtual |
Implements RulerFormat.
Definition at line 43 of file IntFormat.cpp.
46{
47
48 if (d < 0.0 && (d + minor > 0.0))
49 d = 0.0;
50 s.Printf(
wxT(
"%d"), (
int)floor(d + 0.5));
51}
References wxT().
◆ SetTickSizes()
void IntFormat::SetTickSizes |
( |
double |
units, |
|
|
double & |
major, |
|
|
double & |
minor, |
|
|
double & |
minorMinor, |
|
|
int & |
mDigits |
|
) |
| const |
|
overridevirtual |
Implements RulerFormat.
Definition at line 20 of file IntFormat.cpp.
24{
25 double d;
26 d = 1.0;
27 for (;;) {
28 if (units < d) {
29 minor = d;
30 major = d * 5.0;
31 return;
32 }
33 d *= 5.0;
34 if (units < d) {
35 minor = d;
36 major = d * 2.0;
37 return;
38 }
39 d *= 2.0;
40 }
41}
The documentation for this class was generated from the following files: