Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUIStaticImage.h

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIStaticImage.h
00003         created:        4/6/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Interface for the static image widget.
00007 *************************************************************************/
00008 /*************************************************************************
00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *************************************************************************/
00026 #ifndef _CEGUIStaticImage_h_
00027 #define _CEGUIStaticImage_h_
00028 
00029 #include "elements/CEGUIStatic.h"
00030 #include "CEGUIRenderableImage.h"
00031 #include "elements/CEGUIStaticImageProperties.h"
00032 
00033 
00034 #if defined(_MSC_VER)
00035 #       pragma warning(push)
00036 #       pragma warning(disable : 4251)
00037 #endif
00038 
00039 
00040 // Start of CEGUI namespace section
00041 namespace CEGUI
00042 {
00050 class CEGUIBASE_API StaticImage : public Static
00051 {
00052 public:
00053         static const String EventNamespace;                             
00054 
00055 
00056         /*************************************************************************
00057                 Formatting Enumerations
00058         *************************************************************************/
00063         enum HorzFormatting
00064         {
00065                 LeftAligned,    
00066                 RightAligned,   
00067                 HorzCentred,    
00068                 HorzStretched,  
00069                 HorzTiled               
00070         };
00071 
00072 
00077         enum VertFormatting
00078         {
00079                 TopAligned,             
00080                 BottomAligned,  
00081                 VertCentred,    
00082                 VertStretched,  
00083                 VertTiled               
00084         };
00085 
00086 
00087         /*************************************************************************
00088                 Construction and Destruction
00089         *************************************************************************/
00094         StaticImage(const String& type, const String& name);
00095 
00096 
00101         virtual ~StaticImage(void);
00102 
00103 
00104         /*************************************************************************
00105                 Accessors
00106         *************************************************************************/
00114         const Image*    getImage(void) const            {return d_image.getImage();}
00115 
00116 
00124         ColourRect      getImageColours(void) const             {return d_imageCols;}
00125 
00126         
00134         HorzFormatting  getHorizontalFormatting(void) const             {return (HorzFormatting)d_image.getHorzFormatting();}
00135 
00136 
00144         VertFormatting  getVerticalFormatting(void) const               {return (VertFormatting)d_image.getVertFormatting();}
00145 
00146 
00147         /*************************************************************************
00148                 Manipulators
00149         *************************************************************************/
00160         void    setImage(const Image* image);
00161 
00162 
00178         void    setImage(const String& imageset, const String& image);
00179 
00180 
00191         void    setImageColours(const ColourRect& colours);
00192 
00193 
00213         void    setImageColours(const colour& top_left_colour, const colour& top_right_colour, const colour& bottom_left_colour, const colour& bottom_right_colour);
00214 
00215 
00226         void    setImageColours(const colour& col)              {setImageColours(col, col, col, col);}
00227 
00228 
00242         void    setFormatting(HorzFormatting h_fmt, VertFormatting v_fmt);
00243 
00244 
00255         void    setVerticalFormatting(VertFormatting v_fmt);
00256 
00257 
00268         void    setHorizontalFormatting(HorzFormatting h_fmt);
00269 
00270 
00271 protected:
00272         /*************************************************************************
00273                 Overridden from base class
00274         *************************************************************************/
00285         virtual void    drawSelf(float z);
00286 
00287         
00288         /*************************************************************************
00289                 Event handling
00290         *************************************************************************/
00291         virtual void    onSized(WindowEventArgs& e);
00292         virtual void    onAlphaChanged(WindowEventArgs& e);
00293         virtual void    onStaticFrameChanged(WindowEventArgs& e);
00294 
00295 
00296         /*************************************************************************
00297                 Implementation Methods
00298         *************************************************************************/
00304         void    updateRenderableImageColours(void);
00305 
00306 
00307         /*************************************************************************
00308                 Implementation Data
00309         *************************************************************************/
00310         RenderableImage d_image;                
00311         ColourRect              d_imageCols;    
00312 
00313 
00314 private:
00315         /*************************************************************************
00316                 Static Properties for this class
00317         *************************************************************************/
00318         static StaticImageProperties::Image                             d_imageProperty;
00319         static StaticImageProperties::ImageColours              d_imageColoursProperty;
00320         static StaticImageProperties::VertFormatting    d_vertFormattingProperty;
00321         static StaticImageProperties::HorzFormatting    d_horzFormattingProperty;
00322 
00323 
00324         /*************************************************************************
00325                 Private methods
00326         *************************************************************************/
00327         void    addStaticImageProperties(void);
00328 };
00329 
00330 } // End of  CEGUI namespace section
00331 
00332 #if defined(_MSC_VER)
00333 #       pragma warning(pop)
00334 #endif
00335 
00336 #endif  // end of guard _CEGUIStaticImage_h_

Generated on Wed Feb 16 12:41:07 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1