GME
13
|
00001 #if !defined(AFX_GMEVIEWDLG_H__F859CB75_586D_4c49_AACE_69B3B7500DFB__INCLUDED_) 00002 #define AFX_GMEVIEWDLG_H__F859CB75_586D_4c49_AACE_69B3B7500DFB__INCLUDED_ 00003 00004 #if _MSC_VER > 1000 00005 #pragma once 00006 #endif // _MSC_VER > 1000 00007 // GMEViewDlg.h : header file 00008 // 00009 00010 #include "Resource.h" 00011 #include "ModelPropertiesDlgBar.h" 00012 #include "ScrollZoomView.h" 00013 #include "GMEViewDropTarget.h" 00014 00015 #include <vector> 00016 #include "TestWindow.h" 00017 00019 // CGMEViewDlg dialog 00020 00021 class CGMEViewDropTarget; 00022 00023 00024 class CGMEViewDlg : public CScrollZoomView 00025 { 00026 DECLARE_DYNCREATE(CGMEViewDlg) 00027 00028 // Construction 00029 public: 00030 CGMEViewDlg(); // standard constructor 00031 virtual ~CGMEViewDlg(); 00032 00033 public: 00034 // Dialog Data 00035 //{{AFX_DATA(CGMEViewDlg) 00036 enum { IDD = IDD_GMEVIEW_DIALOG }; 00037 //}}AFX_DATA 00038 00039 CComPtr<IMgaProject> mgaProject; 00040 CComPtr<IMgaMetaModel> mgaMetaModel; 00041 CComPtr<IMgaModel> mgaModel; 00042 int currentAspect; 00043 CString strAspect; 00044 CString regPath; 00045 00046 COLORREF canvasBgndColor; 00047 00048 CString defZoomLev; 00049 int m_zoomVal; 00050 CRect modelExtent; 00051 bool modelExtentCalculated; 00052 00053 static int instanceCount; 00054 static bool offScreenCreated; 00055 static CDC* offScreen; 00056 static CBitmap* ofsbmp; 00057 00058 CFont txtMetricFont; 00059 00060 static CString strTestWndClass; 00061 std::vector<CTestWindow*> testWindows; 00062 std::vector<CTestWindow*> displayedWindows; 00063 bool inWindowDragging; 00064 CPoint lastDragPoint; 00065 00066 // Overrides 00067 // ClassWizard generated virtual function overrides 00068 //{{AFX_VIRTUAL(CGMEViewDlg) 00069 protected: 00070 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 00071 virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 00072 //}}AFX_VIRTUAL 00073 00074 public: 00075 void SetCurrentProject(CComPtr<IMgaProject> project); 00076 void SetMetaModel(CComPtr<IMgaMetaModel> meta); 00077 void SetModel(CComPtr<IMgaModel> model); 00078 void ChangeAspect(int aspect); 00079 void Invalidate(void); 00080 void SetScroll(void); 00081 00082 // Implementation 00083 protected: 00084 void CreateOffScreen(CDC* dc); 00085 int RangedRand(int range_min, int range_max); 00086 void CreateTestWindows(void); 00087 void DestroyTestWindows(void); 00088 std::vector<CTestWindow*> GetWindowsInRect(const CRect& rect); 00089 00090 // Generated message map functions 00091 //{{AFX_MSG(CGMEViewDlg) 00092 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 00093 afx_msg void OnClose(); 00094 afx_msg void OnSize(UINT nType, int cx, int cy); 00095 afx_msg void OnMove(int x, int y); 00096 afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos); 00097 afx_msg void OnDraw(CDC* pDC); 00098 afx_msg BOOL OnEraseBkgnd(CDC* pDC); 00099 afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 00100 afx_msg void OnMouseMove(UINT nFlags, CPoint point); 00101 afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 00102 afx_msg void OnSelchangeAspectTab(NMHDR* pNMHDR, LRESULT* pResult); 00103 //}}AFX_MSG 00104 DECLARE_MESSAGE_MAP() 00105 00106 void SendAspectChange(long index); 00107 void SendZoomChange(long index); 00108 void SendWriteStatusZoom(long zoomVal); 00109 00110 public: 00111 CGMEViewDropTarget m_DropTarget; 00112 00113 BOOL DoDrop(eDragOperation doDragOp, COleDataObject* pDataObject, CPoint point); 00114 }; 00115 00116 //{{AFX_INSERT_LOCATION}} 00117 // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 00118 00119 #endif // !defined(AFX_GMEVIEWDLG_H__F859CB75_586D_4c49_AACE_69B3B7500DFB__INCLUDED_)