|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <scrollarea.hpp>
Public Types | |
| enum class | ScrollPolicy : uint8_t { ShowAlways = 0 , ShowNever , ShowAuto } |
| Public Types inherited from fcn::Widget | |
| 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 | |
| void | adjustSize () override |
| void | draw (Graphics *graphics) override |
| void | expandContent () |
| void | expandContent (bool recursion) override |
| Rectangle | getChildrenArea () override |
| Widget * | getContent () const |
| int | getDownButtonScrollAmount () const |
| int | getHorizontalMaxScroll () |
| int | getHorizontalScrollAmount () const |
| ScrollPolicy | getHorizontalScrollPolicy () const |
| int | getLeftButtonScrollAmount () const |
| int | getRightButtonScrollAmount () const |
| int | getScrollbarWidth () const |
| int | getUpButtonScrollAmount () const |
| int | getVerticalMaxScroll () |
| int | getVerticalScrollAmount () const |
| ScrollPolicy | getVerticalScrollPolicy () const |
| virtual Widget * | getWidgetAt (int x, int y) |
| bool | isOpaque () const |
| void | logic () override |
| void | mouseDragged (MouseEvent &mouseEvent) override |
| void | mousePressed (MouseEvent &mouseEvent) override |
| void | mouseReleased (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedDown (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedLeft (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedRight (MouseEvent &mouseEvent) override |
| void | mouseWheelMovedUp (MouseEvent &mouseEvent) override |
| ScrollArea & | operator= (ScrollArea &&)=delete |
| ScrollArea & | operator= (ScrollArea const &)=delete |
| void | resizeToContent (bool recursion=true) override |
| ScrollArea (ScrollArea &&)=delete | |
| ScrollArea (ScrollArea const &)=delete | |
| ScrollArea (Widget *content) | |
| ScrollArea (Widget *content, ScrollPolicy hPolicy, ScrollPolicy vPolicy) | |
| void | setContent (Widget *widget) |
| void | setDimension (Rectangle const &dimension) override |
| void | setDownButtonScrollAmount (int amount) |
| void | setHeight (int height) override |
| void | setHorizontalScrollAmount (int hScroll) |
| void | setHorizontalScrollPolicy (ScrollPolicy hPolicy) |
| void | setLeftButtonScrollAmount (int amount) |
| void | setOpaque (bool opaque) |
| void | setRightButtonScrollAmount (int amount) |
| void | setScrollAmount (int hScroll, int vScroll) |
| void | setScrollbarWidth (int width) |
| void | setScrollPolicy (ScrollPolicy hPolicy, ScrollPolicy vPolicy) |
| void | setUpButtonScrollAmount (int amount) |
| void | setVerticalScrollAmount (int vScroll) |
| void | setVerticalScrollPolicy (ScrollPolicy vPolicy) |
| void | setWidth (int width) override |
| void | showWidgetPart (Widget *widget, Rectangle area) override |
| Public Member Functions inherited from fcn::MouseListener | |
| virtual void | mouseClicked (MouseEvent &mouseEvent) |
| virtual void | mouseEntered (MouseEvent &mouseEvent) |
| virtual void | mouseExited (MouseEvent &mouseEvent) |
| MouseListener (MouseListener &&)=default | |
| MouseListener (MouseListener const &)=default | |
| virtual void | mouseMoved (MouseEvent &mouseEvent) |
| MouseListener & | operator= (MouseListener &&)=default |
| MouseListener & | operator= (MouseListener const &)=default |
| Public Member Functions inherited from fcn::Widget | |
| 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) |
| bool | captureMouse () |
| bool | contains (int x, int y) const |
| 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 | 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 |
| 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 | 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 () |
| 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) |
| 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) |
| 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) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| virtual void | textInput (TextInputEvent &event) |
| Widget () | |
| Widget (Widget &&)=delete | |
| Widget (Widget const &)=delete | |
Additional Inherited Members | |
| Static Public Member Functions inherited from fcn::Widget | |
| 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) |
| Static Protected Attributes inherited from fcn::Widget | |
| static DefaultFont | mDefaultFont |
| static Font * | mGlobalFont = nullptr |
| static DeathListener * | mGuiDeathListener = nullptr |
| static VisibilityEventHandler * | mVisibilityEventHandler = nullptr |
| static std::list< Widget * > | mWidgetInstances |
| static Widget * | sMouseCapture = nullptr |
A scrollable viewport for viewing widgets larger than the visible area.
Implementation if a scrollable area used to view widgets larger than the scroll area. A scroll area can be customized to always show scroll bars or to show them only when necessary.
Definition at line 29 of file scrollarea.hpp.
|
strong |
Scroll policies for the horizontal and vertical scrollbar.
The policies are:
SHOW_ALWAYS - Always show the scrollbars no matter what. SHOW_NEVER - Never show the scrollbars no matter what. SHOW_AUTO - Show the scrollbars only when needed. That is if the content grows larger then the ScrollArea.
Definition at line 41 of file scrollarea.hpp.
| fcn::ScrollArea::ScrollArea | ( | ) |
Definition at line 19 of file scrollarea.cpp.
|
explicit |
Constructor.
| content | The content of the scroll area. |
Definition at line 24 of file scrollarea.cpp.
References fcn::Widget::addMouseListener(), setContent(), and fcn::Widget::Widget().
| fcn::ScrollArea::ScrollArea | ( | Widget * | content, |
| ScrollPolicy | hPolicy, | ||
| ScrollPolicy | vPolicy ) |
Constructor.
| content | The content of the scroll area. |
| hPolicy | The policy for the horizontal scrollbar. See enum with policies. |
| vPolicy | The policy for the vertical scrollbar. See enum with policies. |
Definition at line 31 of file scrollarea.cpp.
References fcn::Widget::addMouseListener(), setContent(), and fcn::Widget::Widget().
|
override |
Definition at line 38 of file scrollarea.cpp.
|
overridevirtual |
Resizes the widget's size to fit the content exactly.
Reimplemented from fcn::Widget.
Definition at line 1018 of file scrollarea.cpp.
References fcn::Widget::adjustSize(), getContent(), fcn::Size::getHeight(), fcn::Widget::getMinSize(), fcn::Size::getWidth(), setHeight(), setWidth(), and fcn::Widget::Widget().
|
protectedvirtual |
Checks the policies for the scroll bars.
Definition at line 643 of file scrollarea.cpp.
References getContent(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), mHBarVisible, mHPolicy, mScrollbarWidth, mVBarVisible, mVPolicy, and fcn::throwException().
Referenced by expandContent(), getHorizontalMaxScroll(), getVerticalMaxScroll(), logic(), setContent(), setDimension(), setHeight(), setHorizontalScrollPolicy(), setScrollPolicy(), setVerticalScrollPolicy(), and setWidth().
|
overridevirtual |
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. |
Implements fcn::Widget.
Definition at line 281 of file scrollarea.cpp.
References drawBackground(), drawDownButton(), drawHBar(), drawHMarker(), drawLeftButton(), drawRightButton(), drawUpButton(), drawVBar(), drawVMarker(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, mVBarVisible, and fcn::Graphics::setColor().
|
protectedvirtual |
Draws the background of the scroll area, that is the area behind the content.
| graphics | a Graphics object to draw with. |
Definition at line 348 of file scrollarea.cpp.
References fcn::Graphics::fillRectangle(), fcn::Widget::getBackgroundColor(), getChildrenArea(), isOpaque(), and fcn::Graphics::setColor().
Referenced by draw().
|
protectedvirtual |
Draws the down button.
| graphics | a Graphics object to draw with. |
Definition at line 411 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), getDownButtonDimension(), fcn::Widget::getForegroundColor(), fcn::Rectangle::height, mDownButtonPressed, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the horizontal scroll bar.
| graphics | a Graphics object to draw with. |
Definition at line 306 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBackgroundColor(), getHorizontalBarDimension(), fcn::Rectangle::height, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the horizontal marker.
| graphics | a Graphics object to draw with. |
Definition at line 602 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), getHorizontalMarkerDimension(), fcn::Rectangle::height, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the left button.
| graphics | a Graphics object to draw with. |
Definition at line 466 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getForegroundColor(), getLeftButtonDimension(), fcn::Rectangle::height, mLeftButtonPressed, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the right button.
| graphics | a Graphics object to draw with. |
Definition at line 520 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getForegroundColor(), getRightButtonDimension(), fcn::Rectangle::height, mRightButtonPressed, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the up button.
| graphics | a Graphics object to draw with. |
Definition at line 356 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), fcn::Widget::getForegroundColor(), getUpButtonDimension(), fcn::Rectangle::height, mUpButtonPressed, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the vertical scroll bar.
| graphics | a Graphics object to draw with. |
Definition at line 327 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBackgroundColor(), getVerticalBarDimension(), fcn::Rectangle::height, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
protectedvirtual |
Draws the vertical marker.
| graphics | a Graphics object to draw with. |
Definition at line 575 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), getVerticalMarkerDimension(), fcn::Rectangle::height, fcn::Graphics::popClipArea(), fcn::Graphics::pushClipArea(), fcn::Graphics::setColor(), and fcn::Rectangle::width.
Referenced by draw().
|
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.
|
overridevirtual |
Expands child widgets to fit this widget's size.
| recursion | If true, call expandContent recursively on children. |
Reimplemented from fcn::Widget.
Definition at line 1029 of file scrollarea.cpp.
References checkPolicies(), fcn::Widget::expandContent(), getContent(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), setHeight(), setWidth(), and fcn::Widget::Widget().
|
overridevirtual |
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 from fcn::Widget.
Definition at line 770 of file scrollarea.cpp.
References fcn::Widget::getHeight(), fcn::Widget::getWidth(), fcn::Rectangle::isEmpty(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawBackground(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalMarkerDimension(), getVerticalMaxScroll(), getWidgetAt(), mousePressed(), mouseWheelMovedDown(), mouseWheelMovedLeft(), mouseWheelMovedRight(), and mouseWheelMovedUp().
| Widget * fcn::ScrollArea::getContent | ( | ) | const |
Gets the content.
Definition at line 60 of file scrollarea.cpp.
References fcn::Widget::mChildren, and fcn::Widget::Widget().
Referenced by adjustSize(), checkPolicies(), expandContent(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalMarkerDimension(), getVerticalMaxScroll(), getWidgetAt(), logic(), resizeToContent(), setDimension(), setHeight(), setWidth(), and showWidgetPart().
|
protected |
Gets the down button dimension.
Definition at line 731 of file scrollarea.cpp.
References fcn::Widget::getHeight(), fcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawDownButton(), getVerticalBarDimension(), and mousePressed().
| int fcn::ScrollArea::getDownButtonScrollAmount | ( | ) | const |
Gets the amount to scroll in pixels when the down scroll button is pushed.
Definition at line 1078 of file scrollarea.cpp.
References mDownButtonScrollAmount.
|
protected |
Gets the horizontal scrollbar dimension.
Definition at line 805 of file scrollarea.cpp.
References fcn::Widget::getHeight(), getLeftButtonDimension(), getRightButtonDimension(), fcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, mVBarVisible, and fcn::Rectangle::width.
Referenced by drawHBar(), getHorizontalMarkerDimension(), mouseDragged(), and mousePressed().
|
protected |
Gets the horizontal marker dimension.
Definition at line 856 of file scrollarea.cpp.
References getChildrenArea(), getContent(), getHorizontalBarDimension(), getHorizontalMaxScroll(), getHorizontalScrollAmount(), fcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by drawHMarker(), mouseDragged(), and mousePressed().
| int fcn::ScrollArea::getHorizontalMaxScroll | ( | ) |
Gets the maximum amount of horizontal scroll.
Definition at line 142 of file scrollarea.cpp.
References checkPolicies(), fcn::Widget::getBorderSize(), getChildrenArea(), getContent(), fcn::Widget::getWidth(), and fcn::Rectangle::width.
Referenced by getHorizontalMarkerDimension(), mouseDragged(), and setHorizontalScrollAmount().
| int fcn::ScrollArea::getHorizontalScrollAmount | ( | ) | const |
Gets the amount that is scrolled horizontally.
Definition at line 131 of file scrollarea.cpp.
References mHScroll.
Referenced by getHorizontalMarkerDimension(), logic(), mousePressed(), mouseWheelMovedLeft(), and mouseWheelMovedRight().
| ScrollArea::ScrollPolicy fcn::ScrollArea::getHorizontalScrollPolicy | ( | ) | const |
Gets the horizontal scrollbar policy.
See enum with policies.
Definition at line 75 of file scrollarea.cpp.
References mHPolicy.
|
protected |
Gets the left button dimension.
Definition at line 746 of file scrollarea.cpp.
References fcn::Widget::getHeight(), mHBarVisible, and mScrollbarWidth.
Referenced by drawLeftButton(), getHorizontalBarDimension(), and mousePressed().
| int fcn::ScrollArea::getLeftButtonScrollAmount | ( | ) | const |
Gets the amount to scroll in pixels when the left scroll button is pushed.
Definition at line 1063 of file scrollarea.cpp.
References mLeftButtonScrollAmount.
|
protected |
Gets the right button dimension.
Definition at line 755 of file scrollarea.cpp.
References fcn::Widget::getHeight(), fcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawRightButton(), getHorizontalBarDimension(), and mousePressed().
| int fcn::ScrollArea::getRightButtonScrollAmount | ( | ) | const |
Gets the amount to scroll in pixels when the right scroll button is pushed.
Definition at line 1068 of file scrollarea.cpp.
References mRightButtonScrollAmount.
| int fcn::ScrollArea::getScrollbarWidth | ( | ) | const |
Gets the width of the scroll bars.
Definition at line 187 of file scrollarea.cpp.
References mScrollbarWidth.
|
protected |
Gets the up button dimension.
Definition at line 722 of file scrollarea.cpp.
References fcn::Widget::getWidth(), mScrollbarWidth, and mVBarVisible.
Referenced by drawUpButton(), getVerticalBarDimension(), and mousePressed().
| int fcn::ScrollArea::getUpButtonScrollAmount | ( | ) | const |
Gets the amount to scroll in pixels when the up scroll button is pushed.
Definition at line 1073 of file scrollarea.cpp.
References mUpButtonScrollAmount.
|
protected |
Gets the vertical scrollbar dimension.
Definition at line 784 of file scrollarea.cpp.
References getDownButtonDimension(), fcn::Widget::getHeight(), getUpButtonDimension(), fcn::Widget::getWidth(), fcn::Rectangle::height, mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawVBar(), getVerticalMarkerDimension(), mouseDragged(), and mousePressed().
|
protected |
Gets the vertical marker dimension.
Definition at line 826 of file scrollarea.cpp.
References getChildrenArea(), getContent(), fcn::Widget::getHeight(), getVerticalBarDimension(), getVerticalMaxScroll(), getVerticalScrollAmount(), fcn::Rectangle::height, mScrollbarWidth, mVBarVisible, fcn::Rectangle::x, and fcn::Rectangle::y.
Referenced by drawVMarker(), mouseDragged(), and mousePressed().
| int fcn::ScrollArea::getVerticalMaxScroll | ( | ) |
Gets the maximum amount of vertical scroll.
Definition at line 159 of file scrollarea.cpp.
References checkPolicies(), fcn::Widget::getBorderSize(), getChildrenArea(), getContent(), fcn::Widget::getHeight(), and fcn::Rectangle::height.
Referenced by getVerticalMarkerDimension(), mouseDragged(), and setVerticalScrollAmount().
| int fcn::ScrollArea::getVerticalScrollAmount | ( | ) | const |
Gets the amount that is scrolled vertically.
Definition at line 113 of file scrollarea.cpp.
References mVScroll.
Referenced by getVerticalMarkerDimension(), logic(), mousePressed(), mouseWheelMovedDown(), and mouseWheelMovedUp().
| ScrollArea::ScrollPolicy fcn::ScrollArea::getVerticalScrollPolicy | ( | ) | const |
Gets the vertical scrollbar policy.
See enum with policies.
Definition at line 86 of file scrollarea.cpp.
References mVPolicy.
|
virtual |
Hit-test for widgets inside the scroll area.
| x | X coordinate to test (local). |
| y | Y coordinate to test (local). |
Definition at line 898 of file scrollarea.cpp.
References getChildrenArea(), getContent(), and fcn::Widget::Widget().
| bool fcn::ScrollArea::isOpaque | ( | ) | const |
Checks if the scroll area is opaque, that is if the scroll area displays its background.
Definition at line 1088 of file scrollarea.cpp.
References mOpaque.
Referenced by drawBackground().
|
overridevirtual |
Called for all widgets in the GUI each time Gui::logic is called.
You can do logic stuff here like playing an animation.
Reimplemented from fcn::Widget.
Definition at line 629 of file scrollarea.cpp.
References checkPolicies(), fcn::Widget::getBorderSize(), getContent(), getHorizontalScrollAmount(), getVerticalScrollAmount(), fcn::Widget::logic(), mHScroll, mVScroll, setHorizontalScrollAmount(), fcn::Widget::setPosition(), and setVerticalScrollAmount().
|
overridevirtual |
Called when the mouse has moved and the mouse has previously been pressed on the widget.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 250 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getHorizontalBarDimension(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalBarDimension(), getVerticalMarkerDimension(), getVerticalMaxScroll(), fcn::MouseEvent::getX(), fcn::MouseEvent::getY(), fcn::Rectangle::height, mHorizontalMarkerDragOffset, mIsHorizontalMarkerDragged, mIsVerticalMarkerDragged, mVerticalMarkerDragOffset, setHorizontalScrollAmount(), setVerticalScrollAmount(), fcn::Rectangle::width, fcn::Rectangle::x, and fcn::Rectangle::y.
|
overridevirtual |
Called when a mouse button has been pressed down on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 192 of file scrollarea.cpp.
References getChildrenArea(), getDownButtonDimension(), getHorizontalBarDimension(), getHorizontalMarkerDimension(), getHorizontalScrollAmount(), getLeftButtonDimension(), getRightButtonDimension(), getUpButtonDimension(), getVerticalBarDimension(), getVerticalMarkerDimension(), getVerticalScrollAmount(), fcn::MouseEvent::getX(), fcn::MouseEvent::getY(), mDownButtonPressed, mDownButtonScrollAmount, mHorizontalMarkerDragOffset, mIsHorizontalMarkerDragged, mIsVerticalMarkerDragged, mLeftButtonPressed, mLeftButtonScrollAmount, mRightButtonPressed, mRightButtonScrollAmount, mUpButtonPressed, mUpButtonScrollAmount, mVerticalMarkerDragOffset, setHorizontalScrollAmount(), setVerticalScrollAmount(), fcn::Rectangle::x, and fcn::Rectangle::y.
|
overridevirtual |
Called when a mouse button has been released on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 238 of file scrollarea.cpp.
References fcn::InputEvent::consume(), mDownButtonPressed, mIsHorizontalMarkerDragged, mIsVerticalMarkerDragged, mLeftButtonPressed, mRightButtonPressed, and mUpButtonPressed.
|
overridevirtual |
Called when the mouse wheel has moved down on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 923 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getChildrenArea(), getVerticalScrollAmount(), fcn::InputEvent::isConsumed(), mVBarVisible, and setVerticalScrollAmount().
|
overridevirtual |
Called when the mouse wheel has moved left on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 955 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getChildrenArea(), getHorizontalScrollAmount(), fcn::InputEvent::isConsumed(), mHBarVisible, and setHorizontalScrollAmount().
|
overridevirtual |
Called when the mouse wheel has moved right on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 939 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getChildrenArea(), getHorizontalScrollAmount(), fcn::InputEvent::isConsumed(), mHBarVisible, and setHorizontalScrollAmount().
|
overridevirtual |
Called when the mouse wheel has moved up on the widget area.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 907 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getChildrenArea(), getVerticalScrollAmount(), fcn::InputEvent::isConsumed(), mVBarVisible, and setVerticalScrollAmount().
|
overridevirtual |
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 from fcn::Widget.
Definition at line 1006 of file scrollarea.cpp.
References getContent(), fcn::Size::getHeight(), fcn::Widget::getMinSize(), fcn::Size::getWidth(), fcn::Widget::resizeToContent(), setHeight(), setWidth(), and fcn::Widget::Widget().
| void fcn::ScrollArea::setContent | ( | Widget * | widget | ) |
Sets the content.
| widget | The content of the scroll area. |
Definition at line 48 of file scrollarea.cpp.
References fcn::Widget::add(), checkPolicies(), fcn::Widget::removeAllChildren(), fcn::Widget::setPosition(), and fcn::Widget::Widget().
Referenced by ScrollArea(), and ScrollArea().
|
overridevirtual |
Set the bounds/dimension of the scroll area.
Reimplemented from fcn::Widget.
Definition at line 993 of file scrollarea.cpp.
References checkPolicies(), getContent(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), fcn::Widget::setDimension(), fcn::Widget::setHeight(), fcn::Widget::setWidth(), and fcn::Widget::Widget().
| void fcn::ScrollArea::setDownButtonScrollAmount | ( | int | amount | ) |
Sets the amount to scroll in pixels when the down scroll button is pushed.
| amount | The amount to scroll in pixels. |
Definition at line 1058 of file scrollarea.cpp.
References mDownButtonScrollAmount.
|
overridevirtual |
Set the height of the scroll area.
Reimplemented from fcn::Widget.
Definition at line 982 of file scrollarea.cpp.
References checkPolicies(), getContent(), fcn::Widget::getHeight(), fcn::Widget::setHeight(), and fcn::Widget::Widget().
Referenced by adjustSize(), expandContent(), and resizeToContent().
| void fcn::ScrollArea::setHorizontalScrollAmount | ( | int | hScroll | ) |
Sets the amount to scroll horizontally.
| hScroll | The amount to scroll. |
Definition at line 118 of file scrollarea.cpp.
References getHorizontalMaxScroll(), and mHScroll.
Referenced by logic(), mouseDragged(), mousePressed(), mouseWheelMovedLeft(), mouseWheelMovedRight(), setScrollAmount(), and showWidgetPart().
| void fcn::ScrollArea::setHorizontalScrollPolicy | ( | ScrollPolicy | hPolicy | ) |
Sets the horizontal scrollbar policy.
See enum with policies.
| hPolicy | The policy for the horizontal scrollbar. |
Definition at line 69 of file scrollarea.cpp.
References checkPolicies(), and mHPolicy.
| void fcn::ScrollArea::setLeftButtonScrollAmount | ( | int | amount | ) |
Sets the amount to scroll in pixels when the left scroll button is pushed.
| amount | The amount to scroll in pixels. |
Definition at line 1043 of file scrollarea.cpp.
References mLeftButtonScrollAmount.
| void fcn::ScrollArea::setOpaque | ( | bool | opaque | ) |
Sets the scroll area to be opaque, that is sets the scroll area to display its background.
| opaque | True if the scroll area should be opaque, false otherwise. |
Definition at line 1083 of file scrollarea.cpp.
References mOpaque.
| void fcn::ScrollArea::setRightButtonScrollAmount | ( | int | amount | ) |
Sets the amount to scroll in pixels when the right scroll button is pushed.
| amount | The amount to scroll in pixels. |
Definition at line 1048 of file scrollarea.cpp.
References mRightButtonScrollAmount.
| void fcn::ScrollArea::setScrollAmount | ( | int | hScroll, |
| int | vScroll ) |
Sets the amount to scroll horizontally and vertically.
| hScroll | The amount to scroll on horizontal scroll. |
| vScroll | The amount to scroll on vertical scroll. |
Definition at line 136 of file scrollarea.cpp.
References setHorizontalScrollAmount(), and setVerticalScrollAmount().
| void fcn::ScrollArea::setScrollbarWidth | ( | int | width | ) |
Sets the width of the scroll bars.
| width | The width of the scroll bars. |
Definition at line 178 of file scrollarea.cpp.
References mScrollbarWidth, and fcn::throwException().
| void fcn::ScrollArea::setScrollPolicy | ( | ScrollPolicy | hPolicy, |
| ScrollPolicy | vPolicy ) |
Sets the horizontal and vertical scrollbar policy.
| hPolicy | The policy for the horizontal scrollbar. |
| vPolicy | The policy for the vertical scrollbar. |
Definition at line 91 of file scrollarea.cpp.
References checkPolicies(), mHPolicy, and mVPolicy.
| void fcn::ScrollArea::setUpButtonScrollAmount | ( | int | amount | ) |
Sets the amount to scroll in pixels when the up scroll button is pushed.
| amount | The amount to scroll in pixels. |
Definition at line 1053 of file scrollarea.cpp.
References mUpButtonScrollAmount.
| void fcn::ScrollArea::setVerticalScrollAmount | ( | int | vScroll | ) |
Sets the amount to scroll vertically.
| vScroll | The amount to scroll. |
Definition at line 98 of file scrollarea.cpp.
References getVerticalMaxScroll(), and mVScroll.
Referenced by logic(), mouseDragged(), mousePressed(), mouseWheelMovedDown(), mouseWheelMovedUp(), setScrollAmount(), and showWidgetPart().
| void fcn::ScrollArea::setVerticalScrollPolicy | ( | ScrollPolicy | vPolicy | ) |
Sets the vertical scrollbar policy.
See enum with policies.
| vPolicy | The policy for the vertical scrollbar. |
Definition at line 80 of file scrollarea.cpp.
References checkPolicies(), and mVPolicy.
|
overridevirtual |
Set the width of the scroll area.
Reimplemented from fcn::Widget.
Definition at line 971 of file scrollarea.cpp.
References checkPolicies(), getContent(), fcn::Widget::getWidth(), fcn::Widget::setWidth(), and fcn::Widget::Widget().
Referenced by adjustSize(), expandContent(), and resizeToContent().
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 from fcn::Widget.
Definition at line 886 of file scrollarea.cpp.
References fcn::Widget::getBorderSize(), getContent(), fcn::Widget::getX(), fcn::Widget::getY(), setHorizontalScrollAmount(), setVerticalScrollAmount(), fcn::Widget::showWidgetPart(), fcn::throwException(), and fcn::Widget::Widget().
|
protected |
True if the down button is pressed, false otherwise.
Definition at line 512 of file scrollarea.hpp.
Referenced by drawDownButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the down button scroll amount.
Definition at line 532 of file scrollarea.hpp.
Referenced by getDownButtonScrollAmount(), mousePressed(), and setDownButtonScrollAmount().
|
protected |
True if the horizontal scroll bar is visible, false otherwise.
Definition at line 502 of file scrollarea.hpp.
Referenced by checkPolicies(), draw(), getChildrenArea(), getDownButtonDimension(), getHorizontalBarDimension(), getHorizontalMarkerDimension(), getLeftButtonDimension(), getRightButtonDimension(), getVerticalBarDimension(), mouseWheelMovedLeft(), and mouseWheelMovedRight().
|
protected |
Holds the horizontal markers drag offset.
Definition at line 557 of file scrollarea.hpp.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Holds the horizontal scroll bar policy.
Definition at line 487 of file scrollarea.hpp.
Referenced by checkPolicies(), getHorizontalScrollPolicy(), setHorizontalScrollPolicy(), and setScrollPolicy().
|
protected |
Holds the horizontal scroll amount.
Definition at line 477 of file scrollarea.hpp.
Referenced by getHorizontalScrollAmount(), logic(), and setHorizontalScrollAmount().
|
protected |
True if the horizontal marked is dragged.
Definition at line 552 of file scrollarea.hpp.
Referenced by mouseDragged(), mousePressed(), and mouseReleased().
|
protected |
True if the vertical marked is dragged.
Definition at line 547 of file scrollarea.hpp.
Referenced by mouseDragged(), mousePressed(), and mouseReleased().
|
protected |
True if the left button is pressed, false otherwise.
Definition at line 517 of file scrollarea.hpp.
Referenced by drawLeftButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the left button scroll amount.
Definition at line 537 of file scrollarea.hpp.
Referenced by getLeftButtonScrollAmount(), mousePressed(), and setLeftButtonScrollAmount().
|
protected |
True if the scroll area should be opaque (that is display its background), false otherwise.
Definition at line 568 of file scrollarea.hpp.
Referenced by isOpaque(), and setOpaque().
|
protected |
True if the right button is pressed, false otherwise.
Definition at line 522 of file scrollarea.hpp.
Referenced by drawRightButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the right button scroll amount.
Definition at line 542 of file scrollarea.hpp.
Referenced by getRightButtonScrollAmount(), mousePressed(), and setRightButtonScrollAmount().
|
protected |
Holds the width of the scroll bars.
Definition at line 482 of file scrollarea.hpp.
Referenced by checkPolicies(), draw(), getChildrenArea(), getDownButtonDimension(), getHorizontalBarDimension(), getHorizontalMarkerDimension(), getLeftButtonDimension(), getRightButtonDimension(), getScrollbarWidth(), getUpButtonDimension(), getVerticalBarDimension(), getVerticalMarkerDimension(), and setScrollbarWidth().
|
protected |
True if the up button is pressed, false otherwise.
Definition at line 507 of file scrollarea.hpp.
Referenced by drawUpButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the up button scroll amount.
Definition at line 527 of file scrollarea.hpp.
Referenced by getUpButtonScrollAmount(), mousePressed(), and setUpButtonScrollAmount().
|
protected |
True if the vertical scroll bar is visible, false otherwise.
Definition at line 497 of file scrollarea.hpp.
Referenced by checkPolicies(), draw(), getChildrenArea(), getDownButtonDimension(), getHorizontalBarDimension(), getRightButtonDimension(), getUpButtonDimension(), getVerticalBarDimension(), getVerticalMarkerDimension(), mouseWheelMovedDown(), and mouseWheelMovedUp().
|
protected |
Holds the vertical markers drag offset.
Definition at line 562 of file scrollarea.hpp.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Holds the vertical scroll bar policy.
Definition at line 492 of file scrollarea.hpp.
Referenced by checkPolicies(), getVerticalScrollPolicy(), setScrollPolicy(), and setVerticalScrollPolicy().
|
protected |
Holds the vertical scroll amount.
Definition at line 472 of file scrollarea.hpp.
Referenced by getVerticalScrollAmount(), logic(), and setVerticalScrollAmount().