CWindowAttributes.hpp

Go to the documentation of this file.
00001 #ifndef __CWindowAttributes__
00002 #define __CWindowAttributes__
00003 
00004 #include <Basics/CString.hpp>
00005 #include "../Basics/CColour.hpp"
00006 #include "../Graphics/CWindowIcon.hpp"
00007 
00008 //  ===========================================================================
00009 
00010 using Exponent::Basics::CString;
00011 using Exponent::GUI::Basics::CColour;
00012 using Exponent::GUI::Graphics::CWindowIcon;
00013 
00014 //  ===========================================================================
00015 
00016 namespace Exponent
00017 {
00018     namespace GUI
00019     {
00020         namespace Windowing
00021         {
00039             class CWindowAttributes : public CCountedObject
00040             {
00042                 EXPONENT_CLASS_DECLARATION;
00045 //  ===========================================================================
00046 
00047             public:
00048 
00049 //  ===========================================================================
00050 
00055                 enum EWindowStyle
00056                 {
00057                     e_default = 0,                          
00058                     e_noMaximiseNoSize,                     
00059                     e_noMaximiseNoSizeNoClose,              
00060                 };
00061 
00062 //  ===========================================================================
00063 
00067                 CWindowAttributes();
00068 
00072                 virtual ~CWindowAttributes();
00073 
00074 //  ===========================================================================
00075 
00081                 CWindowAttributes &operator = (const CWindowAttributes &attributes);
00082 
00083 //  ===========================================================================
00084 
00089                 void initialise(const EWindowStyle style);
00090 
00091                 #ifdef WIN32
00092 
00098                     void initialise(const long style, const long styleEx);
00099                 #else
00100 
00106                     void initialise(WindowAttributes style, WindowClass windowClass);   
00107                 #endif
00108 
00109 //  ===========================================================================
00110 
00120                 void setWindowAttributes(const CString &title, const CColour &backgroundColour, const double alpha, CWindowIcon *windowIcon, const bool enabled, const bool shadow);
00121 
00122 //  ===========================================================================
00123 
00128                 void setWindowTitle(const CString &title) { m_title = title; }
00129 
00134                 void setBackgroundColour(const CColour &backgroundColour) { m_backgroundColour = backgroundColour; }
00135 
00140                 void setWindowAlphaValue(const double alpha) { m_alpha = alpha; }
00141 
00146                 void setWindowIcon(CWindowIcon *icon);
00147 
00152                 void setWindowEnabled(const bool enabled) { m_enabled = enabled; }
00153 
00158                 void windowHasShadow(const bool shadow) { m_hasShadow = shadow; }
00159 
00160 //  ===========================================================================
00161 
00166                 long getWindowStyle() const { return m_windowStyle; }
00167 
00169                 #ifdef WIN32    
00170 
00175                     long getWindowStyleEx() const { return m_windowStyleEx; }   
00177                 #else
00178 
00183                     WindowClass getWindowClass() const { return m_windowClass; }
00185                 #endif
00186 
00192                 const CString &getWindowTitle() const { return m_title; }
00193 
00198                 const CColour &getBackgroundColour() const { return m_backgroundColour; }
00199 
00204                 double getWindowAlphaValue() const { return m_alpha; }
00205 
00210                 long getWindowAlphaValueLong() const { return (long)(m_alpha * 255.0); }
00211 
00216                 CWindowIcon *getWindowIcon() const { return m_windowIcon; }
00217 
00222                 bool isWindowEnabled() const { return m_enabled; }
00223 
00228                 bool windowHasShadow() const { return m_hasShadow; }
00229 
00230 //  ===========================================================================
00231 
00232             protected:
00233 
00234 //  ===========================================================================
00235 
00236                 CString m_title;                            
00237                 CColour m_backgroundColour;                 
00238                 double m_alpha;                             
00239                 CWindowIcon *m_windowIcon;                  
00240                 bool m_enabled;                             
00241                 bool m_hasShadow;                           
00243 //  ===========================================================================
00244 
00246                 #ifdef WIN32
00247 
00248                     long m_windowStyle;                     
00249                     long m_windowStyleEx;                   
00251                 #else
00252 
00253                     WindowAttributes m_windowStyle;         
00254                     WindowClass m_windowClass;              
00256                 #endif
00257 
00259 //  ===========================================================================
00260 
00261             };
00262         }
00263     }
00264 }
00265 #endif  // End of CWindowAttributes.hpp

Infinity API - CWindowAttributes.hpp Source File generated on 7 Mar 2007