4.0.8 & convert utf8
This commit is contained in:
+18
-18
@@ -1,4 +1,4 @@
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl.h>
|
||||
#include <windows.h>
|
||||
#pragma hdrstop
|
||||
@@ -10,10 +10,10 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
|
||||
TColor clrAxis = TColor(RGB(3,5,7)), //XY轴及边框
|
||||
clrLineTen = TColor(RGB(215,215,215)), //十倍横线
|
||||
clrLineNor = TColor(0x00EDEDED),// TColor(RGB(250,250,250)), //普通线
|
||||
clrHeadFont = TColor(RGB(83,109,165)), //头文字
|
||||
TColor clrAxis = TColor(RGB(3,5,7)), //XY轴及边框
|
||||
clrLineTen = TColor(RGB(215,215,215)), //十倍横线
|
||||
clrLineNor = TColor(0x00EDEDED),// TColor(RGB(250,250,250)), //普通线
|
||||
clrHeadFont = TColor(RGB(83,109,165)), //头文字
|
||||
clrSelect = TColor(RGB(150, 155, 159));
|
||||
TColor u_clrLink[] = {clBlue, clWebLimeGreen, clRed, clWebRoyalBlue};
|
||||
|
||||
@@ -107,7 +107,7 @@ void __fastcall TContentPanel::Paint()
|
||||
bool bPeakU = m_iPeakU>=0, bPeakL = m_iPeakL>=0;
|
||||
vector<TDot>& aDots = m_aDots.empty() ? g_aDots[m_iType] : m_aDots;
|
||||
|
||||
//绘制选中线
|
||||
//绘制选中线
|
||||
if(m_iHint>0){
|
||||
int x = m_xZero + m_iHint * m_xScaleGap;
|
||||
Canvas->Pen->Color = clrSelect;
|
||||
@@ -138,7 +138,7 @@ void __fastcall TContentPanel::Paint()
|
||||
int y1 = m_nTopBound + c;
|
||||
|
||||
if(l <= i && r >= i){
|
||||
//绘制连接线
|
||||
//绘制连接线
|
||||
Canvas->LineTo( x1, y1 );
|
||||
}
|
||||
else{
|
||||
@@ -153,12 +153,12 @@ void __fastcall TContentPanel::WMEraseBkgnd(TWMEraseBkgnd &Message)
|
||||
TCanvas* tempCanvas = new TCanvas;
|
||||
tempCanvas->Handle = Message.DC;
|
||||
|
||||
//背景色
|
||||
//背景色
|
||||
TRect rect( 0, 0, ClientWidth, ClientHeight );
|
||||
tempCanvas->Brush->Color = clBtnFace;//clWhite;
|
||||
tempCanvas->FillRect( rect );
|
||||
|
||||
//外边框
|
||||
//外边框
|
||||
rect.left = m_nLeftBound;
|
||||
rect.right = m_nRightBound + 1;
|
||||
rect.top = m_nTopBound;
|
||||
@@ -166,7 +166,7 @@ void __fastcall TContentPanel::WMEraseBkgnd(TWMEraseBkgnd &Message)
|
||||
tempCanvas->Brush->Color = clrAxis;
|
||||
tempCanvas->FrameRect( rect );
|
||||
|
||||
//纵线
|
||||
//纵线
|
||||
int x = m_xZero,
|
||||
t = rect.top+1,
|
||||
b = rect.bottom-1;
|
||||
@@ -177,7 +177,7 @@ void __fastcall TContentPanel::WMEraseBkgnd(TWMEraseBkgnd &Message)
|
||||
tempCanvas->LineTo( x, b );
|
||||
}
|
||||
|
||||
//刻度
|
||||
//刻度
|
||||
tempCanvas->Font->Color = clrHeadFont;
|
||||
tempCanvas->Brush->Style = bsClear;
|
||||
int y = m_nTopGap,//, iY0 = 0,
|
||||
@@ -192,7 +192,7 @@ void __fastcall TContentPanel::WMEraseBkgnd(TWMEraseBkgnd &Message)
|
||||
y += m_yScaleGap;
|
||||
}
|
||||
|
||||
//横线
|
||||
//横线
|
||||
tempCanvas->Brush->Style = bsSolid;
|
||||
y = m_nTopBound;
|
||||
int l = m_xZero+1,
|
||||
@@ -306,7 +306,7 @@ void __fastcall TContentPanel::Resample()
|
||||
m_aDots.push_back(dots[0]);
|
||||
|
||||
int total = dots.size(),
|
||||
num = total-20; //保留最少20个点
|
||||
num = total-20; //保留最少20个点
|
||||
|
||||
bool bNoSample = m_iSample==1,
|
||||
bMask = m_iMask>m_iSample;
|
||||
@@ -437,7 +437,7 @@ bool __fastcall TContentPanel::CalcXUnit()
|
||||
//---------------------------------------------------------------------------
|
||||
bool __fastcall TContentPanel::CalcYUnit(int nMax, int nMin, bool bInit)
|
||||
{
|
||||
if(bInit || nMax > m_nRowMax || nMin < m_nRowMin ){ //初始化||范围变动
|
||||
if(bInit || nMax > m_nRowMax || nMin < m_nRowMin ){ //初始化||范围变动
|
||||
int scale = 100 / m_nAmoUnit;
|
||||
if(nMax==nMin){
|
||||
m_nRowMax = (nMax / m_nAmoUnit + 1) * m_nAmoUnit;
|
||||
@@ -451,7 +451,7 @@ bool __fastcall TContentPanel::CalcYUnit(int nMax, int nMin, bool bInit)
|
||||
nMax = (nMax / m_nAmoUnit + ((nMax % m_nAmoUnit) ? 1 : 0)) * m_nAmoUnit;
|
||||
nMin = (nMin / m_nAmoUnit - ((nMin % m_nAmoUnit) ? 1 : 0)) * m_nAmoUnit;
|
||||
|
||||
//找可整除的0轴
|
||||
//找可整除的0轴
|
||||
int m = (nMax - nMin) * scale / 50;
|
||||
if(0 == (nMin * scale) % m){
|
||||
m_nRowMax = nMax;
|
||||
@@ -463,9 +463,9 @@ bool __fastcall TContentPanel::CalcYUnit(int nMax, int nMin, bool bInit)
|
||||
tmpMin = nMin,
|
||||
rm = m_iType==3 ? 10000 : 10000000;
|
||||
|
||||
//寻找最佳方案
|
||||
//寻找最佳方案
|
||||
bool bUp = g_aDots[m_iType].back().val > 0;
|
||||
for(int m1=m; m1 < (bUp ? rm : rm+1); m1+=2){ //最后的数据为负,优先扩下半区,或者尽量上下同扩
|
||||
for(int m1=m; m1 < (bUp ? rm : rm+1); m1+=2){ //最后的数据为负,优先扩下半区,或者尽量上下同扩
|
||||
if(m1>m && 0 == tmpMin % m1){
|
||||
rMax = nMax;
|
||||
rMin = tmpMin;
|
||||
@@ -474,7 +474,7 @@ bool __fastcall TContentPanel::CalcYUnit(int nMax, int nMin, bool bInit)
|
||||
}
|
||||
|
||||
int tmpMax = nMax;
|
||||
for(int m2=m1+2; -tmpMin>=m2 && m2 < (bUp ? rm+1: rm); m2+=2){ //最后的数据为正,优先扩上半区
|
||||
for(int m2=m1+2; -tmpMin>=m2 && m2 < (bUp ? rm+1: rm); m2+=2){ //最后的数据为正,优先扩上半区
|
||||
tmpMax += m_nAmoUnit;
|
||||
if(0==tmpMin % m2){
|
||||
rMax = tmpMax;
|
||||
|
||||
Reference in New Issue
Block a user