Fission FSN
Loading...
Searching...
No Matches
fsCSliderComponent.h
Go to the documentation of this file.
1/********************************************************************
2*
3* Created: 31/3/2014 14:38
4*
5* File: fsCSliderComponent.h
6*
7* Author: Mick Waites
8*
9* Purpose: Gui element generally used for volume settings.
10*
11*********************************************************************/
12
13#ifndef fsCSliderComponenthdr
14#define fsCSliderComponenthdr
15
17
19
20class fsCBrush;
21
22
24{
25 friend class fsCComponentFactory;
26
27public:
28
30 {
31 sSliderMsgParam(const fsStr& pParentName) : mParentName(pParentName), mValue(0.0f)
32 {
33 }
34
37 };
38
39 static const fsCUniqueId mTypeId;
40
43
44 void valueSet(fsF32 pValue);
45 // Moves the knob and its travel by pDelta: for a panel that re-lays out its children after
46 // loading. Setting the knob's position directly is undone by the next valueSet().
47 void travelMove(const fsVec2d& pDelta);
48
49protected:
50
51 void initialiseDo() override;
52 fsBool acceptingInputGet() const override;
53 fsBool highlightSetDo() override;
54 void onDragStart(const fsPoint& pStartPos) override;
55 void onDragMove(const fsPoint& pCurrPos) override;
56 void onDragEnd(const fsPoint& pEndPos) override;
57
58 static fsIComponent* create(fsCEntity* pParent);
59
60 void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;
61
63 ~fsCSliderComponent() override;
64
66
67 std::shared_ptr<fsCBrush> mBrush;
68 std::shared_ptr<fsCBrush> mOverBrush;
69
71
75
80
81private:
82
83 void spriteInitialise(const fsCVariableTable& pVars);
84 void rangeAndPosInitialise(const fsCVariableTable& pVars);
85 void knobPositionSetByValue();
86};
87
88#endif
Definition fsCBrush.h:26
Definition fsCEntity.h:39
fsBool acceptingInputGet() const override
Definition fsCSliderComponent.cpp:20
void initialiseFromVariableTableDo(const fsCVariableTable &pVars) override
Definition fsCSliderComponent.cpp:42
static fsIComponent * create(fsCEntity *pParent)
Definition fsCSliderComponent.cpp:37
fsBool mVertical
Definition fsCSliderComponent.h:79
friend class fsCComponentFactory
Definition fsCSliderComponent.h:25
std::shared_ptr< fsCBrush > mOverBrush
Definition fsCSliderComponent.h:68
void initialiseDo() override
Definition fsCSliderComponent.cpp:50
fsVec2d mOrigPointerPos
Definition fsCSliderComponent.h:70
static const fsCUniqueId mTypeId
Definition fsCSliderComponent.h:39
fsF32 mOrigValue
Definition fsCSliderComponent.h:74
fsF32 mRange
Definition fsCSliderComponent.h:73
fsBool mArc
Definition fsCSliderComponent.h:78
fsBool mPointerOver
Definition fsCSliderComponent.h:76
void onDragEnd(const fsPoint &pEndPos) override
Definition fsCSliderComponent.cpp:159
void travelMove(const fsVec2d &pDelta)
Definition fsCSliderComponent.cpp:31
void onDragStart(const fsPoint &pStartPos) override
Definition fsCSliderComponent.cpp:132
fsBool highlightSetDo() override
Definition fsCSliderComponent.cpp:121
static const fsCUniqueId mEventSliderMovedMsg
Definition fsCSliderComponent.h:41
static const fsCUniqueId mEventSliderReleasedMsg
Definition fsCSliderComponent.h:42
void valueSet(fsF32 pValue)
Definition fsCSliderComponent.cpp:25
void onDragMove(const fsPoint &pCurrPos) override
Definition fsCSliderComponent.cpp:138
std::shared_ptr< fsCBrush > mBrush
Definition fsCSliderComponent.h:67
fsPoint mKnobLeftPos
Definition fsCSliderComponent.h:72
fsCSliderComponent(fsCEntity *pParent)
Definition fsCSliderComponent.cpp:164
~fsCSliderComponent() override
Definition fsCSliderComponent.cpp:176
fsBool mWaitingForPointerUp
Definition fsCSliderComponent.h:77
sSliderMsgParam mMessageParams
Definition fsCSliderComponent.h:65
Definition fsCUniqueId.h:21
Definition fsCVariableTable.h:27
fsIComponent(fsCEntity *pParent)
Definition fsIComponent.cpp:86
fsIGestureHandlingComponent(fsCEntity *pParent, fsBool pHandleTaps, fsBool pHandleDragEvent, fsBool pHandlePinchEvents)
Definition fsIGestureHandlingComponent.cpp:521
Definition fsStr.h:23
bool fsBool
Definition fsBaseTypes.h:26
float fsF32
Definition fsBaseTypes.h:28
Definition fsCSliderComponent.h:30
fsF32 mValue
Definition fsCSliderComponent.h:36
const fsStr & mParentName
Definition fsCSliderComponent.h:35
sSliderMsgParam(const fsStr &pParentName)
Definition fsCSliderComponent.h:31
Definition fsIMessageDispatcher.h:32
Definition fsPoint.h:17
Definition fsVec2d.h:16