/***********************************************************************/ /* Copyright (C) 2002 Definitive Solutions, Inc. All Rights Reserved. */ /* THIS COMPUTER PROGRAM IS PROPRIETARY AND CONFIDENTIAL TO DEFINITIVE */ /* SOLUTIONS, INC. AND ITS LICENSORS AND CONTAINS TRADE SECRETS OF */ /* DEFINITIVE SOLUTIONS, INC. THAT ARE PROVIDED PURSUANT TO A WRITTEN */ /* AGREEMENT CONTAINING RESTRICTIONS ON USE AND DISCLOSURE. ANY USE, */ /* REPRODUCTION, OR TRANSFER EXCEPT AS PROVIDED IN SUCH AGREEMENT */ /* IS STRICTLY PROHIBITED. */ /***********************************************************************/ ///////////////////////////////////////////////////////////////////////////// // How to add this class to your application. // // Add MyStatic.cpp and MyStatic.h to your project in the usual folders. ///////////////////////////////////////////////////////////////////////////// #if !defined(AFX_MYSTATIC_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_) #define AFX_MYSTATIC_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_ #pragma once ///////////////////////////////////////////////////////////////////////////// // MyStatic window // Declare the class depending on this file is in an EXE project or a DLL one. class #ifdef _WINDLL AFX_EXT_CLASS #endif MyStatic : public CStatic { DECLARE_DYNAMIC(MyStatic) // Construction. public: MyStatic(); virtual ~MyStatic(); // Interface. public: MyStatic& SetBkColor(COLORREF crBkgnd); MyStatic& SetTextColor(COLORREF crText); MyStatic& SetText(const CString& sText); MyStatic& SetFontName(const CString& sFont); MyStatic& SetFontBold(bool bBold = true); MyStatic& SetFontUnderline(bool bSet = true); MyStatic& SetFontItalic(bool bSet = true); MyStatic& SetFontSize(int nSize); MyStatic& SetSunken(bool bSet = true); MyStatic& SetBorder(bool bSet = true); int GetFontSize(); bool GetFontItalic() const; MyStatic& FlashText(bool bActivate = true, int nRequestedMS = -1, int nFlashMS = 500); MyStatic& FlashBackground(bool bActivate = true, int nRequestedMS = -1, int nFlashMS = 500); bool LoadBitmap(const CString& sPath); // Operations. public: //{{AFX_VIRTUAL(MyStatic) //}}AFX_VIRTUAL // Generated message map functions protected: //{{AFX_MSG(MyStatic) afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnClicked(); afx_msg void OnDestroy(); //}}AFX_MSG DECLARE_MESSAGE_MAP() // Implementation private: HRESULT ReconstructFont(); // Data. private: enum FlashType { NoFlash, TextFlash, BackgroundFlash }; COLORREF m_crText; HBRUSH m_hBrush; HBRUSH m_hBrushWnd; bool m_bTimer; bool m_bFlashState; // True = it is off at the moment. FlashType m_FlashType; // Text or background? int m_nFlashReqMS; // How long should it flash (-1 == forever). int m_nFlashDurMS; // How long has it actually flashed? int m_nFlashMS; // How fast should it flash. LOGFONT m_lf; CFont m_font; CString m_sText; // The current text (needed because of flashing). CString m_sTextNew; // New text requested by the user that hasn't been applied yet. }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYSTATIC_H__A4EABEC5_2E8C_11D1_B79F_00805F9ECE10__INCLUDED_)