Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
IGUIButton.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_BUTTON_H_INCLUDED__
6 #define __I_GUI_BUTTON_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 
10 namespace irr
11 {
12 
13 namespace video
14 {
15  class ITexture;
16 } // end namespace video
17 
18 namespace gui
19 {
20  class IGUIFont;
21  class IGUISpriteBank;
22 
24  {
39  };
40 
42  const c8* const GUIButtonStateNames[] =
43  {
44  "buttonUp",
45  "buttonDown",
46  "buttonMouseOver",
47  "buttonMouseOff",
48  "buttonFocused",
49  "buttonNotFocused",
50  0,
51  0,
52  };
53 
55  class IGUIButton : public IGUIElement
56  {
57  public:
58 
60  IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
61  : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {}
62 
64 
66  virtual void setOverrideFont(IGUIFont* font=0) = 0;
67 
69 
70  virtual void setImage(video::ITexture* image=0) = 0;
71 
73 
75  virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
76 
78 
81  virtual void setPressedImage(video::ITexture* image=0) = 0;
82 
84 
86  virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
87 
89  virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0;
90 
92 
98  virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
99  video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
100 
102 
104  virtual void setIsPushButton(bool isPushButton=true) = 0;
105 
107  virtual void setPressed(bool pressed=true) = 0;
108 
110  virtual bool isPressed() const = 0;
111 
113  virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0;
114 
116  virtual bool isAlphaChannelUsed() const = 0;
117 
119  virtual bool isPushButton() const = 0;
120 
122  virtual void setDrawBorder(bool border=true) = 0;
123 
125  virtual bool isDrawingBorder() const = 0;
126 
128  virtual void setScaleImage(bool scaleImage=true) = 0;
129 
131  virtual bool isScalingImage() const = 0;
132  };
133 
134 
135 } // end namespace gui
136 } // end namespace irr
137 
138 #endif
139 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:16 by Doxygen (1.8.1.2)