//********************* // PseudoButtons: replaces CButton class for simple button operations // This solution illustrates // 1) Getting Parent and Message ID from CWnd base class // 2) Smart refrech on MouseMove // 3) Interesting Brush for drawing button window // 4) Handles loss of capture due to another windows action // 5) Uses same constructor as CButton // 6) Makes minimal changes in MsgEdit program (only the class types) // // AUTHOR: Chris Wild // DATE: October 20, 1997 //**************** #ifndef CPseudoButton_H #define CPseudoButton_H #include const COLORREF RED(RGB(255,0,0)); const COLORREF GREEN(RGB(0,255,0)); const COLORREF BLUE(RGB(0,0,255)); const COLORREF BLACK(RGB(255,255,255)); const COLORREF WHITE(RGB(0,0,0)); class CPseudoButton : public CWnd { public: CPseudoButton(); ~CPseudoButton(); BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); afx_msg void OnLButtonUp(); afx_msg void OnPaint(); afx_msg void OnMouseMove(UINT, CPoint); afx_msg void OnCaptureChanged( CWnd* pWnd ); DECLARE_MESSAGE_MAP() private: bool highLight; bool roaming; }; #endif