TouchGFX + 0/2 examples
CodeScope will show references to touchgfx::ScrollableContainer from the following samples and libraries:
Examples
STM324x9I_EVAL
Demonstrations
STM32F429I-Discovery
Demonstrations
 
Symbols
loading...
Files
loading...

touchgfx::ScrollableContainer class

@class ScrollableContainer ScrollableContainer.hpp touchgfx/containers/ScrollableContainer.hpp A ScrollableContainer is a container that allows its contents to be scrolled. A ScrollableContainer is a container that allows its contents to be scrolled. It will intercept drag operations and move child nodes accordingly. The size of the ScrollableContainer should be the visible view port area. If the container contains drawables that are larger than the ScrollableContainer itself, scrolling is enabled. @see Container

Syntax

class ScrollableContainer : public Container { public:     ScrollableContainer();     virtual ~ScrollableContainer() { }     void enableHorizontalScroll(bool enable)     {         scrollableX = enable;     }     void enableVerticalScroll(bool enable)     {         scrollableY = enable;     }     virtual void isScrollableXY(bool& scrollX, bool& scrollY)     {         Rect contained = getContainedArea();         scrollX = (scrollableX && (rect.width < contained.width));         scrollY = (scrollableY && (rect.height < contained.height));     }     void setScrollbarsVisible(bool newVisible);     void setScrollbarsPermanentlyVisible();     virtual void add(Drawable& d);     virtual void getLastChild(int16_t x, int16_t y, Drawable** last)     {         if (isVisible())         {             if (isTouchable())             {                 *last = this;             }             else             {                 Container::getLastChild(x, y, last);             }         }     }     virtual void handleClickEvent(const ClickEvent& evt);     virtual void handleDragEvent(const DragEvent& evt);     virtual void handleGestureEvent(const GestureEvent& evt);     virtual void handleTickEvent();     virtual Rect getContainedArea() const;     virtual void childGeometryChanged();     void reset();     virtual void moveChildrenRelative(int16_t deltaX, int16_t deltaY);     void setMaxVelocity(uint16_t max)     {         maxVelocity = max;     };     void setScrollThreshold(int16_t t)     {         scrollThreshold = t;     }     void setScrollbarsColor(colortype color);     void setScrollbarsAlpha(uint8_t alpha);     void setScrollbarPadding(uint8_t padding);     void setScrollbarWidth(uint8_t width);     int16_t getScrolledX() const;     int16_t getScrolledY() const;     virtual uint16_t getType() const     {         return (uint16_t)TYPE_SCROLLABLECONTAINER;     } protected:     uint8_t   scrollbarPadding;                                uint8_t   scrollbarWidth;                                  uint8_t   scrollbarAlpha;                                  static    const uint8_t SCROLLBAR_LINE = 0;                colortype scrollbarColor;                                  static    const uint16_t SCROLLBAR_MIN_VELOCITY = 5;       static    const uint16_t SCROLLBAR_MAX_VELOCITY = 17;      uint16_t  maxVelocity;                                     Rect getXScrollbar() const;     Rect getYScrollbar() const;     Rect getXBorder(const Rect& xBar, const Rect& yBar) const;     Rect getYBorder(const Rect& xBar, const Rect& yBar) const;     void invalidateScrollbars();     virtual bool doScroll(int16_t deltaX, int16_t deltaY);     GestureEvent::GestureType accelDirection;      Box xSlider;      Box ySlider;      Drawable* pressedDrawable;         Drawable* lastDraggableChild;      int16_t scrolledXDistance;      int16_t scrolledYDistance;      int16_t scrollThreshold;        int16_t pressedX;      int16_t pressedY;      bool isPressed;        bool isScrolling;      bool scrollableX;      bool scrollableY;      bool scrollbarsVisible;      bool scrollbarsPermanentlyVisible;      uint16_t scrollDuration;      int16_t beginningValue;      int16_t targetValue;         uint16_t animationCounter;      bool animate;                   int16_t fingerAdjustmentX;      int16_t fingerAdjustmentY;      bool hasIssuedCancelEvent;  };

Fields

scrollbarPadding

No summary provided. Read more...

scrollbarWidth

No summary provided. Read more...

scrollbarAlpha

No summary provided. Read more...

SCROLLBAR_LINE

No summary provided. Read more...

