Source code of Windows XP (NT5)
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.

135 lines
3.5 KiB

  1. #ifndef __CDEFINESS_H__
  2. #define __CDEFINESS_H__
  3. #ifndef __CSUBSET_H__
  4. #include "csubset.h"
  5. #endif
  6. #ifndef HHCTRL
  7. #ifndef _CDLG_H_
  8. #include "..\hha\cdlg.h"
  9. #endif
  10. #else
  11. #include "cdlg.h"
  12. #endif
  13. #include <commctrl.h>
  14. #ifndef HHCTRL
  15. #include "..\hhw\resource.h"
  16. #else
  17. #include "resource.h"
  18. #endif
  19. #define SS_IMAGELIST_WIDTH 10
  20. #define SS_IMAGELIST_HEIGHT 10
  21. #define CWIDTH_IMAGE_LIST 16
  22. #ifdef HHCTRL
  23. class CChooseSubsets : public CDlg
  24. {
  25. public:
  26. CChooseSubsets(HWND hwndParent, CHHWinType* phh) : CDlg(hwndParent, CChooseSubsets::IDD) {
  27. m_phh = phh;
  28. }
  29. BOOL OnBeginOrEnd(void);
  30. enum { IDD = IDDLG_CHOOSE_SUBSETS };
  31. private:
  32. CHHWinType* m_phh;
  33. };
  34. #endif // HHCTRL
  35. class CDefineSubSet : public CDlg
  36. {
  37. public:
  38. CDefineSubSet( HWND hwndParent, CSubSets *pSubSets, CInfoType *pInfoType, BOOL fHidden );
  39. ~CDefineSubSet();
  40. BOOL InitTreeView(int);
  41. void SetItemFont(HFONT hFont);
  42. int IncState(int const type);
  43. int GetITState(int const type );
  44. LRESULT OnDlgMsg(UINT msg, WPARAM wParam, LPARAM lParam);
  45. LRESULT TreeViewMsg(NM_TREEVIEW* pnmhdr);
  46. BOOL Save(); // returns TRUE if a new SubSet in m_aSubSets.
  47. BOOL OnBeginOrEnd();
  48. void OnSelChange( UINT id );
  49. void OnButton(UINT id);
  50. void Refresh();
  51. BOOL GetDisplayHidden() const { return m_pSubSets->m_fPredefined; }
  52. void SetDisplayHidden( BOOL const fHidden) { m_pSubSets->m_fPredefined = fHidden; }
  53. protected:
  54. HWND m_hwndTree; // The tree view that contains all the categories and ITs
  55. public:
  56. BOOL m_fSaveHHP; // TRUE if need to save the HHP file with subset changes.
  57. private:
  58. BOOL m_fModified; // TRUE if the subset has changed;
  59. CSubSets *m_pSubSets;
  60. CSubSet *m_pSubSet; // used for current state of treeview items.
  61. CInfoType *m_pInfoType; // The IT and Categories available to choose from
  62. HTREEITEM *m_pSSRoot;
  63. int m_cFonts;
  64. HFONT* m_ahfonts;
  65. HIMAGELIST m_hil;
  66. #ifdef HHCTRL
  67. enum { IDD = IDDLG_HH_DEFINESUBSET };
  68. #else
  69. enum { IDD = IDD_DEFINESUBSET };
  70. #endif
  71. enum {EXCLUSIVE, DONT_CARE, INCLUSIVE};
  72. #define BOLD INCLUSIVE
  73. #define NORMAL DONT_CARE
  74. };
  75. class CNameSubSet : public CDlg
  76. {
  77. public:
  78. #ifdef HHCTRL
  79. CNameSubSet(HWND hwndParent, CStr &cszName, int max_text) : CDlg(hwndParent, IDD) ,m_csz(cszName){ m_max_text = max_text; }
  80. #else
  81. CNameSubSet(HWND hwndParent, CStr &cszName, int max_text) : CDlg(IDD, hwndParent),m_csz(cszName){ m_max_text = max_text; }
  82. #endif
  83. CStr &m_csz;
  84. int m_max_text;
  85. BOOL OnBeginOrEnd() {if (m_fInitializing)
  86. {
  87. SetFocus( IDC_SUBSET_NAME );
  88. SetWindowText(IDC_SUBSET_NAME, m_csz.psz);
  89. m_fInitializing = FALSE;
  90. }
  91. else
  92. {
  93. CStr cszTemp;
  94. lcHeapCheck();
  95. cszTemp.ReSize(80);
  96. GetWindowText(IDC_SUBSET_NAME, cszTemp.psz, 79);
  97. lcHeapCheck();
  98. m_csz = cszTemp.psz;
  99. lcHeapCheck();
  100. }
  101. return TRUE;
  102. }
  103. enum {IDD = IDD_SUBSET_NAME };
  104. };
  105. #endif // __CSUBSET_H__