ScriptDlg.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. #pragma once
  2. #include "..//Controls//SyntaxColorizer.h"
  3. #include "afxwin.h"
  4. #include "..//resource.h"
  5. #define GRP_KEYWORD   0
  6. #define GRP_PRAGMA    1
  7. #define GRP_DIRECTIVE 2
  8. class  ILoger
  9. {
  10. public:
  11. virtual  void   SetMessage(const char *message)   =0;
  12. };
  13. // CScriptDlg dialog
  14. // CMyRichEdit
  15. class CMyRichEdit : public CRichEditCtrl
  16. {
  17. DECLARE_DYNAMIC(CMyRichEdit)
  18. public:
  19. CMyRichEdit();
  20. virtual ~CMyRichEdit();
  21. protected:
  22. DECLARE_MESSAGE_MAP()
  23. public:
  24. afx_msg void OnEnSetfocus();
  25. afx_msg void OnEnKillfocus();
  26. };
  27. class CScriptDlg : public CDialog, public ILoger
  28. {
  29. DECLARE_DYNAMIC(CScriptDlg)
  30. public:
  31. CScriptDlg(CWnd* pParent = NULL);   // standard constructor
  32. virtual ~CScriptDlg();
  33. // Dialog Data
  34. enum { IDD = IDD_SCRIPT_DLG };
  35. protected:
  36. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  37. DECLARE_MESSAGE_MAP()
  38. public:
  39. afx_msg void OnSize(UINT nType, int cx, int cy);
  40. virtual BOOL OnInitDialog();
  41. afx_msg void OnEnChangeScriptRichedit();
  42. public:
  43. virtual  void   SetMessage(const char *message);
  44. private:
  45. CMyRichEdit      m_rich_edit;
  46. CSyntaxColorizer m_syntax_colorizer;
  47. EDITSTREAM       m_es;
  48. void readFile(CString sFileName);
  49. void parse();
  50. void parse2();
  51. CString         m_file_name;
  52. void            SetFileName(CString& newFN);
  53. bool            m_was_modified;
  54. public:
  55. void OnNew();
  56. void OnOpen();
  57. void OnSave();
  58. void OnSaveAs();
  59. void OnRun();
  60. private:
  61. CEdit   m_errors_log;
  62. CEdit   m_trace_log;
  63. bool    m_active_error_regime;
  64. HBRUSH  m_error_brush;
  65. public:
  66. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  67. };
  68. extern ILoger*   global_loger;