00001 //--------------------------------------------------------------------------- 00002 /// \file CATLabel.h 00003 /// \brief Text label for GUI 00004 /// \ingroup CATGUI 00005 /// 00006 /// Copyright (c) 2003-2008 by Michael Ellison. 00007 /// See COPYING.txt for the \ref gaslicense License (MIT License). 00008 /// 00009 // $Author: mikeellison $ 00010 // $Date: 2008-01-24 06:27:32 -0600 (Thu, 24 Jan 2008) $ 00011 // $Revision: $ 00012 // $NoKeywords: $ 00013 //--------------------------------------------------------------------------- 00014 #ifndef _GGLabel_H_ 00015 #define _GGLabel_H_ 00016 00017 #include "CATControl.h" 00018 00019 class CATLabel; 00020 00021 /// \class CATLabel CATLabel.h 00022 /// \brief Text label for GUI 00023 /// \ingroup CATGUI 00024 /// 00025 class CATLabel : public CATControl 00026 { 00027 public: 00028 /// CATLabel constructor (inherited from CATControl->CATXMLObject) 00029 /// \param element - Type name ("Label") 00030 /// \param attribs - attribute information for the window 00031 /// \param parent - parent XML object (should be a "Window" element) 00032 /// \param rootDir - root directory of skin for bin/png load 00033 CATLabel( const CATString& element, 00034 const CATString& rootDir); 00035 00036 virtual ~CATLabel(); 00037 00038 /// IsFocusable() returns true if the control can receive 00039 /// focus, and false otherwise. 00040 virtual bool IsFocusable() const; 00041 00042 /// Draw() draws the control into the parent's image 00043 /// \param image - parent image to draw into 00044 /// \param dirtyRect - portion of control (in window coordinates) 00045 /// that requires redrawing. 00046 virtual void Draw(CATImage* image, const CATRect& dirtyRect); 00047 00048 00049 /// ParseAttributes() parses the known attributes for an object. 00050 virtual CATResult ParseAttributes(); 00051 00052 virtual void SetString ( const CATString& text ); 00053 virtual CATString GetString () const; 00054 00055 /// Event handler 00056 virtual CATResult OnEvent(const CATEvent& event, CATInt32& retVal); 00057 00058 #ifdef _WIN32 00059 virtual CATUInt32 GetAccessRole() {return CAT_ROLE_SYSTEM_TEXT;} 00060 #endif 00061 00062 00063 protected: 00064 bool fAllowClick; 00065 }; 00066 00067 #endif // _GGLabel_H_ 00068 00069