// ColorStatic.h : header file // // Copyright (C) 2002-2004 William Braynen // Contact information can be found at www.samdurak.com // // The CColorStatic MFC class consists of two files: ColorStatic.cpp // and ColorStatic.h. It is a subclass of CStatic and allows to // change the background and text colors of a Windows static control. // However, it changes the text color of all the text and does not // implement multi-colored text or multi-colored backgrounds. // // Use this class just as you would a regular CStatic class. // Just replace 'CStatic' in the declaration by 'CColorStatic'. // And don't forget to #include ColorStatic.h (this header file). // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #if !defined(AFX_COLORSTATIC_H__15D29217_6234_46E6_810B_EFC15DE3CFCD__INCLUDED_) #define AFX_COLORSTATIC_H__15D29217_6234_46E6_810B_EFC15DE3CFCD__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CColorStatic window class CColorStatic : public CStatic { // Construction public: CColorStatic (COLORREF backgroundColor = 0, COLORREF textColor = 0); // Attributes public: // Operations public: void SetBackgroundColor (COLORREF color); void SetTextColor (COLORREF color); void SetFont (int nPointSize, LPCTSTR lpszFaceName); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CColorStatic) public: virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult); //}}AFX_VIRTUAL // Implementation public: virtual ~CColorStatic(); // Generated message map functions protected: CBrush m_brush; COLORREF m_backgroundColor; COLORREF m_textColor; CFont m_font; UINT m_nTimerID, m_iRolloverDelay; BOOL m_bOverControl; CBrush* m_pBrush; //CBrush* m_pHotBrush; //{{AFX_MSG(CColorStatic) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_COLORSTATIC_H__15D29217_6234_46E6_810B_EFC15DE3CFCD__INCLUDED_)