36 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
59 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
64 dc->Line(0, 0,0, height);
67 dc->Line(width, 0, width, height);
70 dc->Line(0, 0, width, 0);
73 dc->Line(0, height, width, height);
88 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
90 dc->SetBackColor(_color);
94 dc->
FillRect (left, top, left+width, top+height);
107 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
123 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
125 dc->SetColor(_color);
139 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
141 dc->
Rectangle3D(left, top, left+width, top+height,_color1,_color2);
164 static const int _tick_length=5;
176 _orientation(orientation),
226 return (AHelper::GetNumberLength(max(_minValue,_maxValue),1)*dc->
FontWidth()+_tick_length)+_offsetX;
228 case HorizontalBottom:
229 return _length+_offsetX;
243 return _length+_offsetY;
245 case HorizontalBottom:
246 return _offsetY+dc->
FontHeight()+_tick_length;
249 void Draw(
DC *dc,
int left,
int top,
int width,
int height)
252 float range=_maxValue-_minValue;
253 float step_val=(range)/(_numTicks-1);
260 float scale_step=_length/(_numTicks-1.0);
262 for(
int i=0;i<_numTicks;i++)
264 y=_length+_offsetY-scale_step*i;
265 float value=_minValue+i*step_val;
266 if(_orientation == VerticalRight)
268 dc->MoveTo(_offsetX,y);
269 dc->LineTo(_offsetX+_tick_length,y);
274 dc->MoveTo(axis_right,y);
275 dc->LineTo(axis_right-_tick_length,y);
276 int val_width=AHelper::GetNumberLength(value,1)*dc->
FontWidth();
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:123
int EstimateRight(DC *dc)
Estimates decorator right coordinate.
Definition: DecoratorPrimitives.h:219
int GetLength()
Returns axis length.
Definition: DecoratorPrimitives.h:206
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:88
Implements definition and operations with color.
Definition: Color.h:27
Not implemented yet.
Definition: DecoratorPrimitives.h:151
int EstimateLeft(DC *dc)
Estimates decorator left coordinate.
Definition: DecoratorPrimitives.h:215
int FontHeight()
Returns symbol jeight for the current font.
Definition: DC.h:211
void FillRect(int left, int top, int right, int bottom)
Fills rectangle. Input coordinates have to be defined in the window coordinate system.
Definition: DC.h:116
Vertcal axis with the labels left to the axis.
Definition: DecoratorPrimitives.h:152
Decorator primitive for boundary lines. Overriden members description see Decorator class documentati...
Definition: DecoratorPrimitives.h:42
void DrawNumber(int number, int x, int y)
Draws integer number. Input coordinates have to be defined in the window coordinate system...
Definition: DC.h:161
void SetOffset(int offsetX, int offsetY)
Sets decorator offset in the parent window coordinate system.
Definition: DecoratorPrimitives.h:188
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:36
Axis decorator primitive. It is shared between gauge and chart objects. Overriden members description...
Definition: DecoratorPrimitives.h:145
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:249
Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing functio...
Definition: DC.h:29
Orientation
Definition: DecoratorPrimitives.h:148
int FontWidth()
Returns symbol width for the current font.
Definition: DC.h:206
Decorator primitive for round rect filled area. Overriden members description see Decorator class doc...
Definition: DecoratorPrimitives.h:98
Base class for window decorators. This concept allows sharing of drawing setting among more than one ...
Definition: Decorator.h:24
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:107
Decorator primitive for 3D rectangle. Overriden members description see Decorator class documentation...
Definition: DecoratorPrimitives.h:130
virtual int EstimateRight(DC *dc)
Estimates decorator right coordinate.
Definition: Decorator.h:33
Decorator primitive that sets current color. Overriden members description see Decorator class docume...
Definition: DecoratorPrimitives.h:24
int EstimateBottom(DC *dc)
Estimates decorator bottom coordinate.
Definition: DecoratorPrimitives.h:236
Decorator primitive for round rect filled area. Overriden members description see Decorator class doc...
Definition: DecoratorPrimitives.h:79
DecoratorColor(Color color)
Constructor.
Definition: DecoratorPrimitives.h:32
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:139
void Draw(DC *dc, int left, int top, int width, int height)
Drawing code implementation.
Definition: DecoratorPrimitives.h:59
void SetMinMax(float minVal, float maxVal)
Sets min and max for label values.
Definition: DecoratorPrimitives.h:200
Not implemented yet.
Definition: DecoratorPrimitives.h:150
int EstimateTop(DC *dc)
Estimates decorator top coordinate.
Definition: DecoratorPrimitives.h:232
void Rectangle3D(int left, int top, int right, int bottom, Color color1, Color color2)
Draws rectangle with 3D border. Input coordinates have to be defined in the window coordinate system...
Definition: DC.h:105
void GetMinMax(float &minVal, float &maxVal)
Return min and max label values.
Definition: DecoratorPrimitives.h:194
DecoratorAxis(Orientation orientation, uint8_t *font, int length, float minValue, float maxValue, int nTicks)
Constructor.
Definition: DecoratorPrimitives.h:175
void DrawRoundRect(int left, int top, int right, int bottom)
Draws rounded rectangle. Input coordinates have to be defined in the window coordinate system...
Definition: DC.h:156
void FillGradientRect(int left, int top, int right, int bottom, Color color1, Color color2)
Fills rectangle with gradient color. Input coordinates have to be defined in the window coordinate sy...
Definition: DC.h:121
Decorator primitive for round rectangle. Overriden members description see Decorator class documentat...
Definition: DecoratorPrimitives.h:115
void FillRoundRect(int left, int top, int right, int bottom)
Fills rounded rectangle. Input coordinates have to be defined in the window coordinate system...
Definition: DC.h:151