20 #include <vstgui4/vstgui/lib/controls/ccontrol.h> 21 #include <vstgui4/vstgui/lib/cdrawcontext.h> 79 void draw(CDrawContext *iContext)
override;
82 virtual void drawHeldPad(CDrawContext *iContext);
85 virtual void drawReleasedPad(CDrawContext *iContext);
88 CMouseEventResult onMouseDown(CPoint &where,
const CButtonState &buttons)
override;
89 CMouseEventResult onMouseMoved(CPoint &where,
const CButtonState &buttons)
override;
90 CMouseEventResult onMouseUp(CPoint &where,
const CButtonState &buttons)
override;
91 CMouseEventResult onMouseCancel()
override;
94 bool isHeld()
const {
return fHeld; }
217 void registerParameters()
override;
221 virtual CMouseEventResult setNextValue(CPoint &iWhere,
const CButtonState &iButtons);
224 bool sizeToFit()
override;
231 int32 fStepIncrement{1};
232 int32 fShiftStepIncrement{1};
233 double fDragFactor{100.0};
234 double fShiftDragFactor{100.0};
237 CColor fHeldColor{kRedCColor};
238 CColor fDisabledColor{kBlackCColor};
240 bool fInverse{
false};
244 bool fImageHasDisabledState{
false};
247 std::unique_ptr<GUIOptionalParam<int32>::EditorType> fEditor{};
248 CPoint fMousePosition{};
254 explicit Creator(
char const *iViewName =
nullptr,
char const *iDisplayName =
nullptr) :
267 registerListAttribute<EPositiveDirection>(
"positive-direction",
270 {
"up", EPositiveDirection::kUp},
271 {
"down", EPositiveDirection::kDown},
272 {
"right", EPositiveDirection::kRight},
273 {
"left", EPositiveDirection::kLeft}
Inherit from this class to provide the factory for a custom view.
Definition: CustomViewCreator.h:1312
int32 getStepIncrement() const
Value by which this pad will increment (positive) or decrement (negative) the parameter.
Definition: StepPadView.h:148
bool getWrap() const
Defines what happens when the value reaches its end of range after being incremented (resp.
Definition: StepPadView.h:184
double getShiftDragFactor() const
Defines how many pixels the mouse needs to move to go through the range of values when shift is being...
Definition: StepPadView.h:177
BitmapPtr getImage() const
The image to use to draw the pad.
Definition: StepPadView.h:133
A step pad lets you step through the values of a parameter by click dragging vertically or horizontal...
Definition: StepPadView.h:60
bool isHeld() const
Definition: StepPadView.h:94
CColor const & getDisabledColor() const
When no image is provided and the control is disabled, this color is used instead.
Definition: StepPadView.h:107
int32 getShiftStepIncrement() const
Value by which this pad will increment (positive) or decrement (negative) the parameter when the shif...
Definition: StepPadView.h:156
void setImageHasDisabledState(bool iValue)
Attribute button-image.
Definition: StepPadView.h:144
void setStepIncrement(int32 iStepIncrement)
Attribute step-increment.
Definition: StepPadView.h:150
CColor const & getHeldColor() const
When no image is provided, the "released" color is the back color.
Definition: StepPadView.h:101
bool getInverse() const
Inverses the meaning of "held" and "released" in regards to drawing the view/image.
Definition: StepPadView.h:194
void setHeldColor(CColor const &iColor)
attribute held-color
Definition: StepPadView.h:103
void setDisabledColor(CColor const &iColor)
attribute disabled-color
Definition: StepPadView.h:109
void setDragFactor(double iDragFactor)
Attribute drag-factor.
Definition: StepPadView.h:170
SharedPointer< CBitmap > BitmapSPtr
Definition: Types.h:50
EPositiveDirection
Represents the direction the mouse needs to be moved to register a change.
Definition: StepPadView.h:65
StepPadView(const CRect &iSize)
Definition: StepPadView.h:74
Creator(char const *iViewName=nullptr, char const *iDisplayName=nullptr)
Definition: StepPadView.h:254
Definition: CustomController.h:24
double getDragFactor() const
Defines how many pixels the mouse needs to move to go through the range of values.
Definition: StepPadView.h:168
void setWrap(bool iFlag)
Attribute wrap.
Definition: StepPadView.h:186
bool getImageHasDisabledState() const
Flag to determine whether the image contains a disabled state (3 frames) or not (2 frames)
Definition: StepPadView.h:142
void setShiftStepIncrement(int32 iStepIncrement)
Attribute shift-step-increment.
Definition: StepPadView.h:159
Definition: StepPadView.h:251
void setDirection(EPositiveDirection iDirection)
Attribute positive-direction.
Definition: StepPadView.h:213
EPositiveDirection getDirection() const
Defines the direction in which the mouse needs to be dragged in order to increase the value.
Definition: StepPadView.h:211
Specialization of TCustomControlView for discrete values.
Definition: CustomControlView.h:152
void setImage(BitmapPtr iImage)
Attribute pad-image.
Definition: StepPadView.h:136
void setInverse(bool iInverse)
Attribute inverse.
Definition: StepPadView.h:196
CBitmap * BitmapPtr
Definition: Types.h:49
void setShiftDragFactor(double iShiftDragFactor)
Attribute shift-drag-factor.
Definition: StepPadView.h:179