8 #include "../../lib/cviewcontainer.h" 10 #if VSTGUI_LIVE_EDITING 12 #include "../../lib/cbitmap.h" 13 #include "../../lib/ccolor.h" 21 class ViewSizeChangeOperation;
23 namespace UIEditViewInternal {
24 class UIHighlightView;
28 class UIEditView :
public CViewContainer
31 UIEditView (
const CRect& size, UIDescription* uidescription);
32 ~UIEditView ()
override;
34 void enableEditing (
bool state);
35 void enableAutosizing (
bool state);
36 void setScale (
double scale);
38 void setEditView (CView* view);
39 CView* getEditView ()
const;
41 void doKeyMove (
const CPoint& delta);
42 void doKeySize (
const CPoint& delta);
44 void setUndoManager (UIUndoManager* manager);
45 UIUndoManager* getUndoManager ();
47 void setSelection (UISelection* selection);
48 UISelection* getSelection ();
50 void setGrid (UIGrid* grid);
52 void setupColors (
const IUIDescription* description);
54 static IdStringPtr kMsgAttached;
55 static IdStringPtr kMsgRemoved;
75 void invalidSelection ();
76 MouseSizeMode selectionHitTest (
const CPoint& where, CView** resultView);
77 bool hitTestSubViews (
const CPoint& where,
const CButtonState& buttons = -1)
override;
78 CMouseEventResult onMouseDown (CPoint &where,
const CButtonState& buttons)
override;
79 CMouseEventResult onMouseUp (CPoint &where,
const CButtonState& buttons)
override;
80 CMouseEventResult onMouseMoved (CPoint &where,
const CButtonState& buttons)
override;
81 CMouseEventResult onMouseExited (CPoint& where,
const CButtonState& buttons)
override;
82 CMessageResult notify (CBaseObject* sender, IdStringPtr message)
override;
84 void doDragEditingMove (CPoint& where);
85 void doSizeEditingMove (CPoint& where);
87 CBitmap* createBitmapFromSelection (UISelection* selection);
88 void startDrag (CPoint& where);
89 UISelection* getSelectionOutOfDrag (IDataPackage* drag);
90 bool onDrop (IDataPackage* drag,
const CPoint& where)
override;
91 void onDragEnter (IDataPackage* drag,
const CPoint& where)
override;
92 void onDragLeave (IDataPackage* drag,
const CPoint& where)
override;
93 void onDragMove (IDataPackage* drag,
const CPoint& where)
override;
95 void draw (CDrawContext *pContext)
override;
96 void drawRect (CDrawContext *pContext,
const CRect& updateRect)
override;
97 CView* getViewAt (
const CPoint& p,
const GetViewOptions& options = GetViewOptions ())
const override;
98 CViewContainer* getContainerAt (
const CPoint& p,
const GetViewOptions& options = GetViewOptions ().deep ())
const override;
99 bool advanceNextFocusView (CView* oldFocus,
bool reverse)
override;
100 bool onWheel (
const CPoint &where,
const CMouseWheelAxis &axis,
const float &distance,
const CButtonState &buttons)
override;
102 void looseFocus ()
override;
103 void takeFocus ()
override;
104 bool removed (CView* parent)
override;
105 bool attached (CView* parent)
override;
108 bool autosizing {
true};
109 MouseEditMode mouseEditMode {kNoEditing};
110 MouseSizeMode mouseSizeMode {kSizeModeNone};
111 CPoint mouseStartPoint;
113 SharedPointer<UIUndoManager> undoManger;
114 SharedPointer<UISelection> selection;
115 UISelection* dragSelection {
nullptr};
116 UIDescription* description {
nullptr};
117 SharedPointer<UIGrid> grid;
119 UIEditViewInternal::UIHighlightView* highlightView {
nullptr};
120 CLayeredViewContainer* overlayView {
nullptr};
121 UICrossLines* lines {
nullptr};
122 ViewSizeChangeOperation* moveSizeOperation {
nullptr};
123 CVSTGUITimer* editTimer {
nullptr};
125 CColor crosslineForegroundColor;
126 CColor crosslineBackgroundColor;
127 CColor viewHighlightColor;
128 CColor viewSelectionColor;
133 #endif // VSTGUI_LIVE_EDITING 135 #endif // __uieditview__ Definition: customcontrols.cpp:8