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.

72 lines
2.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. focuschk.hxx
  7. This file contains the definition for the focus checkbox
  8. FILE HISTORY:
  9. Johnl 29-Aug-1991 Created
  10. */
  11. #ifndef _FOCUSCHK_HXX_
  12. #define _FOCUSCHK_HXX_
  13. /*************************************************************************
  14. NAME: FOCUS_CHECKBOX
  15. SYNOPSIS: A checkbox that has a focus rectangle drawn around it
  16. when it has the focus.
  17. INTERFACE: Same as CHECKBOX
  18. PARENT: CHECKBOX, CUSTOM_CONTROL
  19. CAVEATS: The focus rectangle is drawn on the owner window, just outside
  20. the defining window of the checkbox. This means if you drag
  21. the checkbox so the focus box is off the screen but the
  22. checkbox's window is not, you will lose the border. We
  23. are willing to live with this given our scheduling
  24. constraints.
  25. The checkbox should not move after this is constructed.
  26. Originally the focus rectangle was drawn inside the checkbox's
  27. window, unfortunately the control is always drawn after
  28. the OnPaintReq is called, thus we get overwritten, thus
  29. the we draw outside the control window.
  30. NOTES:
  31. HISTORY:
  32. Johnl 10-Sep-1991 Created
  33. **************************************************************************/
  34. DLL_CLASS FOCUS_CHECKBOX : public CHECKBOX, public CUSTOM_CONTROL
  35. {
  36. private:
  37. RECT _rectFocusBox ;
  38. BOOL _fHasFocus ;
  39. protected:
  40. virtual BOOL OnFocus( const FOCUS_EVENT & focusevent ) ;
  41. virtual BOOL OnDefocus( const FOCUS_EVENT & focusevent ) ;
  42. virtual BOOL OnPaintReq( void ) ;
  43. void DrawFocusRect( DEVICE_CONTEXT * pdc, LPRECT lpRect, BOOL fErase = FALSE ) ;
  44. void EraseFocusRect( DEVICE_CONTEXT * pdc, LPRECT lpRect )
  45. { DrawFocusRect( pdc, lpRect, TRUE ) ; }
  46. public:
  47. FOCUS_CHECKBOX( OWNER_WINDOW * powin, CID cidCheckBox ) ;
  48. } ;
  49. #endif // _FOCUSCHK_HXX_