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.

154 lines
2.5 KiB

  1. //
  2. // AGRP.HPP
  3. // WbAttributesGroup
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #ifndef __AGRP_HPP_
  8. #define __AGRP_HPP_
  9. #define FONTBUTTONWIDTH 100
  10. #define FONTBUTTONHEIGHT 23
  11. #define PAGEBTN_WIDTH 23
  12. #define PAGEBTN_HEIGHT 23
  13. #define MAX_NUMCHARS 3
  14. //
  15. // Local defines
  16. //
  17. #define BORDER_SIZE_X ::GetSystemMetrics(SM_CXEDGE)
  18. #define BORDER_SIZE_Y ::GetSystemMetrics(SM_CYEDGE)
  19. #define SEPARATOR_SIZE_X 6
  20. #define SEPARATOR_SIZE_Y 6
  21. #define DEFAULT_PGC_WIDTH (8*24)
  22. enum
  23. {
  24. PGC_FIRST = 0,
  25. PGC_PREV,
  26. PGC_ANY,
  27. PGC_NEXT,
  28. PGC_LAST,
  29. PGC_INSERT,
  30. NUM_PAGE_CONTROLS
  31. };
  32. //
  33. // Indexedby PGC_ value
  34. //
  35. typedef struct tagPAGECTRL
  36. {
  37. HBITMAP hbmp;
  38. HWND hwnd;
  39. }
  40. PAGECTRL;
  41. //
  42. // The buttons are all BS_BITMAP
  43. // The edit field is ES_CENTER | ES_MULTILINE | ES_NUMBER | WS_BORDER
  44. //
  45. class WbTool;
  46. //
  47. //
  48. // Class: WbAttributesGroup
  49. //
  50. // Purpose: Define Whiteboard tool attributes display group
  51. //
  52. //
  53. class WbAttributesGroup
  54. {
  55. public:
  56. WbAttributesGroup();
  57. ~WbAttributesGroup();
  58. //
  59. // Window creation
  60. //
  61. BOOL Create(HWND hwndParent, LPCRECT lprc);
  62. //
  63. // Display the attributes of the tool passed as parameter
  64. //
  65. void DisplayTool(WbTool* pTool);
  66. //
  67. // Hide the tool attributes bar.
  68. //
  69. void Hide(void);
  70. //
  71. // Resizing functions
  72. //
  73. void GetNaturalSize(LPSIZE lpsize);
  74. //
  75. // Colors
  76. //
  77. void SelectColor(WbTool* pTool);
  78. void SetChoiceColor(COLORREF clr)
  79. {m_colorsGroup.SetCurColor(clr);}
  80. LRESULT OnEditColors( void )
  81. {return m_colorsGroup.OnEditColors();}
  82. void SaveSettings( void )
  83. {m_colorsGroup.SaveSettings();}
  84. //
  85. // Page Controls
  86. //
  87. BOOL IsChildEditField(HWND hwnd);
  88. UINT GetCurrentPageNumber(void);
  89. void SetCurrentPageNumber(UINT number);
  90. void SetLastPageNumber(UINT number);
  91. void EnablePageCtrls(BOOL bEnable);
  92. void EnableInsert(BOOL bEnable);
  93. BOOL RecolorButtonImages();
  94. HWND m_hwnd;
  95. friend LRESULT CALLBACK AGWndProc(HWND, UINT, WPARAM, LPARAM);
  96. protected:
  97. void OnSize(UINT nType, int cx, int cy);
  98. void OnCommand(UINT id, UINT code, HWND hwndCtl);
  99. //
  100. // Color palette
  101. //
  102. WbColorsGroup m_colorsGroup;
  103. //
  104. // Font Button
  105. //
  106. HWND m_hwndFontButton;
  107. //
  108. // Page controls
  109. //
  110. PAGECTRL m_uPageCtrls[NUM_PAGE_CONTROLS];
  111. HFONT m_hPageCtrlFont;
  112. int m_cxPageCtrls;
  113. void SetPageButtonNo(UINT pgcCtrl, UINT uiPageNumber);
  114. };
  115. #endif // __AGRP_HPP_