10 #include "../ccolor.h" 11 #include "../cbitmap.h" 12 #include "../cgradient.h" 13 #include "../cgraphicspath.h" 14 #include "../cstring.h" 15 #include "../cdrawmethods.h" 34 virtual int32_t getStyle ()
const {
return style; }
35 virtual void setStyle (int32_t newStyle) { style = newStyle; }
74 virtual void setTitle (
const UTF8String& newTitle);
75 const UTF8String& getTitle ()
const {
return title; }
77 virtual void setFont (CFontRef newFont);
78 const CFontRef getFont ()
const {
return font; }
80 virtual void setFontColor (
const CColor& newColor) { fontColor = newColor;
invalid (); }
81 const CColor& getFontColor ()
const {
return fontColor; }
83 virtual void setBoxFrameColor (
const CColor& newColor) { boxFrameColor = newColor;
invalid (); }
84 const CColor& getBoxFrameColor ()
const {
return boxFrameColor; }
85 virtual void setBoxFillColor (
const CColor& newColor) { boxFillColor = newColor;
invalid (); }
86 const CColor& getBoxFillColor ()
const {
return boxFillColor; }
87 virtual void setCheckMarkColor (
const CColor& newColor) { checkMarkColor = newColor;
invalid (); }
88 const CColor& getCheckMarkColor ()
const {
return checkMarkColor; }
90 virtual int32_t getStyle ()
const {
return style; }
91 virtual void setStyle (int32_t newStyle);
93 CCoord getFrameWidth ()
const {
return frameWidth; }
94 virtual void setFrameWidth (CCoord width);
95 CCoord getRoundRectRadius ()
const {
return roundRectRadius; }
96 virtual void setRoundRectRadius (CCoord radius);
101 void draw (CDrawContext* context)
override;
102 CMouseEventResult
onMouseDown (CPoint& where,
const CButtonState& buttons)
override;
103 CMouseEventResult
onMouseMoved (CPoint& where,
const CButtonState& buttons)
override;
104 CMouseEventResult
onMouseUp (CPoint& where,
const CButtonState& buttons)
override;
111 CLASS_METHODS(CCheckBox, CControl)
113 ~CCheckBox () noexcept override = default;
118 CColor boxFrameColor;
120 CColor checkMarkColor;
121 CCoord frameWidth {1};
122 CCoord roundRectRadius {0};
123 SharedPointer<CFontDesc> font;
126 float previousValue {0.f};
127 bool hilight {
false};
153 void setNumSubPixmaps (int32_t numSubPixmaps)
override { IMultiBitmapControl::setNumSubPixmaps (numSubPixmaps);
invalid (); }
182 virtual void setTitle (
const UTF8String& newTitle);
183 const UTF8String& getTitle ()
const {
return title; }
185 virtual void setFont (CFontRef newFont);
186 CFontRef getFont ()
const {
return font; }
188 virtual void setTextColor (
const CColor& color);
189 const CColor& getTextColor ()
const {
return textColor; }
190 virtual void setTextColorHighlighted (
const CColor& color);
191 const CColor& getTextColorHighlighted ()
const {
return textColorHighlighted; }
193 virtual void setGradient (CGradient* gradient);
194 CGradient* getGradient ()
const;
195 virtual void setGradientHighlighted (CGradient* gradient);
196 CGradient* getGradientHighlighted ()
const;
198 virtual void setFrameColor (
const CColor& color);
199 const CColor& getFrameColor ()
const {
return frameColor; }
200 virtual void setFrameColorHighlighted (
const CColor& color);
201 const CColor& getFrameColorHighlighted ()
const {
return frameColorHighlighted; }
203 virtual void setFrameWidth (CCoord width);
204 CCoord getFrameWidth ()
const {
return frameWidth; }
206 virtual void setRoundRadius (CCoord radius);
207 CCoord getRoundRadius ()
const {
return roundRadius; }
209 virtual void setStyle (
Style style);
210 Style getStyle ()
const {
return style; }
212 virtual void setIcon (CBitmap* bitmap);
213 CBitmap* getIcon ()
const;
215 virtual void setIconHighlighted (CBitmap* bitmap);
216 CBitmap* getIconHighlighted ()
const;
218 virtual void setIconPosition (CDrawMethods::IconPosition pos);
219 CDrawMethods::IconPosition getIconPosition ()
const {
return iconPosition; }
221 virtual void setTextMargin (CCoord margin);
222 CCoord getTextMargin ()
const {
return textMargin; }
224 virtual void setTextAlignment (CHoriTxtAlign hAlign);
225 CHoriTxtAlign getTextAlignment ()
const {
return horiTxtAlign; }
229 void draw (CDrawContext* context)
override;
233 bool removed (CView* parent)
override;
235 CMouseEventResult
onMouseDown (CPoint& where,
const CButtonState& buttons)
override;
236 CMouseEventResult
onMouseUp (CPoint& where,
const CButtonState& buttons)
override;
237 CMouseEventResult
onMouseMoved (CPoint& where,
const CButtonState& buttons)
override;
242 CLASS_METHODS(CTextButton, CControl)
244 ~CTextButton () noexcept override = default;
247 CGraphicsPath* getPath (CDrawContext* context, CCoord lineWidth);
249 SharedPointer<CFontDesc> font;
250 SharedPointer<CGraphicsPath> _path;
251 SharedPointer<CBitmap> icon;
252 SharedPointer<CBitmap> iconHighlighted;
253 SharedPointer<CGradient> gradient;
254 SharedPointer<CGradient> gradientHighlighted;
259 CColor textColorHighlighted;
260 CColor frameColorHighlighted;
266 CHoriTxtAlign horiTxtAlign;
267 CDrawMethods::IconPosition iconPosition;
void setViewSize(const CRect &rect, bool invalid=true) override
set views size
Definition: cbuttons.cpp:720
bool sizeToFit() override
resize view to optimal size
Definition: cbuttons.cpp:880
int32_t onKeyUp(VstKeyCode &keyCode) override
called if a key up event occurs and this view has focus
Definition: cbuttons.cpp:1067
bool removed(CView *parent) override
view is removed from parent view
Definition: cbuttons.cpp:713
void draw(CDrawContext *context) override
called if the view should draw itself
Definition: cbuttons.cpp:897
Rect structure.
Definition: crect.h:17
automatically adjusts the width so that the label is completely visible
Definition: cbuttons.h:66
void setBackground(CBitmap *background) override
set the background image of this view
Definition: cbuttons.cpp:379
Definition: xmlparse.c:181
Definition: vstkeycode.h:12
bool getFocusPath(CGraphicsPath &outPath) override
Definition: cbuttons.cpp:933
bool drawFocusOnTop() override
Definition: cbuttons.cpp:946
Style
< CTextButton style
Definition: cbuttons.h:170
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
CMouseEventResult onMouseMoved(CPoint &where, const CButtonState &buttons) override
called when a mouse move event occurs
Definition: cbuttons.cpp:624
int32_t onKeyDown(VstKeyCode &keyCode) override
called if a key down event occurs and this view has focus
Definition: cbuttons.cpp:673
bool getFocusPath(CGraphicsPath &outPath) override
Definition: cbuttons.cpp:587
CMouseEventResult onMouseUp(CPoint &where, const CButtonState &buttons) override
called when a mouse up event occurs
Definition: cbuttons.cpp:993
Encapsulates various platform depended kinds of bitmaps.
Definition: cbitmap.h:21
Definition: customcontrols.cpp:8
base class of all VSTGUI controls
Definition: ccontrol.h:76
CMouseEventResult onMouseDown(CPoint &where, const CButtonState &buttons) override
called when a mouse down event occurs
Definition: cbuttons.cpp:612
draws a crossbox instead of a checkmark if no bitmap is provided
Definition: cbuttons.h:67
CMouseEventResult onMouseDown(CPoint &where, const CButtonState &buttons) override
called when a mouse down event occurs
Definition: cbuttons.cpp:970
CMouseEventResult onMouseUp(CPoint &where, const CButtonState &buttons) override
called when a mouse up event occurs
Definition: cbuttons.cpp:656
holds an UTF8 encoded string and a platform representation of it
Definition: cstring.h:56
virtual void invalid()
mark whole view as invalid
Definition: cview.h:63
Styles
Definition: cbuttons.h:65
bool sizeToFit() override
resize view to optimal size
Definition: cbuttons.cpp:440
void draw(CDrawContext *context) override
called if the view should draw itself
Definition: cbuttons.cpp:466
Point structure.
Definition: cpoint.h:17
CMouseEventResult onMouseMoved(CPoint &where, const CButtonState &buttons) override
called when a mouse move event occurs
Definition: cbuttons.cpp:1014
a check box control with a title and 3 states
Definition: cbuttons.h:59
CMouseEventResult onMouseCancel() override
called when mouse tracking should be canceled
Definition: cbuttons.cpp:641
a button which renders without bitmaps
Definition: cbuttons.h:167
CMouseEventResult onMouseCancel() override
called when mouse tracking should be canceled
Definition: cbuttons.cpp:980
int32_t onKeyDown(VstKeyCode &keyCode) override
called if a key down event occurs and this view has focus
Definition: cbuttons.cpp:1032
Definition: icontrollistener.h:14
interface for controls with sub images
Definition: ccontrol.h:182