24 #include "IDataBuffer.h" 25 #include "TextBoxNumber.h" 27 #include "DecoratorPrimitives.h" 33 unsigned long _last_buffer_change;
57 _last_buffer_change=0;
76 if(_buffer!=NULL && _buffer->StartIndex()<_buffer->Size()-1)
78 unsigned int size=_buffer->Size();
84 _buffer->MinMax(min_x,max_x,min_y,max_y);
90 if(_last_buffer_change!=_buffer->X(size-1))
92 _dc.setScalingX(xOffset,
Width()-xOffset-1,min_x,max_x);
94 _last_buffer_change=max_x;
96 dc->SetBackColor(Color::Black);
100 dc->SetColor(Color::Yellow);
101 _dc.
MoveTo(dc,min_x,max(min_y,0));
102 _dc.
LineTo(dc,max_x,max(min_y,0));
105 _dc.
MoveTo(dc,max(min_x,0),min_y);
106 _dc.
LineTo(dc,max(min_x,0),max_y);
108 dc->SetColor(Color::LightBlue);
109 dc->SetFont(SmallFont);
115 _dc.
MoveTo(dc,_buffer->X(_buffer->StartIndex()),_buffer->Y(_buffer->StartIndex()));
116 for(
int i=_buffer->StartIndex()+1;i<size;i++)
118 _dc.
LineTo(dc,_buffer->X(i),_buffer->Y(i));
int EstimateRight(DC *dc)
Estimates decorator right coordinate.
Definition: DecoratorPrimitives.h:219
Base class for all window objects. Provides basic window functionality.
Definition: Window.h:34
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
Device context for chart window. Implement transformation of logic coordinates into window coordinate...
Definition: ChartDC.h:23
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 InvalidateOnlyChartArea()
Forces to repain only chart arey (not axises) - reduces flickering.
Definition: ChartWindow.h:60
Axis decorator primitive. It is shared between gauge and chart objects. Overriden members description...
Definition: DecoratorPrimitives.h:145
void PrepareDC(DC *dc)
Setups window coordinate system. This function called by window manager right before window has to be...
Definition: Window.h:249
Device context. Abstraction layer to the device specific drawing code. Coordinates in drawing functio...
Definition: DC.h:29
void MoveTo(DC *dc, float x, float y)
Moves actual position in logic coordinates.
Definition: ChartDC.h:106
Chart window implement XY plots.
Definition: ChartWindow.h:30
int Height()
Returns window height.
Definition: Window.h:189
void Invalidate()
If function is called than the window manager updates the window.
Definition: Window.h:157
ChartWindow(DecoratorAxis *xAxis, DecoratorAxis *yAxis, int left, int top, int width, int hight)
Constructor.
Definition: ChartWindow.h:47
void SetBuffer(IDataBuffer *buffer)
Sets data buffer.
Definition: ChartWindow.h:54
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
void LineTo(DC *dc, float x, float y)
Draws line from actual position to the new position.
Definition: ChartDC.h:114
int Width()
Returns window width.
Definition: Window.h:184
void OnDraw(DC *dc)
Implements drawing code. Please note axises are plotted as decorators.
Definition: ChartWindow.h:74