20#ifndef HEADER_WIDGET_HPP
21#define HEADER_WIDGET_HPP
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;
114 PROP_LABELS_LOCATION,
124 bool isWithinATextBox();
125 void setWithinATextBox(
bool in);
145 unsigned int m_magic_number;
149 std::bitset<Input::IT_LAST + 1> m_active_event_callback;
165 int m_absolute_reverse_x, m_absolute_reverse_y;
166 float m_relative_x, m_relative_y, m_relative_w, m_relative_h;
194 virtual EventPropagation
rightPressed(
const int playerID) {
return EVENT_BLOCK; }
202 virtual EventPropagation
leftPressed (
const int playerID) {
return EVENT_BLOCK; }
210 virtual EventPropagation
upPressed(
const int playerID) {
return EVENT_BLOCK; }
218 virtual EventPropagation
downPressed(
const int playerID) {
return EVENT_BLOCK; }
227 virtual EventPropagation
focused(
const int playerID) { setWithinATextBox(
false);
return EVENT_LET; }
286 irr::core::stringw m_tooltip_text;
348 Widget(WidgetType type,
bool reserve_id =
false);
365 void setParent(irr::gui::IGUIElement* parent);
395 virtual void setCollapsed(
bool collapsed,
int uncollapsed_height,
Screen* calling_screen = NULL);
403 bool isActivated()
const;
405 virtual EventPropagation onActivationInput(
const int playerID) {
return EVENT_LET; }
410 virtual void move(
const int x,
const int y,
const int w,
const int h);
418 void setSelected(
const int playerID,
bool state) {
m_selected[playerID] = state;}
420 bool isBottomBar()
const {
return m_bottom_bar; }
421 bool isTopBar ()
const {
return m_top_bar; }
432 virtual void setActive(
bool active=
true);
474 void moveIrrlichtElement();
497 virtual void setText(
const irr::core::stringw &s);
626 const std::string& originator,
628 {
return EVENT_LET; }
707 bool hasTooltip()
const {
return m_has_tooltip; }
712 void setTooltip(irr::core::stringw s) { m_tooltip_text = s; m_has_tooltip =
true; }
718 bool ok()
const {
return (m_magic_number == 0xCAFEC001); }
721 virtual EventPropagation
onClick() {
return EVENT_LET; }
722 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:97
Object used to render the GUI widgets see Overview of GUI skin for more information about skinning in...
Definition: skin.hpp:269
Definition: ptr_vector.hpp:44
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33
BadgeType
Definition: widget.hpp:63
@ 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
@ 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