CStaticFx m_TestRead0;
CStaticFx m_TestRead1;
CStaticFx m_TestRead2;
CStaticFx m_TestRead3;
CStaticFx m_TestWrite0;
CStaticFx m_TestWrite1;
CStaticFx m_TestWrite2;
CStaticFx m_TestWrite3;
//-----------------------------------------------------------------------------
void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl);
//-----------------------------------------------------------------------------
void CDiskMarkDlg::DoDataExchange(CDataExchange* pDX)
{
CMainDialogFx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BUTTON_ALL, m_ButtonAll);
DDX_Control(pDX, IDC_BUTTON_TEST_0, m_ButtonTest0);
DDX_Control(pDX, IDC_BUTTON_TEST_1, m_ButtonTest1);
DDX_Control(pDX, IDC_BUTTON_TEST_2, m_ButtonTest2);
DDX_Control(pDX, IDC_BUTTON_TEST_3, m_ButtonTest3);
//m_TestRead0 *= 2;
DDX_Control(pDX, IDC_TEST_READ_0, (m_TestRead0));
DDX_Control(pDX, IDC_TEST_READ_1, m_TestRead1);
DDX_Control(pDX, IDC_TEST_READ_2, m_TestRead2);
DDX_Control(pDX, IDC_TEST_READ_3, m_TestRead3);
DDX_Control(pDX, IDC_TEST_WRITE_0, m_TestWrite0);
DDX_Control(pDX, IDC_TEST_WRITE_1, m_TestWrite1);
DDX_Control(pDX, IDC_TEST_WRITE_2, m_TestWrite2);
DDX_Control(pDX, IDC_TEST_WRITE_3, m_TestWrite3);
#ifdef MIX_MODE
DDX_Control(pDX, IDC_TEST_MIX_0, m_TestMix0);
DDX_Control(pDX, IDC_TEST_MIX_1, m_TestMix1);
DDX_Control(pDX, IDC_TEST_MIX_2, m_TestMix2);
DDX_Control(pDX, IDC_TEST_MIX_3, m_TestMix3);
DDX_Control(pDX, IDC_COMBO_MIX, m_ComboMix);
#endif
DDX_Control(pDX, IDC_COMMENT, m_Comment);
DDX_Control(pDX, IDC_COMBO_COUNT, m_ComboCount);
DDX_Control(pDX, IDC_COMBO_SIZE, m_ComboSize);
DDX_Control(pDX, IDC_COMBO_DRIVE, m_ComboDrive);
DDX_Control(pDX, IDC_COMBO_UNIT, m_ComboUnit);
DDX_Control(pDX, IDC_DEMO_SETTING, m_DemoSetting);
DDX_Control(pDX, IDC_READ_UNIT, m_ReadUnit);
DDX_Control(pDX, IDC_WRITE_UNIT, m_WriteUnit);
#ifdef MIX_MODE
DDX_Control(pDX, IDC_MIX_UNIT, m_MixUnit);
#endif
DDX_Text(pDX, IDC_COMBO_COUNT, m_ValueTestCount);
DDX_Text(pDX, IDC_COMBO_SIZE, m_ValueTestSize);
DDX_Text(pDX, IDC_COMBO_DRIVE, m_ValueTestDrive);
DDX_Text(pDX, IDC_COMBO_UNIT, m_ValueTestUnit);
DDX_CBIndex(pDX, IDC_COMBO_COUNT, m_IndexTestCount);
DDX_CBIndex(pDX, IDC_COMBO_SIZE, m_IndexTestSize);
DDX_CBIndex(pDX, IDC_COMBO_DRIVE, m_IndexTestDrive);
DDX_CBIndex(pDX, IDC_COMBO_UNIT, m_IndexTestUnit);
#ifdef MIX_MODE
DDX_CBIndex(pDX, IDC_COMBO_MIX, m_IndexTestMix);
#endif
}
//------------------------------------------------------------
class CStaticFx : public CStatic
{
DECLARE_DYNAMIC(CStaticFx);
public:
// Constructors
CStaticFx();
virtual ~CStaticFx();
// Control
BOOL InitControl(int x, int y, int width, int height, double zoomRatio, CDC* bkDC,
LPCWSTR imagePath, int imageCount, DWORD textAlign, int renderMode, BOOL bHighContrast, BOOL bDarkMode);
void SetMargin(int top, int left, int bottom, int right, double zoomRatio);
CSize GetSize(void);
void SetDrawFrame(BOOL bDrawFrame);
void SetDrawFrameEx(BOOL bDrawFrame, COLORREF frameColor = RGB(128, 128, 128));
void SetGlassColor(COLORREF glassColor, BYTE glassAlpha);
void SetMeter(BOOL bMeter, double meterRatio);
void SetLabelUnit(CString label, CString unit);
// Font
void SetFontEx(CString face, int size, int sizeToolTip, double zoomRatio, double fontRatio = 1.0,
COLORREF textColor = RGB(0, 0, 0), LONG fontWeight = FW_NORMAL, BYTE fontRender = CLEARTYPE_NATURAL_QUALITY);
// ToolTip
void SetToolTipText(LPCTSTR pText);
void SetToolTipActivate(BOOL bActivate = TRUE);
void SetToolTipWindowText(LPCTSTR pText);
CString GetToolTipText();
// Mouse
void SetHandCursor(BOOL bHandCuror = TRUE);
protected:
// Draw Control
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual void DrawControl(CDC* drawDC, LPDRAWITEMSTRUCT lpDrawItemStruct, CBitmap& ctrlBitmap, CBitmap& bkBitmap, int no);
virtual void DrawString(CDC* drawDC, LPDRAWITEMSTRUCT lpDrawItemStruct);
// Image
BOOL LoadBitmap(LPCTSTR fileName);
BOOL LoadBitmap(HBITMAP hBitmap);
void SetBkReload(void);
BOOL SetBitmap(CBitmap& bitmap);
void LoadCtrlBk(CDC* drawDC);
// ToolTip
void InitToolTip();
virtual BOOL PreTranslateMessage(MSG* pMsg);
// Message Map
DECLARE_MESSAGE_MAP()
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnMouseHover(UINT nFlags, CPoint point);
afx_msg void OnMouseLeave();
afx_msg void OnKillfocus();
afx_msg void OnSetfocus();
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
protected:
// Control
int m_X;
int m_Y;
CSize m_CtrlSize;
CRect m_Margin;
int m_RenderMode;
BOOL m_bHighContrast;
BOOL m_bDarkMode;
BOOL m_bDrawFrame;
COLORREF m_FrameColor;
CString m_Label;
CString m_Unit;
// Glass
COLORREF m_GlassColor;
BYTE m_GlassAlpha;
// Meter
BOOL m_bMeter;
double m_MeterRatio;
// Image
CString m_ImagePath;
int m_ImageCount;
CDC* m_BkDC;
CBitmap m_BkBitmap;
BOOL m_bBkBitmapInit;
BOOL m_bBkLoad;
CBitmap m_CtrlBitmap;
CImage m_CtrlImage;
// Font
DWORD m_TextAlign;
CFont m_Font;
CFont m_FontToolTip;
COLORREF m_TextColor;
// ToolTip
CToolTipCtrl m_ToolTip;
CString m_ToolTipText;
// Mouse
BOOL m_bHover;
BOOL m_bFocas;
BOOL m_bTrackingNow;
BOOL m_bHandCursor;
};