20 #ifndef HEADER_WIDGET_HPP
21 #define HEADER_WIDGET_HPP
23 #include <irrString.h>
26 namespace gui {
class IGUIElement; }
31 #include "guiengine/event_handler.hpp"
32 #include "guiengine/skin.hpp"
33 #include "utils/constants.hpp"
34 #include "utils/ptr_vector.hpp"
39 class DynamicRibbonWidget;
118 PROP_LABELS_LOCATION,
128 bool isWithinATextBox();
129 void setWithinATextBox(
bool in);
149 unsigned int m_magic_number;
153 std::bitset<Input::IT_LAST + 1> m_active_event_callback;
169 int m_absolute_reverse_x, m_absolute_reverse_y;
170 float m_relative_x, m_relative_y, m_relative_w, m_relative_h;
198 virtual EventPropagation
rightPressed(
const int playerID) {
return EVENT_BLOCK; }
206 virtual EventPropagation
leftPressed (
const int playerID) {
return EVENT_BLOCK; }
214 virtual EventPropagation
upPressed(
const int playerID) {
return EVENT_BLOCK; }
222 virtual EventPropagation
downPressed(
const int playerID) {
return EVENT_BLOCK; }
231 virtual EventPropagation
focused(
const int playerID) { setWithinATextBox(
false);
return EVENT_LET; }
290 irr::core::stringw m_tooltip_text;
352 Widget(WidgetType type,
bool reserve_id =
false);
369 void setParent(irr::gui::IGUIElement* parent);
399 virtual void setCollapsed(
bool collapsed,
int uncollapsed_height,
Screen* calling_screen = NULL);
407 bool isActivated()
const;
409 virtual EventPropagation onActivationInput(
const int playerID) {
return EVENT_LET; }
424 virtual void move(
const int x,
const int y,
const int w,
const int h);
432 void setSelected(
const int playerID,
bool state) {
m_selected[playerID] = state;}
434 bool isBottomBar()
const {
return m_bottom_bar; }
435 bool isTopBar ()
const {
return m_top_bar; }
446 virtual void setActive(
bool active=
true);
488 void moveIrrlichtElement();
511 virtual void setText(
const irr::core::stringw &s);
644 const std::string& originator,
646 {
return EVENT_LET; }
725 bool hasTooltip()
const {
return m_has_tooltip; }
730 void setTooltip(irr::core::stringw s) { m_tooltip_text = s; m_has_tooltip =
true; }
736 bool ok()
const {
return (m_magic_number == 0xCAFEC001); }
739 virtual EventPropagation
onClick() {
return EVENT_LET; }
740 virtual irr::core::dimension2di getDimension()
const {
return irr::core::dimension2di(m_w, m_h); }
Represents a GUI widgets container.
Definition: abstract_top_level_container.hpp:43
Class to handle irrLicht events (GUI and input as well)
Definition: event_handler.hpp:66
Definition: layout_manager.hpp:32
Abstract base class representing a modal dialog.
Definition: modaldialog.hpp:56
Represents a single GUI screen.
Definition: screen.hpp:94
Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in...
Definition: skin.hpp:280
Definition: ptr_vector.hpp:44
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33
BadgeType
Definition: widget.hpp:63
@ HEART_BADGE
A heart badge, to indicate e.g.
Definition: widget.hpp:85
@ GAMEPAD_BADGE
A gamepad icon.
Definition: widget.hpp:73
@ BAD_BADGE
display a red mark badge on the widget, useful e.g.
Definition: widget.hpp:69
@ KEYBOARD_BADGE
A keyboard icon.
Definition: widget.hpp:75
@ OK_BADGE
display a green check on a widget, useful e.g.
Definition: widget.hpp:67
@ REDDOT_BADGE
A red dot badge, to indicate there's something new inside.
Definition: widget.hpp:87
@ TROPHY_BADGE
display a trophy badge on the widget, useful e.g.
Definition: widget.hpp:71
@ LOCKED_BADGE
display a lock on the widget, to mean a certain game feature is locked
Definition: widget.hpp:65
@ DOWN_BADGE
A down arrow badge to indicate new addons for downloading.
Definition: widget.hpp:83
@ ANCHOR_BADGE
A anchor badge to indicate that this player receives a handicap.
Definition: widget.hpp:81
@ ZIPPER_BADGE
A zipper badge to indicate that this player receives a boost.
Definition: widget.hpp:79
@ LOADING_BADGE
An hourglass badge to indicate loading.
Definition: widget.hpp:77