SwipeContainer is only used within TouchGFX.
 
Symbols
loading...
Files
loading...

SwipeContainer class

@class SwipeContainer A container that holds elements that be swiped through to the left or right. The container will animate to the next element or snaps back to the shown element if a too small drag is performed. All elements added must have the same dimensions. This widget is part of the TouchGFX Open Widget Repository. https://github.com/draupnergraphics/touchgfx-widgets Widget has been slightly modified for this demo. @see touchgfx::Container

Syntax

class SwipeContainer : public touchgfx::Container { public:     SwipeContainer();     virtual ~SwipeContainer();     virtual void handleTickEvent();     virtual void handleClickEvent(const touchgfx::ClickEvent& evt);     virtual void handleDragEvent(const touchgfx::DragEvent& evt);     virtual void handleGestureEvent(const touchgfx::GestureEvent& evt);     virtual void add(touchgfx::Drawable& screen);     virtual void setSwipeCutoff(uint16_t cutoff);     void setDotIndicatorXY(uint16_t x, uint16_t y);     void setDotIndicatorXYWithCenteredX(uint16_t x, uint16_t y);     void setDotIndicatorBitmaps(const touchgfx::Bitmap& normalDot, const touchgfx::Bitmap& highlightedDot);     void setEndSwipeElasticWidth(uint16_t width);     uint8_t getNumberOfScreens()     {         return numberOfScreens;     }     void setSelectedScreen(uint8_t screenIndex);     uint8_t getSelectedScreen()     {         return currentScreen;     }     void setMenuChangeInitiatedCallback(touchgfx::GenericCallback<const SwipeContainer&>& callback)     {         menuChangeInitiatedAction = &callback;     }     void setMenuChangeEndedCallback(touchgfx::GenericCallback<const SwipeContainer&>& callback)     {         menuChangeEndedAction = &callback;     } private:     enum States     {         ANIMATE_SWIPE_CANCELLED_LEFT,         ANIMATE_SWIPE_CANCELLED_RIGHT,         ANIMATE_LEFT,         ANIMATE_RIGHT,         NO_ANIMATION     } currentState;     uint8_t numberOfScreens;     uint8_t animationCounter;     uint16_t swipeCutoff;     int16_t dragX;     int16_t animateDistance;     int16_t startX;     uint8_t currentScreen;     uint16_t endElasticWidth;     DotIndicator dotIndicator;     touchgfx::ListLayout screens;     GenericCallback<const SwipeContainer&>* menuChangeInitiatedAction;     GenericCallback<const SwipeContainer&>* menuChangeEndedAction;     void adjustScreens();     void animateSwipeCancelledLeft();     void animateSwipeCancelledRight();     void animateLeft();     void animateRight(); };

Fields

currentState

No summary provided. Read more...

numberOfScreens

No summary provided. Read more...

animationCounter

No summary provided. Read more...

swipeCutoff

No summary provided. Read more...

dragX

No summary provided. Read more...

animateDistance

No summary provided. Read more...

startX

No summary provided. Read more...

currentScreen

No summary provided. Read more...

endElasticWidth

No summary provided. Read more...

dotIndicator

No summary provided. Read more...

screens

No summary provided. Read more...
No summary provided. Read more...
No summary provided. Read more...

Methods

handleTickEvent()

No summary provided. Read more...

handleClickEvent()

No summary provided. Read more...

handleDragEvent()

No summary provided. Read more...

handleGestureEvent()

No summary provided. Read more...

add()

@fn virtual void SwipeContainer::add(touchgfx::Drawable& screen); Adds a screen to the container. Note that all screens must have the same width and height. Read more...

setSwipeCutoff()

@fn virtual void SwipeContainer::setSwipeCutoff(uint16_t cutoff); Set the swipe cutoff which indicates how far you should drag a screen before it results in a screen change. Read more...

setDotIndicatorXY()

@fn void SwipeContainer::setDotIndicatorXY(uint16_t x, uint16_t y); Sets the x and y position of the dot indicator. Read more...

setDotIndicatorXYWithCenteredX()

@fn void SwipeContainer::setDotIndicatorXYWithCenteredX(uint16_t x, uint16_t y); Sets the x and y position of the dot indicator. The value specified as x will be the center coordinate of the dot indicators. Note that this method should first be used after all screens have been added, the setDotIndicatorBitmaps has been called and the dot indicator therefore has the correct width. Read more...

setDotIndicatorBitmaps()

@fn void SwipeContainer::setDotIndicatorBitmaps(const touchgfx::Bitmap& normalDot, const touchgfx::Bitmap& highlightedDot); Sets the bitmaps that are used by the dot indicator. Read more...

setEndSwipeElasticWidth()

@fn void SwipeContainer::setEndSwipeElasticWidth(uint16_t width); When dragging either one of the end screens a part of the background will become visible until the user stop dragging and the end screen swipes back to its position. The width of this area is set by this method. Read more...

getNumberOfScreens()

@fn uint8_t SwipeContainer::getNumberOfScreens() Gets number of screens. Read more...

