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.

55 lines
1.5 KiB

  1. //-----------------------------------------------------------------------------
  2. // File: flexcheckbox.h
  3. //
  4. // Desc: Implements a check box control similar to Windows check box.
  5. // CFlexCheckBox is derived from CFlexWnd. The only place that
  6. // uses CFlxCheckBox is in the keyboard for sorting by assigned
  7. // keys.
  8. //
  9. // Copyright (C) 1999-2000 Microsoft Corporation. All Rights Reserved.
  10. //-----------------------------------------------------------------------------
  11. #ifndef __FLEXCHECKBOX_H__
  12. #define __FLEXCHECKBOX_H__
  13. enum CHECKNOTIFY {
  14. CHKNOTIFY_UNCHECK,
  15. CHKNOTIFY_CHECK,
  16. CHKNOTIFY_MOUSEOVER};
  17. class CFlexCheckBox : public CFlexWnd
  18. {
  19. LPTSTR m_tszText; // Text string of the message
  20. BOOL m_bChecked;
  21. COLORREF m_rgbText, m_rgbBk, m_rgbSelText, m_rgbSelBk, m_rgbFill, m_rgbLine;
  22. HFONT m_hFont;
  23. HWND m_hWndNotify;
  24. void SetRect();
  25. void InternalPaint(HDC hDC);
  26. RECT GetRect(const RECT &);
  27. RECT GetRect();
  28. void Notify(int code);
  29. public:
  30. CFlexCheckBox();
  31. virtual ~CFlexCheckBox();
  32. void SetNotify(HWND hWnd) { m_hWndNotify = hWnd; }
  33. void SetCheck(BOOL bChecked) { m_bChecked = bChecked; }
  34. BOOL GetCheck() { return m_bChecked; }
  35. void SetText(LPCTSTR tszText);
  36. // cosmetics
  37. void SetFont(HFONT hFont);
  38. void SetColors(COLORREF text, COLORREF bk, COLORREF seltext, COLORREF selbk, COLORREF fill, COLORREF line);
  39. virtual void OnPaint(HDC hDC);
  40. virtual void OnClick(POINT point, WPARAM fwKeys, BOOL bLeft);
  41. virtual void OnMouseOver(POINT point, WPARAM fwKeys);
  42. };
  43. #endif