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.

249 lines
7.1 KiB

  1. /******************************************************************************
  2. Header File: Glyph Map View.H
  3. This defines the classes used to edit and view the glyph mappings.
  4. Copyright (c) 1997 by Microsoft Corporation. All Rights Reserved.
  5. A Pretty Penny Enterprises Production
  6. Change History:
  7. 02-20-1997 Bob_Kjelgaard@Prodigy.Net Began work on it.
  8. ******************************************************************************/
  9. /******************************************************************************
  10. CGlyphMappingPage class
  11. This class handles the property sheet page which displays a list of the
  12. individual code points in the glyph translatin table.
  13. ******************************************************************************/
  14. class CGlyphMappingPage : public CPropertyPage {
  15. // Sorting members and methods
  16. enum {Strings, Codes, Pages, Columns};
  17. BOOL m_abDirection[Columns]; // Sort directions;
  18. BYTE m_bSortFirst, m_bSortSecond, m_bSortLast;
  19. static int CALLBACK MapSorter(LPARAM lp1, LPARAM lp2, LPARAM lp3);
  20. CGlyphMap* m_pcgm;
  21. BOOL m_bJustChangedSelectString; // Semi-flaky work-around
  22. long m_lPredefinedID; // So we know if we need to change this.
  23. unsigned m_uTimer; // Using a timer for long fills
  24. unsigned m_uidGlyph; // Used to track where we are on fills
  25. // Construction
  26. public:
  27. CGlyphMappingPage();
  28. ~CGlyphMappingPage();
  29. void Init(CGlyphMap* pcgm) { m_pcgm = pcgm; }
  30. // Dialog Data
  31. //{{AFX_DATA(CGlyphMappingPage)
  32. enum { IDD = IDD_GlyphMappings };
  33. CProgressCtrl m_cpcBanner;
  34. CListCtrl m_clcMap;
  35. //}}AFX_DATA
  36. // Overrides
  37. // ClassWizard generate virtual function overrides
  38. //{{AFX_VIRTUAL(CGlyphMappingPage)
  39. public:
  40. virtual BOOL OnSetActive();
  41. protected:
  42. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  43. //}}AFX_VIRTUAL
  44. // Implementation
  45. protected:
  46. // Stuff Class Wizard doesn't know about, because we generate it from
  47. // our on-the-fly context menus...
  48. afx_msg void OnChangeInvocation();
  49. afx_msg void OnChangeCodePage();
  50. afx_msg void OnDeleteItem();
  51. afx_msg void OnAddItem();
  52. // Generated message map functions
  53. //{{AFX_MSG(CGlyphMappingPage)
  54. virtual BOOL OnInitDialog();
  55. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  56. afx_msg void OnEndlabeleditGlyphMapping(NMHDR* pNMHDR, LRESULT* pResult);
  57. afx_msg void OnItemchangedGlyphMapping(NMHDR* pNMHDR, LRESULT* pResult);
  58. afx_msg void OnColumnclickGlyphMapping(NMHDR* pNMHDR, LRESULT* pResult);
  59. afx_msg void OnGetdispinfoGlyphMapping(NMHDR* pNMHDR, LRESULT* pResult);
  60. afx_msg void OnKeydownGlyphMapping(NMHDR* pNMHDR, LRESULT* pResult);
  61. afx_msg void OnTimer(UINT nIDEvent);
  62. afx_msg void OnDestroy();
  63. //}}AFX_MSG
  64. DECLARE_MESSAGE_MAP()
  65. void LoadCharMapList() ;
  66. };
  67. /*****************************************************************************
  68. CCodePagePage class
  69. This class handles the property page which describes the code pages used
  70. along with their selection and deselection strings.
  71. ******************************************************************************/
  72. class CCodePagePage : public CToolTipPage {
  73. CGlyphMap *m_pcgm;
  74. bool m_bInitialized ; // True iff page has been initialized.
  75. bool m_bSelDeselChgSignificant ; // True iff a change to a sel/desel
  76. // editbox means contents should be
  77. // Construction // saved.
  78. public:
  79. CCodePagePage();
  80. ~CCodePagePage();
  81. void Init(CGlyphMap * pcgm) { m_pcgm = pcgm; }
  82. void SaveBothSelAndDeselStrings() ;
  83. void SaveSelDeselString(CEdit &cesd, BOOL bselstr) ;
  84. // Dialog Data
  85. //{{AFX_DATA(CCodePagePage)
  86. enum { IDD = IDD_CodePageView };
  87. CButton m_cbDelete;
  88. CEdit m_ceSelect;
  89. CEdit m_ceDeselect;
  90. CButton m_cbRemove;
  91. CListBox m_clbPages;
  92. //}}AFX_DATA
  93. // Overrides
  94. // ClassWizard generate virtual function overrides
  95. //{{AFX_VIRTUAL(CCodePagePage)
  96. protected:
  97. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  98. //}}AFX_VIRTUAL
  99. // Implementation
  100. protected:
  101. // Generated message map functions
  102. //{{AFX_MSG(CCodePagePage)
  103. virtual BOOL OnInitDialog();
  104. afx_msg void OnKillfocusSelectString();
  105. afx_msg void OnKillfocusDeselectString();
  106. afx_msg void OnAddPage();
  107. afx_msg void OnSelchangeCodePageList();
  108. afx_msg void OnReplacePage();
  109. afx_msg void OnChangeSelectString();
  110. afx_msg void OnChangeDeselectString();
  111. afx_msg void OnDeletePage();
  112. //}}AFX_MSG
  113. DECLARE_MESSAGE_MAP()
  114. };
  115. /******************************************************************************
  116. CPredefinedMaps class
  117. This class allows the user to specify a predefined mapping (if desired) and
  118. the way the code points in the table are ro be considered in relation to the
  119. same.
  120. ******************************************************************************/
  121. class CPredefinedMaps : public CPropertyPage {
  122. CGlyphMap *m_pcgm;
  123. // Construction
  124. public:
  125. CPredefinedMaps();
  126. ~CPredefinedMaps();
  127. void Init(CGlyphMap *pcgm) { m_pcgm = pcgm; }
  128. // Dialog Data
  129. //{{AFX_DATA(CPredefinedMaps)
  130. enum { IDD = IDD_PredefinedPage };
  131. CListBox m_clbIDs;
  132. //}}AFX_DATA
  133. // Overrides
  134. // ClassWizard generate virtual function overrides
  135. //{{AFX_VIRTUAL(CPredefinedMaps)
  136. public:
  137. virtual BOOL OnKillActive();
  138. protected:
  139. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  140. //}}AFX_VIRTUAL
  141. // Implementation
  142. protected:
  143. // Generated message map functions
  144. //{{AFX_MSG(CPredefinedMaps)
  145. virtual BOOL OnInitDialog();
  146. afx_msg void OnOverstrike();
  147. //}}AFX_MSG
  148. DECLARE_MESSAGE_MAP()
  149. };
  150. /******************************************************************************
  151. CGlyphMapView class
  152. This class is the view class for glyph maps. It creates a property sheet
  153. using the above pages.
  154. ******************************************************************************/
  155. class CGlyphMapView : public CView {
  156. CPropertySheet m_cps;
  157. CGlyphMappingPage m_cgmp;
  158. CCodePagePage m_ccpp;
  159. CPredefinedMaps m_cpm;
  160. protected:
  161. CGlyphMapView(); // protected constructor used by dynamic creation
  162. DECLARE_DYNCREATE(CGlyphMapView)
  163. // Attributes
  164. public:
  165. CGlyphMapContainer* GetDocument() {
  166. return (CGlyphMapContainer *) m_pDocument;
  167. }
  168. // Operations
  169. public:
  170. // Overrides
  171. // ClassWizard generated virtual function overrides
  172. //{{AFX_VIRTUAL(CGlyphMapView)
  173. protected:
  174. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  175. virtual void OnInitialUpdate(); // first time after construct
  176. virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  177. //}}AFX_VIRTUAL
  178. public:
  179. void SaveBothSelAndDeselStrings() ;
  180. // Implementation
  181. protected:
  182. virtual ~CGlyphMapView();
  183. #ifdef _DEBUG
  184. virtual void AssertValid() const;
  185. virtual void Dump(CDumpContext& dc) const;
  186. #endif
  187. // Generated message map functions
  188. //{{AFX_MSG(CGlyphMapView)
  189. afx_msg void OnDestroy();
  190. //}}AFX_MSG
  191. DECLARE_MESSAGE_MAP()
  192. };