ASPiK SDK
cshadowviewcontainer.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 __cshadowviewcontainer__
6 #define __cshadowviewcontainer__
7 
8 #include "cviewcontainer.h"
9 #include "iviewlistener.h"
10 #include "iscalefactorchangedlistener.h"
11 
12 namespace VSTGUI {
13 
14 //-----------------------------------------------------------------------------
15 // CShadowViewContainer Declaration
19 //-----------------------------------------------------------------------------
21 {
22 public:
23  explicit CShadowViewContainer (const CRect& size);
25  ~CShadowViewContainer () noexcept override;
26 
27  //-----------------------------------------------------------------------------
29  //-----------------------------------------------------------------------------
31  virtual void setShadowOffset (const CPoint& offset);
32  const CPoint& getShadowOffset () const { return shadowOffset; }
33 
34  virtual void setShadowIntensity (float intensity);
35  float getShadowIntensity () const { return shadowIntensity; }
36 
37  virtual void setShadowBlurSize (double size);
38  double getShadowBlurSize () const { return shadowBlurSize; }
39 
40  void invalidateShadow ();
42 
43  // override
44  bool removed (CView* parent) override;
45  bool attached (CView* parent) override;
46  void drawRect (CDrawContext* pContext, const CRect& updateRect) override;
47  void drawBackgroundRect (CDrawContext* pContext, const CRect& _updateRect) override;
48  void setViewSize (const CRect& rect, bool invalid = true) override;
49  CMessageResult notify (CBaseObject* sender, IdStringPtr message) override;
50 
51  void onScaleFactorChanged (CFrame* frame, double newScaleFactor) override;
52 
53  CLASS_METHODS(CShadowViewContainer, CViewContainer)
54 protected:
55  void viewContainerViewAdded (CViewContainer* container, CView* view) override;
56  void viewContainerViewRemoved (CViewContainer* container, CView* view) override;
57  void viewContainerViewZOrderChanged (CViewContainer* container, CView* view) override;
58 
59  void beforeDelete () override;
60 
61  bool dontDrawBackground;
62  CPoint shadowOffset;
63  float shadowIntensity;
64  double shadowBlurSize;
65  double scaleFactorUsed;
66 };
67 
68 } // namespace
69 
70 #endif // __cshadowviewcontainer__
void invalid() override
mark whole view as invalid
Definition: cviewcontainer.cpp:618
Container Class of CView objects.
Definition: cviewcontainer.h:52
Rect structure.
Definition: crect.h:17
ViewContainer Listener Interface Adapter.
Definition: iviewlistener.h:59
bool attached(CView *parent) override
view is attached to a parent view
Definition: cshadowviewcontainer.cpp:56
A drawing context encapsulates the drawing context of the underlying OS.
Definition: cdrawcontext.h:29
void setViewSize(const CRect &rect, bool invalid=true) override
set views size
Definition: cshadowviewcontainer.cpp:218
Base Object with reference counter.
Definition: vstguibase.h:276
bool removed(CView *parent) override
view is removed from parent view
Definition: cshadowviewcontainer.cpp:48
Definition: customcontrols.cpp:8
void drawRect(CDrawContext *pContext, const CRect &updateRect) override
called if the view should draw itself
Definition: cshadowviewcontainer.cpp:142
Base Class of all view objects.
Definition: cview.h:44
void drawBackgroundRect(CDrawContext *pContext, const CRect &_updateRect) override
draw the background
Definition: cshadowviewcontainer.cpp:206
Definition: iscalefactorchangedlistener.h:13
a view container which draws a shadow for it's subviews
Definition: cshadowviewcontainer.h:20
Point structure.
Definition: cpoint.h:17
The CFrame is the parent container of all views.
Definition: cframe.h:32