|
IrrlichtEngine
|
00001 // Copyright (C) 2002-2011 Nikolaus Gebhardt 00002 // This file is part of the "Irrlicht Engine". 00003 // For conditions of distribution and use, see copyright notice in irrlicht.h 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 } // end namespace video 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 IGUIFont* getOverrideFont(void) const = 0; 00071 00073 00075 virtual IGUIFont* getActiveFont() const = 0; 00076 00078 00079 virtual void setImage(video::ITexture* image=0) = 0; 00080 00082 00084 virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0; 00085 00087 00090 virtual void setPressedImage(video::ITexture* image=0) = 0; 00091 00093 00095 virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0; 00096 00098 virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0; 00099 00101 00107 virtual void setSprite(EGUI_BUTTON_STATE state, s32 index, 00108 video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0; 00109 00111 00113 virtual void setIsPushButton(bool isPushButton=true) = 0; 00114 00116 virtual void setPressed(bool pressed=true) = 0; 00117 00119 virtual bool isPressed() const = 0; 00120 00122 virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0; 00123 00125 virtual bool isAlphaChannelUsed() const = 0; 00126 00128 virtual bool isPushButton() const = 0; 00129 00131 virtual void setDrawBorder(bool border=true) = 0; 00132 00134 virtual bool isDrawingBorder() const = 0; 00135 00137 virtual void setScaleImage(bool scaleImage=true) = 0; 00138 00140 virtual bool isScalingImage() const = 0; 00141 }; 00142 00143 00144 } // end namespace gui 00145 } // end namespace irr 00146 00147 #endif 00148