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.

70 lines
1.5 KiB

  1. //
  2. // CGRP.HPP
  3. // WbColorsGroup
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #ifndef CGRP_HPP
  8. #define CGRP_HPP
  9. #define NUMROWS 2
  10. #define NUMCOLS 14
  11. #define NUMCLRPANES (NUMROWS*NUMCOLS + 1) // palette + current one
  12. #define INDEX_CHOICE (NUMCLRPANES-1) // last one
  13. #define NUMCUSTCOLORS 16
  14. #define CLRPANE_HEIGHT 16
  15. #define CLRPANE_WIDTH CLRPANE_HEIGHT
  16. #define CLRPANE_BLACK RGB( 0,0,0 )
  17. #define CLRPANE_WHITE RGB( 255,255,255 )
  18. #define CLRCHOICE_HEIGHT (NUMROWS * CLRPANE_HEIGHT)
  19. #define CLRCHOICE_WIDTH CLRCHOICE_HEIGHT
  20. //
  21. // Colors window proc
  22. //
  23. class WbColorsGroup
  24. {
  25. public:
  26. WbColorsGroup();
  27. ~WbColorsGroup();
  28. virtual BOOL Create(HWND hwndParent, LPCRECT lprect);
  29. void GetNaturalSize(LPSIZE lpsize);
  30. void SaveSettings( void );
  31. COLORREF GetCurColor(void);
  32. void SetCurColor(COLORREF clr);
  33. void OnEditColors( void );
  34. HWND m_hwnd;
  35. friend LRESULT CALLBACK CGWndProc(HWND, UINT, WPARAM, LPARAM);
  36. protected:
  37. void OnPaint(void);
  38. void OnLButtonDown(UINT nFlags, int x, int y);
  39. void OnLButtonDblClk(UINT nFlags, int x, int y);
  40. int m_nLastColor;
  41. COLORREF m_crColors[ NUMCLRPANES ];
  42. HBRUSH m_hBrushes[ NUMCLRPANES ];
  43. COLORREF m_crCustomColors[ NUMCUSTCOLORS ];
  44. COLORREF GetColorOfBrush( int nColor );
  45. void SetColorOfBrush( int nColor, COLORREF crNewColor );
  46. void SetColorOfPane(int nColor, COLORREF clr);
  47. COLORREF DoColorDialog( int nColor );
  48. void ClickOwner( void );
  49. };
  50. #endif // CGRP_HPP