setSelectedScreen()

@fn void SwipeContainer::setSelectedScreen(uint8_t screenIndex); Sets the selected screen. Read more...

getSelectedScreen()

No summary provided. Read more...

setMenuChangeInitiatedCallback()

@fn void CollapsibleMenu::setStateChangedCallback(touchgfx::GenericCallback& callback) Associates an action to be performed when a transition to a different screen initiates. @see GenericCallback. Read more...

setMenuChangeEndedCallback()

@fn void SwipeContainer::setMenuChangeEndedCallback(touchgfx::GenericCallback& callback) Associates an action to be performed when a transition to a different screen ends. @see GenericCallback. Read more...

adjustScreens()

No summary provided. Read more...

animateSwipeCancelledLeft()

No summary provided. Read more...

animateSwipeCancelledRight()

No summary provided. Read more...

animateLeft()

No summary provided. Read more...

animateRight()

No summary provided. Read more...

handleClickEvent()

No summary provided. Read more...

handleDragEvent()

No summary provided. Read more...

handleGestureEvent()

No summary provided. Read more...

add()

@fn virtual void SwipeContainer::add(touchgfx::Drawable& screen); Adds a screen to the container. Note that all screens must have the same width and height. Read more...

References

LocationReferrerScopeText
SwipeContainer.hpp:43
class SwipeContainer : public touchgfx::Container
MainMenuView.cpp:116MainMenuView::menuStateChangeInitiatedHandler()
void MainMenuView::menuStateChangeInitiatedHandler(const SwipeContainer& sc)
MainMenuView.cpp:120MainMenuView::menuStateChangeEndedHandler()
void MainMenuView::menuStateChangeEndedHandler(const SwipeContainer& sc)
MainMenuView.hpp:54MainMenuView::menuContainerMainMenuView
SwipeContainer menuContainer;
MainMenuView.hpp:61MainMenuView::menuStateChangeInitiatedHandler()::scMainMenuView::menuStateChangeInitiatedHandler()
void menuStateChangeInitiatedHandler(const SwipeContainer& sc);
MainMenuView.hpp:62MainMenuView::menuStateChangeEndedHandler()::scMainMenuView::menuStateChangeEndedHandler()
void menuStateChangeEndedHandler(const SwipeContainer& sc);
SwipeContainer.cpp:26SwipeContainer::SwipeContainer()
SwipeContainer::SwipeContainer() :
SwipeContainer.cpp:46SwipeContainer::~SwipeContainer()
SwipeContainer::~SwipeContainer()
SwipeContainer.cpp:52SwipeContainer::add()
void SwipeContainer::add(Drawable& screen)
SwipeContainer.cpp:63SwipeContainer::setEndSwipeElasticWidth()
void SwipeContainer::setEndSwipeElasticWidth(uint16_t width)
SwipeContainer.cpp:68SwipeContainer::setSwipeCutoff()
void SwipeContainer::setSwipeCutoff(uint16_t cutoff)
SwipeContainer.cpp:73SwipeContainer::setDotIndicatorBitmaps()
void SwipeContainer::setDotIndicatorBitmaps(const touchgfx::Bitmap& normalDot, const touchgfx::Bitmap& highlightedDot)
SwipeContainer.cpp:78SwipeContainer::setDotIndicatorXY()
void SwipeContainer::setDotIndicatorXY(uint16_t x, uint16_t y)
SwipeContainer.cpp:83SwipeContainer::setDotIndicatorXYWithCenteredX()
void SwipeContainer::setDotIndicatorXYWithCenteredX(uint16_t x, uint16_t y)
SwipeContainer.cpp:88SwipeContainer::setSelectedScreen()
void SwipeContainer::setSelectedScreen(uint8_t screenIndex)
SwipeContainer.cpp:95SwipeContainer::handleTickEvent()
void SwipeContainer::handleTickEvent()
SwipeContainer.cpp:115SwipeContainer::handleClickEvent()
void SwipeContainer::handleClickEvent(const ClickEvent& evt)
SwipeContainer.cpp:165SwipeContainer::handleDragEvent()
void SwipeContainer::handleDragEvent(const DragEvent& evt)
SwipeContainer.cpp:189SwipeContainer::handleGestureEvent()
void SwipeContainer::handleGestureEvent(const GestureEvent& evt)
SwipeContainer.cpp:224SwipeContainer::adjustScreens()
void SwipeContainer::adjustScreens()
SwipeContainer.cpp:229SwipeContainer::animateSwipeCancelledLeft()
void SwipeContainer::animateSwipeCancelledLeft()
SwipeContainer.cpp:251SwipeContainer::animateSwipeCancelledRight()
void SwipeContainer::animateSwipeCancelledRight()
SwipeContainer.cpp:273SwipeContainer::animateLeft()
void SwipeContainer::animateLeft()
SwipeContainer.cpp:303SwipeContainer::animateRight()
void SwipeContainer::animateRight()

Class Tree

Child classes
SwipeContainer
all items filtered out
Variables of SwipeContainer type
SwipeContainer