|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <widget.hpp>
Public Types | |
| enum | BorderSide : uint8_t { BORDER_NONE = 0 , BORDER_LEFT = 1 << 0 , BORDER_TOP = 1 << 1 , BORDER_RIGHT = 1 << 2 , BORDER_BOTTOM = 1 << 3 , BORDER_ALL = BORDER_LEFT | BORDER_TOP | BORDER_RIGHT | BORDER_BOTTOM } |
| enum | BorderStyle : uint8_t { BORDER_STYLE_BEVEL = 0 , BORDER_STYLE_FLAT = 1 } |
| enum class | SelectionMode : uint8_t { None = 0 , Border = 1 , Background = 2 } |
Public Member Functions | |
| virtual void | _draw (Graphics *graphics) |
| virtual FocusHandler * | _getFocusHandler () |
| virtual std::list< FocusListener * > const & | _getFocusListeners () |
| virtual FocusHandler * | _getInternalFocusHandler () |
| virtual std::list< KeyListener * > const & | _getKeyListeners () |
| virtual std::list< MouseListener * > const & | _getMouseListeners () |
| virtual void | _logic () |
| virtual void | _setFocusHandler (FocusHandler *focusHandler) |
| virtual void | _setParent (Widget *parent) |
| void | adaptLayout () |
| virtual void | adaptLayout (bool top) |
| void | addActionListener (ActionListener *actionListener) |
| void | addDeathListener (DeathListener *deathListener) |
| void | addDropTargetListener (DropTargetListener *listener) |
| void | addFocusListener (FocusListener *focusListener) |
| void | addKeyListener (KeyListener *keyListener) |
| void | addMouseListener (MouseListener *mouseListener) |
| void | addWidgetListener (WidgetListener *widgetListener) |
| virtual void | adjustSize () |
| bool | captureMouse () |
| bool | contains (int x, int y) const |
| virtual void | draw (Graphics *graphics)=0 |
| virtual void | drawBorder (Graphics *graphics) |
| void | drawBorder (Graphics *graphics, unsigned int sides) const |
| virtual void | drawOutline (Graphics *graphics) |
| virtual void | drawSelectionFrame (Graphics *graphics) |
| void | expandContent () |
| virtual void | expandContent (bool recursion) |
| virtual void | focusNext () |
| virtual void | focusPrevious () |
| virtual void | fontChanged () |
| virtual void | getAbsolutePosition (int &x, int &y) const |
| std::string const & | getActionEventId () const |
| Color const & | getBackgroundColor () const |
| Color const & | getBaseColor () const |
| Color const & | getBorderColor () const |
| unsigned int | getBorderSides () const |
| unsigned int | getBorderSize () const |
| unsigned int | getBorderStyle () const |
| virtual Rectangle | getChildrenArea () |
| unsigned int | getChildrenCount () const |
| Rectangle const & | getDimension () const |
| Size const & | getFixedSize () const |
| Font * | getFont () const |
| Color const & | getForegroundColor () const |
| int | getHeight () const |
| std::string const & | getId () const |
| void | getLastPosition (int &x, int &y) const |
| int | getMarginBottom () const |
| int | getMarginLeft () const |
| int | getMarginRight () const |
| int | getMarginTop () const |
| Size const & | getMaxSize () const |
| Size const & | getMinSize () const |
| Color const & | getOutlineColor () const |
| unsigned int | getOutlineSize () const |
| unsigned int | getPaddingBottom () const |
| unsigned int | getPaddingLeft () const |
| unsigned int | getPaddingRight () const |
| unsigned int | getPaddingTop () const |
| virtual Widget * | getParent () const |
| Color const & | getSelectionColor () const |
| SelectionMode | getSelectionMode () const |
| virtual Widget * | getTop () const |
| unsigned int | getVisibleChildrenCount () const |
| Widget * | getWidgetAt (int x, int y) |
| virtual Widget * | getWidgetAt (int x, int y, Widget *exclude) |
| std::list< Widget * > | getWidgetsIn (Rectangle const &area) |
| virtual std::list< Widget * > | getWidgetsIn (Rectangle const &area, Widget *ignore) |
| int | getWidth () const |
| int | getX () const |
| int | getY () const |
| bool | hasMouseCapture () const |
| bool | isDescendantOf (Widget const *ancestor) const noexcept |
| bool | isEnabled () const |
| bool | isFixedSize () const |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| bool | isHorizontalExpand () const |
| bool | isInsideActiveMouseModal () const noexcept |
| bool | isLastPositionSet () const |
| virtual bool | isLayouted () |
| virtual bool | isModalFocusable () const |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocusable () const |
| bool | isMouseInside (MouseEvent const &mouseEvent) const |
| bool | isSetVisible () const |
| bool | isTabInEnabled () const |
| bool | isTabOutEnabled () const |
| virtual bool | isUnderMouseModal () const |
| bool | isVerticalExpand () const |
| bool | isVisible () const |
| virtual void | logic () |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | moveToTop (Widget *widget) |
| virtual void | onFocusChanged () |
| virtual void | onFocusGained () |
| virtual void | onFocusLost () |
| Widget & | operator= (Widget &&)=delete |
| Widget & | operator= (Widget const &)=delete |
| void | releaseMouse () |
| void | removeActionListener (ActionListener *actionListener) |
| void | removeDeathListener (DeathListener *deathListener) |
| void | removeDropTargetListener (DropTargetListener *listener) |
| void | removeFocusListener (FocusListener *focusListener) |
| void | removeKeyListener (KeyListener *keyListener) |
| void | removeMouseListener (MouseListener *mouseListener) |
| void | removeWidgetListener (WidgetListener *widgetListener) |
| virtual void | requestFocus () |
| virtual void | requestMoveToBottom () |
| virtual void | requestMoveToTop () |
| virtual void | resizeToContent (bool recursion=true) |
| void | setActionEventId (std::string const &actionEventId) |
| virtual void | setBackgroundColor (Color const &color) |
| virtual void | setBaseColor (Color const &color) |
| void | setBorderBottom (unsigned int size, unsigned int style) |
| virtual void | setBorderColor (Color const &color) |
| void | setBorderSides (unsigned int sides) |
| void | setBorderSize (unsigned int size) |
| void | setBorderStyle (unsigned int style) |
| void | setBorderTop (unsigned int size, unsigned int style) |
| virtual void | setDimension (Rectangle const &dimension) |
| void | setEnabled (bool enabled) |
| void | setFixedSize (Size const &size) |
| void | setFocusable (bool focusable) |
| virtual void | setFocused (bool focused) |
| virtual void | setFont (Font *font) |
| virtual void | setForegroundColor (Color const &color) |
| virtual void | setHeight (int height) |
| void | setHorizontalExpand (bool expand) |
| void | setId (std::string const &id) |
| void | setInternalFocusHandler (FocusHandler *internalFocusHandler) |
| void | setLastPosition (int x, int y) |
| void | setMargin (int margin) |
| void | setMarginBottom (int margin) |
| void | setMarginLeft (int margin) |
| void | setMarginRight (int margin) |
| void | setMarginTop (int margin) |
| void | setMaxSize (Size const &size) |
| void | setMinSize (Size const &size) |
| virtual void | setOutlineColor (Color const &color) |
| void | setOutlineSize (unsigned int size) |
| void | setPadding (unsigned int padding) |
| void | setPaddingBottom (unsigned int padding) |
| void | setPaddingLeft (unsigned int padding) |
| void | setPaddingRight (unsigned int padding) |
| void | setPaddingTop (unsigned int padding) |
| void | setPosition (int x, int y) |
| virtual void | setSelectionColor (Color const &color) |
| virtual void | setSelectionMode (SelectionMode mode) |
| virtual void | setSize (int width, int height) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| virtual void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| virtual void | showWidgetPart (Widget *widget, Rectangle area) |
| virtual void | textInput (TextInputEvent &event) |
| Widget () | |
| Widget (Widget &&)=delete | |
| Widget (Widget const &)=delete | |
Static Public Member Functions | |
| static DeathListener * | _getGuiDeathListener () |
| static VisibilityEventHandler * | _getVisibilityEventHandler () |
| static void | _setGuiDeathListener (DeathListener *deathListener) |
| static void | _setVisibilityEventHandler (VisibilityEventHandler *visibilityEventHandler) |
| static Widget * | getMouseCapture () |
| static void | resetGlobalFont () |
| static void | setGlobalFont (Font *font) |
| static bool | widgetExists (Widget const *widget) |
Protected Member Functions | |
| void | add (Widget *widget) |
| void | calculateSize () |
| void | distributeActionEvent () |
| void | distributeAncestorHiddenEvent (Widget *ancestor) |
| void | distributeAncestorMovedEvent (Widget *ancestor) |
| void | distributeAncestorShownEvent (Widget *ancestor) |
| void | distributeDragDrop (DragEvent &event) |
| bool | distributeDragEnter (DragEvent &event) |
| void | distributeDragHover (DragEvent &event) |
| void | distributeDragLeave (DragEvent &event) |
| void | distributeHiddenEvent () |
| void | distributeMovedEvent () |
| void | distributeResizedEvent () |
| void | distributeShownEvent () |
| virtual Widget * | findWidgetById (std::string const &id) |
| std::list< Widget * > const & | getChildren () const |
| virtual void | remove (Widget *widget) |
| virtual void | removeAllChildren () |
| void | resizeToChildren () |
Protected Attributes | |
| std::string | mActionEventId |
| std::list< ActionListener * > | mActionListeners |
| Color | mBackgroundColor {0xf9fafb} |
| Color | mBaseColor {0xe5e7eb} |
| Color | mBorderColor {0xd1d5db} |
| unsigned int | mBorderSides {BORDER_ALL} |
| unsigned int | mBorderSize {0} |
| unsigned int | mBorderStyle {BORDER_STYLE_FLAT} |
| std::list< Widget * > | mChildren |
| Font * | mCurrentFont {nullptr} |
| std::list< DeathListener * > | mDeathListeners |
| Rectangle | mDimension |
| std::list< DropTargetListener * > | mDropTargetListeners |
| bool | mEnabled {true} |
| Size | mFixedSize {-1, -1} |
| bool | mFixedSizeUsed {false} |
| bool | mFocusable {false} |
| bool | mFocused {false} |
| FocusHandler * | mFocusHandler {nullptr} |
| std::list< FocusListener * > | mFocusListeners |
| Color | mForegroundColor {0x1f2933} |
| bool | mHExpand {false} |
| std::string | mId |
| FocusHandler * | mInternalFocusHandler {nullptr} |
| std::list< KeyListener * > | mKeyListeners |
| int | mLastX {0} |
| int | mLastY {0} |
| int | mMarginBottom {0} |
| int | mMarginLeft {0} |
| int | mMarginRight {0} |
| int | mMarginTop {0} |
| Size | mMaxSize {std::numeric_limits<int>::max(), std::numeric_limits<int>::max()} |
| Size | mMinSize {0, 0} |
| std::list< MouseListener * > | mMouseListeners |
| Rectangle | mOffsetRect |
| Color | mOutlineColor {0x9ca3af} |
| unsigned int | mOutlineSize {0} |
| unsigned int | mPaddingBottom {0} |
| unsigned int | mPaddingLeft {0} |
| unsigned int | mPaddingRight {0} |
| unsigned int | mPaddingTop {0} |
| Widget * | mParent {nullptr} |
| Color | mSelectionColor {0x3b82f6} |
| SelectionMode | mSelectionMode {SelectionMode::None} |
| bool | mTabIn {true} |
| bool | mTabOut {true} |
| bool | mVExpand {false} |
| bool | mVisible {true} |
| std::list< WidgetListener * > | mWidgetListeners |
Static Protected Attributes | |
| static DefaultFont | mDefaultFont |
| static Font * | mGlobalFont = nullptr |
| static DeathListener * | mGuiDeathListener = nullptr |
| static VisibilityEventHandler * | mVisibilityEventHandler = nullptr |
| static std::list< Widget * > | mWidgetInstances |
| static Widget * | sMouseCapture = nullptr |
Friends | |
| class | DragHandler |
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
It contains basic functions every widget should have.
Definition at line 55 of file widget.hpp.
| enum fcn::Widget::BorderSide : uint8_t |
Border side flags for flexible border drawing.
Definition at line 61 of file widget.hpp.
| enum fcn::Widget::BorderStyle : uint8_t |
Border drawing style.
Definition at line 74 of file widget.hpp.
|
strong |
Selection mode.
Definition at line 82 of file widget.hpp.
| fcn::Widget::Widget | ( | ) |
Constructor.
Resets member variables. Notably, a widget is not focusable as default, therefore, widgets that are supposed to be focusable should override this default in their own constructor.
Definition at line 52 of file widget.cpp.
Referenced by _setParent(), fcn::TabbedArea::action(), adaptLayout(), fcn::Container::add(), fcn::Container::add(), add(), fcn::TabbedArea::addTab(), fcn::Container::addWidget(), fcn::Container::addWidget(), fcn::ScrollArea::adjustSize(), fcn::Container::Container(), distributeAncestorHiddenEvent(), distributeAncestorMovedEvent(), distributeAncestorShownEvent(), fcn::Container::distributeWidgetAddedEvent(), fcn::Container::distributeWidgetRemovedEvent(), fcn::ScrollArea::expandContent(), fcn::Container::findWidgetById(), findWidgetById(), fcn::Container::getBackgroundWidget(), fcn::TabbedArea::getBackgroundWidget(), fcn::Container::getChild(), fcn::ScrollArea::getContent(), getMouseCapture(), getParent(), getTop(), fcn::ScrollArea::getWidgetAt(), getWidgetAt(), getWidgetAt(), getWidgetsIn(), isDescendantOf(), isInsideActiveMouseModal(), fcn::TextBox::keyPressed(), fcn::TabbedArea::mousePressed(), moveToBottom(), moveToTop(), fcn::Container::remove(), remove(), removeAllChildren(), resizeToChildren(), fcn::ScrollArea::resizeToContent(), fcn::ScrollArea::ScrollArea(), fcn::ScrollArea::ScrollArea(), fcn::Container::setBackgroundWidget(), fcn::TabbedArea::setBackgroundWidget(), fcn::ScrollArea::setContent(), fcn::ScrollArea::setDimension(), fcn::ScrollArea::setHeight(), fcn::ScrollArea::setWidth(), fcn::ScrollArea::showWidgetPart(), showWidgetPart(), and widgetExists().
|
virtual |
Definition at line 57 of file widget.cpp.
|
virtual |
Called whenever a widget should draw itself.
The function will set up clip areas and call the draw function for this widget and for all its children.
Definition at line 1546 of file widget.cpp.
References draw(), drawOutline(), getChildrenArea(), fcn::Rectangle::height, fcn::Rectangle::isIntersecting(), mChildren, mDimension, mOutlineSize, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
|
virtual |
Gets the focus handler used.
Definition at line 838 of file widget.cpp.
References mFocusHandler.
Referenced by add(), setInternalFocusHandler(), and fcn::MenuPopup::show().
|
virtual |
Gets the focus listeners of the widget.
Definition at line 1161 of file widget.cpp.
References mFocusListeners.
Referenced by fcn::FocusHandler::distributeFocusGainedEvent(), and fcn::FocusHandler::distributeFocusLostEvent().
|
static |
Get the global GUI death listener.
Definition at line 858 of file widget.cpp.
References mGuiDeathListener.
|
virtual |
Gets the internal focus handler used.
Definition at line 1171 of file widget.cpp.
References mInternalFocusHandler.
Referenced by fcn::Gui::getKeyEventSource().
|
virtual |
Gets the key listeners of the widget.
Definition at line 1156 of file widget.cpp.
References mKeyListeners.
Referenced by fcn::Gui::distributeKeyEvent().
|
virtual |
Gets the mouse listeners of the widget.
Definition at line 1151 of file widget.cpp.
References mMouseListeners.
Referenced by fcn::Gui::distributeMouseEvent().
|
static |
Gets the visibility event handler of this widget.
Definition at line 848 of file widget.cpp.
References mVisibilityEventHandler.
Referenced by add(), distributeAncestorHiddenEvent(), distributeAncestorShownEvent(), remove(), removeAllChildren(), and setVisible().
|
virtual |
Called whenever a widget should perform logic.
The function will call the logic function for this widget and for all its children.
Definition at line 1579 of file widget.cpp.
|
virtual |
Sets the focus handler to be used.
| focusHandler | The focus handler to use. |
Definition at line 807 of file widget.cpp.
References fcn::FocusHandler::add(), mChildren, mFocusHandler, mInternalFocusHandler, and widgetExists().
Referenced by add(), remove(), removeAllChildren(), and fcn::Gui::setTop().
|
static |
Set the global GUI death listener used to observe widget deletions.
| deathListener | Pointer to a DeathListener instance (ownership not transferred). |
Definition at line 853 of file widget.cpp.
References mGuiDeathListener.
|
virtual |
Sets the parent of the widget.
A parent must be a Container.
| parent | The parent of the widget. |
Definition at line 234 of file widget.cpp.
References mParent, and Widget().
Referenced by add(), remove(), and removeAllChildren().
|
static |
Sets the visibility event handler to be used.
| visibilityEventHandler | The visibility event handler to be used. |
Definition at line 843 of file widget.cpp.
References mVisibilityEventHandler.
|
inline |
Execute the layouting.
In case you want to relayout a visible widget. This function will automatically perform the layout adaption from the widget.
This is a convenience wrapper that calls adaptLayout(true).
Definition at line 1560 of file widget.hpp.
References adaptLayout().
Referenced by adaptLayout(), fcn::TabbedArea::addTab(), fcn::TabbedArea::removeTab(), and fcn::TabbedArea::setSelectedTab().
|
virtual |
Execute the layouting for this widget.
| top | If true, perform top-level layout adaptations as well. |
Definition at line 445 of file widget.cpp.
References expandContent(), getParent(), isLayouted(), resizeToContent(), and Widget().
|
protected |
Adds a child to the widget.
THIS METHOD IS NOT SAFE TO CALL INSIDE A WIDGETS LOGIC FUNCTION INSIDE ANY LISTER FUNCTIONS!
| widget | The widget to add. |
Definition at line 1446 of file widget.cpp.
References _getFocusHandler(), _getVisibilityEventHandler(), _setFocusHandler(), _setParent(), mChildren, mInternalFocusHandler, setLastPosition(), Widget(), and fcn::VisibilityEventHandler::widgetShown().
Referenced by fcn::Container::add(), fcn::Container::add(), fcn::DropDown::DropDown(), fcn::ActivityBarItem::mouseEntered(), and fcn::ScrollArea::setContent().
| void fcn::Widget::addActionListener | ( | ActionListener * | actionListener | ) |
Adds an action listener to the widget.
When an action event is fired by the widget the action listeners of the widget will get notified.
| actionListener | The action listener to add. |
Definition at line 863 of file widget.cpp.
References mActionListeners.
Referenced by fcn::TabbedArea::addTab().
| void fcn::Widget::addDeathListener | ( | DeathListener * | deathListener | ) |
Adds a death listener to the widget.
When a death event is fired by the widget the death listeners of the widget will get notified.
| deathListener | The death listener to add. |
Definition at line 874 of file widget.cpp.
References mDeathListeners.
| void fcn::Widget::addDropTargetListener | ( | DropTargetListener * | listener | ) |
Adds a drop target listener to the widget.
When a drag event is fired the drop target listeners of the widget will get notified.
| listener | The listener to add (non-owning). |
Definition at line 967 of file widget.cpp.
References mDropTargetListeners.
| void fcn::Widget::addFocusListener | ( | FocusListener * | focusListener | ) |
Adds a focus listener to the widget.
When a focus event is fired by the widget the key listeners of the widget will get notified.
| focusListener | The focus listener to add. |
Definition at line 896 of file widget.cpp.
References mFocusListeners.
Referenced by fcn::Button::Button(), and fcn::DropDown::DropDown().
| void fcn::Widget::addKeyListener | ( | KeyListener * | keyListener | ) |
Adds a key listener to the widget.
When a key event is fired by the widget the key listeners of the widget will get notified.
| keyListener | The key listener to add. |
Definition at line 885 of file widget.cpp.
References mKeyListeners.
Referenced by fcn::Button::Button(), fcn::DropDown::DropDown(), fcn::ListBox::ListBox(), fcn::Slider::Slider(), fcn::TextBox::TextBox(), and fcn::TextField::TextField().
| void fcn::Widget::addMouseListener | ( | MouseListener * | mouseListener | ) |
Adds a mouse listener to the widget.
When a mouse event is fired by the widget the mouse listeners of the widget will get notified.
| mouseListener | The mouse listener to add. |
Definition at line 907 of file widget.cpp.
References mMouseListeners.
Referenced by fcn::Button::Button(), fcn::DropDown::DropDown(), fcn::ListBox::ListBox(), fcn::MenuBar::MenuBar(), fcn::MenuPopup::MenuPopup(), fcn::Panel::Panel(), fcn::RadioButton::RadioButton(), fcn::ScrollArea::ScrollArea(), fcn::ScrollArea::ScrollArea(), fcn::Slider::Slider(), fcn::TextBox::TextBox(), fcn::TextField::TextField(), and fcn::Window::Window().
| void fcn::Widget::addWidgetListener | ( | WidgetListener * | widgetListener | ) |
Adds a widget listener to the widget.
When a widget event is fired by the widget the key listeners of the widget will get notified.
| widgetListener | The widget listener to add. |
Definition at line 918 of file widget.cpp.
References mWidgetListeners.
Referenced by fcn::Button::Button().
|
inlinevirtual |
Resizes the widget's size to fit the content exactly.
Reimplemented in fcn::ActivityBar, fcn::AdjustingContainer, fcn::Button, fcn::CheckBox, fcn::Container, fcn::DropDown, fcn::HorizontalBar, fcn::Icon, fcn::IconProgressBar, fcn::ImageButton, fcn::ImageProgressBar, fcn::Label, fcn::ListBox, fcn::Panel, fcn::ScrollArea, fcn::Tab, fcn::TabbedArea, fcn::TextBox, fcn::TextField, and fcn::Window.
Definition at line 1587 of file widget.hpp.
Referenced by fcn::MenuPopup::addItem(), and fcn::ScrollArea::adjustSize().
|
protected |
Checks the size against the size constraints.
Used by setDimension.
Prevents negative sizes and sizes larger than the maximum size.
Definition at line 406 of file widget.cpp.
References mDimension, mFixedSize, mFixedSizeUsed, mMaxSize, and mMinSize.
Referenced by setDimension(), setFixedSize(), setMaxSize(), and setMinSize().
| bool fcn::Widget::captureMouse | ( | ) |
Attempts to capture mouse input to this widget.
Definition at line 1611 of file widget.cpp.
References sMouseCapture.
Referenced by fcn::Gui::captureMouse().
| bool fcn::Widget::contains | ( | int | x, |
| int | y ) const |
Checks if a point is within the widget's bounds.
| x | The x coordinate (relative to widget origin). |
| y | The y coordinate (relative to widget origin). |
Definition at line 270 of file widget.cpp.
References getHeight(), and getWidth().
Referenced by isMouseInside(), and fcn::MenuPopup::mousePressed().
|
protected |
Distributes an action event to all action listeners of the widget.
Definition at line 1291 of file widget.cpp.
References mActionEventId, and mActionListeners.
Referenced by fcn::DropDown::action(), fcn::CheckBox::keyPressed(), fcn::ListBox::keyPressed(), fcn::PasswordField::keyPressed(), fcn::Slider::keyPressed(), fcn::TextField::keyPressed(), fcn::Button::keyReleased(), fcn::CheckBox::mouseClicked(), fcn::Slider::mouseDragged(), fcn::ListBox::mousePressed(), fcn::Slider::mousePressed(), fcn::Button::mouseReleased(), fcn::Slider::mouseWheelMovedDown(), fcn::Slider::mouseWheelMovedLeft(), fcn::Slider::mouseWheelMovedRight(), fcn::Slider::mouseWheelMovedUp(), fcn::ActivityBarItem::setPanelVisible(), and fcn::ToggleButton::toggleSelected().
|
protected |
Distributes ancestor hidden events to all of the widget's listeners.
All children will also distribute the same event.
| ancestor | Ancestor widget that was hidden. |
Definition at line 1245 of file widget.cpp.
References _getVisibilityEventHandler(), mChildren, mWidgetListeners, Widget(), and fcn::VisibilityEventHandler::widgetHidden().
|
protected |
Distributes ancestor moved events to all of the widget's listeners.
All children will also distribute the same event.
| ancestor | Ancestor widget that was moved. |
Definition at line 1227 of file widget.cpp.
References mChildren, mWidgetListeners, and Widget().
|
protected |
Distributes ancestor shown events to all of the widget's listeners.
All children will also distribute the same event.
| ancestor | Ancestor widget that was shown. |
Definition at line 1268 of file widget.cpp.
References _getVisibilityEventHandler(), mChildren, mWidgetListeners, Widget(), and fcn::VisibilityEventHandler::widgetShown().
|
protected |
Distribute a drop event to listeners.
Definition at line 958 of file widget.cpp.
References mDropTargetListeners.
|
protected |
Distribute a drag enter event to listeners.
Definition at line 929 of file widget.cpp.
References mDropTargetListeners.
|
protected |
Distribute a drag hover event to listeners.
Definition at line 949 of file widget.cpp.
References mDropTargetListeners.
|
protected |
Distribute a drag leave event to listeners.
Definition at line 940 of file widget.cpp.
References mDropTargetListeners.
|
protected |
Distributes hidden events to all of the widget's listeners.
Definition at line 1218 of file widget.cpp.
References mWidgetListeners.
Referenced by setVisible().
|
protected |
Distributes moved events to all of the widget's listeners.
Definition at line 1209 of file widget.cpp.
References mWidgetListeners.
Referenced by setDimension().
|
protected |
Distributes resized events to all of the widget's listeners.
Definition at line 1200 of file widget.cpp.
References mWidgetListeners.
Referenced by setDimension().
|
protected |
Distributes shown events to all of the widget's listeners.
Definition at line 1300 of file widget.cpp.
References mWidgetListeners.
Referenced by setVisible().
|
pure virtual |
Draws the widget.
The call to draw is initiated by the widget's parent. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension. If a widget has children, the parent's draw function will always be called before the children's draw functions are called.
| graphics | A graphics object to draw with. |
Implemented in fcn::ActivityBar, fcn::BarGraph, fcn::Button, fcn::CheckBox, fcn::Container, fcn::CurveGraph, fcn::DropDown, fcn::HorizontalBar, fcn::Icon, fcn::IconProgressBar, fcn::ImageButton, fcn::ImageProgressBar, fcn::Label, fcn::LineGraph, fcn::ListBox, fcn::MenuBar, fcn::MenuItem, fcn::MenuPopup, fcn::ModalBackdrop, fcn::Panel, fcn::PieGraph, fcn::PointGraph, fcn::ScrollArea, fcn::Slider, fcn::Spacer, fcn::StatusBar, fcn::Tab, fcn::TabbedArea, fcn::TextBox, fcn::TextField, fcn::Tooltip, and fcn::Window.
References drawBorder(), drawOutline(), drawSelectionFrame(), getOutlineSize(), and setOutlineSize().
Referenced by _draw().
|
virtual |
Called when a widget have a border.
| graphics | A graphics object to draw with. |
Definition at line 156 of file widget.cpp.
References drawBorder(), and mBorderSides.
Referenced by fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::Panel::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), draw(), fcn::Window::draw(), drawBorder(), and fcn::CheckBox::drawBox().
| void fcn::Widget::drawBorder | ( | Graphics * | graphics, |
| unsigned int | sides ) const |
Draw the border for the given sides.
This overload allows callers to draw a subset of sides.
Definition at line 161 of file widget.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), getBaseColor(), getBorderColor(), getBorderSize(), getHeight(), getWidth(), mBorderStyle, and fcn::Graphics::setColor().
|
virtual |
Called when a widget is given a chance to draw a outline around itself.
The outline is not considered as part of the widget, it only allows a outline to be drawn around the widget, thus a outline will never be included when calculating if a widget should receive events from user input. Also a widget's outline will never be included when calculating a widget's position.
The size of the outline is calculated using the widget's outline size. If a widget has a outline size of 10 pixels than the area the drawOutline function can draw to will be the size of the widget with an additional extension of 10 pixels in each direction.
An example when drawOutline is a useful function is if a widget needs a glow around itself.
| graphics | A graphics object to draw with. |
Definition at line 133 of file widget.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), getBaseColor(), getHeight(), getOutlineColor(), getOutlineSize(), getWidth(), and fcn::Graphics::setColor().
|
virtual |
Called when a widget is "active" and the selection mode is Frame or FrameWithBackground.
Currently the size of the border is used, so it will replace the border with the frame.
| graphics | A graphics object to draw with. |
Definition at line 217 of file widget.cpp.
References fcn::Graphics::drawLine(), getBorderSize(), getHeight(), getSelectionColor(), getWidth(), and fcn::Graphics::setColor().
Referenced by fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), draw(), and fcn::CheckBox::drawBox().
|
inline |
Expands the child widgets to the size of this widget, calls recursively all childs.
This is a convenience wrapper that calls expandContent(true).
Definition at line 1597 of file widget.hpp.
References expandContent().
Referenced by adaptLayout(), fcn::Container::Container(), fcn::ScrollArea::expandContent(), and expandContent().
|
inlinevirtual |
Expands child widgets to fit this widget's size.
| recursion | If true, call expandContent recursively on children. |
Reimplemented in fcn::AdjustingContainer, fcn::Container, fcn::FlowContainer, fcn::ScrollArea, and fcn::TabbedArea.
Definition at line 1607 of file widget.hpp.
|
protectedvirtual |
Finds a widget by id.
This function can be useful when implementing a GUI generator, such as the ability to create a GUI from an XML file.
| id | The id to find a widget by. |
Reimplemented in fcn::Container.
Definition at line 1358 of file widget.cpp.
References findWidgetById(), getId(), mChildren, and Widget().
Referenced by fcn::Container::findWidgetById(), and findWidgetById().
|
virtual |
Focuses the next widget in the widget.
Definition at line 1490 of file widget.cpp.
References mChildren.
|
virtual |
Focuses the previous widget in the widget.
Definition at line 1517 of file widget.cpp.
References mChildren.
|
inlinevirtual |
Called when the font has changed.
If the change is global, this function will only be called if the widget doesn't have a font already set.
Reimplemented in fcn::Button, and fcn::TextBox.
Definition at line 1160 of file widget.hpp.
Referenced by setFont().
|
virtual |
Gets the absolute position on the screen for the widget.
| x | The absolute x coordinate will be stored in this parameter. |
| y | The absolute y coordinate will be stored in this parameter. |
Definition at line 978 of file widget.cpp.
References getAbsolutePosition(), getChildrenArea(), getParent(), isLastPositionSet(), mDimension, mLastX, mLastY, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::Gui::distributeMouseEvent(), getAbsolutePosition(), fcn::Gui::getWidgetAt(), fcn::Gui::getWidgetsAt(), fcn::Gui::handleMousePressed(), fcn::Gui::handleMouseReleased(), fcn::Gui::handleMouseWheelMovedDown(), fcn::Gui::handleMouseWheelMovedLeft(), fcn::Gui::handleMouseWheelMovedRight(), fcn::Gui::handleMouseWheelMovedUp(), fcn::MenuPopup::mousePressed(), fcn::ModalBackdrop::mousePressed(), remove(), and removeAllChildren().
| std::string const & fcn::Widget::getActionEventId | ( | ) | const |
Gets the action event identifier of the widget.
Definition at line 614 of file widget.cpp.
References mActionEventId.
| Color const & fcn::Widget::getBackgroundColor | ( | ) | const |
Gets the background color.
Definition at line 762 of file widget.cpp.
References mBackgroundColor.
Referenced by fcn::ActivityBar::draw(), fcn::BarGraph::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::HorizontalBar::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageProgressBar::draw(), fcn::LineGraph::draw(), fcn::ListBox::draw(), fcn::MenuBar::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::Slider::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::ScrollArea::drawBackground(), fcn::CheckBox::drawBox(), fcn::ScrollArea::drawHBar(), fcn::CheckBox::drawRhombus(), and fcn::ScrollArea::drawVBar().
| Color const & fcn::Widget::getBaseColor | ( | ) | const |
Gets the base color.
Definition at line 742 of file widget.cpp.
References mBaseColor.
Referenced by fcn::TabbedArea::addTab(), fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::ImageButton::draw(), fcn::LineGraph::draw(), fcn::Panel::draw(), fcn::PointGraph::draw(), fcn::ScrollArea::draw(), fcn::Tab::draw(), fcn::TabbedArea::draw(), fcn::TextField::draw(), fcn::Window::draw(), drawBorder(), fcn::CheckBox::drawBox(), fcn::DropDown::drawButton(), fcn::ScrollArea::drawDownButton(), fcn::ScrollArea::drawHMarker(), fcn::Window::drawInnerBorder(), fcn::ScrollArea::drawLeftButton(), fcn::Slider::drawMarker(), drawOutline(), fcn::CheckBox::drawRhombus(), fcn::ScrollArea::drawRightButton(), fcn::ScrollArea::drawUpButton(), and fcn::ScrollArea::drawVMarker().
| Color const & fcn::Widget::getBorderColor | ( | ) | const |
Gets the border color.
Definition at line 792 of file widget.cpp.
References mBorderColor.
Referenced by drawBorder().
| unsigned int fcn::Widget::getBorderSides | ( | ) | const |
Get the currently selected border sides.
Definition at line 484 of file widget.cpp.
References mBorderSides.
Referenced by fcn::Container::draw(), fcn::FlowContainer::expandContent(), and fcn::Container::getChildrenArea().
| unsigned int fcn::Widget::getBorderSize | ( | ) | const |
Gets the size of the widget's border.
The border is considered as part of the widget.
A border size of 0 means that the widget has no border. The default border size is 0.
Definition at line 474 of file widget.cpp.
References mBorderSize.
Referenced by fcn::AdjustingContainer::adjustSize(), fcn::Container::adjustSize(), fcn::Panel::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::BarGraph::draw(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::Panel::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::Window::draw(), drawBorder(), fcn::CheckBox::drawBox(), fcn::Window::drawInnerBorder(), drawSelectionFrame(), fcn::FlowContainer::expandContent(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getHorizontalMaxScroll(), fcn::ScrollArea::getVerticalMaxScroll(), fcn::ScrollArea::logic(), fcn::MenuPopup::MenuPopup(), fcn::Panel::mousePressed(), fcn::Window::mousePressed(), and fcn::ScrollArea::showWidgetPart().
| unsigned int fcn::Widget::getBorderStyle | ( | ) | const |
Get the current border drawing style.
Definition at line 494 of file widget.cpp.
References mBorderStyle.
Referenced by fcn::FlowContainer::expandContent(), fcn::MenuBar::MenuBar(), and fcn::MenuPopup::MenuPopup().
|
protected |
Gets the children of the widget.
Definition at line 1589 of file widget.cpp.
References mChildren.
Referenced by fcn::HorizontalBar::adjustSize(), fcn::Container::getChild(), fcn::ActivityBar::hideAll(), fcn::MenuPopup::keyPressed(), fcn::MenuPopup::mouseEntered(), fcn::HorizontalBar::resizeToContent(), and fcn::ActivityBar::showAll().
|
virtual |
Gets the area of the widget occupied by the widget's children.
By default this method returns an empty rectangle as not all widgets are containers. If you want to make a container this method should return the area where the children resides. This method is used when drawing children of a widget when computing clip rectangles for the children.
An example of a widget that overloads this method is ScrollArea. A ScrollArea has a view of its constant and that view is the children area. The size of a ScrollArea's children area might vary depending on if the scroll bars of the ScrollArea is shown or not.
Reimplemented in fcn::AdjustingContainer, fcn::Container, fcn::DropDown, fcn::ScrollArea, fcn::Tab, fcn::TabbedArea, fcn::Tooltip, and fcn::Window.
Definition at line 1166 of file widget.cpp.
Referenced by _draw(), fcn::DropDown::adjustHeight(), getAbsolutePosition(), getWidgetAt(), fcn::TextBox::keyPressed(), and showWidgetPart().
| unsigned int fcn::Widget::getChildrenCount | ( | ) | const |
Gets how many childs the widget have.
Definition at line 339 of file widget.cpp.
References mChildren.
Referenced by fcn::Container::getChild(), fcn::MenuBar::keyPressed(), fcn::MenuPopup::mousePressed(), and fcn::ModalBackdrop::mousePressed().
| Rectangle const & fcn::Widget::getDimension | ( | ) | const |
Gets the dimension of the widget.
The dimension is relative to the widget's parent.
Definition at line 609 of file widget.cpp.
References mDimension.
Referenced by fcn::FlowContainer::adjustContent(), getWidgetAt(), getWidgetsIn(), and fcn::Container::resizeToContent().
| Size const & fcn::Widget::getFixedSize | ( | ) | const |
Gets the fixed size of the widget.
Definition at line 396 of file widget.cpp.
References mFixedSize.
| Font * fcn::Widget::getFont | ( | ) | const |
Gets the font set for the widget.
If no font has been set, the global font will be returned. If no global font has been set, the default font will be returned.
Definition at line 1000 of file widget.cpp.
References mCurrentFont, mDefaultFont, and mGlobalFont.
Referenced by fcn::DropDown::adjustHeight(), fcn::TextField::adjustHeight(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::ListBox::adjustSizeImpl(), fcn::TextBox::adjustSizeImpl(), fcn::TextField::adjustSizeImpl(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::DropDown::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::ListBox::draw(), fcn::MenuItem::draw(), fcn::Panel::draw(), fcn::StatusBar::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::Window::draw(), fcn::TextBox::drawCaret(), fcn::TextField::fixScroll(), fcn::ListBox::getRowHeight(), fcn::TextBox::keyPressed(), fcn::TextBox::mousePressed(), fcn::TextField::mousePressed(), and fcn::TextBox::scrollToCaret().
| Color const & fcn::Widget::getForegroundColor | ( | ) | const |
Gets the foreground color.
Definition at line 752 of file widget.cpp.
References mForegroundColor.
Referenced by fcn::ActivityBar::draw(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::DropDown::draw(), fcn::HorizontalBar::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::ListBox::draw(), fcn::MenuItem::draw(), fcn::Panel::draw(), fcn::StatusBar::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::Window::draw(), fcn::CheckBox::drawBox(), fcn::DropDown::drawButton(), fcn::TextBox::drawCaret(), fcn::TextField::drawCaret(), fcn::ScrollArea::drawDownButton(), fcn::ScrollArea::drawLeftButton(), fcn::Slider::drawMarker(), fcn::CheckBox::drawRhombus(), fcn::ScrollArea::drawRightButton(), and fcn::ScrollArea::drawUpButton().
| int fcn::Widget::getHeight | ( | ) | const |
Gets the height of the widget.
Definition at line 265 of file widget.cpp.
References mDimension.
Referenced by fcn::TextField::adjustHeight(), fcn::ActivityBar::adjustSize(), fcn::Container::adjustSize(), fcn::TabbedArea::adjustSize(), fcn::Window::adjustSize(), fcn::CheckBox::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::TextBox::adjustSizeImpl(), fcn::TabbedArea::adjustTabPositions(), fcn::ScrollArea::checkPolicies(), contains(), fcn::ActivityBar::draw(), fcn::BarGraph::draw(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::HorizontalBar::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::ListBox::draw(), fcn::MenuBar::draw(), fcn::MenuItem::draw(), fcn::MenuPopup::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::ScrollArea::draw(), fcn::Slider::draw(), fcn::StatusBar::draw(), fcn::Tab::draw(), fcn::TabbedArea::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::Tooltip::draw(), fcn::Window::draw(), drawBorder(), fcn::CheckBox::drawBox(), fcn::TextBox::drawCaret(), fcn::Window::drawInnerBorder(), fcn::Slider::drawMarker(), drawOutline(), fcn::CheckBox::drawRhombus(), drawSelectionFrame(), fcn::DropDown::dropDown(), fcn::ScrollArea::expandContent(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::DropDown::getChildrenArea(), fcn::ScrollArea::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getDownButtonDimension(), fcn::ScrollArea::getHorizontalBarDimension(), fcn::ScrollArea::getLeftButtonDimension(), fcn::ScrollArea::getRightButtonDimension(), fcn::ScrollArea::getVerticalBarDimension(), fcn::ScrollArea::getVerticalMarkerDimension(), fcn::ScrollArea::getVerticalMaxScroll(), fcn::Slider::markerPositionToValue(), fcn::Slider::mouseDragged(), fcn::MenuPopup::mousePressed(), fcn::ModalBackdrop::mousePressed(), fcn::Slider::mousePressed(), resizeToChildren(), fcn::ActivityBar::resizeToContent(), fcn::FlowContainer::resizeToContent(), fcn::Spacer::resizeToContent(), fcn::ScrollArea::setDimension(), fcn::ScrollArea::setHeight(), fcn::ActivityBar::setWidth(), fcn::MenuPopup::show(), and fcn::Slider::valueToMarkerPosition().
| std::string const & fcn::Widget::getId | ( | ) | const |
Gets the id of a widget.
The id is useful if a widget needs to be identified in a container. For example, if widgets are created by an XML document, a certain widget can be retrieved given that the widget has an id.
Definition at line 1195 of file widget.cpp.
References mId.
Referenced by findWidgetById().
| void fcn::Widget::getLastPosition | ( | int & | x, |
| int & | y ) const |
Retrieves the last stored position used by layout or event logic.
| x | Output parameter receiving the last x coordinate. |
| y | Output parameter receiving the last y coordinate. |
Definition at line 1594 of file widget.cpp.
| int fcn::Widget::getMarginBottom | ( | ) | const |
Gets the bottom margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
Definition at line 546 of file widget.cpp.
References mMarginBottom.
Referenced by fcn::FlowContainer::adjustContent(), and fcn::FlowContainer::expandContent().
| int fcn::Widget::getMarginLeft | ( | ) | const |
Gets the left margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
Definition at line 556 of file widget.cpp.
References mMarginLeft.
Referenced by fcn::FlowContainer::adjustContent(), and fcn::FlowContainer::expandContent().
| int fcn::Widget::getMarginRight | ( | ) | const |
Gets the right margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
Definition at line 536 of file widget.cpp.
References mMarginRight.
Referenced by fcn::FlowContainer::adjustContent(), and fcn::FlowContainer::expandContent().
| int fcn::Widget::getMarginTop | ( | ) | const |
Gets the top margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
Definition at line 526 of file widget.cpp.
References mMarginTop.
Referenced by fcn::FlowContainer::adjustContent(), and fcn::FlowContainer::expandContent().
| Size const & fcn::Widget::getMaxSize | ( | ) | const |
Gets the maximal dimension of the widget.
Definition at line 380 of file widget.cpp.
References mMaxSize.
| Size const & fcn::Widget::getMinSize | ( | ) | const |
Gets the minimal dimension of the widget.
Definition at line 369 of file widget.cpp.
References mMinSize.
Referenced by fcn::ScrollArea::adjustSize(), fcn::FlowContainer::resizeToContent(), fcn::ScrollArea::resizeToContent(), and fcn::Spacer::resizeToContent().
|
static |
Gets the widget that currently has mouse capture.
Definition at line 1629 of file widget.cpp.
References sMouseCapture, and Widget().
Referenced by fcn::FocusHandler::pushModal().
| Color const & fcn::Widget::getOutlineColor | ( | ) | const |
Gets the outline color.
Definition at line 782 of file widget.cpp.
References mOutlineColor.
Referenced by drawOutline().
| unsigned int fcn::Widget::getOutlineSize | ( | ) | const |
Gets the size of the widget's outline.
The outline is not considered as part of the widget, it only allows a outline to be drawn around the widget, thus a outline will never be included when calculating if a widget should receive events from user input. Also a widget's outline will never be included when calculating a widget's position.
A outline size of 0 means that the widget has no outline. The default outline size is 0.
Definition at line 464 of file widget.cpp.
References mOutlineSize.
Referenced by draw(), and drawOutline().
| unsigned int fcn::Widget::getPaddingBottom | ( | ) | const |
Gets the bottom padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
Definition at line 594 of file widget.cpp.
References mPaddingBottom.
Referenced by fcn::Container::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::MenuItem::draw(), fcn::StatusBar::draw(), fcn::CheckBox::drawBox(), fcn::Window::drawInnerBorder(), fcn::FlowContainer::expandContent(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), and fcn::MenuItem::measure().
| unsigned int fcn::Widget::getPaddingLeft | ( | ) | const |
Gets the left padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
Definition at line 604 of file widget.cpp.
References mPaddingLeft.
Referenced by fcn::Container::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::Panel::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::Panel::draw(), fcn::Window::draw(), fcn::CheckBox::drawBox(), fcn::Window::drawInnerBorder(), fcn::FlowContainer::expandContent(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), and fcn::HorizontalBar::resizeToContent().
| unsigned int fcn::Widget::getPaddingRight | ( | ) | const |
Gets the right padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
Definition at line 584 of file widget.cpp.
References mPaddingRight.
Referenced by fcn::Container::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::Panel::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::Button::draw(), fcn::Icon::draw(), fcn::ImageButton::draw(), fcn::Label::draw(), fcn::Panel::draw(), fcn::Window::draw(), fcn::Window::drawInnerBorder(), fcn::FlowContainer::expandContent(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), and fcn::HorizontalBar::resizeToContent().
| unsigned int fcn::Widget::getPaddingTop | ( | ) | const |
Gets the top padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
Definition at line 574 of file widget.cpp.
References mPaddingTop.
Referenced by fcn::Container::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::Button::draw(), fcn::CheckBox::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::MenuItem::draw(), fcn::Panel::draw(), fcn::StatusBar::draw(), fcn::Window::draw(), fcn::CheckBox::drawBox(), fcn::Window::drawInnerBorder(), fcn::FlowContainer::expandContent(), fcn::Container::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::MenuItem::measure(), fcn::Panel::mousePressed(), and fcn::Window::mousePressed().
|
virtual |
Gets the widget's parent container.
Definition at line 239 of file widget.cpp.
References mParent, and Widget().
Referenced by fcn::MenuBar::action(), adaptLayout(), fcn::DropDown::adjustHeight(), fcn::Gui::distributeKeyEvent(), fcn::Gui::distributeMouseEvent(), fcn::DropDown::dropDown(), fcn::Container::expandContent(), getAbsolutePosition(), getTop(), isDescendantOf(), isModalFocused(), isUnderMouseModal(), isVisible(), fcn::TextBox::keyPressed(), fcn::Window::mousePressed(), fcn::FlowContainer::resizeToContent(), and fcn::MenuPopup::show().
| Color const & fcn::Widget::getSelectionColor | ( | ) | const |
Gets the selection color.
Definition at line 772 of file widget.cpp.
References mSelectionColor.
Referenced by fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::LineGraph::draw(), fcn::ListBox::draw(), fcn::MenuItem::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::TextField::draw(), fcn::CheckBox::drawBox(), fcn::CheckBox::drawRhombus(), and drawSelectionFrame().
| Widget::SelectionMode fcn::Widget::getSelectionMode | ( | ) | const |
Gets the selection mode.
Definition at line 802 of file widget.cpp.
References mSelectionMode.
Referenced by fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), and fcn::CheckBox::drawBox().
|
virtual |
Gets the top widget, or top parent, of this widget.
Definition at line 1316 of file widget.cpp.
References getParent(), and Widget().
Referenced by fcn::MenuBar::addMenu(), fcn::MenuPopup::mousePressed(), fcn::ModalBackdrop::mousePressed(), and fcn::MenuPopup::show().
| unsigned int fcn::Widget::getVisibleChildrenCount | ( | ) | const |
Gets how many visible childs the widget have.
Definition at line 350 of file widget.cpp.
References mChildren.
|
inline |
Gets a widget at a certain position in the widget.
This function is used to decide which gets mouse input, thus it can be overloaded to change that behaviour.
| x | The x coordinate of the widget to get. |
| y | The y coordinate of the widget to get. |
Definition at line 1287 of file widget.hpp.
References getWidgetAt(), and Widget().
Referenced by fcn::DragHandler::findWidgetAt(), fcn::Gui::getWidgetAt(), getWidgetAt(), fcn::Gui::getWidgetsAt(), fcn::MenuBar::mousePressed(), and fcn::DragHandler::update().
Variant of getWidgetAt that allows excluding a specific widget from the hit-test.
| x | The x coordinate of the widget to get. |
| y | The y coordinate of the widget to get. |
| exclude | Widget to exclude from search, if Nullptr no widgets get excluded. |
Definition at line 1128 of file widget.cpp.
References getChildrenArea(), getDimension(), fcn::Rectangle::isContaining(), isVisible(), mChildren, Widget(), fcn::Rectangle::x, and fcn::Rectangle::y.
Gets all widgets inside a certain area of the widget.
| area | The area to check. |
Definition at line 1312 of file widget.hpp.
References getWidgetsIn().
Referenced by getWidgetsIn().
Gets all widgets inside a certain area of the widget.
| area | The area to check. |
| ignore | Optional widget pointer to exclude from the results. |
Definition at line 1333 of file widget.cpp.
References getDimension(), fcn::Rectangle::isIntersecting(), mChildren, and Widget().
| int fcn::Widget::getWidth | ( | ) | const |
Gets the width of the widget.
Definition at line 252 of file widget.cpp.
References mDimension.
Referenced by fcn::DropDown::adjustHeight(), fcn::Container::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::TabbedArea::adjustSize(), fcn::Window::adjustSize(), fcn::ImageButton::adjustSizeImpl(), fcn::ListBox::adjustSizeImpl(), fcn::TextBox::adjustSizeImpl(), fcn::TabbedArea::adjustTabPositions(), fcn::ScrollArea::checkPolicies(), contains(), fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::HorizontalBar::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::ListBox::draw(), fcn::MenuBar::draw(), fcn::MenuItem::draw(), fcn::MenuPopup::draw(), fcn::Panel::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::ScrollArea::draw(), fcn::Slider::draw(), fcn::StatusBar::draw(), fcn::Tab::draw(), fcn::TabbedArea::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::Tooltip::draw(), fcn::Window::draw(), drawBorder(), fcn::CheckBox::drawBox(), fcn::Window::drawInnerBorder(), fcn::Slider::drawMarker(), drawOutline(), fcn::CheckBox::drawRhombus(), drawSelectionFrame(), fcn::ScrollArea::expandContent(), fcn::TextField::fixScroll(), fcn::AdjustingContainer::getChildrenArea(), fcn::Container::getChildrenArea(), fcn::DropDown::getChildrenArea(), fcn::ScrollArea::getChildrenArea(), fcn::Tab::getChildrenArea(), fcn::TabbedArea::getChildrenArea(), fcn::Window::getChildrenArea(), fcn::ScrollArea::getDownButtonDimension(), fcn::ScrollArea::getHorizontalBarDimension(), fcn::ScrollArea::getHorizontalMarkerDimension(), fcn::ScrollArea::getHorizontalMaxScroll(), fcn::ScrollArea::getRightButtonDimension(), fcn::ScrollArea::getUpButtonDimension(), fcn::ScrollArea::getVerticalBarDimension(), fcn::Slider::markerPositionToValue(), fcn::ActivityBarItem::mouseEntered(), fcn::MenuPopup::mousePressed(), fcn::ModalBackdrop::mousePressed(), fcn::Slider::mousePressed(), resizeToChildren(), fcn::FlowContainer::resizeToContent(), fcn::HorizontalBar::resizeToContent(), fcn::Spacer::resizeToContent(), fcn::ScrollArea::setDimension(), fcn::ScrollArea::setWidth(), fcn::MenuPopup::show(), and fcn::Slider::valueToMarkerPosition().
| int fcn::Widget::getX | ( | ) | const |
Gets the x coordinate of the widget.
The coordinate is relative to the widget's parent.
Definition at line 288 of file widget.cpp.
References mDimension.
Referenced by fcn::MenuBar::action(), fcn::Window::mouseDragged(), resizeToChildren(), fcn::ScrollArea::showWidgetPart(), and showWidgetPart().
| int fcn::Widget::getY | ( | ) | const |
Gets the y coordinate of the widget.
The coordinate is relative to the widget's parent.
Definition at line 301 of file widget.cpp.
References mDimension.
Referenced by fcn::MenuBar::action(), fcn::DropDown::adjustHeight(), fcn::ListBox::draw(), fcn::Window::mouseDragged(), resizeToChildren(), fcn::ScrollArea::showWidgetPart(), and showWidgetPart().
| bool fcn::Widget::hasMouseCapture | ( | ) | const |
Checks if this widget currently has mouse capture.
Definition at line 1634 of file widget.cpp.
References sMouseCapture.
|
noexcept |
Checks if this widget is a descendant of (or equal to) the given ancestor.
Walks the parent chain to determine if this widget is somewhere in the ancestor's child tree.
| ancestor | The potential ancestor to check against. |
Definition at line 1639 of file widget.cpp.
References getParent(), and Widget().
Referenced by isInsideActiveMouseModal(), and fcn::FocusHandler::pushModal().
| bool fcn::Widget::isEnabled | ( | ) | const |
Checks if the widget is enabled.
A disabled widget will never receive mouse or key events.
Definition at line 1079 of file widget.cpp.
References isVisible(), and mEnabled.
Referenced by fcn::Gui::distributeKeyEvent(), fcn::Gui::distributeMouseEvent(), fcn::Gui::handleTextInput(), and isFocusable().
| bool fcn::Widget::isFixedSize | ( | ) | const |
Gets if the widget use a fixed size.
Definition at line 401 of file widget.cpp.
References mFixedSizeUsed.
Referenced by fcn::TextBox::adjustSizeImpl().
| bool fcn::Widget::isFocusable | ( | ) | const |
Checks if a widget is focusable.
Definition at line 655 of file widget.cpp.
References isEnabled(), isVisible(), and mFocusable.
Referenced by fcn::TabbedArea::mousePressed(), and requestFocus().
|
virtual |
Checks if the widget is focused.
Definition at line 624 of file widget.cpp.
References mFocused.
Referenced by fcn::BarGraph::draw(), fcn::Button::draw(), fcn::Container::draw(), fcn::CurveGraph::draw(), fcn::DropDown::draw(), fcn::Icon::draw(), fcn::IconProgressBar::draw(), fcn::ImageButton::draw(), fcn::ImageProgressBar::draw(), fcn::Label::draw(), fcn::LineGraph::draw(), fcn::PieGraph::draw(), fcn::PointGraph::draw(), fcn::TextBox::draw(), fcn::TextField::draw(), fcn::CheckBox::drawBox(), fcn::Slider::drawMarker(), fcn::CheckBox::drawRhombus(), fcn::TextField::fixScroll(), fcn::TabbedArea::keyPressed(), fcn::DropDown::mouseWheelMovedDown(), fcn::ListBox::mouseWheelMovedDown(), fcn::DropDown::mouseWheelMovedUp(), fcn::ListBox::mouseWheelMovedUp(), setFocusable(), and setVisible().
| bool fcn::Widget::isHorizontalExpand | ( | ) | const |
Gets if widget is horizontal expandable.
Definition at line 440 of file widget.cpp.
References mHExpand.
Referenced by fcn::FlowContainer::adjustContent(), fcn::HorizontalBar::adjustSize(), fcn::TextBox::adjustSizeImpl(), fcn::Container::expandContent(), and fcn::HorizontalBar::resizeToContent().
|
noexcept |
Checks if this widget is inside the active mouse modal root.
Walks up from this widget to find if it is contained within the widget returned by FocusHandler::getActiveMouseInputRoot().
Definition at line 1654 of file widget.cpp.
References isDescendantOf(), mFocusHandler, and Widget().
| bool fcn::Widget::isLastPositionSet | ( | ) | const |
Returns whether a last position has been stored for this widget.
Definition at line 1606 of file widget.cpp.
References mLastX, and mLastY.
Referenced by getAbsolutePosition().
|
inlinevirtual |
Helper function to decide if we need to layout.
Reimplemented in fcn::Container.
Definition at line 1614 of file widget.hpp.
Referenced by adaptLayout().
|
virtual |
Checks if a widget is modal focusable.
Definition at line 1084 of file widget.cpp.
References mFocusHandler, and fcn::throwException().
|
virtual |
Checks if the widget or it's parent has modal focus.
Definition at line 1102 of file widget.cpp.
References getParent(), isModalFocused(), mFocusHandler, and fcn::throwException().
Referenced by fcn::Gui::distributeKeyEvent(), fcn::Gui::distributeMouseEvent(), fcn::Gui::handleMousePressed(), and isModalFocused().
|
virtual |
Checks if a widget is modal mouse input focusable.
Definition at line 1093 of file widget.cpp.
References mFocusHandler, and fcn::throwException().
| bool fcn::Widget::isMouseInside | ( | MouseEvent const & | mouseEvent | ) | const |
Checks if a mouse event occurred within this widget.
| mouseEvent | The mouse event to check. |
Definition at line 275 of file widget.cpp.
References contains(), fcn::MouseEvent::getX(), and fcn::MouseEvent::getY().
Referenced by fcn::Button::mousePressed(), fcn::DropDown::mousePressed(), fcn::DropDown::mouseReleased(), fcn::DropDown::mouseWheelMovedDown(), and fcn::DropDown::mouseWheelMovedUp().
| bool fcn::Widget::isSetVisible | ( | ) | const |
Checks if the widget setting is visible.
Definition at line 732 of file widget.cpp.
References mVisible.
| bool fcn::Widget::isTabInEnabled | ( | ) | const |
Checks if tab in is enabled.
Tab in means that you can set focus to this widget by pressing the tab button. If tab in is disabled then the focus handler will skip this widget and focus the next in its focus order.
Definition at line 1045 of file widget.cpp.
References mTabIn.
| bool fcn::Widget::isTabOutEnabled | ( | ) | const |
Checks if tab out is enabled.
Tab out means that you can lose focus to this widget by pressing the tab button. If tab out is disabled then the FocusHandler ignores tabbing and focus will stay with this widget.
Definition at line 1055 of file widget.cpp.
References mTabOut.
|
virtual |
Checks if the widget or its parent is under a mouse modal.
Definition at line 1115 of file widget.cpp.
References getParent(), isUnderMouseModal(), mFocusHandler, and fcn::throwException().
Referenced by fcn::Gui::distributeMouseEvent(), isUnderMouseModal(), and fcn::DropDown::mouseReleased().
| bool fcn::Widget::isVerticalExpand | ( | ) | const |
Gets if widget is vertical expandable.
Definition at line 430 of file widget.cpp.
References mVExpand.
Referenced by fcn::FlowContainer::adjustContent(), fcn::TextBox::adjustSizeImpl(), and fcn::Container::expandContent().
| bool fcn::Widget::isVisible | ( | ) | const |
Checks if the widget is visible.
Definition at line 724 of file widget.cpp.
References getParent(), isVisible(), and mVisible.
Referenced by fcn::FlowContainer::adjustContent(), getWidgetAt(), isEnabled(), isFocusable(), and isVisible().
|
inlinevirtual |
Called for all widgets in the GUI each time Gui::logic is called.
You can do logic stuff here like playing an animation.
Reimplemented in fcn::ListBox, and fcn::ScrollArea.
Definition at line 467 of file widget.hpp.
Referenced by _logic(), and fcn::ScrollArea::logic().
|
virtual |
Moves a widget in this widget to the bottom of this widget.
The moved widget will be drawn below all other widgets in this widget.
This method is safe to call at any time.
| widget | The widget to move to the bottom. |
Definition at line 1477 of file widget.cpp.
References mChildren, fcn::throwException(), and Widget().
|
virtual |
Moves a widget to the top of this widget.
The moved widget will be drawn above all other widgets in this widget.
This method is safe to call at any time.
| widget | The widget to move to the top. |
Definition at line 1464 of file widget.cpp.
References mChildren, fcn::throwException(), and Widget().
Referenced by fcn::DropDown::dropDown(), fcn::Window::mousePressed(), and fcn::MenuPopup::show().
|
inlinevirtual |
Called when the widget focus changes.
Override this to perform custom actions when focus is gained or lost.
Definition at line 1187 of file widget.hpp.
Referenced by setFocused().
|
inlinevirtual |
Called when the widget gains focus.
Override this to perform custom actions when focus is gained.
Definition at line 1169 of file widget.hpp.
Referenced by setFocused().
|
inlinevirtual |
Called when the widget loses focus.
Override this to perform custom actions when focus is lost.
Definition at line 1178 of file widget.hpp.
Referenced by setFocused().
| void fcn::Widget::releaseMouse | ( | ) |
Releases mouse capture from this widget, if it has capture.
This method is idempotent - it's safe to call even if this widget doesn't currently have mouse capture.
Definition at line 1621 of file widget.cpp.
References sMouseCapture.
Referenced by fcn::Gui::releaseMouse().
|
protectedvirtual |
Removes a specific child from the widget.
THIS METHOD IS NOT SAFE TO CALL INSIDE A WIDGETS LOGIC FUNCTION INSIDE ANY LISTER FUNCTIONS!
| widget | The widget to remove. |
Reimplemented in fcn::AdjustingContainer, and fcn::Container.
Definition at line 1422 of file widget.cpp.
References _getVisibilityEventHandler(), _setFocusHandler(), _setParent(), getAbsolutePosition(), mChildren, setLastPosition(), fcn::throwException(), Widget(), and fcn::VisibilityEventHandler::widgetHidden().
Referenced by fcn::ActivityBarItem::mouseExited(), and fcn::Container::remove().
| void fcn::Widget::removeActionListener | ( | ActionListener * | actionListener | ) |
Removes an added action listener from the widget.
| actionListener | The action listener to remove. |
Definition at line 869 of file widget.cpp.
References mActionListeners.
|
protectedvirtual |
Remvoes all children from the widget.
THIS METHOD IS NOT SAFE TO CALL INSIDE A WIDGETS LOGIC FUNCTION INSIDE ANY LISTER FUNCTIONS!
Reimplemented in fcn::AdjustingContainer, and fcn::Container.
Definition at line 1402 of file widget.cpp.
References _getVisibilityEventHandler(), _setFocusHandler(), _setParent(), getAbsolutePosition(), mChildren, setLastPosition(), Widget(), and fcn::VisibilityEventHandler::widgetHidden().
Referenced by fcn::Container::removeAllChildren(), and fcn::ScrollArea::setContent().
| void fcn::Widget::removeDeathListener | ( | DeathListener * | deathListener | ) |
Removes an added death listener from the widget.
| deathListener | The death listener to remove. |
Definition at line 880 of file widget.cpp.
References mDeathListeners.
| void fcn::Widget::removeDropTargetListener | ( | DropTargetListener * | listener | ) |
Removes an added drop target listener from the widget.
| listener | The listener to remove. |
Definition at line 973 of file widget.cpp.
References mDropTargetListeners.
| void fcn::Widget::removeFocusListener | ( | FocusListener * | focusListener | ) |
Removes an added focus listener from the widget.
| focusListener | The focus listener to remove. |
Definition at line 902 of file widget.cpp.
References mFocusListeners.
| void fcn::Widget::removeKeyListener | ( | KeyListener * | keyListener | ) |
Removes an added key listener from the widget.
| keyListener | The key listener to remove. |
Definition at line 891 of file widget.cpp.
References mKeyListeners.
| void fcn::Widget::removeMouseListener | ( | MouseListener * | mouseListener | ) |
Removes an added mouse listener from the widget.
| mouseListener | The mouse listener to remove. |
Definition at line 913 of file widget.cpp.
References mMouseListeners.
| void fcn::Widget::removeWidgetListener | ( | WidgetListener * | widgetListener | ) |
Removes an added widget listener from the widget.
| widgetListener | The widget listener to remove. |
Definition at line 924 of file widget.cpp.
References mWidgetListeners.
|
virtual |
Requests focus for the widget.
A widget will only receive focus if it is focusable.
Definition at line 660 of file widget.cpp.
References isFocusable(), mFocusHandler, and fcn::throwException().
Referenced by fcn::MenuBar::action(), fcn::Gui::handleMousePressed(), fcn::MenuBar::keyPressed(), fcn::MenuBar::mousePressed(), fcn::TabbedArea::mousePressed(), and fcn::MenuPopup::show().
|
virtual |
Requests a move to the bottom in the parent widget.
Definition at line 678 of file widget.cpp.
References mParent.
|
virtual |
Requests a move to the top in the parent widget.
Definition at line 671 of file widget.cpp.
References mParent.
|
static |
Resets the global font, detaching it from the Widget class.
This allows the font to be destroyed externally after being detached.
Definition at line 1026 of file widget.cpp.
References mGlobalFont.
|
protected |
Resizes the widget to fit it's children exactly.
Definition at line 1344 of file widget.cpp.
References getHeight(), getWidth(), getX(), getY(), mChildren, setSize(), and Widget().
Referenced by fcn::Container::adjustSize(), fcn::Window::adjustSize(), and fcn::TabbedArea::resizeToContent().
|
inlinevirtual |
Resizes the widget's size to fit the content exactly, calls recursively all childs.
The default value true allows callers to use resizeToContent() without argument.
| recursion | If true, perform the resize operation recursively on children. |
Reimplemented in fcn::ActivityBar, fcn::AdjustingContainer, fcn::Button, fcn::Container, fcn::DropDown, fcn::FlowContainer, fcn::HorizontalBar, fcn::Icon, fcn::IconProgressBar, fcn::ImageButton, fcn::ImageProgressBar, fcn::Label, fcn::ListBox, fcn::ScrollArea, fcn::Spacer, fcn::TabbedArea, fcn::TextBox, and fcn::TextField.
Definition at line 1580 of file widget.hpp.
Referenced by adaptLayout(), fcn::Container::Container(), and fcn::ScrollArea::resizeToContent().
| void fcn::Widget::setActionEventId | ( | std::string const & | actionEventId | ) |
Sets the action event identifier of the widget.
The identifier is used to be able to identify which action has occurred.
| actionEventId | The action event identifier. |
Definition at line 619 of file widget.cpp.
References mActionEventId.
|
virtual |
Sets the background color.
| color | The background Color. |
Reimplemented in fcn::DropDown.
Definition at line 757 of file widget.cpp.
References mBackgroundColor.
Referenced by fcn::DropDown::setBackgroundColor(), and fcn::Slider::Slider().
|
virtual |
Sets the base color of the widget.
| color | The base color. |
Reimplemented in fcn::DropDown, and fcn::TabbedArea.
Definition at line 737 of file widget.cpp.
References mBaseColor.
Referenced by fcn::TabbedArea::addTab(), fcn::DropDown::setBaseColor(), fcn::TabbedArea::setBaseColor(), and fcn::Slider::Slider().
| void fcn::Widget::setBorderBottom | ( | unsigned int | size, |
| unsigned int | style ) |
Convenience helper: set a bottom-only border with size and style.
This sets the border size, selects the bottom side and applies style.
Definition at line 506 of file widget.cpp.
References setBorderSides(), setBorderSize(), and setBorderStyle().
Referenced by fcn::FlowContainer::expandContent(), and fcn::MenuBar::MenuBar().
|
virtual |
Sets the border color.
| color | The border color. |
Definition at line 787 of file widget.cpp.
References mBorderColor.
| void fcn::Widget::setBorderSides | ( | unsigned int | sides | ) |
Select which sides the border should be drawn on.
Default is BORDER_ALL.
Definition at line 479 of file widget.cpp.
References mBorderSides.
Referenced by fcn::FlowContainer::expandContent(), setBorderBottom(), and setBorderTop().
| void fcn::Widget::setBorderSize | ( | unsigned int | size | ) |
Sets the size of the widget's border.
The border is considered a part of the widget.
A border size of 0 means that the widget has no border. The default border size is 0.
| size | The size of the widget's border. |
Definition at line 469 of file widget.cpp.
References mBorderSize.
Referenced by fcn::FlowContainer::expandContent(), fcn::MenuItem::MenuItem(), fcn::MenuPopup::MenuPopup(), setBorderBottom(), setBorderTop(), fcn::Slider::Slider(), and fcn::Window::Window().
| void fcn::Widget::setBorderStyle | ( | unsigned int | style | ) |
Set border drawing style (bevel or flat).
Definition at line 489 of file widget.cpp.
References mBorderStyle.
Referenced by fcn::FlowContainer::expandContent(), fcn::MenuPopup::MenuPopup(), setBorderBottom(), and setBorderTop().
| void fcn::Widget::setBorderTop | ( | unsigned int | size, |
| unsigned int | style ) |
Convenience helper: set a top-only border with size and style.
This sets the border size, selects the top side and applies style.
Definition at line 499 of file widget.cpp.
References setBorderSides(), setBorderSize(), and setBorderStyle().
Referenced by fcn::FlowContainer::expandContent().
|
virtual |
Sets the dimension of the widget.
The dimension is relative to the widget's parent.
| dimension | The dimension of the widget. |
Reimplemented in fcn::ScrollArea, and fcn::TabbedArea.
Definition at line 315 of file widget.cpp.
References calculateSize(), distributeMovedEvent(), distributeResizedEvent(), fcn::Rectangle::height, mChildren, mDimension, fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::ScrollArea::setDimension(), fcn::TabbedArea::setDimension(), setHeight(), setPosition(), setSize(), setWidth(), setX(), and setY().
| void fcn::Widget::setEnabled | ( | bool | enabled | ) |
Sets the widget to enabled, or not.
A disabled widget will never receive mouse or key events.
| enabled | True if widget should be enabled, false otherwise. |
Definition at line 1074 of file widget.cpp.
References mEnabled.
Referenced by fcn::ModalBackdrop::ModalBackdrop().
| void fcn::Widget::setFixedSize | ( | Size const & | size | ) |
Sets the dimension of the widget to a fixed size.
To disable it, provide a size with negative values.
| size | The fixed size of the widget. |
Definition at line 385 of file widget.cpp.
References calculateSize(), mFixedSize, and mFixedSizeUsed.
| void fcn::Widget::setFocusable | ( | bool | focusable | ) |
Sets the widget to be focusable, or not.
| focusable | True if the widget should be focusable, false otherwise. |
Definition at line 646 of file widget.cpp.
References isFocused(), mFocusable, and mFocusHandler.
Referenced by fcn::Button::Button(), fcn::DropDown::DropDown(), fcn::ListBox::ListBox(), fcn::ModalBackdrop::ModalBackdrop(), fcn::Slider::Slider(), fcn::TextBox::TextBox(), and fcn::TextField::TextField().
|
virtual |
Sets the widget as focused, or not.
This method handles focus state changes and calls onFocusGained(), onFocusLost(), and onFocusChanged() hooks.
| focused | True if the widget should be focused, false otherwise. |
Definition at line 629 of file widget.cpp.
References mFocused, onFocusChanged(), onFocusGained(), and onFocusLost().
Referenced by fcn::FocusHandler::setFocusedWidget().
|
virtual |
Sets the font for the widget.
If Nullptr is passed, the global font will be used.
| font | The font to set for the widget. |
Reimplemented in fcn::DropDown.
Definition at line 1031 of file widget.cpp.
References fontChanged(), and mCurrentFont.
Referenced by fcn::DropDown::setFont().
|
virtual |
Sets the foreground color.
| color | The foreground color. |
Reimplemented in fcn::DropDown.
Definition at line 747 of file widget.cpp.
References mForegroundColor.
Referenced by fcn::DropDown::setForegroundColor(), and fcn::Slider::Slider().
|
static |
Sets the global font to be used by default for all widgets.
IMPORTANT: This method does not support resetting the font (use resetGlobalFont() instead).
| font | The global font (must not be null). |
Definition at line 1013 of file widget.cpp.
References mGlobalFont.
Referenced by fcn::Gui::setGlobalFont().
|
virtual |
Sets the height of the widget.
| height | The height of the widget. |
Reimplemented in fcn::ScrollArea, and fcn::TabbedArea.
Definition at line 257 of file widget.cpp.
References fcn::Rectangle::height, mDimension, and setDimension().
Referenced by fcn::DropDown::adjustHeight(), fcn::TextField::adjustHeight(), fcn::AdjustingContainer::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::ListBox::adjustSizeImpl(), fcn::HorizontalBar::resizeToContent(), fcn::ScrollArea::setDimension(), fcn::ScrollArea::setHeight(), fcn::TabbedArea::setHeight(), and fcn::StatusBar::StatusBar().
| void fcn::Widget::setHorizontalExpand | ( | bool | expand | ) |
Sets the widget to horizontal expandable.
| expand | True if the widget can be horizontal expanded, otherwise false. |
Definition at line 435 of file widget.cpp.
References mHExpand.
Referenced by fcn::HorizontalBar::adjustSize(), fcn::HorizontalBar::resizeToContent(), and fcn::Spacer::Spacer().
| void fcn::Widget::setId | ( | std::string const & | id | ) |
Sets an id of a widget.
The id is useful if a widget needs to be identified in a container. For example, if widgets are created by an XML document, a certain widget can be retrieved given that the widget has an id.
| id | The id to set to the widget. |
Definition at line 1190 of file widget.cpp.
References mId.
| void fcn::Widget::setInternalFocusHandler | ( | FocusHandler * | internalFocusHandler | ) |
Sets the internal focus handler.
An internal focus handler is needed, if both 'a widget in the widget' and 'the widget itself' should be focused at the same time.
| internalFocusHandler | The internal focus handler to be used. |
Definition at line 1176 of file widget.cpp.
References _getFocusHandler(), mChildren, and mInternalFocusHandler.
| void fcn::Widget::setLastPosition | ( | int | x, |
| int | y ) |
Stores the last known position for this widget.
| x | The x coordinate to store. |
| y | The y coordinate to store. |
Definition at line 1600 of file widget.cpp.
References mLastX, and mLastY.
Referenced by add(), remove(), and removeAllChildren().
| void fcn::Widget::setMargin | ( | int | margin | ) |
Sets all 4 margins to one value.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
| margin | The margin of the widget. |
Definition at line 513 of file widget.cpp.
References mMarginBottom, mMarginLeft, mMarginRight, and mMarginTop.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setMarginBottom | ( | int | margin | ) |
Sets the bottom margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
| margin | The bottom margin of the widget. |
Definition at line 541 of file widget.cpp.
References mMarginBottom.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setMarginLeft | ( | int | margin | ) |
Sets the left margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
| margin | The left margin of the widget. |
Definition at line 551 of file widget.cpp.
References mMarginLeft.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setMarginRight | ( | int | margin | ) |
Sets the right margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
| margin | The right margin of the widget. |
Definition at line 531 of file widget.cpp.
References mMarginRight.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setMarginTop | ( | int | margin | ) |
Sets the top margin.
The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent. It is also possible to use negative values, to overlap content.
| margin | The top margin of the widget. |
Definition at line 521 of file widget.cpp.
References mMarginTop.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setMaxSize | ( | Size const & | size | ) |
Sets the maximal dimension of the widget.
| size | The maximal size of the widget. |
Definition at line 374 of file widget.cpp.
References calculateSize(), and mMaxSize.
| void fcn::Widget::setMinSize | ( | Size const & | size | ) |
Sets the minimal dimension of the widget.
| size | The minimal size of the widget. |
Definition at line 363 of file widget.cpp.
References calculateSize(), and mMinSize.
|
virtual |
Sets the outline color.
| color | The outline color. |
Definition at line 777 of file widget.cpp.
References mOutlineColor.
| void fcn::Widget::setOutlineSize | ( | unsigned int | size | ) |
Sets the size of the widget's outline.
The outline is not considered as part of the widget, it only allows a outline to be drawn around the widget, thus a outline will never be included when calculating if a widget should receive events from user input. Also a widget's outline will never be included when calculating a widget's position.
A outline size of 0 means that the widget has no outline. The default outline size is 0.
| size | The size of the widget's outline. |
Definition at line 459 of file widget.cpp.
References mOutlineSize.
Referenced by draw().
| void fcn::Widget::setPadding | ( | unsigned int | padding | ) |
Sets all 4 paddings to one value.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
| padding | The top padding of the widget. |
Definition at line 561 of file widget.cpp.
References mPaddingBottom, mPaddingLeft, mPaddingRight, and mPaddingTop.
Referenced by fcn::FlowContainer::expandContent(), and fcn::Window::Window().
| void fcn::Widget::setPaddingBottom | ( | unsigned int | padding | ) |
Sets the bottom padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
| padding | The bottom padding of the widget. |
Definition at line 589 of file widget.cpp.
References mPaddingBottom.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setPaddingLeft | ( | unsigned int | padding | ) |
Sets the left padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
| padding | The left padding of the widget. |
Definition at line 599 of file widget.cpp.
References mPaddingLeft.
Referenced by fcn::FlowContainer::expandContent(), and fcn::MenuPopup::MenuPopup().
| void fcn::Widget::setPaddingRight | ( | unsigned int | padding | ) |
Sets the right padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
| padding | The right padding of the widget. |
Definition at line 579 of file widget.cpp.
References mPaddingRight.
Referenced by fcn::FlowContainer::expandContent(), and fcn::MenuPopup::MenuPopup().
| void fcn::Widget::setPaddingTop | ( | unsigned int | padding | ) |
Sets the top padding.
The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
| padding | The top padding of the widget. |
Definition at line 569 of file widget.cpp.
References mPaddingTop.
Referenced by fcn::FlowContainer::expandContent().
| void fcn::Widget::setPosition | ( | int | x, |
| int | y ) |
Sets position of the widget.
The position is relative to the widget's parent.
| x | The x coordinate of the widget. |
| y | The y coordinate of the widget. |
Definition at line 306 of file widget.cpp.
References mDimension, setDimension(), fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::Container::add(), fcn::TabbedArea::adjustTabPositions(), fcn::ScrollArea::logic(), fcn::Window::mouseDragged(), fcn::ScrollArea::setContent(), and fcn::MenuPopup::show().
|
virtual |
Sets the selection color.
| color | The selection color. |
Reimplemented in fcn::DropDown.
Definition at line 767 of file widget.cpp.
References mSelectionColor.
Referenced by fcn::DropDown::setSelectionColor().
|
virtual |
Sets the selection mode.
| mode | The selection mode that is used when the widget is "active". |
Definition at line 797 of file widget.cpp.
References mSelectionMode.
|
virtual |
Sets the size of the widget.
| width | The width of the widget. |
| height | The height of the widget. |
Reimplemented in fcn::TabbedArea.
Definition at line 1065 of file widget.cpp.
References fcn::Rectangle::height, mDimension, setDimension(), and fcn::Rectangle::width.
Referenced by fcn::ActivityBarItem::ActivityBarItem(), fcn::FlowContainer::adjustContent(), fcn::ActivityBar::adjustSize(), fcn::Container::adjustSize(), fcn::Window::adjustSize(), fcn::Button::adjustSizeImpl(), fcn::CheckBox::adjustSizeImpl(), fcn::Icon::adjustSizeImpl(), fcn::IconProgressBar::adjustSizeImpl(), fcn::ImageButton::adjustSizeImpl(), fcn::ImageProgressBar::adjustSizeImpl(), fcn::Label::adjustSizeImpl(), fcn::TextBox::adjustSizeImpl(), fcn::MenuPopup::MenuPopup(), resizeToChildren(), fcn::ActivityBar::resizeToContent(), fcn::Container::resizeToContent(), fcn::FlowContainer::resizeToContent(), fcn::Spacer::resizeToContent(), fcn::ActivityBarItem::setSize(), fcn::TabbedArea::setSize(), and fcn::ActivityBar::setWidth().
| void fcn::Widget::setTabInEnabled | ( | bool | enabled | ) |
Sets tab in enabled, or not.
Tab in means that you can set focus to this widget by pressing the tab button. If tab in is disabled then the FocusHandler will skip this widget and focus the next in its focus order.
| enabled | True if tab in should be enabled, false otherwise. |
Definition at line 1050 of file widget.cpp.
References mTabIn.
| void fcn::Widget::setTabOutEnabled | ( | bool | enabled | ) |
Sets tab out enabled.
Tab out means that you can lose focus to this widget by pressing the tab button. If tab out is disabled then the FocusHandler ignores tabbing and focus will stay with this widget.
| enabled | True if tab out should be enabled, false otherwise. |
Definition at line 1060 of file widget.cpp.
References mTabOut.
| void fcn::Widget::setVerticalExpand | ( | bool | expand | ) |
Sets the widget to vertical expandable.
| expand | True if the widget can be vertical expanded, otherwise false. |
Definition at line 425 of file widget.cpp.
References mVExpand.
Referenced by fcn::Spacer::Spacer().
| void fcn::Widget::setVisible | ( | bool | visible | ) |
Sets the widget to be visible, or not.
| visible | True if widget should be visible, false otherwise. |
Definition at line 685 of file widget.cpp.
References _getVisibilityEventHandler(), distributeHiddenEvent(), distributeShownEvent(), isFocused(), mChildren, mFocusHandler, mVisible, fcn::VisibilityEventHandler::widgetHidden(), and fcn::VisibilityEventHandler::widgetShown().
Referenced by fcn::MenuBar::addMenu(), fcn::MenuPopup::hide(), fcn::Panel::setVisible(), and fcn::MenuPopup::show().
|
virtual |
Sets the width of the widget.
| width | The width of the widget. |
Reimplemented in fcn::ActivityBar, fcn::ScrollArea, and fcn::TabbedArea.
Definition at line 244 of file widget.cpp.
References mDimension, setDimension(), and fcn::Rectangle::width.
Referenced by fcn::AdjustingContainer::adjustSize(), fcn::HorizontalBar::adjustSize(), fcn::Panel::adjustSize(), fcn::ListBox::adjustSizeImpl(), fcn::TextField::adjustSizeImpl(), fcn::DropDown::DropDown(), fcn::ListBox::ListBox(), fcn::PrimaryPanel::PrimaryPanel(), fcn::HorizontalBar::resizeToContent(), fcn::SecondaryPanel::SecondaryPanel(), fcn::ScrollArea::setDimension(), fcn::ScrollArea::setWidth(), and fcn::TabbedArea::setWidth().
| void fcn::Widget::setX | ( | int | x | ) |
Sets the x coordinate of the widget.
The coordinate is relative to the widget's parent.
| x | The x coordinate of the widget. |
Definition at line 280 of file widget.cpp.
References mDimension, setDimension(), and fcn::Rectangle::x.
Referenced by showWidgetPart().
| void fcn::Widget::setY | ( | int | y | ) |
Sets the y coordinate of the widget.
The coordinate is relative to the widget's parent.
| y | The y coordinate of the widget. |
Definition at line 293 of file widget.cpp.
References mDimension, setDimension(), and fcn::Rectangle::y.
Referenced by showWidgetPart().
|
virtual |
Shows a certain part of a widget in the widget's parent.
Used when widgets want a specific part to be visible in its parent. An example is a TextArea that wants a specific part of its text to be visible when a TextArea is a child of a ScrollArea.
| rectangle | The rectangle to be shown. |
Definition at line 1309 of file widget.cpp.
References mParent.
Referenced by fcn::TextBox::scrollToCaret(), and fcn::ListBox::setSelected().
Tries to show a specific part of a widget by moving it.
Used if the widget should act as a container.
| widget | The target widget. |
| area | The area to show. |
Reimplemented in fcn::ScrollArea.
Definition at line 1378 of file widget.cpp.
References getChildrenArea(), getX(), getY(), fcn::Rectangle::height, setX(), setY(), Widget(), fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by fcn::ScrollArea::showWidgetPart().
|
inlinevirtual |
Called when text input (IME, dead-key, paste) is received.
Override this to handle text input in your widget. The default implementation does nothing.
| event | The text input event containing the UTF-8 text. |
Reimplemented in fcn::TextBox, and fcn::TextField.
Definition at line 479 of file widget.hpp.
Referenced by fcn::Gui::handleTextInput().
|
static |
Checks if a widget exists or not, that is if it still exists an instance of the object.
| widget | The widget to check. |
Definition at line 1037 of file widget.cpp.
References Widget().
Referenced by _setFocusHandler(), fcn::Gui::distributeKeyEvent(), fcn::Gui::distributeMouseEvent(), and fcn::Gui::handleHiddenWidgets().
|
friend |
Definition at line 105 of file widget.hpp.
|
protected |
Holds the action event of the widget.
Definition at line 1987 of file widget.hpp.
Referenced by distributeActionEvent(), getActionEventId(), and setActionEventId().
|
protected |
Holds the action listeners of the widget.
Definition at line 1836 of file widget.hpp.
Referenced by addActionListener(), distributeActionEvent(), and removeActionListener().
|
protected |
Holds the background color of the widget.
Definition at line 1866 of file widget.hpp.
Referenced by getBackgroundColor(), and setBackgroundColor().
|
protected |
Holds the base color of the widget.
Definition at line 1871 of file widget.hpp.
Referenced by getBaseColor(), and setBaseColor().
|
protected |
Holds the border color of the widget.
Definition at line 1886 of file widget.hpp.
Referenced by getBorderColor(), and setBorderColor().
|
protected |
Which sides to draw the border on (bitmask of BorderSide).
Definition at line 1930 of file widget.hpp.
Referenced by drawBorder(), getBorderSides(), and setBorderSides().
|
protected |
Holds the border size of the widget.
Definition at line 1923 of file widget.hpp.
Referenced by getBorderSize(), and setBorderSize().
|
protected |
Border drawing style (see BorderStyle).
Definition at line 1937 of file widget.hpp.
Referenced by drawBorder(), getBorderStyle(), and setBorderStyle().
|
protected |
Holds all children of the widget.
Definition at line 2099 of file widget.hpp.
Referenced by _draw(), _logic(), _setFocusHandler(), add(), fcn::FlowContainer::adjustContent(), distributeAncestorHiddenEvent(), distributeAncestorMovedEvent(), distributeAncestorShownEvent(), fcn::Container::expandContent(), fcn::FlowContainer::expandContent(), findWidgetById(), focusNext(), focusPrevious(), getChildren(), getChildrenCount(), fcn::ScrollArea::getContent(), getVisibleChildrenCount(), getWidgetAt(), getWidgetsIn(), moveToBottom(), moveToTop(), remove(), removeAllChildren(), resizeToChildren(), fcn::Container::resizeToContent(), fcn::FlowContainer::resizeToContent(), setDimension(), setInternalFocusHandler(), and setVisible().
|
protected |
Holds the font used by the widget.
Definition at line 2060 of file widget.hpp.
|
protected |
Holds the death listeners of the widget.
Definition at line 1841 of file widget.hpp.
Referenced by addDeathListener(), and removeDeathListener().
|
staticprotected |
Holds the default font used by the widget.
Definition at line 2065 of file widget.hpp.
Referenced by getFont().
|
protected |
Holds the dimension of the widget.
Definition at line 1908 of file widget.hpp.
Referenced by _draw(), calculateSize(), getAbsolutePosition(), getDimension(), getHeight(), getWidth(), getX(), getY(), fcn::TabbedArea::setDimension(), setDimension(), fcn::TabbedArea::setHeight(), setHeight(), setPosition(), fcn::TabbedArea::setSize(), setSize(), fcn::TabbedArea::setWidth(), setWidth(), setX(), and setY().
|
protected |
Holds the drop target listeners of the widget.
Definition at line 1856 of file widget.hpp.
Referenced by addDropTargetListener(), distributeDragDrop(), distributeDragEnter(), distributeDragHover(), distributeDragLeave(), and removeDropTargetListener().
|
protected |
True if the widget is enabled, false otherwise.
Definition at line 2017 of file widget.hpp.
Referenced by isEnabled(), and setEnabled().
|
protected |
Holds the fixed size.
Definition at line 2040 of file widget.hpp.
Referenced by calculateSize(), getFixedSize(), and setFixedSize().
|
protected |
True if the widget used a fixed size.
Definition at line 2045 of file widget.hpp.
Referenced by calculateSize(), isFixedSize(), and setFixedSize().
|
protected |
True if the widget focusable, false otherwise.
Definition at line 1992 of file widget.hpp.
Referenced by isFocusable(), and setFocusable().
|
protected |
True if the widget has focus, false otherwise.
Definition at line 1997 of file widget.hpp.
Referenced by isFocused(), and setFocused().
|
protected |
Holds the focus handler used by the widget.
Definition at line 1891 of file widget.hpp.
Referenced by _getFocusHandler(), _setFocusHandler(), fcn::DropDown::action(), fcn::DropDown::focusLost(), fcn::DropDown::foldUp(), isInsideActiveMouseModal(), isModalFocusable(), isModalFocused(), isModalMouseInputFocusable(), isUnderMouseModal(), fcn::DropDown::mousePressed(), fcn::DropDown::mouseReleased(), requestFocus(), setFocusable(), and setVisible().
|
protected |
Holds the focus listeners of the widget.
Definition at line 1846 of file widget.hpp.
Referenced by _getFocusListeners(), addFocusListener(), and removeFocusListener().
|
protected |
Holds the foreground color of the widget.
Definition at line 1861 of file widget.hpp.
Referenced by getForegroundColor(), and setForegroundColor().
|
staticprotected |
Holds the global font used by the widget.
Definition at line 2070 of file widget.hpp.
Referenced by getFont(), resetGlobalFont(), and setGlobalFont().
|
staticprotected |
Holds the death listener used by the widgets.
Definition at line 2089 of file widget.hpp.
Referenced by _getGuiDeathListener(), and _setGuiDeathListener().
|
protected |
True if the widget can be horizontal expanded.
Definition at line 2055 of file widget.hpp.
Referenced by isHorizontalExpand(), and setHorizontalExpand().
|
protected |
Holds the id of the widget.
Definition at line 2022 of file widget.hpp.
|
protected |
Holds the focus handler used by the widget.
Nullptr if no internal focus handler is used.
Definition at line 1897 of file widget.hpp.
Referenced by _getInternalFocusHandler(), _setFocusHandler(), add(), and setInternalFocusHandler().
|
protected |
Holds the key listeners of the widget.
Definition at line 1831 of file widget.hpp.
Referenced by _getKeyListeners(), addKeyListener(), and removeKeyListener().
|
protected |
Last stored X coordinate used for layout and event calculations.
Definition at line 2102 of file widget.hpp.
Referenced by getAbsolutePosition(), getLastPosition(), isLastPositionSet(), and setLastPosition().
|
protected |
Last stored Y coordinate used for layout and event calculations.
Definition at line 2105 of file widget.hpp.
Referenced by getAbsolutePosition(), getLastPosition(), isLastPositionSet(), and setLastPosition().
|
protected |
Holds the bottom margin of the widget.
Definition at line 1957 of file widget.hpp.
Referenced by getMarginBottom(), setMargin(), and setMarginBottom().
|
protected |
Holds the left margin of the widget.
Definition at line 1962 of file widget.hpp.
Referenced by getMarginLeft(), setMargin(), and setMarginLeft().
|
protected |
Holds the top right of the widget.
Definition at line 1952 of file widget.hpp.
Referenced by getMarginRight(), setMargin(), and setMarginRight().
|
protected |
Holds the top margin of the widget.
Definition at line 1947 of file widget.hpp.
Referenced by getMarginTop(), setMargin(), and setMarginTop().
|
protected |
Holds the max size.
Default to a very large value so widgets are not clamped to zero when the user does not explicitly set a max size.
Definition at line 2035 of file widget.hpp.
Referenced by calculateSize(), getMaxSize(), and setMaxSize().
|
protected |
Holds the min size.
Definition at line 2027 of file widget.hpp.
Referenced by calculateSize(), getMinSize(), and setMinSize().
|
protected |
Holds the mouse listeners of the widget.
Definition at line 1826 of file widget.hpp.
Referenced by _getMouseListeners(), addMouseListener(), and removeMouseListener().
|
protected |
Holds the offset dimension of the widget.
Definition at line 1913 of file widget.hpp.
|
protected |
Holds the outline color of the widget.
Definition at line 1881 of file widget.hpp.
Referenced by getOutlineColor(), and setOutlineColor().
|
protected |
Holds the outline size of the widget.
Definition at line 1918 of file widget.hpp.
Referenced by _draw(), getOutlineSize(), and setOutlineSize().
|
protected |
Holds the bottom padding of the widget.
Definition at line 1977 of file widget.hpp.
Referenced by fcn::AdjustingContainer::adjustSize(), getPaddingBottom(), setPadding(), and setPaddingBottom().
|
protected |
Holds the left padding of the widget.
Definition at line 1982 of file widget.hpp.
Referenced by fcn::AdjustingContainer::adjustContent(), fcn::AdjustingContainer::adjustSize(), getPaddingLeft(), setPadding(), and setPaddingLeft().
|
protected |
Holds the right padding of the widget.
Definition at line 1972 of file widget.hpp.
Referenced by fcn::AdjustingContainer::adjustSize(), getPaddingRight(), setPadding(), and setPaddingRight().
|
protected |
Holds the top padding of the widget.
Definition at line 1967 of file widget.hpp.
Referenced by fcn::AdjustingContainer::adjustContent(), fcn::AdjustingContainer::adjustSize(), getPaddingTop(), setPadding(), and setPaddingTop().
|
protected |
Holds the parent of the widget.
Nullptr if the widget has no parent.
Definition at line 1903 of file widget.hpp.
Referenced by _setParent(), getParent(), requestMoveToBottom(), requestMoveToTop(), and showPart().
|
protected |
Holds the selection color of the widget.
Definition at line 1876 of file widget.hpp.
Referenced by getSelectionColor(), and setSelectionColor().
|
protected |
Holds the selection mode.
Definition at line 1942 of file widget.hpp.
Referenced by getSelectionMode(), and setSelectionMode().
|
protected |
True if the widget has tab in enabled, false otherwise.
Definition at line 2007 of file widget.hpp.
Referenced by isTabInEnabled(), and setTabInEnabled().
|
protected |
True if the widget has tab in enabled, false otherwise.
Definition at line 2012 of file widget.hpp.
Referenced by isTabOutEnabled(), and setTabOutEnabled().
|
protected |
True if the widget can be vertical expanded.
Definition at line 2050 of file widget.hpp.
Referenced by isVerticalExpand(), and setVerticalExpand().
|
staticprotected |
Holds the visibility event handler used by the widgets.
Definition at line 2084 of file widget.hpp.
Referenced by _getVisibilityEventHandler(), and _setVisibilityEventHandler().
|
protected |
True if the widget visible, false otherwise.
Definition at line 2002 of file widget.hpp.
Referenced by isSetVisible(), isVisible(), and setVisible().
|
staticprotected |
Holds a list of all instances of widgets.
Definition at line 2075 of file widget.hpp.
|
protected |
Holds the widget listeners of the widget.
Definition at line 1851 of file widget.hpp.
Referenced by addWidgetListener(), distributeAncestorHiddenEvent(), distributeAncestorMovedEvent(), distributeAncestorShownEvent(), distributeHiddenEvent(), distributeMovedEvent(), distributeResizedEvent(), distributeShownEvent(), and removeWidgetListener().
|
staticprotected |
Holds the widget that currently has mouse capture.
Definition at line 2094 of file widget.hpp.
Referenced by captureMouse(), getMouseCapture(), hasMouseCapture(), and releaseMouse().