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.

138 lines
3.5 KiB

  1. // Copyright (C) 1996-1997 Microsoft Corporation. All rights reserved.
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #ifndef __CINDEX_H__
  6. #define __CINDEX_H__
  7. #ifndef __SITEMAP_H__
  8. #include "sitemap.h"
  9. #endif
  10. #ifndef _CINFOTYPE_H
  11. #include "cinfotyp.h"
  12. #endif
  13. #include "clistbox.h"
  14. #include "navui.h" // Clean up headers
  15. // CDlgItemInfo class --- currently only used for accelerator support.
  16. #include "navpane.h"
  17. #include "vlist.h"
  18. // #include "secwin.h"
  19. //////////////////////////////////////////////////////////////////////////
  20. //
  21. // Constants
  22. //
  23. ///////////////////////////////////////////////////////////
  24. //
  25. // Forward References
  26. //
  27. class CHtmlHelpControl; // forward reference
  28. class CHHWinType; // forward reference
  29. ///////////////////////////////////////////////////////////
  30. //
  31. // CIndex
  32. //
  33. class CIndex : MI_COUNT(CIndex) public INavUI, // NOTE: This interface must be first. Otherwise, you get an mem error.
  34. public CSiteMap
  35. {
  36. public:
  37. //--- Internal Contants
  38. typedef enum DlgItemInfoIndex
  39. {
  40. c_KeywordEdit,
  41. //c_KeywordsList,
  42. c_DisplayBtn,
  43. c_NumDlgItems
  44. };
  45. //--- Constructor
  46. CIndex(CHtmlHelpControl* phhctrl, IUnknown* pUnkOuter, CHHWinType* phh);
  47. virtual ~CIndex();
  48. //--- INavUI Interface
  49. BOOL Create(HWND hwndParent);
  50. LRESULT OnCommand(HWND hwnd, UINT id, UINT uNotifiyCode, LPARAM lParam) ;
  51. void ResizeWindow();
  52. void HideWindow(void);
  53. void ShowWindow(void);
  54. void SetPadding(int pad) { m_padding = pad; }
  55. void SetTabPos(int tabpos) { m_NavTabPos = tabpos; }
  56. void SetDefaultFocus() ;
  57. bool ProcessMenuChar(HWND hwndParent, int ch);
  58. LRESULT OnNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) {return 1l;}
  59. void OnDrawItem(UINT id, LPDRAWITEMSTRUCT pdis) {/*Not Implemented*/}
  60. void Seed(PCSTR pszSeed);
  61. void Seed(WCHAR* pwszSeed);
  62. void Refresh(void)
  63. {
  64. if ( m_pVList )
  65. m_pVList->Refresh();
  66. }
  67. // Other member functions.
  68. void ChangeOuter(IUnknown* pUnkOuter) { m_pOuter = pUnkOuter; }
  69. void OnVKListNotify(NMHDR* pNMHdr);
  70. BOOL ReadIndexFile(PCSTR pszFile);
  71. void FillListBox(BOOL fReset = FALSE);
  72. //--- Helper functions.
  73. // Returns the font to be used.
  74. HFONT GetContentFont();
  75. // Initialize the DlgItemArray.
  76. void InitDlgItemArray() ;
  77. //--- Member variables.
  78. int m_cFonts;
  79. HFONT* m_ahfonts;
  80. BOOL m_fGlobal; // means we've already initialized ourselves once
  81. LANGID m_langid;
  82. CHtmlHelpControl* m_phhctrl;
  83. IUnknown* m_pOuter;
  84. CHHWinType* m_phh;
  85. HPALETTE m_hpalBackGround;
  86. HBRUSH m_hbrBackGround; // background brush
  87. HBITMAP m_hbmpBackGround;
  88. int m_cxBackBmp;
  89. int m_cyBackBmp;
  90. HWND m_hwndEditBox;
  91. HWND m_hwndListBox;
  92. HWND m_hwndDisplayButton;
  93. HWND m_hwndStaticKeyword;
  94. BOOL m_fSelectionChange;
  95. int m_padding;
  96. CDlgListBox m_listbox;
  97. int m_NavTabPos; // location of parent tabs
  98. BOOL m_fBinary;
  99. CInfoType *pInfoType; // the Information Types
  100. // The window passed into create is not the actual parent window of the
  101. // controls. Instead, the controls are always parented to the Navigation window
  102. // which owns the tabs. For resizing, we need to have a pointer to the
  103. // tabctrl window. So, we save this pointer here.
  104. HWND m_hwndResizeToParent ;
  105. private:
  106. BOOL m_bInit;
  107. CVirtualListCtrl* m_pVList;
  108. // Array of dlgitems
  109. CDlgItemInfo m_aDlgItems[c_NumDlgItems] ;
  110. BOOL m_bUnicode;
  111. };
  112. #endif // __CINDEX_H__