from WheelSelector.hpp:47
class WheelSelector : public Container
{
public:
WheelSelector();
virtual ~WheelSelector();
virtual void handleDragEvent(const DragEvent& evt);
virtual void setup(int width, int height, int textXPosition, int textYPosition, TEXTS wheelText);
void setTextColor(colortype normalColor, colortype selectedColor, colortype selectedBackgroundColor, int selectedYOffset = 0, int selectedHeight = 0);
virtual void handleClickEvent(const ClickEvent& evt);
virtual void handleGestureEvent(const GestureEvent& evt);
int getSelectedIndex();
void setSelectedIndex(int index, int duration, EasingEquation equation = EasingEquations::backEaseInOut);
void reset();
void setElementSelectedCallback(touchgfx::GenericCallback<const WheelSelector&, const int&>& callback)
{
elementSelectedAction = &callback;
}
protected:
enum AnimationState
{
ANIMATING_GESTURE,
ANIMATING_SNAP,
ANIMATING_DRAG,
NO_ANIMATION
};
AnimationState currentAnimationState;
Container textContainer;
MoveAnimator<TextArea> text;
Container textSelectedContainer;
MoveAnimator<TextArea> textSelected;
Box textSelectedBackground;
int selectedAreaYOffset;
int selectedTextYPosition;
int spaceBetweenTextRows;
int topCutOff;
int bottomCutOff;
GenericCallback<const WheelSelector&, const int&>* elementSelectedAction;
Callback<WheelSelector, const MoveAnimator<TextArea>& > textMoveEndedCallback;
void textMoveEndedHandler(const MoveAnimator<TextArea>& textArea);
virtual void moveText(int newYPosition);
virtual void animateMoveText(int newYPosition, int duration, EasingEquation equation);
void snap();
void adjustForBoundries(int& newYValue);
};