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.

104 lines
2.7 KiB

  1. #ifndef __NAVPANE_H__
  2. #define __NAVPANE_H__
  3. ///////////////////////////////////////////////////////////
  4. //
  5. //
  6. // navpane.h --- Structures used by the nav panes.
  7. //
  8. //
  9. //
  10. /*
  11. Currently the structures in this file are used by AdvFTS
  12. and the bookmarks tab for resizing the window.
  13. */
  14. ///////////////////////////////////////////////////////////
  15. //
  16. // Forwards
  17. //
  18. interface INavUI ;
  19. ///////////////////////////////////////////////////////////
  20. //
  21. // CDlgItemInfo - Contains information about each control
  22. // in the pane. Used for enabling/disabling controls and
  23. // for sizing.
  24. //
  25. namespace Justify
  26. {
  27. typedef enum Vertical
  28. {
  29. Bottom,
  30. Top
  31. };
  32. typedef enum Horizontal
  33. {
  34. Left,
  35. Right
  36. };
  37. };
  38. namespace ItemInfo
  39. {
  40. typedef enum Type
  41. {
  42. Generic,
  43. Button,
  44. CheckBox
  45. };
  46. };
  47. struct CDlgItemInfo
  48. {
  49. // Window Info
  50. HWND m_hWnd ; // hWnd Cache.
  51. int m_id ; // ctrl id.
  52. CHAR m_accelkey ; // accelerator key.
  53. // Control Type Information
  54. ItemInfo::Type m_Type; //Used when processing menu keys.
  55. // Status bits
  56. bool m_bIgnoreEnabled:1 ; // Ignore the following.
  57. bool m_bEnabled:1 ; // Is the control enabled?
  58. bool m_bIgnoreMax:1 ; // Ignore the Max parameter.
  59. bool m_bGrowH:1 ; // Grow Horizontally.
  60. bool m_bGrowV:1 ; // Grow Vertically.
  61. Justify::Vertical m_JustifyV ; // Do we stick to the top or the bottom.
  62. int m_iOffsetV ; // Distance from our justification point.
  63. Justify::Horizontal m_JustifyH ; // Do we stick to the right or the left
  64. int m_iOffsetH ;
  65. int m_iPadH ; // Right Horizontal Padding.
  66. int m_iPadV ; // Bottom Vertical Padding.
  67. RECT m_rectMin ; // Defined in the RC file.
  68. RECT m_rectCur ;
  69. RECT m_rectMax ; // Max size.
  70. };
  71. ///////////////////////////////////////////////////////////
  72. //
  73. // Utility Functions
  74. //
  75. // Convert a rect from screen to client.
  76. void ScreenRectToClientRect(HWND hWnd, RECT* prect) ;
  77. // Get an accelerator key for the appropriate control.
  78. int GetAcceleratorKey(HWND hwndctrl) ;
  79. inline int GetAcceleratorKey(HWND hWndDlg, int ctrlid) {return GetAcceleratorKey(::GetDlgItem(hWndDlg, ctrlid)) ; }
  80. //TODO: Put this into a base class
  81. // Process the menu character.
  82. bool ProcessMenuChar( INavUI* pNavUI,
  83. HWND hwndParent,
  84. CDlgItemInfo* DlgItems, // Array of dialog items
  85. int NumDlgItems, // Number of items in the array
  86. int ch // accelerator to act on.
  87. ) ;
  88. #endif //__NAVPANE_H__