diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/include/IGUIButton.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IGUIButton.h | 302 |
1 files changed, 151 insertions, 151 deletions
diff --git a/libraries/irrlicht-1.8/include/IGUIButton.h b/libraries/irrlicht-1.8/include/IGUIButton.h index 1da880e..cc0ada1 100644 --- a/libraries/irrlicht-1.8/include/IGUIButton.h +++ b/libraries/irrlicht-1.8/include/IGUIButton.h | |||
@@ -1,151 +1,151 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __I_GUI_BUTTON_H_INCLUDED__ | 5 | #ifndef __I_GUI_BUTTON_H_INCLUDED__ |
6 | #define __I_GUI_BUTTON_H_INCLUDED__ | 6 | #define __I_GUI_BUTTON_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IGUIElement.h" | 8 | #include "IGUIElement.h" |
9 | 9 | ||
10 | namespace irr | 10 | namespace irr |
11 | { | 11 | { |
12 | 12 | ||
13 | namespace video | 13 | namespace video |
14 | { | 14 | { |
15 | class ITexture; | 15 | class ITexture; |
16 | } // end namespace video | 16 | } // end namespace video |
17 | 17 | ||
18 | namespace gui | 18 | namespace gui |
19 | { | 19 | { |
20 | class IGUIFont; | 20 | class IGUIFont; |
21 | class IGUISpriteBank; | 21 | class IGUISpriteBank; |
22 | 22 | ||
23 | enum EGUI_BUTTON_STATE | 23 | enum EGUI_BUTTON_STATE |
24 | { | 24 | { |
25 | //! The button is not pressed | 25 | //! The button is not pressed |
26 | EGBS_BUTTON_UP=0, | 26 | EGBS_BUTTON_UP=0, |
27 | //! The button is currently pressed down | 27 | //! The button is currently pressed down |
28 | EGBS_BUTTON_DOWN, | 28 | EGBS_BUTTON_DOWN, |
29 | //! The mouse cursor is over the button | 29 | //! The mouse cursor is over the button |
30 | EGBS_BUTTON_MOUSE_OVER, | 30 | EGBS_BUTTON_MOUSE_OVER, |
31 | //! The mouse cursor is not over the button | 31 | //! The mouse cursor is not over the button |
32 | EGBS_BUTTON_MOUSE_OFF, | 32 | EGBS_BUTTON_MOUSE_OFF, |
33 | //! The button has the focus | 33 | //! The button has the focus |
34 | EGBS_BUTTON_FOCUSED, | 34 | EGBS_BUTTON_FOCUSED, |
35 | //! The button doesn't have the focus | 35 | //! The button doesn't have the focus |
36 | EGBS_BUTTON_NOT_FOCUSED, | 36 | EGBS_BUTTON_NOT_FOCUSED, |
37 | //! not used, counts the number of enumerated items | 37 | //! not used, counts the number of enumerated items |
38 | EGBS_COUNT | 38 | EGBS_COUNT |
39 | }; | 39 | }; |
40 | 40 | ||
41 | //! Names for gui button state icons | 41 | //! Names for gui button state icons |
42 | const c8* const GUIButtonStateNames[] = | 42 | const c8* const GUIButtonStateNames[] = |
43 | { | 43 | { |
44 | "buttonUp", | 44 | "buttonUp", |
45 | "buttonDown", | 45 | "buttonDown", |
46 | "buttonMouseOver", | 46 | "buttonMouseOver", |
47 | "buttonMouseOff", | 47 | "buttonMouseOff", |
48 | "buttonFocused", | 48 | "buttonFocused", |
49 | "buttonNotFocused", | 49 | "buttonNotFocused", |
50 | 0, | 50 | 0, |
51 | 0, | 51 | 0, |
52 | }; | 52 | }; |
53 | 53 | ||
54 | //! GUI Button interface. | 54 | //! GUI Button interface. |
55 | /** \par This element can create the following events of type EGUI_EVENT_TYPE: | 55 | /** \par This element can create the following events of type EGUI_EVENT_TYPE: |
56 | \li EGET_BUTTON_CLICKED | 56 | \li EGET_BUTTON_CLICKED |
57 | */ | 57 | */ |
58 | class IGUIButton : public IGUIElement | 58 | class IGUIButton : public IGUIElement |
59 | { | 59 | { |
60 | public: | 60 | public: |
61 | 61 | ||
62 | //! constructor | 62 | //! constructor |
63 | IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) | 63 | IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) |
64 | : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {} | 64 | : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {} |
65 | 65 | ||
66 | //! Sets another skin independent font. | 66 | //! Sets another skin independent font. |
67 | /** If this is set to zero, the button uses the font of the skin. | 67 | /** If this is set to zero, the button uses the font of the skin. |
68 | \param font: New font to set. */ | 68 | \param font: New font to set. */ |
69 | virtual void setOverrideFont(IGUIFont* font=0) = 0; | 69 | virtual void setOverrideFont(IGUIFont* font=0) = 0; |
70 | 70 | ||
71 | //! Gets the override font (if any) | 71 | //! Gets the override font (if any) |
72 | /** \return The override font (may be 0) */ | 72 | /** \return The override font (may be 0) */ |
73 | virtual IGUIFont* getOverrideFont(void) const = 0; | 73 | virtual IGUIFont* getOverrideFont(void) const = 0; |
74 | 74 | ||
75 | //! Get the font which is used right now for drawing | 75 | //! Get the font which is used right now for drawing |
76 | /** Currently this is the override font when one is set and the | 76 | /** Currently this is the override font when one is set and the |
77 | font of the active skin otherwise */ | 77 | font of the active skin otherwise */ |
78 | virtual IGUIFont* getActiveFont() const = 0; | 78 | virtual IGUIFont* getActiveFont() const = 0; |
79 | 79 | ||
80 | //! Sets an image which should be displayed on the button when it is in normal state. | 80 | //! Sets an image which should be displayed on the button when it is in normal state. |
81 | /** \param image: Image to be displayed */ | 81 | /** \param image: Image to be displayed */ |
82 | virtual void setImage(video::ITexture* image=0) = 0; | 82 | virtual void setImage(video::ITexture* image=0) = 0; |
83 | 83 | ||
84 | //! Sets a background image for the button when it is in normal state. | 84 | //! Sets a background image for the button when it is in normal state. |
85 | /** \param image: Texture containing the image to be displayed | 85 | /** \param image: Texture containing the image to be displayed |
86 | \param pos: Position in the texture, where the image is located */ | 86 | \param pos: Position in the texture, where the image is located */ |
87 | virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0; | 87 | virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0; |
88 | 88 | ||
89 | //! Sets a background image for the button when it is in pressed state. | 89 | //! Sets a background image for the button when it is in pressed state. |
90 | /** If no images is specified for the pressed state via | 90 | /** If no images is specified for the pressed state via |
91 | setPressedImage(), this image is also drawn in pressed state. | 91 | setPressedImage(), this image is also drawn in pressed state. |
92 | \param image: Image to be displayed */ | 92 | \param image: Image to be displayed */ |
93 | virtual void setPressedImage(video::ITexture* image=0) = 0; | 93 | virtual void setPressedImage(video::ITexture* image=0) = 0; |
94 | 94 | ||
95 | //! Sets an image which should be displayed on the button when it is in pressed state. | 95 | //! Sets an image which should be displayed on the button when it is in pressed state. |
96 | /** \param image: Texture containing the image to be displayed | 96 | /** \param image: Texture containing the image to be displayed |
97 | \param pos: Position in the texture, where the image is located */ | 97 | \param pos: Position in the texture, where the image is located */ |
98 | virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0; | 98 | virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0; |
99 | 99 | ||
100 | //! Sets the sprite bank used by the button | 100 | //! Sets the sprite bank used by the button |
101 | virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0; | 101 | virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0; |
102 | 102 | ||
103 | //! Sets the animated sprite for a specific button state | 103 | //! Sets the animated sprite for a specific button state |
104 | /** \param index: Number of the sprite within the sprite bank, use -1 for no sprite | 104 | /** \param index: Number of the sprite within the sprite bank, use -1 for no sprite |
105 | \param state: State of the button to set the sprite for | 105 | \param state: State of the button to set the sprite for |
106 | \param index: The sprite number from the current sprite bank | 106 | \param index: The sprite number from the current sprite bank |
107 | \param color: The color of the sprite | 107 | \param color: The color of the sprite |
108 | \param loop: True if the animation should loop, false if not | 108 | \param loop: True if the animation should loop, false if not |
109 | */ | 109 | */ |
110 | virtual void setSprite(EGUI_BUTTON_STATE state, s32 index, | 110 | virtual void setSprite(EGUI_BUTTON_STATE state, s32 index, |
111 | video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0; | 111 | video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0; |
112 | 112 | ||
113 | //! Sets if the button should behave like a push button. | 113 | //! Sets if the button should behave like a push button. |
114 | /** Which means it can be in two states: Normal or Pressed. With a click on the button, | 114 | /** Which means it can be in two states: Normal or Pressed. With a click on the button, |
115 | the user can change the state of the button. */ | 115 | the user can change the state of the button. */ |
116 | virtual void setIsPushButton(bool isPushButton=true) = 0; | 116 | virtual void setIsPushButton(bool isPushButton=true) = 0; |
117 | 117 | ||
118 | //! Sets the pressed state of the button if this is a pushbutton | 118 | //! Sets the pressed state of the button if this is a pushbutton |
119 | virtual void setPressed(bool pressed=true) = 0; | 119 | virtual void setPressed(bool pressed=true) = 0; |
120 | 120 | ||
121 | //! Returns if the button is currently pressed | 121 | //! Returns if the button is currently pressed |
122 | virtual bool isPressed() const = 0; | 122 | virtual bool isPressed() const = 0; |
123 | 123 | ||
124 | //! Sets if the alpha channel should be used for drawing background images on the button (default is false) | 124 | //! Sets if the alpha channel should be used for drawing background images on the button (default is false) |
125 | virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0; | 125 | virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0; |
126 | 126 | ||
127 | //! Returns if the alpha channel should be used for drawing background images on the button | 127 | //! Returns if the alpha channel should be used for drawing background images on the button |
128 | virtual bool isAlphaChannelUsed() const = 0; | 128 | virtual bool isAlphaChannelUsed() const = 0; |
129 | 129 | ||
130 | //! Returns whether the button is a push button | 130 | //! Returns whether the button is a push button |
131 | virtual bool isPushButton() const = 0; | 131 | virtual bool isPushButton() const = 0; |
132 | 132 | ||
133 | //! Sets if the button should use the skin to draw its border and button face (default is true) | 133 | //! Sets if the button should use the skin to draw its border and button face (default is true) |
134 | virtual void setDrawBorder(bool border=true) = 0; | 134 | virtual void setDrawBorder(bool border=true) = 0; |
135 | 135 | ||
136 | //! Returns if the border and button face are being drawn using the skin | 136 | //! Returns if the border and button face are being drawn using the skin |
137 | virtual bool isDrawingBorder() const = 0; | 137 | virtual bool isDrawingBorder() const = 0; |
138 | 138 | ||
139 | //! Sets if the button should scale the button images to fit | 139 | //! Sets if the button should scale the button images to fit |
140 | virtual void setScaleImage(bool scaleImage=true) = 0; | 140 | virtual void setScaleImage(bool scaleImage=true) = 0; |
141 | 141 | ||
142 | //! Checks whether the button scales the used images | 142 | //! Checks whether the button scales the used images |
143 | virtual bool isScalingImage() const = 0; | 143 | virtual bool isScalingImage() const = 0; |
144 | }; | 144 | }; |
145 | 145 | ||
146 | 146 | ||
147 | } // end namespace gui | 147 | } // end namespace gui |
148 | } // end namespace irr | 148 | } // end namespace irr |
149 | 149 | ||
150 | #endif | 150 | #endif |
151 | 151 | ||