20 #include <vstgui4/vstgui/lib/controls/ccontrol.h> 21 #include <vstgui4/vstgui/lib/cdrawcontext.h> 67 void draw(CDrawContext *iContext)
override;
70 virtual void drawHeldButton(CDrawContext *iContext);
73 virtual void drawReleasedButton(CDrawContext *iContext);
76 CMouseEventResult onMouseDown(CPoint &where,
const CButtonState &buttons)
override;
77 CMouseEventResult onMouseUp(CPoint &where,
const CButtonState &buttons)
override;
78 CMouseEventResult onMouseCancel()
override;
79 int32_t onKeyDown(VstKeyCode &keyCode)
override;
80 int32_t onKeyUp(VstKeyCode &keyCode)
override;
83 bool isHeld()
const {
return fHeld; }
87 void setHeldColor(CColor
const &iColor) { fHeldColor = iColor; markDirty(); }
119 void setStepIncrement(int32 iStepIncrement) { fStepIncrement = iStepIncrement; fButtonPolygon =
nullptr; }
136 void setWrap(
bool iFlag) { fWrap = iFlag; markDirty(); }
149 void registerParameters()
override;
156 virtual int32 computeNextValue(int32 iIncrement)
const;
161 virtual CDrawContext::PointList *getButtonPolygon();
164 void setViewSize(
const CRect &rect,
bool invalid)
override;
172 double fStepIncrement{1.0};
173 double fShiftStepIncrement{0.0};
175 CColor fHeldColor{kRedCColor};
176 CColor fReleasedColor{kGreyCColor};
180 std::unique_ptr<CDrawContext::PointList> fButtonPolygon{};
186 explicit Creator(
char const *iViewName =
nullptr,
char const *iDisplayName =
nullptr) :
195 registerListAttribute<EArrowDirection>(
"arrow-direction",
198 {
"auto", EArrowDirection::kAuto},
199 {
"up", EArrowDirection::kUp},
200 {
"right", EArrowDirection::kRight},
201 {
"down", EArrowDirection::kDown},
202 {
"left", EArrowDirection::kLeft}
Inherit from this class to provide the factory for a custom view.
Definition: CustomViewCreator.h:1311
SharedPointer< CBitmap > BitmapSPtr
Definition: Types.h:50
Definition: CustomController.h:24
Specialization of TCustomControlView for discrete values.
Definition: CustomControlView.h:152
CBitmap * BitmapPtr
Definition: Types.h:49