20 #ifndef HEADER_IBTN_HPP
21 #define HEADER_IBTN_HPP
23 #include <irrString.h>
31 namespace video {
class ITexture; }
34 #include "guiengine/widget.hpp"
35 #include "utils/leak_check.hpp"
36 #include "utils/cpp2011.hpp"
46 irr::core::rect<s32> m_list_header_icon_rect, m_icon_rect, m_label_rect;
47 irr::video::ITexture* m_texture;
48 irr::video::ITexture* m_deactivated_texture;
49 irr::video::ITexture* m_highlight_texture;
50 int m_texture_w, m_texture_h;
52 float m_target_height;
54 video::ITexture* getDeactivatedTexture(video::ITexture* texture);
56 void updateIconRect();
57 void updateLabelRect();
63 SCALE_MODE_LIST_WIDGET,
64 SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO,
65 SCALE_MODE_KEEP_CUSTOM_ASPECT_RATIO
69 ICON_PATH_TYPE_ABSOLUTE,
83 irr::gui::IGUIStaticText* m_label;
86 ScaleMode m_scale_mode;
87 float m_custom_aspect_ratio;
89 void setTexture(video::ITexture* texture);
98 IconButtonWidget(ScaleMode scale_mode=SCALE_MODE_KEEP_TEXTURE_ASPECT_RATIO, const
bool tab_stop=true,
103 virtual void add() OVERRIDE;
119 void setLabel(
const irr::core::stringw& new_label);
135 void setImage(
const char* path_to_texture,
142 setImage(path_to_texture.c_str(), path_type);
156 void setHighlightedImage(irr::video::ITexture* texture)
158 m_highlight_texture = texture;
162 void setTargetSize(
float width,
float height)
164 m_target_width = width;
165 m_target_height = height;
170 virtual EventPropagation
focused(
const int playerID) OVERRIDE;
174 virtual void unfocused(
const int playerID, Widget* new_focus) OVERRIDE;
179 virtual void setVisible(
bool visible) OVERRIDE;
187 virtual void resize() OVERRIDE;
189 const irr::core::rect<s32>& getListHeaderIconRect()
const
191 return m_list_header_icon_rect;
Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in...
Definition: skin.hpp:280
Definition: scalable_font.hpp:35
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33