ASPiK SDK
uicrosslines.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 __uicrosslines__
6 #define __uicrosslines__
7 
8 #include "../../lib/vstguifwd.h"
9 
10 #if VSTGUI_LIVE_EDITING
11 
12 #include "../../lib/crect.h"
13 #include "../../lib/ccolor.h"
14 #include "../../lib/cview.h"
15 #include "../../lib/iviewlistener.h"
16 
17 namespace VSTGUI {
18 class UISelection;
19 
20 //----------------------------------------------------------------------------------------------------
21 class UICrossLines : public CView, public IViewListenerAdapter
22 {
23 public:
24  enum {
25  kSelectionStyle,
26  kDragStyle
27  };
28 
29  UICrossLines (CViewContainer* editView, int32_t style, const CColor& background = kWhiteCColor, const CColor& foreground = kBlackCColor);
30  ~UICrossLines () override;
31 
32  int32_t getStyle () const { return style; }
33 
34  void update (UISelection* selection);
35  void update (const CPoint& point);
36  void invalid () override;
37  void draw (CDrawContext* pContext) override;
38 protected:
39  void drawLines (CDrawContext* pContext, const CRect& size, const CRect& selectionSize);
40  void viewSizeChanged (CView* view, const CRect& oldSize) override;
41 
42  CViewContainer* editView;
43  CRect currentRect;
44  int32_t style;
45 
46  CColor background;
47  CColor foreground;
48 };
49 
50 } // namespace
51 
52 #endif // VSTGUI_LIVE_EDITING
53 
54 #endif // __uicrosslines__
Definition: customcontrols.cpp:8