00001 #pragma once
00002
00003 #include "MFCBase.h"
00004
00005
00039 #define VIEW_8_MAX 255
00040 #define VIEW_8_MIN 0
00041
00042 #define VIEW_ZDIR 0
00043 #define VIEW_XDIR 1
00044 #define VIEW_YDIR 2
00045
00046
00047
00048 namespace jbxwl {
00049
00050 using namespace jbxl;
00051
00052
00053 extern UINT TimerID;
00054
00055 class CExDocument;
00056 class CExView;
00057 class CExFrame;
00058 class CAppCallBack;
00059
00060
00062
00063
00064 class CExView : public CView
00065 {
00066 protected:
00067 CExView();
00068 DECLARE_DYNCREATE(CExView)
00069
00070
00071 public:
00072 ExCmnHead viewData;
00073 ExCmnHead cmnHead;
00074 ExMSGraph<sWord> msGraph;
00075
00076 CExDocument* pDoc;
00077 CExFrame* pFrame;
00078 CAppCallBack* pApp;
00079 void* anyData;
00080
00081 BOOL hasViewData;
00082
00083 CString Title;
00084
00085 RECT clientRect;
00086 double sizeXYRate;
00087 double clientRate;
00088 double sizeFac;
00089
00090 int xsize;
00091 int ysize;
00092 int zsize;
00093
00094 int origXSize;
00095 int origYSize;
00096 int initXSize;
00097 int initYSize;
00098 int prevXSize;
00099 int prevYSize;
00100
00101 bool cnstSize;
00102 bool cnstXSize;
00103 bool cnstYSize;
00104 bool cnstXYRate;
00105 int maxXSize;
00106 int maxYSize;
00107
00108 int vSBpos;
00109 int prevSBpos;
00110 int vSBmax;
00111 int vSBntch;
00112 bool vSBctrl;
00113 int viewMode;
00114 int colorMode;
00115 bool usePlane;
00116
00117 int cMax;
00118 int cMin;
00119 int vMax;
00120 int vMin;
00121
00122 bool doReSize;
00123
00124 protected:
00125 int timerID;
00126 bool ctrlMouse;
00127 bool activeWin;
00128
00129
00130 public:
00131 POINT GetMousePos();
00132 virtual int GetMouseButton(){return 0;}
00133
00134 POINT SetWindowSize(int xs, int ys, BOOL first=TRUE);
00135 POINT GetWindowSize(POINT pt);
00136 POINT GetClientSize(POINT pt);
00137 POINT GetWindowReSize(POINT pt);
00138 POINT ExecWindowReSize(int xs, int ys);
00139 void SetTitle(LPCTSTR title);
00140
00141 virtual POINT GetWindowDisplaySize(POINT pt) { return pt;}
00142 virtual BOOL SetNewSurface(int ovsbpos=0) { return TRUE;}
00143 virtual void TimerStart(int tm=40) { timerID = TimerID++; SetTimer(timerID, tm, NULL);}
00144 virtual void TimerStop() { KillTimer(timerID); timerID = -1; }
00145 virtual void ExecRender() {}
00146
00147
00148
00149
00150 public:
00151 virtual void OnInitialUpdate();
00152 virtual void OnDraw(CDC* pDC);
00153
00154 protected:
00155 virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
00156
00157
00158
00159 public:
00160 virtual ~CExView();
00161
00162 protected:
00163 #ifdef _DEBUG
00164 virtual void AssertValid() const;
00165 virtual void Dump(CDumpContext& dc) const;
00166 #endif
00167
00168 protected:
00169
00170 afx_msg void OnSize(UINT nType, int cx, int cy);
00171 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00172 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00173
00174 DECLARE_MESSAGE_MAP()
00175 public:
00176 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00177 afx_msg void OnTimer(UINT_PTR nIDEvent);
00178 };
00179
00180
00181
00183
00184
00185
00186
00187 }