⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 batteryctl.h

📁 电池控件
💻 H
字号:
#if !defined(AFX_BATTERYCTL_H__81A1AF9B_B217_4B4D_AADC_252C5A421110__INCLUDED_)
#define AFX_BATTERYCTL_H__81A1AF9B_B217_4B4D_AADC_252C5A421110__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// BatteryCtl.h : Declaration of the CBatteryCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CBatteryCtrl : See BatteryCtl.cpp for implementation.
#include "picture.h"
#include <vector>
using namespace std;
class CBatteryCtrl : public COleControl
{
	DECLARE_DYNCREATE(CBatteryCtrl)

// Constructor
public:
	CBatteryCtrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBatteryCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	//}}AFX_VIRTUAL

// Implementation
protected:
	~CBatteryCtrl();

	DECLARE_OLECREATE_EX(CBatteryCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CBatteryCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CBatteryCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CBatteryCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CBatteryCtrl)
		// NOTE - ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CBatteryCtrl)
	
	afx_msg void OnBackPictureChanged();	
	afx_msg void OnRowsChanged();	
	afx_msg void OnColsChanged();	
	afx_msg void OnRowAscendingChanged();	
	afx_msg void OnColAscendingChanged();	
	afx_msg void OnShowCoordinateChanged();	
	afx_msg void OnCoordinateStyleChanged();	
	afx_msg void OnSpacePercentChanged();	
	short m_nRows;
	short m_nCols;
	BOOL m_bRowAscending;
	BOOL m_bColAscending;
	BOOL m_bShowCoordinate;
	short m_nCoordinateStyle;
	short m_nSpacePercent;
	CString m_strBackPicture;
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CBatteryCtrl)
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CBatteryCtrl)
	dispidBackPicture = 1L,
	dispidRows = 2L,
	dispidCols = 3L,
	dispidRowAscending = 4L,
	dispidColAscending = 5L,
	dispidShowCoordinate = 6L,
	dispidCoordinateStyle = 7L,
	dispidSpacePercent = 8L,
	//}}AFX_DISP_ID
	};
private:
	void LoadPicture();
	BOOL LoadImage(UINT nIDRes){
		Invalidate();
		return m_pict.Load(nIDRes);
	}
	BOOL LoadImage(LPCTSTR pszPathName) {
		Invalidate();
		return m_pict.Load(pszPathName);
	}
	BOOL LoadImage(CArchive& ar) {
		Invalidate();
		return m_pict.Load(ar);
	}
	BOOL LoadImage(IStream* pstm) {
		Invalidate();
		return m_pict.Load(pstm);
	}
private:
	CSize  GetRowCol(USHORT nBarreryNo);
	void GetBatteryZone(const CRect& rcBounds,CRect& rcBattery);
	//CRect GetBarreryPeriphery(const CRect& rcBounds,USHORT nBarreryNo);
	//CRect GetBarreryInlier(const CRect& rcPeriphery,USHORT nBarreryNo);
private:
	CPicture m_pict;
	vector<double> m_dVoltage;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BATTERYCTL_H__81A1AF9B_B217_4B4D_AADC_252C5A421110__INCLUDED)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -