73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
//---------------------------------------------------------------------------
|
|
|
|
#ifndef ContentPanelH
|
|
#define ContentPanelH
|
|
|
|
#include <vector>
|
|
using namespace std;
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
class TContentPanel : public Extctrls::TPanel
|
|
{
|
|
private:
|
|
//显示相关
|
|
int m_nTopGap,
|
|
m_nLeftBound,
|
|
m_nRightBound,
|
|
m_nTopBound,
|
|
m_nBottomBound,
|
|
m_nGap,
|
|
m_nCols,
|
|
m_nRows,
|
|
m_xZero,
|
|
m_yZero,
|
|
m_xScaleGap,
|
|
m_yScaleGap;
|
|
|
|
//刻度相关
|
|
int m_nAmoMax, m_nAmoMin, m_iAmoUnit, m_nRowMax, m_nRowMin, m_nAmoUnit;
|
|
double m_yScale;
|
|
//峰值
|
|
int m_iPeakU, m_iPeakL;
|
|
//点显示与压缩
|
|
vector<TDot> m_aDots;
|
|
int m_nOriDots, m_iType, m_iSample, m_iMask;
|
|
|
|
//显示时间
|
|
int m_iHint, m_xHalfGap, m_xMaxHint;
|
|
|
|
TLabel * m_lblHint[2];
|
|
|
|
bool __fastcall CalcXUnit();
|
|
bool __fastcall CalcYUnit(int nMax, int nMin, bool bInit=false);
|
|
void __fastcall Resample();
|
|
int __fastcall HitTest(int x, int y);
|
|
void __fastcall ShowTimeHint(int iHint);
|
|
|
|
void __fastcall PanMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
|
|
|
|
MESSAGE void __fastcall WMEraseBkgnd(TWMEraseBkgnd &Message);
|
|
MESSAGE void __fastcall WMSize(TWMSize &Message);
|
|
|
|
BEGIN_MESSAGE_MAP
|
|
MESSAGE_HANDLER(WM_ERASEBKGND, TWMEraseBkgnd, WMEraseBkgnd)
|
|
MESSAGE_HANDLER(WM_SIZE, TWMSize, WMSize)
|
|
END_MESSAGE_MAP(Vcl::Extctrls::TPanel)
|
|
|
|
protected:
|
|
virtual void __fastcall CreateWnd();
|
|
virtual void __fastcall Paint(void);
|
|
|
|
public:
|
|
__fastcall virtual TContentPanel(System::Classes::TComponent* AOwner);
|
|
__fastcall ~TContentPanel();
|
|
|
|
void __fastcall SetView(int iType);
|
|
void __fastcall UpdateView(int iType, bool bInit);
|
|
void __fastcall PanKeyDown(WORD Key);
|
|
|
|
};
|
|
|
|
#endif
|