scrollbarColor

No summary provided. Read more...

SCROLLBAR_MIN_VELOCITY

No summary provided. Read more...

SCROLLBAR_MAX_VELOCITY

No summary provided. Read more...

maxVelocity

No summary provided. Read more...

accelDirection

No summary provided. Read more...

xSlider

No summary provided. Read more...

ySlider

No summary provided. Read more...

pressedDrawable

No summary provided. Read more...

lastDraggableChild

No summary provided. Read more...

scrolledXDistance

No summary provided. Read more...

scrolledYDistance

No summary provided. Read more...

scrollThreshold

No summary provided. Read more...

pressedX

No summary provided. Read more...

pressedY

No summary provided. Read more...

isPressed

No summary provided. Read more...

isScrolling

No summary provided. Read more...

scrollableX

No summary provided. Read more...

scrollableY

No summary provided. Read more...

scrollbarsVisible

No summary provided. Read more...

scrollbarsPermanentlyVisible

No summary provided. Read more...

scrollDuration

No summary provided. Read more...

beginningValue

No summary provided. Read more...

targetValue

No summary provided. Read more...

animationCounter

No summary provided. Read more...

animate

No summary provided. Read more...

fingerAdjustmentX

No summary provided. Read more...

fingerAdjustmentY

No summary provided. Read more...

hasIssuedCancelEvent

No summary provided. Read more...

Methods

enableHorizontalScroll()

@fn void ScrollableContainer::enableHorizontalScroll(bool enable) Enables horizontal scrolling. By default, scrolling in either direction is enabled, provided that the content is larger than the size of the scrollable container. This function can be used to explicitly (dis)allow scrolling in the horizontal direction, even if the content is larger than the container. Read more...

enableVerticalScroll()

@fn void ScrollableContainer::enableVerticalScroll(bool enable) Enables the vertical scroll. Enables the vertical scroll. By default, scrolling in either direction is enabled, provided that the content is larger than the size of the scrollable container. This function can be used to explicitly (dis)allow scrolling in the vertical direction, even if the content is larger than the container. Read more...

isScrollableXY()

@fn virtual void ScrollableContainer::isScrollableXY(bool& scrollX, bool& scrollY) Is the ClickableContainer scrollable in either direction? Is the ClickableContainer scrollable in either direction? Takes the width of the contained elements into account. Read more...

setScrollbarsVisible()

@fn void ScrollableContainer::setScrollbarsVisible(bool newVisible); Sets the visibility of the scrollbars, when the scrollable area is pressed. Sets the visibility of the scrollbars, when the scrollable area is pressed. Read more...

setScrollbarsPermanentlyVisible()

@fn void ScrollableContainer::setScrollbarsPermanentlyVisible() sets the visibility for the scrollbars to be permanent. sets the visibility for the scrollbars to be permanent. Read more...

add()

@fn virtual void ScrollableContainer::add(Drawable& d); Adds a Drawable instance as child to this ScrollableContainer. Adds a Drawable instance as child to this ScrollableContainer. Read more...

getLastChild()

@fn virtual void ScrollableContainer::getLastChild(int16_t x, int16_t y, Drawable** last) Gets the last child in the container. Gets the last child in the container. The ScrollableContainer needs to intercept click events, since the scrollbars are displayed upon reception of a PRESSED ClickEvent. The ScrollableContainer will automatically re-delegate the event to the appropriate child. Read more...

handleClickEvent()

@fn virtual void ScrollableContainer::handleClickEvent(const ClickEvent& evt); Handle the click event. Handle the click event. Get ready for scrolling, display scrollbars, etc. Send the click to appropriate child widget. Read more...

handleDragEvent()

@fn virtual void ScrollableContainer::handleDragEvent(const DragEvent& evt); Handle the drag event. Handle the drag event. Initiate a scrolling of the container. Update scrollbars. Read more...

handleGestureEvent()

@fn virtual void ScrollableContainer::handleGestureEvent(const GestureEvent& evt); Gestures generate a scroll animation so these are intercepted in the same manner as drag events. Gestures generate a scroll animation so these are intercepted in the same manner as drag events. Read more...

handleTickEvent()

@fn virtual void ScrollableContainer::handleTickEvent(); Handle tick events. Handle tick events. Used in updating the animation of the scroll. Read more...

getContainedArea() const

