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 _CEGUIPushButton_h_
00027 #define _CEGUIPushButton_h_
00028
00029 #include "CEGUIBase.h"
00030 #include "elements/CEGUIButtonBase.h"
00031 #include "elements/CEGUIPushButtonProperties.h"
00032 #include "CEGUIRenderableImage.h"
00033
00034 #if defined(_MSC_VER)
00035 # pragma warning(push)
00036 # pragma warning(disable : 4251)
00037 #endif
00038
00039
00040 namespace CEGUI
00041 {
00046 class CEGUIEXPORT PushButton : public ButtonBase
00047 {
00048 public:
00049 static const String EventNamespace;
00050
00051
00052
00053
00054
00055
00056 static const String EventClicked;
00057
00058
00059
00060
00065 PushButton(const String& type, const String& name);
00066
00067
00072 virtual ~PushButton(void);
00073
00074
00075
00076
00084 bool isStandardImageryEnabled(void) const;
00085
00086
00095 bool isCustomImageryAutoSized(void) const;
00096
00106 const RenderableImage* getNormalImage(void) const;
00107
00117 const RenderableImage* getHoverImage(void) const;
00118
00128 const RenderableImage* getPushedImage(void) const;
00129
00139 const RenderableImage* getDisabledImage(void) const;
00140
00150 float getTextXOffset(void) const;
00151
00162 void setStandardImageryEnabled(bool setting);
00163
00174 void setCustomImageryAutoSized(bool setting);
00175
00188 void setNormalImage(const RenderableImage* image);
00189
00202 void setHoverImage(const RenderableImage* image);
00203
00216 void setPushedImage(const RenderableImage* image);
00217
00230 void setDisabledImage(const RenderableImage* image);
00231
00244 void setTextXOffset(float offset);
00245
00246 protected:
00247
00248
00249
00254 virtual void onClicked(WindowEventArgs& e);
00255
00256
00257
00258
00259
00260 virtual void onMouseButtonUp(MouseEventArgs& e);
00261 virtual void onSized(WindowEventArgs& e);
00262
00263
00264
00265
00266
00271 void addPushButtonEvents(void);
00272
00273
00284 virtual bool testClassName_impl(const String& class_name) const
00285 {
00286 if (class_name==(const utf8*)"PushButton") return true;
00287 return ButtonBase::testClassName_impl(class_name);
00288 }
00289
00290
00291
00292
00293
00294
00295 bool d_autoscaleImages;
00296 bool d_useStandardImagery;
00297 bool d_useNormalImage;
00298 bool d_useHoverImage;
00299 bool d_usePushedImage;
00300 bool d_useDisabledImage;
00301
00302
00303 RenderableImage d_normalImage;
00304 RenderableImage d_hoverImage;
00305 RenderableImage d_pushedImage;
00306 RenderableImage d_disabledImage;
00307
00308
00309 float d_textXOffset;
00310
00311 private:
00312
00313
00314
00315 static PushButtonProperties::NormalImage d_normalImageProperty;
00316 static PushButtonProperties::PushedImage d_pushedImageProperty;
00317 static PushButtonProperties::HoverImage d_hoverImageProperty;
00318 static PushButtonProperties::DisabledImage d_disabledImageProperty;
00319 static PushButtonProperties::UseStandardImagery d_useStandardImageryProperty;
00320 static PushButtonProperties::TextXOffset d_textXOffsetProperty;
00321
00322
00323
00324
00325 void addPushButtonProperties(void);
00326 };
00327
00328
00329 }
00330
00331 #if defined(_MSC_VER)
00332 # pragma warning(pop)
00333 #endif
00334
00335 #endif // end of guard _CEGUIPushButton_h_