Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
6.5 KiB

  1. /******************************************************************************
  2. Header File: GPD Viewer.H
  3. This defines the class which implements the GPD viewer / editor. Looks
  4. pretty painless for the nonce.
  5. Copyright (c) 1997 by Microsoft Corporation. All Rights Reserved.
  6. A Pretty Penny Enterprises Production
  7. Change History:
  8. 03/24/1997 Bob_Kjelgaard@Prodigy.Net Created it
  9. ******************************************************************************/
  10. #if !defined(AFX_GPDVIEWER_H__1BDEA163_A492_11D0_9505_444553540000__INCLUDED_)
  11. #define AFX_GPDVIEWER_H__1BDEA163_A492_11D0_9505_444553540000__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. class CGPDViewer : public CRichEditView {
  16. int m_iLine, m_iTopLineColored; // Used for work items
  17. UINT m_uTimer; // Identifier for change timer
  18. CDialogBar m_cdbActionBar; // Holds GPD related controls/info
  19. CStatusBar m_csb; // Manages the GPD Editor's status bar
  20. CFindReplaceDialog m_cfrd; // Unused at this (6/29/98) time
  21. BOOL m_bInColor, m_bStart; // Flags to avoid recursion
  22. int m_nErrorLevel ; // Parser verbosity level
  23. bool m_bEditingAidsEnabled ; // True iff editing aids are enabled
  24. void* m_punk ; // Used to freeze REC display
  25. void* m_pdoc ; // Used to freeze REC display
  26. long m_lcount ; // Used to freeze REC display
  27. bool m_bVScroll ; // True iff VScroll msg handled
  28. void MarkError(unsigned u);
  29. void CreateActionBar();
  30. void LoadErrorListBox();
  31. void Color();
  32. unsigned TextColor(int i, int& nstartchar, int& nendchar);
  33. unsigned CommentColor(CString csphrase, int ncomloc, CString csline,
  34. int& nstartchar, int& nendchar) ;
  35. unsigned KeywordColor(CString csphrase, int nkeyloc, CString csline,
  36. int& nstartchar, int& nendchar) ;
  37. bool IsRECLineVisible(int nline = -1) ;
  38. static LPTSTR alptstrStringIDKeys[] ; // Keywords with string ID values
  39. static LPTSTR alptstrUFMIDKeys[] ; // Keywords with UFM ID values
  40. protected: // create from serialization only
  41. CGPDViewer();
  42. DECLARE_DYNCREATE(CGPDViewer)
  43. // Attributes
  44. public:
  45. CGPDContainer* GetDocument() { return (CGPDContainer *) m_pDocument; }
  46. // Operations
  47. public:
  48. void UpdateNow();
  49. void FreezeREC() ;
  50. void UnfreezeREC() ;
  51. // Overrides
  52. // ClassWizard generated virtual function overrides
  53. //{{AFX_VIRTUAL(CGPDViewer)
  54. public:
  55. virtual void OnInitialUpdate();
  56. virtual BOOL PreTranslateMessage(MSG* pMsg);
  57. protected:
  58. virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  59. //}}AFX_VIRTUAL
  60. virtual HRESULT QueryAcceptData(LPDATAOBJECT lpdo, CLIPFORMAT FAR *pcf,
  61. DWORD dwUnused, BOOL bReally, HGLOBAL hgMetaFile);
  62. // Implementation
  63. public:
  64. virtual ~CGPDViewer();
  65. #ifdef _DEBUG
  66. virtual void AssertValid() const;
  67. virtual void Dump(CDumpContext& dc) const;
  68. #endif
  69. protected:
  70. afx_msg void OnSelChange(LPNMHDR pnmh, LRESULT *plr);
  71. // Generated message map functions
  72. //{{AFX_MSG(CGPDViewer)
  73. afx_msg void OnDestroy();
  74. afx_msg void OnFileParse();
  75. afx_msg void OnChange();
  76. afx_msg void OnTimer(UINT nIDEvent);
  77. afx_msg void OnVscroll();
  78. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  79. afx_msg void OnFileSave();
  80. afx_msg void OnFileSaveAs();
  81. afx_msg void OnFileErrorLevel();
  82. afx_msg void OnGotoGPDLineNumber();
  83. afx_msg void OnSrchNextBtn();
  84. afx_msg void OnSrchPrevBtn();
  85. afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  86. afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
  87. afx_msg void OnSelchangeErrorLst();
  88. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  89. afx_msg void OnEditEnableAids();
  90. afx_msg void OnEditPaste();
  91. afx_msg void OnEditCut();
  92. afx_msg void OnFileInf();
  93. //}}AFX_MSG
  94. DECLARE_MESSAGE_MAP()
  95. void ChangeSelectedError(int nchange) ;
  96. bool SearchTheREC(bool bforward) ;
  97. int ReverseSearchREC(CRichEditCtrl& crec, FINDTEXTEX& fte, int norgcpmin,
  98. int norgcpmax) ;
  99. bool GotoMatchingBrace() ;
  100. bool IsBraceToMatch(CString& cssel, TCHAR& chopen, TCHAR& chclose,
  101. bool bchecksecondchar, bool& bsearchup, CHARRANGE cr,
  102. int& noffset) ;
  103. void InitGPDKeywordArray() ;
  104. } ;
  105. #define MIN_PARSER_VERBOSITY 0
  106. #define MAX_PARSER_VERBOSITY 4
  107. /////////////////////////////////////////////////////////////////////////////
  108. /////////////////////////////////////////////////////////////////////////////
  109. // CGotoLine dialog
  110. class CGotoLine : public CDialog
  111. {
  112. int m_nMaxLine ; // Maximum allowable line number
  113. int m_nLineNum ; // Line number entered by user
  114. // Construction
  115. public:
  116. CGotoLine(CWnd* pParent = NULL); // standard constructor
  117. // Dialog Data
  118. //{{AFX_DATA(CGotoLine)
  119. enum { IDD = IDD_GotoLine };
  120. CEdit m_ceGotoBox;
  121. CString m_csLineNum;
  122. //}}AFX_DATA
  123. // Overrides
  124. // ClassWizard generated virtual function overrides
  125. //{{AFX_VIRTUAL(CGotoLine)
  126. protected:
  127. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  128. //}}AFX_VIRTUAL
  129. // Implementation
  130. protected:
  131. // Generated message map functions
  132. //{{AFX_MSG(CGotoLine)
  133. virtual void OnOK();
  134. //}}AFX_MSG
  135. DECLARE_MESSAGE_MAP()
  136. public:
  137. void SetMaxLine(int nmax) { m_nMaxLine = nmax ; }
  138. int GetMaxLine() { return m_nMaxLine ; }
  139. int GetLineNum() { return m_nLineNum ; }
  140. };
  141. /////////////////////////////////////////////////////////////////////////////
  142. // CErrorLevel dialog
  143. class CErrorLevel : public CDialog
  144. {
  145. // Construction
  146. public:
  147. CErrorLevel(CWnd* pParent = NULL); // standard constructor
  148. // Dialog Data
  149. //{{AFX_DATA(CErrorLevel)
  150. enum { IDD = IDD_ErrorLevel };
  151. CComboBox m_ccbErrorLevel;
  152. int m_nErrorLevel;
  153. //}}AFX_DATA
  154. // Overrides
  155. // ClassWizard generated virtual function overrides
  156. //{{AFX_VIRTUAL(CErrorLevel)
  157. protected:
  158. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  159. //}}AFX_VIRTUAL
  160. // Implementation
  161. protected:
  162. // Generated message map functions
  163. //{{AFX_MSG(CErrorLevel)
  164. virtual BOOL OnInitDialog();
  165. virtual void OnOK();
  166. //}}AFX_MSG
  167. DECLARE_MESSAGE_MAP()
  168. public:
  169. void SetErrorLevel(int nerrlev) { m_nErrorLevel = nerrlev ; }
  170. int GetErrorLevel() { return m_nErrorLevel ; }
  171. };
  172. //{{AFX_INSERT_LOCATION}}
  173. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  174. #endif // !defined(AFX_GPDVIEWER_H__1BDEA163_A492_11D0_9505_444553540000__INCLUDED_)