Files
FireAlarmCtrlCn/MyCode/Gui/Chart.h
2026-04-06 19:02:09 +08:00

90 lines
1.6 KiB
C++

#ifndef CHART_H_
#define CHART_H_
#include "gType.h"
#include "GraphLow.h"
#include "GraphBase.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "my_string.h"
#define dfValueCount 2
#define dfValueLength 1024
#define dfNameLength 32
typedef enum{
ltNone = 0,
ltPoint = 1,
LtSOlid = 2
}TLineType;
class TChart{
public:
TRect Bound;
TRect Content;
TRect RectDiagram;
u32 Color;
short Value[dfValueCount][dfValueLength];
struct{
short x;
short y;
char Text[dfNameLength];
char tUnit[dfNameLength];
}vName[dfValueCount];
struct{
short StartX;
short StartY;
short EndX;
short EndY;
unsigned int Color;
short GridCount;
unsigned char IsHoriz;
unsigned char IsShowGrid;
unsigned char IsShowPointedTip;
TLineType GridLineType;
}BaseAxis;
struct{
short StartX;
short StartY;
short EndX;
short EndY;
unsigned int Color;
short GridCount;
unsigned char IsHoriz;
unsigned char IsShowGrid;
unsigned char IsShowPointedTip;
TLineType GridLineType;
}Axis[dfValueCount];
public:
TChart(){};
TChart(int aX, int aY, int aW, int aH, int OwnerX, int OwnerY, u32 aColor, TBvStyle aBevelOuter){
Init(aX, aY, aW, aH, OwnerX, OwnerY, aColor, aBevelOuter);
}
void Init(int aX, int aY, int aW, int aH, int OwnerX, int OwnerY, u32 aColor, TBvStyle aBevelOuter);
void DrawSelf(void);
void Show(void);
void DrawBaseAxis();
void DrawAxis(short aInx);
void DrawAllAxis();
void SetName(short Inx, char *P);
void SetName(short Inx, const char *P);
void SetNamePosition(short Inx, short aX, short aY);
};
#endif