GME  13
ObjectInspectorCtl.h
Go to the documentation of this file.
00001 #if !defined(AFX_OBJECTINSPECTORCTL_H__746A87ED_6895_4A5D_84B2_A822210554BD__INCLUDED_)
00002 #define AFX_OBJECTINSPECTORCTL_H__746A87ED_6895_4A5D_84B2_A822210554BD__INCLUDED_
00003 
00004 
00005 #if _MSC_VER > 1000
00006 #pragma once
00007 #endif // _MSC_VER > 1000
00008 
00009 
00010 #include "InspectorDefs.h"
00011 #include "InspectorDlg.h"
00012 
00013 #include "..\GmeActiveBrowser\MgaObjectEventList.h"
00014 // ObjectInspectorCtl.h : Declaration of the CObjectInspectorCtrl ActiveX Control class.
00015 
00017 // CObjectInspectorCtrl : See ObjectInspectorCtl.cpp for implementation.
00018 
00019 typedef CComPtr<IMgaFCO> MgaFCOPtr;
00020 #define ADAPT_FCO(x) CAdapt<MgaFCOPtr>(x)
00021 typedef CList< CAdapt< MgaFCOPtr >, CAdapt< MgaFCOPtr > & > CMgaFCOPtrList;
00022 
00023 typedef CComPtr<IMgaFolder>MgaFolderPtr;
00024 #define ADAPT_FOLDER(x) CAdapt<MgaFolderPtr>(x)
00025 typedef CList< CAdapt< MgaFolderPtr >, CAdapt< MgaFolderPtr > & > CMgaFolderPtrList;
00026 
00027 
00028 
00029 #include "Attribute.h"  // Added by ClassView
00030 #include "Preference.h" // Added by ClassView
00031 #include "Property.h"
00032 
00033 
00034 
00035 
00036 class CObjectInspectorCtrl : public COleControl
00037 {
00038         DECLARE_DYNCREATE(CObjectInspectorCtrl)
00039 
00040 // Constructor
00041 public:
00042         CObjectInspectorCtrl();
00043 
00044 // Overrides
00045         // ClassWizard generated virtual function overrides
00046         //{{AFX_VIRTUAL(CObjectInspectorCtrl)
00047         public:
00048         virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
00049         virtual void DoPropExchange(CPropExchange* pPX);
00050         virtual void OnResetState();
00051         protected:
00052         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00053         //}}AFX_VIRTUAL
00054 
00055 // Implementation
00056 protected:
00057         ~CObjectInspectorCtrl();
00058 
00059         DECLARE_OLECREATE_EX(CObjectInspectorCtrl)    // Class factory and guid
00060         DECLARE_OLETYPELIB(CObjectInspectorCtrl)      // GetTypeInfo
00061         DECLARE_PROPPAGEIDS(CObjectInspectorCtrl)     // Property page IDs
00062         DECLARE_OLECTLTYPE(CObjectInspectorCtrl)                // Type name and misc status
00063 
00064         CInspectorDlg   m_inspectorDlg;
00065 
00066         CComPtr<IMgaTerritory>  m_territory;
00067         CComPtr<IMgaProject>    m_project;
00068         CComPtr<IMgaObjects>    m_objects;
00069 
00070         CMgaFCOPtrList m_FCOList;
00071         CMgaFolderPtrList m_FolderList;
00072 
00073         bool ignoreNextEvents;
00074 
00075 // Message maps
00076         //{{AFX_MSG(CObjectInspectorCtrl)
00077         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00078         //}}AFX_MSG
00079         DECLARE_MESSAGE_MAP()
00080 
00081 // Dispatch maps
00082         //{{AFX_DISPATCH(CObjectInspectorCtrl)
00083         afx_msg LPUNKNOWN GetMgaProject();
00084         afx_msg void SetMgaProject(LPUNKNOWN newValue);
00085         afx_msg LPUNKNOWN GetMgaObjects();
00086         afx_msg void SetMgaObjects(LPUNKNOWN newValue);
00087         afx_msg void ShowPanel(long panelID);
00088         afx_msg void EditName();
00089         afx_msg void CyclePanel(VARIANT_BOOL frwd);
00090         //}}AFX_DISPATCH
00091         DECLARE_DISPATCH_MAP()
00092 
00093         afx_msg void AboutBox();
00094 
00095         void OnMgaObjectEvent(IMgaObject * obj, unsigned long eventmask);
00096         void OnMgaGlobalEvent(globalevent_enum event);
00097         void RemoveZombies();
00098 
00099 public:
00100 // Event maps
00101         //{{AFX_EVENT(CObjectInspectorCtrl)
00102         void FireRootFolderNameChanged()
00103                 {FireEvent(eventidRootFolderNameChanged, EVENT_PARAM(VTS_NONE)); }
00104         void FireConvertPathToCustom(LPUNKNOWN pMgaObject)
00105                 {FireEvent(eventidConvertPathToCustom, EVENT_PARAM(VTS_UNKNOWN), pMgaObject);}
00106         //}}AFX_EVENT
00107         DECLARE_EVENT_MAP()
00108 
00109 // Native COM interfaces - peter
00110         DECLARE_INTERFACE_MAP()
00111 
00112         BEGIN_INTERFACE_PART(EventSink, IMgaEventSink)
00113                 STDMETHOD(GlobalEvent(globalevent_enum event));
00114                 STDMETHOD(ObjectEvent(IMgaObject * obj, unsigned long eventmask, VARIANT v));
00115         END_INTERFACE_PART(EventSink)
00116 
00117 // Dispatch and event IDs
00118 public:
00119         void WriteNameToMga( const CString& strName);
00120         void UndoRedo( bool undo = true);
00121         
00122         void WriteAttributeItemToMga(CListItem ListItem);
00123         void WritePreferenceItemToMga(CListItem ListItem,bool bIsForKind);
00124         void RefreshReferencePanel();
00125         void RefreshAttributePanel();
00126         void RefreshPropertyPanel();
00127 
00128         CAttribute m_Attribute;
00129         CPreference m_Preference;
00130         CProperty m_Property;
00131 
00132         void RefreshPanels();
00133         bool IsInitialized(bool withObject = false) const;
00134         void IgnoreNextEvents(void);
00135 
00136         enum {
00137         //{{AFX_DISP_ID(CObjectInspectorCtrl)
00138         dispidMgaProject = 1L,
00139         dispidMgaObject = 2L,
00140         dispidShowPanel = 3L,
00141         dispidEditName = 4L,
00142         dispidCyclePanel = 5L,
00143         eventidRootFolderNameChanged = 1L,
00144         eventidConvertPathToCustom = 2L
00145         //}}AFX_DISP_ID
00146         };
00147 private:
00148         void RefreshName();
00149         CMgaObjectEventList m_MgaObjectEventList;
00150         void PropagateMgaMessages();
00151 };
00152 
00153 //{{AFX_INSERT_LOCATION}}
00154 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00155 
00156 #endif // !defined(AFX_OBJECTINSPECTORCTL_H__746A87ED_6895_4A5D_84B2_A822210554BD__INCLUDED)