- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
- #if !defined(AFX_ANALOGMETER_H__7B6C2C14_9681_11D2_9136_0020AF9FE21E__INCLUDED_)
- #define AFX_ANALOGMETER_H__7B6C2C14_9681_11D2_9136_0020AF9FE21E__INCLUDED_
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- // AnalogMeter.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CAnalogMeter command target
- class CAnalogMeter : public CCmdTarget
- {
- DECLARE_DYNCREATE(CAnalogMeter)
- CAnalogMeter() ;
- virtual ~CAnalogMeter();
- // Attributes
- public:
- COLORREF m_colorGrid;
- COLORREF m_colorNeedle;
- COLORREF m_colorValue;
- double m_dMinScale;
- double m_dMaxScale;
- // Operations
- public:
- double m_dPercent; // 当前指针的百分比
- void ShowMeter(CDC *pDC, CRect rectBorder);
- void UpdateNeedle(CDC *pDC, double dPos);
- void SetRange (double dMin, double dMax);
- void SetRangeDecimals(int nRangeDecimals);
- void SetValueDecimals(int nValueDecimals);
- void SetTitle(CString strTitle);
- double GetMaxRange() {return m_dMaxScale; } ;
- double GetMinRange() {return m_dMinScale; } ;
- int GetRangeDecimals() {return m_nRangeDecimals; } ;
- int GetValueDecimals() {return m_nValueDecimals; } ;
- CString GetTitle() {return m_strTitle; } ;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAnalogMeter)
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- void DrawGrid (); // 画标尺
- void DrawNeedle(); // 画指针
- void ShowMeterImage(CDC *pDC);//显示整幅图
- bool m_boolUseBitmaps ;
- bool m_boolForceRedraw;
- int m_nRangeDecimals; // 范围值的小数点位数
- int m_nValueDecimals; // 当前值的小数点位数
- int m_nRectWidth;
- int m_nRectHeight;
- int m_nCXPix; // 指针中心(x,y)坐标
- int m_nCYPix; //
- int m_nRadiusPix; // 半径
- int m_nLeftLimitXPix;
- int m_nLeftLimitYPix;
- int m_nRightLimitXPix;
- int m_nRightLimitYPix;
- int m_nHalfBaseWidth;
- int m_nTextBaseSpacing;
- double m_dPI; // 180度的弧度值
- double m_dLimitAngleRad;
- double m_dRadiansPerValue; // m_dMaxScale-m_dMinScale范围内每个刻度的弧度值
- double m_dNeedlePos; // 指针的当前位置
- CString m_strTitle;
- CDC m_dcGrid;
- CBitmap m_bitmapGrid;
- CBitmap *m_pbitmapOldGrid;
- CDC m_dcNeedle ;
- CBitmap m_bitmapNeedle;
- CBitmap *m_pbitmapOldNeedle;
- CRect m_rectDraw;
- CRect m_rectOwner;
- CRect m_rectMinValue;
- CRect m_rectMaxValue;
- CRect m_rectValue;
- CFont m_fontValue;
- CBrush m_brushErase;
- CPen m_penErase;
- // Generated message map functions
- //{{AFX_MSG(CAnalogMeter)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_ANALOGMETER_H__7B6C2C14_9681_11D2_9136_0020AF9FE21E__INCLUDED_)