GME  13
ScriptEdit.h
Go to the documentation of this file.
00001 // ScriptEdit.h: interface for the CScriptEdit class.
00002 //
00004 
00005 #if !defined(AFX_SCRIPTEDIT_H__5EF35F5A_41C7_4F59_A025_215986107399__INCLUDED_)
00006 #define AFX_SCRIPTEDIT_H__5EF35F5A_41C7_4F59_A025_215986107399__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 #include <comdef.h>
00013 #include "Console.h"
00014 #include "ScriptHost.h"
00015 #include <vector>
00016 
00017 
00018 _COM_SMARTPTR_TYPEDEF(IScriptHost, __uuidof(IScriptHost));
00019 
00020 class CConsoleCtrl;
00021 class CScriptEdit : public CEdit  
00022 {
00023 public:
00024         CScriptEdit();
00025         virtual ~CScriptEdit();
00026         bool Init(CConsoleCtrl *console);
00027         void SetGMEApp(IDispatch *disp);
00028         void SetGMEProj(IDispatch *dsp);
00029         void ExecuteScript( CString& p_str);
00030         inline void SetLoadedScript( const CString& p_script)  { m_loadedScript   = p_script; }
00031         inline void SetScriptFileName( const CString& p_fname) { m_loadedFileName = p_fname;  }
00032         inline CString& GetLoadedScript()                      { return m_loadedScript;       }
00033         inline CString& GetLoadedScriptFileName()              { return m_loadedFileName;     }
00034         void showPrev();
00035         void showNext();
00036         void returnHit();
00037 protected:
00038         static const TCHAR* defPrompt;
00039 
00040         CConsoleCtrl *m_console;
00041         IScriptHostPtr m_host;
00042         typedef std::vector<CString> Strings;
00043         Strings m_inputlist;
00044         CString m_loadedScript;
00045         CString m_loadedFileName;
00046 
00047         DECLARE_MESSAGE_MAP()
00048 
00049         afx_msg void OnKeyUp( UINT nChar, UINT nRepCnt, UINT nFlags );
00050 
00051 public:
00052         afx_msg void OnEnKillfocus();
00053         afx_msg void OnEnSetfocus();
00054 };
00055 
00056 #endif // !defined(AFX_SCRIPTEDIT_H__5EF35F5A_41C7_4F59_A025_215986107399__INCLUDED_)