00001
00002
00003
00004
00005 #ifndef __I_GUI_BUTTON_H_INCLUDED__
00006 #define __I_GUI_BUTTON_H_INCLUDED__
00007
00008 #include "IGUIElement.h"
00009
00010 namespace irr
00011 {
00012
00013 namespace video
00014 {
00015 class ITexture;
00016 }
00017
00018 namespace gui
00019 {
00020 class IGUIFont;
00021 class IGUISpriteBank;
00022
00023 enum EGUI_BUTTON_STATE
00024 {
00026 EGBS_BUTTON_UP=0,
00028 EGBS_BUTTON_DOWN,
00030 EGBS_BUTTON_MOUSE_OVER,
00032 EGBS_BUTTON_MOUSE_OFF,
00034 EGBS_BUTTON_FOCUSED,
00036 EGBS_BUTTON_NOT_FOCUSED,
00038 EGBS_COUNT
00039 };
00040
00042 const c8* const GUIButtonStateNames[] =
00043 {
00044 "buttonUp",
00045 "buttonDown",
00046 "buttonMouseOver",
00047 "buttonMouseOff",
00048 "buttonFocused",
00049 "buttonNotFocused",
00050 0,
00051 0,
00052 };
00053
00055 class IGUIButton : public IGUIElement
00056 {
00057 public:
00058
00060 IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
00061 : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {}
00062
00064
00066 virtual void setOverrideFont(IGUIFont* font=0) = 0;
00067
00069
00070 virtual void setImage(video::ITexture* image=0) = 0;
00071
00073
00075 virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
00076
00078
00081 virtual void setPressedImage(video::ITexture* image=0) = 0;
00082
00084
00086 virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
00087
00089 virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0;
00090
00092
00098 virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
00099 video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
00100
00102
00104 virtual void setIsPushButton(bool isPushButton=true) = 0;
00105
00107 virtual void setPressed(bool pressed=true) = 0;
00108
00110 virtual bool isPressed() const = 0;
00111
00113 virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0;
00114
00116 virtual bool isAlphaChannelUsed() const = 0;
00117
00119 virtual bool isPushButton() const = 0;
00120
00122 virtual void setDrawBorder(bool border=true) = 0;
00123
00125 virtual bool isDrawingBorder() const = 0;
00126
00128 virtual void setScaleImage(bool scaleImage=true) = 0;
00129
00131 virtual bool isScalingImage() const = 0;
00132 };
00133
00134
00135 }
00136 }
00137
00138 #endif
00139