20 #include <vstgui4/vstgui/lib/controls/ccontrol.h> 61 fBackColor = CColor{200,200,200};
65 void draw(CDrawContext *iContext)
override;
68 virtual void drawOn(CDrawContext *iContext);
71 virtual void drawOff(CDrawContext *iContext);
74 CMouseEventResult onMouseDown(CPoint &where,
const CButtonState &buttons)
override;
75 CMouseEventResult onMouseUp(CPoint &where,
const CButtonState &buttons)
override;
76 CMouseEventResult onMouseCancel()
override;
77 int32_t onKeyDown(VstKeyCode &keyCode)
override;
78 int32_t onKeyUp(VstKeyCode &keyCode)
override;
81 bool sizeToFit()
override;
90 void setOffStep(int32 iStep) { fOffStep = iStep; markDirty(); }
102 void setOnStep(int32 iStep) { fOnStep = iStep; markDirty(); }
105 int32 getComputedOnStep()
const;
108 bool isOff()
const {
return getControlValue() == getComputedOffStep(); }
109 bool isOn()
const {
return !isOff(); }
174 CColor fOnColor{kRedCColor};
175 CColor fDisabledColor{kBlackCColor};
177 bool fInverse{
false};
180 bool fImageHasDisabledState{
false};
186 explicit Creator(
char const *iViewName =
nullptr,
char const *iDisplayName =
nullptr) :
Inherit from this class to provide the factory for a custom view.
Definition: CustomViewCreator.h:1314
constexpr auto ZERO_INT32
Definition: Constants.h:24
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