GME
13
|
00001 #if !defined(AFX_GMEVIEWCTRL_H__1D56CE4E_1840_4991_A5EB_6F6DA3CEEABB__INCLUDED_) 00002 #define AFX_GMEVIEWCTRL_H__1D56CE4E_1840_4991_A5EB_6F6DA3CEEABB__INCLUDED_ 00003 00004 00005 #if _MSC_VER > 1000 00006 #pragma once 00007 #endif // _MSC_VER > 1000 00008 00009 00010 #include "GMEViewFrame.h" 00011 #include "..\GmeActiveBrowser\MgaObjectEventList.h" 00012 00013 // GMEViewCtrl.h : Declaration of the CGMEViewCtrl ActiveX Control class. 00014 00015 00016 // CGMEViewCtrl : See GMEViewCtrl.cpp for implementation. 00017 00018 class CGMEViewCtrl : public COleControl 00019 { 00020 DECLARE_DYNCREATE(CGMEViewCtrl) 00021 00022 // Constructor 00023 public: 00024 CGMEViewCtrl(); 00025 00026 // Overrides 00027 // ClassWizard generated virtual function overrides 00028 //{{AFX_VIRTUAL(CGMEViewCtrl) 00029 public: 00030 virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid); 00031 virtual void DoPropExchange(CPropExchange* pPX); 00032 virtual void OnResetState(); 00033 protected: 00034 virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 00035 //}}AFX_VIRTUAL 00036 00037 // Implementation 00038 protected: 00039 ~CGMEViewCtrl(); 00040 00041 DECLARE_OLECREATE_EX(CGMEViewCtrl) // Class factory and guid 00042 DECLARE_OLETYPELIB(CGMEViewCtrl) // GetTypeInfo 00043 DECLARE_PROPPAGEIDS(CGMEViewCtrl) // Property page IDs 00044 DECLARE_OLECTLTYPE(CGMEViewCtrl) // Type name and misc status 00045 00046 CGMEViewFrame* m_gmeViewFrame; 00047 00048 // Just for temporary store until GMEViewDlg is created 00049 CComPtr<IMgaProject> mgaProject; 00050 CComPtr<IMgaMetaModel> mgaMetaModel; 00051 CComPtr<IMgaModel> mgaModel; 00052 int aspect; 00053 00054 // Message maps 00055 //{{AFX_MSG(CGMEViewCtrl) 00056 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 00057 //}}AFX_MSG 00058 DECLARE_MESSAGE_MAP() 00059 00060 // Dispatch maps 00061 //{{AFX_DISPATCH(CGMEViewCtrl) 00062 afx_msg void SetCurrentProject(LPUNKNOWN project); 00063 afx_msg void SetMetaModel(LPUNKNOWN meta); 00064 afx_msg void SetModel(LPUNKNOWN model); 00065 afx_msg void ChangeAspect(LONG index); 00066 afx_msg void CycleAspect(void); 00067 afx_msg void Invalidate(void); 00068 //}}AFX_DISPATCH 00069 DECLARE_DISPATCH_MAP() 00070 00071 afx_msg void AboutBox(); 00072 00073 void OnMgaObjectEvent(IMgaObject* obj, unsigned long eventmask); 00074 void OnMgaGlobalEvent(globalevent_enum event); 00075 00076 // Event maps 00077 //{{AFX_EVENT(CGMEViewCtrl) 00078 void FireAspectChanged(LONG index) 00079 {FireEvent(eventidAspectChanged, EVENT_PARAM(VTS_I4), index); } 00080 void FireZoomChanged(LONG index) 00081 {FireEvent(eventidZoomChanged, EVENT_PARAM(VTS_I4), index); } 00082 void FireWriteStatusZoom(LONG zoomVal) 00083 {FireEvent(eventidWriteStatusZoom, EVENT_PARAM(VTS_I4), zoomVal); } 00084 //}}AFX_EVENT 00085 DECLARE_EVENT_MAP() 00086 00087 // Native COM interfaces - peter 00088 DECLARE_INTERFACE_MAP() 00089 00090 BEGIN_INTERFACE_PART(EventSink, IMgaEventSink) 00091 STDMETHOD(GlobalEvent(globalevent_enum event)); 00092 STDMETHOD(ObjectEvent(IMgaObject* obj, unsigned long eventmask, VARIANT v)); 00093 END_INTERFACE_PART(EventSink) 00094 00095 // Dispatch and event IDs 00096 public: 00097 enum { 00098 //{{AFX_DISP_ID(CGMEViewCtrl) 00099 dispidCycleAspect = 5L, 00100 dispidChangeAspect = 4L, 00101 dispidInvalidate = 6L, 00102 dispidSetCurrentProject = 1L, 00103 dispidSetMetaModel = 2L, 00104 dispidSetModel = 3L, 00105 eventidAspectChanged = 1L, 00106 eventidWriteStatusZoom = 3L, 00107 eventidZoomChanged = 2L 00108 //}}AFX_DISP_ID 00109 }; 00110 00111 void SendAspectChanged(LONG index); 00112 void SendZoomChanged(LONG index); 00113 void SendWriteStatusZoom(LONG zoomVal); 00114 00115 protected: 00116 CMgaObjectEventList m_MgaObjectEventList; 00117 void PropagateMgaMessages(); 00118 }; 00119 00120 //{{AFX_INSERT_LOCATION}} 00121 // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 00122 00123 #endif // !defined(AFX_GMEVIEWCTRL_H__1D56CE4E_1840_4991_A5EB_6F6DA3CEEABB__INCLUDED_)