|
FifeGUI 0.2.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 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 () |
| void | resizeToContent (bool recursion) 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) |
| void | setDownButtonScrollAmount (int amount) |
| void | setHeight (int height) |
| 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) |
| 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 | addFocusListener (FocusListener *focusListener) |
| void | addKeyListener (KeyListener *keyListener) |
| void | addMouseListener (MouseListener *mouseListener) |
| void | addWidgetListener (WidgetListener *widgetListener) |
| virtual void | drawBorder (Graphics *graphics) |
| 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 | getBorderSize () 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 | isEnabled () const |
| bool | isFixedSize () const |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| bool | isHorizontalExpand () const |
| bool | isLastPositionSet () const |
| virtual bool | isLayouted () |
| virtual bool | isModalFocusable () const |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocusable () const |
| virtual bool | isModalMouseInputFocused () const |
| bool | isSetVisible () const |
| bool | isTabInEnabled () const |
| bool | isTabOutEnabled () const |
| bool | isVerticalExpand () const |
| bool | isVisible () const |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | moveToTop (Widget *widget) |
| Widget & | operator= (Widget &&)=delete |
| Widget & | operator= (Widget const &)=delete |
| virtual void | releaseModalFocus () |
| virtual void | releaseModalMouseInputFocus () |
| void | removeActionListener (ActionListener *actionListener) |
| void | removeDeathListener (DeathListener *deathListener) |
| void | removeFocusListener (FocusListener *focusListener) |
| void | removeKeyListener (KeyListener *keyListener) |
| void | removeMouseListener (MouseListener *mouseListener) |
| void | removeWidgetListener (WidgetListener *widgetListener) |
| virtual void | requestFocus () |
| virtual void | requestModalFocus () |
| virtual void | requestModalMouseInputFocus () |
| virtual void | requestMoveToBottom () |
| virtual void | requestMoveToTop () |
| void | resizeToContent () |
| void | setActionEventId (std::string const &actionEventId) |
| virtual void | setBackgroundColor (Color const &color) |
| virtual void | setBaseColor (Color const &color) |
| virtual void | setBorderColor (Color const &color) |
| void | setBorderSize (unsigned int size) |
| void | setDimension (Rectangle const &dimension) |
| void | setEnabled (bool enabled) |
| void | setFixedSize (Size const &size) |
| void | setFocusable (bool focusable) |
| virtual void | setFont (Font *font) |
| virtual void | setForegroundColor (Color const &color) |
| 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) |
| void | setSize (int width, int height) |
| void | setTabInEnabled (bool enabled) |
| void | setTabOutEnabled (bool enabled) |
| void | setVerticalExpand (bool expand) |
| void | setVisible (bool visible) |
| void | setWidth (int width) |
| void | setX (int x) |
| void | setY (int y) |
| virtual void | showPart (Rectangle rectangle) |
| 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 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 |
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 25 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 37 of file scrollarea.hpp.
| fcn::ScrollArea::ScrollArea | ( | ) |
Definition at line 14 of file scrollarea.cpp.
|
explicit |
Constructor.
| content | The content of the scroll area. |
Definition at line 19 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 25 of file scrollarea.cpp.
References fcn::Widget::addMouseListener(), setContent(), and fcn::Widget::Widget().
|
override |
Definition at line 31 of file scrollarea.cpp.
|
overridevirtual |
Resizes the widget's size to fit the content exactly.
Reimplemented from fcn::Widget.
Definition at line 1009 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 635 of file scrollarea.cpp.
References getContent(), fcn::Widget::getHeight(), fcn::Widget::getWidth(), mHBarVisible, mHPolicy, mScrollbarWidth, mVBarVisible, and mVPolicy.
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.
NOTE: A widget with children won't draw its children unless the children area given by Widget::getChildrenArea returns a none empty rectangle inside the widgets dimension. The children area is considered relative to the widget's position.
| Graphics & Rendering | A graphics object to draw with. |
Implements fcn::Widget.
Definition at line 273 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 & Rendering | a Graphics object to draw with. |
Definition at line 340 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 & Rendering | a Graphics object to draw with. |
Definition at line 403 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 & Rendering | a Graphics object to draw with. |
Definition at line 298 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), 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 & Rendering | a Graphics object to draw with. |
Definition at line 594 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 & Rendering | a Graphics object to draw with. |
Definition at line 458 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 & Rendering | a Graphics object to draw with. |
Definition at line 512 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 & Rendering | a Graphics object to draw with. |
Definition at line 348 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 & Rendering | a Graphics object to draw with. |
Definition at line 319 of file scrollarea.cpp.
References fcn::Color::a, fcn::Graphics::drawLine(), fcn::Graphics::fillRectangle(), fcn::Widget::getBaseColor(), 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 & Rendering | a Graphics object to draw with. |
Definition at line 567 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 1440 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 1020 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.
NOTE: The returned rectangle should be relative to the widget, i.e a rectangle with x and y coordinate (0,0) and with width and height the same as the widget will let the children draw themselves in the whole widget.
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 760 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 52 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 723 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 1069 of file scrollarea.cpp.
References mDownButtonScrollAmount.
|
protected |
Gets the horizontal scrollbar dimension.
Definition at line 796 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 847 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 134 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 123 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 67 of file scrollarea.cpp.
References mHPolicy.
|
protected |
Gets the left button dimension.
Definition at line 737 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 1054 of file scrollarea.cpp.
References mLeftButtonScrollAmount.
|
protected |
Gets the right button dimension.
Definition at line 746 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 1059 of file scrollarea.cpp.
References mRightButtonScrollAmount.
| int fcn::ScrollArea::getScrollbarWidth | ( | ) | const |
Gets the width of the scroll bars.
Definition at line 179 of file scrollarea.cpp.
References mScrollbarWidth.
|
protected |
Gets the up button dimension.
Definition at line 714 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 1064 of file scrollarea.cpp.
References mUpButtonScrollAmount.
|
protected |
Gets the vertical scrollbar dimension.
Definition at line 775 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 817 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 151 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 105 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 78 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 889 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 1079 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 621 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 242 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 on the widget area.
NOTE: A mouse press is NOT equal to a mouse click. Use mouseClickMessage to check for mouse clicks.
| mouseEvent | Describes the event. |
Reimplemented from fcn::MouseListener.
Definition at line 184 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 230 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 914 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 946 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 930 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 898 of file scrollarea.cpp.
References fcn::InputEvent::consume(), getChildrenArea(), getVerticalScrollAmount(), fcn::InputEvent::isConsumed(), mVBarVisible, and setVerticalScrollAmount().
|
inline |
Resizes the widget's size to fit the content exactly, calls recursively all childs.
This is a convenience wrapper that calls resizeToContent(true).
Definition at line 1417 of file widget.hpp.
|
overridevirtual |
Resize this widget to fit its content.
| recursion | If true, perform the resize operation recursively on children. |
Reimplemented from fcn::Widget.
Definition at line 997 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 40 of file scrollarea.cpp.
References fcn::Widget::add(), checkPolicies(), fcn::Widget::removeAllChildren(), fcn::Widget::setPosition(), and fcn::Widget::Widget().
Referenced by ScrollArea(), and ScrollArea().
| void fcn::ScrollArea::setDimension | ( | Rectangle const & | dimension | ) |
Set the bounds/dimension of the scroll area.
Definition at line 984 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 1049 of file scrollarea.cpp.
References mDownButtonScrollAmount.
| void fcn::ScrollArea::setHeight | ( | int | height | ) |
Set the height of the scroll area.
Definition at line 973 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 110 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 61 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 1034 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 1074 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 1039 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 128 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 170 of file scrollarea.cpp.
References mScrollbarWidth.
| 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 83 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 1044 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 90 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 72 of file scrollarea.cpp.
References checkPolicies(), and mVPolicy.
| void fcn::ScrollArea::setWidth | ( | int | width | ) |
Set the width of the scroll area.
Definition at line 962 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 877 of file scrollarea.cpp.
References fcn::Widget::getBorderSize(), getContent(), fcn::Widget::getX(), fcn::Widget::getY(), setHorizontalScrollAmount(), setVerticalScrollAmount(), fcn::Widget::showWidgetPart(), and fcn::Widget::Widget().
|
protected |
True if the down button is pressed, false otherwise.
Definition at line 508 of file scrollarea.hpp.
Referenced by drawDownButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the down button scroll amount.
Definition at line 528 of file scrollarea.hpp.
Referenced by getDownButtonScrollAmount(), mousePressed(), and setDownButtonScrollAmount().
|
protected |
True if the horizontal scroll bar is visible, false otherwise.
Definition at line 498 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 553 of file scrollarea.hpp.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Holds the horizontal scroll bar policy.
Definition at line 483 of file scrollarea.hpp.
Referenced by checkPolicies(), getHorizontalScrollPolicy(), setHorizontalScrollPolicy(), and setScrollPolicy().
|
protected |
Holds the horizontal scroll amount.
Definition at line 473 of file scrollarea.hpp.
Referenced by getHorizontalScrollAmount(), logic(), and setHorizontalScrollAmount().
|
protected |
True if the horizontal marked is dragged.
Definition at line 548 of file scrollarea.hpp.
Referenced by mouseDragged(), mousePressed(), and mouseReleased().
|
protected |
True if the vertical marked is dragged.
Definition at line 543 of file scrollarea.hpp.
Referenced by mouseDragged(), mousePressed(), and mouseReleased().
|
protected |
True if the left button is pressed, false otherwise.
Definition at line 513 of file scrollarea.hpp.
Referenced by drawLeftButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the left button scroll amount.
Definition at line 533 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 564 of file scrollarea.hpp.
Referenced by isOpaque(), and setOpaque().
|
protected |
True if the right button is pressed, false otherwise.
Definition at line 518 of file scrollarea.hpp.
Referenced by drawRightButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the right button scroll amount.
Definition at line 538 of file scrollarea.hpp.
Referenced by getRightButtonScrollAmount(), mousePressed(), and setRightButtonScrollAmount().
|
protected |
Holds the width of the scroll bars.
Definition at line 478 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 503 of file scrollarea.hpp.
Referenced by drawUpButton(), mousePressed(), and mouseReleased().
|
protected |
Holds the up button scroll amount.
Definition at line 523 of file scrollarea.hpp.
Referenced by getUpButtonScrollAmount(), mousePressed(), and setUpButtonScrollAmount().
|
protected |
True if the vertical scroll bar is visible, false otherwise.
Definition at line 493 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 558 of file scrollarea.hpp.
Referenced by mouseDragged(), and mousePressed().
|
protected |
Holds the vertical scroll bar policy.
Definition at line 488 of file scrollarea.hpp.
Referenced by checkPolicies(), getVerticalScrollPolicy(), setScrollPolicy(), and setVerticalScrollPolicy().
|
protected |
Holds the vertical scroll amount.
Definition at line 468 of file scrollarea.hpp.
Referenced by getVerticalScrollAmount(), logic(), and setVerticalScrollAmount().