@fn virtual Rect ScrollableContainer::getContainedArea() const; Gets contained area. Gets contained area. Read more...

childGeometryChanged()

@fn virtual void ScrollableContainer::childGeometryChanged(); Used to signal that the size of one or more children have changed. This function can be called on parent nodes to signal that the size of one or more of its children have changed. Currently only used in ScrollableContainer to redraw scrollbars when the size of the scrolling contents changes. @see Drawable::childGeometryChanged. Read more...

reset()

@fn void ScrollableContainer::reset(); Resets the x/y coordinates of children. Resets the x/y coordinates of childrento the position they were in before the first drag event was received or to the position they were in the last time reset() was invoked. Read more...

moveChildrenRelative()

@fn virtual void ScrollableContainer::moveChildrenRelative(int16_t deltaX, int16_t deltaY); Moves the scrollable contents relatively. Moves the scrollable contents relatively. Read more...

setMaxVelocity()

@fn void ScrollableContainer::setMaxVelocity(uint16_t max) Sets the maximum velocity of a scroll due to a swipe. Sets the maximum velocity of a scroll due to a swipe. Read more...

setScrollThreshold()

@fn void ScrollableContainer::setScrollThreshold(int16_t t) Change the threshold which the first drag event received must exceed before initiating a scroll. Change the threshold which the first drag event received must exceed before initiating a scroll. Read more...

setScrollbarsColor()

@fn void ScrollableContainer::setScrollbarsColor(colortype color); Sets the color of the scroll bars. Sets the color of the scroll bars. Read more...

setScrollbarsAlpha()

@fn void ScrollableContainer::setScrollbarsAlpha(uint8_t alpha); Sets the alpha value for the scroll bars. Sets the alpha value for the scroll bars. Read more...

setScrollbarPadding()

@fn void ScrollableContainer::setScrollbarPadding(uint8_t padding); Sets the amount of space the scrollbar has to its borders. Sets the amount of space the scrollbar has to its borders. Read more...

setScrollbarWidth()

@fn void ScrollableContainer::setScrollbarWidth(uint8_t width); Sets the width of the scrollbar. Sets the width of the scrollbar. Read more...

getScrolledX() const

@fn int16_t ScrollableContainer::getScrolledX() const; Gets the distance scrolled for the x-axis. Gets the distance scrolled for the x-axis. Read more...

getScrolledY() const

@fn int16_t ScrollableContainer::getScrolledY() const; Gets the distance scrolled for the y-axis. Gets the distance scrolled for the y-axis. Read more...

getType() const

@fn virtual uint16_t ScrollableContainer::getType() const For GUI testing only. For GUI testing only. Returns type of this drawable. Read more...

getXScrollbar() const

@fn Rect ScrollableContainer::getXScrollbar() const; Gets x coordinate of the scrollbar. Gets x coordinate of the scrollbar. Read more...

getYScrollbar() const

@fn Rect ScrollableContainer::getYScrollbar() const; Gets y coordinate of the scrollbar. Gets y coordinate of the scrollbar. Read more...

getXBorder() const

@fn Rect ScrollableContainer::getXBorder(const Rect& xBar, const Rect& yBar) const; Gets the area where the horizontal scrollbar can move. Gets the area where the horizontal scrollbar can move. Read more...

getYBorder() const

@fn Rect ScrollableContainer::getYBorder(const Rect& xBar, const Rect& yBar) const; Gets the area where the vertical scrollbar can move. Gets the area where the vertical scrollbar can move. Read more...

invalidateScrollbars()

@fn void ScrollableContainer::invalidateScrollbars(); Invalidate the scrollbars. Invalidate the scrollbars. Read more...

doScroll()

@fn virtual bool ScrollableContainer::doScroll(int16_t deltaX, int16_t deltaY); Method to actually scroll the container. Method to actually scroll the container. Passing negative values will scroll the items in the ScrollableContainer up / left, whereas positive values will scroll items down / right. If the distance is larger than allowed, the deltas are adjusted down to make sure the contained items stay inside view. Read more...

Examples

touchgfx::ScrollableContainer is referenced by 2 libraries and example projects.

References

LocationText
ScrollableContainer.hpp:42
class ScrollableContainer : public Container

Class Tree

Child classes
touchgfx::ScrollableContainer
all items filtered out