18 void value(
double v )
23 virtual void draw( PAINTSTRUCT& ps )
25 int w = ps.rcPaint.right - ps.rcPaint.left;
26 int h = ps.rcPaint.bottom - ps.rcPaint.top;
27 int x0 = ps.rcPaint.left + w / 2;
28 int y0 = ps.rcPaint.top + h / 2;
38 std::cout <<
"radius " << r <<
"\n";
39 for(
int k = 1; k <= 10; k++ )
42 double rads = 0.0174533 * theta;
43 int x = x0 - sin( rads ) * r * 0.8;
44 int y = y0 + cos( rads ) * r * 0.8;
45 S.
text( std::to_string( k * inc ), { x,y,30,30});
47 (int)(x0 - sin( rads ) * r),
48 (int)(y0 + cos( rads ) * r) });
51 theta = 30 + 200 * myValue / myMax;
52 double rads = 0.0174533 * theta;
56 (int)( x0 - sin( rads ) * r * 0.9),
57 (
int)( y0 + cos( rads ) * r * 0.9 )});
Widget to display a value on a circular clock face.
Definition: guage.h:5
The base class for all windex gui elements.
Definition: wex.h:824
gui()
Construct top level window with no parent.
Definition: wex.h:831
A class that offers application code methods to draw on a window.
Definition: wex.h:525
void penThick(int t)
Set pen thickness in pixels.
Definition: wex.h:597
void text(const std::string &t, const std::vector< int > &v)
Draw text.
Definition: wex.h:727
void line(const std::vector< int > &v)
Draw line between two points.
Definition: wex.h:616
void circle(int x0, int y0, double r)
Draw circle.
Definition: wex.h:714
void color(int r, int g, int b)
Set color for drawings.
Definition: wex.h:559