ASPiK SDK
cmoviebutton.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __cmoviebutton__
6 #define __cmoviebutton__
7 
8 #include "ccontrol.h"
9 
10 namespace VSTGUI {
11 
12 //-----------------------------------------------------------------------------
13 // CMovieButton Declaration
16 //-----------------------------------------------------------------------------
18 {
19 public:
20  CMovieButton (const CRect& size, IControlListener* listener, int32_t tag, CBitmap* background, const CPoint& offset = CPoint (0, 0));
21  CMovieButton (const CRect& size, IControlListener* listener, int32_t tag, CCoord heightOfOneImage, CBitmap* background, const CPoint& offset = CPoint (0, 0));
22  CMovieButton (const CMovieButton& movieButton);
23 
24  void draw (CDrawContext*) override;
25 
26  CMouseEventResult onMouseDown (CPoint& where, const CButtonState& buttons) override;
27  CMouseEventResult onMouseUp (CPoint& where, const CButtonState& buttons) override;
28  CMouseEventResult onMouseMoved (CPoint& where, const CButtonState& buttons) override;
29  CMouseEventResult onMouseCancel () override;
30  int32_t onKeyDown (VstKeyCode& keyCode) override;
31  bool sizeToFit () override;
32 
33  void setNumSubPixmaps (int32_t numSubPixmaps) override { IMultiBitmapControl::setNumSubPixmaps (numSubPixmaps); invalid (); }
34 
35  CLASS_METHODS(CMovieButton, CControl)
36 protected:
37  ~CMovieButton () noexcept override = default;
38  CPoint offset;
39  float buttonState;
40 
41 private:
42  float fEntryState;
43 };
44 
45 } // namespace
46 
47 #endif
void draw(CDrawContext *) override
called if the view should draw itself
Definition: cmoviebutton.cpp:61
CMouseEventResult onMouseMoved(CPoint &where, const CButtonState &buttons) override
called when a mouse move event occurs
Definition: cmoviebutton.cpp:100
Rect structure.
Definition: crect.h:17
CMovieButton(const CRect &size, IControlListener *listener, int32_t tag, CBitmap *background, const CPoint &offset=CPoint(0, 0))
Definition: cmoviebutton.cpp:23
Definition: xmlparse.c:181
Definition: vstkeycode.h:12
CMouseEventResult onMouseUp(CPoint &where, const CButtonState &buttons) override
called when a mouse up event occurs
Definition: cmoviebutton.cpp:92
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
a bi-states button with 2 subbitmaps
Definition: cmoviebutton.h:17
CMouseEventResult onMouseDown(CPoint &where, const CButtonState &buttons) override
called when a mouse down event occurs
Definition: cmoviebutton.cpp:82
int32_t onKeyDown(VstKeyCode &keyCode) override
called if a key down event occurs and this view has focus
Definition: cmoviebutton.cpp:139
bool sizeToFit() override
resize view to optimal size
Definition: cmoviebutton.cpp:154
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
Button and Modifier state.
Definition: cbuttonstate.h:34
CMouseEventResult onMouseCancel() override
called when mouse tracking should be canceled
Definition: cmoviebutton.cpp:123
virtual void invalid()
mark whole view as invalid
Definition: cview.h:63
Point structure.
Definition: cpoint.h:17
Definition: icontrollistener.h:14
interface for controls with sub images
Definition: ccontrol.h:182