00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfMfcView_h_
00026 #define _CIvfMfcView_h_
00027
00028 #include <afxwin.h>
00029
00030 #include <ivfwidget/IvfWidgetBase.h>
00031
00040 class CIvfMfcView : public CWnd, public CIvfWidgetBase {
00041 private:
00042 HDC m_hDC;
00043 HGLRC m_hRC;
00044
00045 LARGE_INTEGER m_countsPerSec;
00046 double m_elapsedTime;
00047 double m_zeroTime;
00048
00049 int m_size[2];
00050 int m_pos[2];
00051 int m_colorBits;
00052
00053 int m_mousePos[2];
00054
00055 bool m_initDone;
00056
00057 double largeToDouble(LARGE_INTEGER &value);
00058 public:
00060 CIvfMfcView();
00061
00062 BOOL SetPixelformat(HDC hdc);
00063 virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
00064
00065 virtual void doInit(int width, int height);
00066 virtual void doDestroy();
00067 virtual void doRedraw();
00068 virtual void doEnableTimeout(float time, int nbr);
00069 virtual void doDisableTimeout(int nbr);
00070 virtual void doDisableIdleProcessing();
00071 virtual void doEnableIdleProcessing();
00072 virtual double doElapsedTime();
00073 virtual void doSetPosition(int x, int y);
00074 virtual void doSetSize(int w, int h);
00075
00076 protected:
00077 afx_msg void OnPaint();
00078 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00079 afx_msg void OnSize(UINT nType, int cx, int cy );
00080 afx_msg BOOL OnEraseBkgnd( CDC* pDC );
00081 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00082 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00083 afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00084 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
00085 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00086 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00087 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00088 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00089 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00090 afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
00091 afx_msg void OnClose();
00092 afx_msg void OnDestroy();
00093 afx_msg void OnTimer(UINT nIDEvent);
00094
00095 DECLARE_MESSAGE_MAP()
00096 };
00101 #endif