GME  13
ConsoleCtl.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "HtmlCtrl.h"
00004 #include "ScriptEdit.h"
00005 // ConsoleCtl.h : Declaration of the CConsoleCtrl ActiveX Control class.
00006 
00008 // CConsoleCtrl : See ConsoleCtl.cpp for implementation.
00009 
00010 class CConsoleCtrl : public COleControl
00011 {
00012         friend class CHtmlCtrl;
00013         DECLARE_DYNCREATE(CConsoleCtrl)
00014 
00015 // Constructor
00016 public:
00017         CConsoleCtrl();
00018 
00019         // Overrides
00020         // ClassWizard generated virtual function overrides
00021         //{{AFX_VIRTUAL(CConsoleCtrl)
00022         public:
00023         virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
00024         virtual void DoPropExchange(CPropExchange* pPX);
00025         virtual void OnResetState();
00026         //}}AFX_VIRTUAL
00027 
00028 // Implementation
00029 // protected:
00030         ~CConsoleCtrl();
00031         void LoadScript(BSTR fileName);
00032         void RunScript();
00033         void RunCode(BSTR code)
00034         {
00035                 m_edit.ExecuteScript(CString(code));
00036         }
00037 
00038         CHtmlCtrl   m_browser;
00039         CScriptEdit     m_edit;
00040         CButton     m_cmdButton;
00041         CButton     m_exeButton;
00042         CButton     m_clrButton;
00043         CButton     m_upButton;
00044         CButton     m_dnButton;
00045         CButton     m_retButton;
00046         CString     m_recent1;
00047         CString     m_recent2;
00048         CString     m_recent3;
00049         CString     m_recent4;
00050         CString     m_recent5;
00051 
00052         HICON           m_hIco1;
00053         HICON           m_hIco2;
00054         HICON           m_hIco3;
00055         HICON           m_hIcou;
00056         HICON           m_hIcod;
00057         HICON           m_hIcor;
00058 
00059         DECLARE_OLECREATE_EX(CConsoleCtrl)    // Class factory and guid
00060         DECLARE_OLETYPELIB(CConsoleCtrl)      // GetTypeInfo
00061         DECLARE_PROPPAGEIDS(CConsoleCtrl)     // Property page IDs
00062         DECLARE_OLECTLTYPE(CConsoleCtrl)                // Type name and misc status
00063 
00064 // Message maps
00065         //{{AFX_MSG(CConsoleCtrl)
00066         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00067         afx_msg void OnShowMenu();
00068         afx_msg void LoadScriptDlg();
00069         afx_msg void runScript();
00070         afx_msg void relScript();
00071         afx_msg void rlrScript();
00072         afx_msg void selectEngine();
00073         afx_msg void prevCommand();
00074         afx_msg void nextCommand();
00075         afx_msg void retCommand();
00076         afx_msg void loadRecent( UINT);
00077         afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult);
00078 
00079         //}}AFX_MSG
00080         DECLARE_MESSAGE_MAP()
00081 public:
00082 // Dispatch maps
00083         //{{AFX_DISPATCH(CConsoleCtrl)
00084         afx_msg BSTR GetContents();
00085         afx_msg void SetContents(LPCTSTR lpszNewValue);
00086         afx_msg void Message(LPCTSTR str, short type);
00087         afx_msg void Clear();
00088         afx_msg void SetGMEApp(IDispatch *disp);
00089         afx_msg void SetGMEProj(IDispatch *disp);
00090         afx_msg void NavigateTo(LPCTSTR url);
00091         afx_msg void AboutBox();
00092         //}}AFX_DISPATCH
00093         DECLARE_DISPATCH_MAP()
00094 
00095 // Event maps
00096         //{{AFX_EVENT(CConsoleCtrl)
00097         void FireClickMGAID(LPCTSTR objid)
00098                 {FireEvent(eventidClickMGAID,EVENT_PARAM(VTS_BSTR), objid);}
00099         //}}AFX_EVENT
00100         DECLARE_EVENT_MAP()
00101 
00102 // Dispatch and event IDs
00103 public:
00104         enum {
00105                 dispidNavigateTo = 7L,
00106                 //{{AFX_DISP_ID(CConsoleCtrl)
00107         dispidContents = 1L,
00108         dispidMessage = 2L,
00109         dispidClear = 3L,
00110         eventidClickMGAID = 1L,
00111         //}}AFX_DISP_ID
00112         };
00113         afx_msg __int64 GetCWnd() { return (__int64)(void*)(CWnd*)this; }
00114         afx_msg void SetCWnd(void*) {  }
00115         BOOL PreTranslateMessage(MSG* pMsg);
00116         HRESULT AddGMEToScript();
00117         CComPtr<IDispatch> m_gmeptr;
00118 };
00119 
00120 //{{AFX_INSERT_LOCATION}}
00121 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00122