00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
00041 namespace CEGUI
00042 {
00050 class CEGUIBASE_API StaticImage : public Static
00051 {
00052 public:
00053 static const String EventNamespace;
00054
00055
00056
00057
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
00089
00094 StaticImage(const String& type, const String& name);
00095
00096
00101 virtual ~StaticImage(void);
00102
00103
00104
00105
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
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
00274
00285 virtual void drawSelf(float z);
00286
00287
00288
00289
00290
00291 virtual void onSized(WindowEventArgs& e);
00292 virtual void onAlphaChanged(WindowEventArgs& e);
00293 virtual void onStaticFrameChanged(WindowEventArgs& e);
00294
00295
00296
00297
00298
00304 void updateRenderableImageColours(void);
00305
00306
00307
00308
00309
00310 RenderableImage d_image;
00311 ColourRect d_imageCols;
00312
00313
00314 private:
00315
00316
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
00326
00327 void addStaticImageProperties(void);
00328 };
00329
00330 }
00331
00332 #if defined(_MSC_VER)
00333 # pragma warning(pop)
00334 #endif
00335
00336 #endif // end of guard _CEGUIStaticImage_h_