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.

85 lines
1.7 KiB

  1. //
  2. // TWND.HPP
  3. // Tool Window Class
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #ifndef __TWND_HPP_
  8. #define __TWND_HPP_
  9. //
  10. // Our toolbar has three sections:
  11. // 5 rows of exclusive tools
  12. // SEPARATOR
  13. // 2 rows of options
  14. // SEPARATOR
  15. // 1 row of other commands (screen grabbing)
  16. //
  17. #define TOOLBAR_NUMROWS 8
  18. #define TOOLBAR_NUMSEPARATORS 2
  19. #define TOOLBAR_NUMCOLS 2
  20. #define TOOLBAR_FIRSTBUTTON 0
  21. #define TOOLBAR_MAXBUTTON 18
  22. #define TOOLBAR_LASTBUTTON (TOOLBAR_MAXBUTTON - 1)
  23. #define TOOLBAR_IMAGEWIDTH 16
  24. #define TOOLBAR_IMAGEHEIGHT 15
  25. #define TOOLBAR_BTNEXTRA 7
  26. #define TOOLBAR_BTNWIDTH (TOOLBAR_IMAGEWIDTH + TOOLBAR_BTNEXTRA)
  27. #define TOOLBAR_BTNHEIGHT (TOOLBAR_IMAGEHEIGHT + TOOLBAR_BTNEXTRA)
  28. #define TOOLBAR_MARGINX (::GetSystemMetrics(SM_CXEDGE))
  29. #define TOOLBAR_SEPARATORY 8
  30. #define TOOLBAR_WIDTH (2 * TOOLBAR_BTNWIDTH + 3 * TOOLBAR_MARGINX)
  31. //
  32. //
  33. // Class: WbToolBar
  34. //
  35. // Purpose: Define Whiteboard tool-bar window
  36. //
  37. //
  38. class WbToolBar
  39. {
  40. public:
  41. //
  42. // Construction
  43. //
  44. WbToolBar();
  45. ~WbToolBar();
  46. //
  47. // Window creation
  48. //
  49. BOOL Create(HWND hwndParent);
  50. //
  51. // Button manipulation
  52. //
  53. BOOL PushDown(UINT uiId);
  54. BOOL PopUp(UINT uiId);
  55. BOOL Enable(UINT uiId);
  56. BOOL Disable(UINT uiId);
  57. //
  58. // Resizing functions
  59. //
  60. void GetNaturalSize(LPSIZE lpsize);
  61. UINT WidthFromHeight(UINT height);
  62. void RecolorButtonImages(void);
  63. HWND m_hwnd;
  64. protected:
  65. HBITMAP m_hbmImages;
  66. };
  67. #endif // __TWND_HPP_