From: Jean-Philippe Bruyère Date: Sat, 18 Sep 2021 09:45:17 +0000 (+0000) Subject: DbgEvtType.DragNDrop, removed DEBUG_DRAGNDROP preproc X-Git-Tag: v0.9.7-beta~7 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5c71e11b3648cbfa8f05cf01cbd87694ab142b82;p=jp%2Fcrow.git DbgEvtType.DragNDrop, removed DEBUG_DRAGNDROP preproc --- diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index 1c61b00e..d5912c8a 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -31,7 +31,7 @@ full - $(DefineConstants);DEBUG;TRACE;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_DRAGNDROP + $(DefineConstants);DEBUG;TRACE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE true diff --git a/Crow/src/DebugUtils/DbgEvtType.cs b/Crow/src/DebugUtils/DbgEvtType.cs index dff68490..ed6bfea2 100644 --- a/Crow/src/DebugUtils/DbgEvtType.cs +++ b/Crow/src/DebugUtils/DbgEvtType.cs @@ -26,8 +26,9 @@ namespace Crow TemplatedGroup = 0x00080000, Dispose = 0x00100000, Mouse = 0x00200000, + DragNDrop = 0x00400000, - Update = IFace | 0x00100000, + Update = IFace | 0x10000000, ProcessLayouting = IFace | Update | Lock | Layouting, ClippingRegistration = IFace | Update | Lock | Clipping, ProcessDrawing = IFace | Update | Lock | Drawing, @@ -98,6 +99,12 @@ namespace Crow WidgetMouseWheel = Widget | Mouse | 0x06, WidgetMouseClick = Widget | Mouse | 0x07, WidgetMouseDblClick = Widget | Mouse | 0x08, + Drag = Widget | DragNDrop | 0x01, + DragEnter = Widget | DragNDrop | 0x02, + DragLeave = Widget | DragNDrop | 0x03, + StartDrag = Widget | DragNDrop | 0x04, + EndDrag = Widget | DragNDrop | 0x05, + Drop = Widget | DragNDrop | 0x06, All = 0x7FFFFF00 } diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs index 46645dee..250d2fb1 100644 --- a/Crow/src/Interface.cs +++ b/Crow/src/Interface.cs @@ -1742,7 +1742,7 @@ namespace Crow topContainer = w; int indexOfTopContainer = GraphicTree.IndexOf (topContainer); - if (indexOfTopContainer != 0) { + if (indexOfTopContainer != 0) {//0 is topMost for (int i = 0; i < indexOfTopContainer; i++) {//check all top containers that are at a higher level //if logical parent of top container is the Interface, that's not a popup. if (GraphicTree [i].LogicalParent is Interface) { diff --git a/Crow/src/Widgets/Widget.cs b/Crow/src/Widgets/Widget.cs index 1f7c1b08..da4d7c35 100644 --- a/Crow/src/Widgets/Widget.cs +++ b/Crow/src/Widgets/Widget.cs @@ -1437,56 +1437,49 @@ namespace Crow /// equivalent to mouse move for a dragged widget, no bubbling. /// public virtual void onDrag (object sender, MouseMoveEventArgs e) { + DbgLogger.AddEvent (DbgEvtType.Drag, this, e); + if (Drag != null) Drag.Invoke (this, e); -#if DEBUG_DRAGNDROP - Debug.WriteLine (this.ToString () + " : DRAG => " + e.ToString ()); -#endif } /// /// fired when drag and drop operation start /// protected virtual void onStartDrag (object sender, DragDropEventArgs e){ + DbgLogger.AddEvent (DbgEvtType.StartDrag, this, e); + IFace.DragAndDropOperation = e; IFace.dragndropHover = e.DropTarget; IsDragged = true; StartDrag.Raise (this, IFace.DragAndDropOperation); - #if DEBUG_DRAGNDROP - Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString()); - #endif } protected virtual void onDragEnter (object sender, DragDropEventArgs e){ + DbgLogger.AddEvent (DbgEvtType.DragEnter, this, e); + e.DropTarget = this; DragEnter.Raise (this, e); - #if DEBUG_DRAGNDROP - Debug.WriteLine(this.ToString() + " : DRAG Enter => " + e.ToString()); - #endif } public virtual void onDragLeave (object sender, DragDropEventArgs e){ + DbgLogger.AddEvent (DbgEvtType.DragLeave, this, e); + DragLeave.Raise (this, e); -#if DEBUG_DRAGNDROP - Debug.WriteLine (this.ToString () + " : DRAG Leave => " + e.ToString ()); -#endif e.DropTarget = null; } /// /// Occured when dragging ends without dropping /// public virtual void onEndDrag (object sender, DragDropEventArgs e) { + DbgLogger.AddEvent (DbgEvtType.EndDrag, this, e); + IsDragged = false; EndDrag.Raise (this, e); -#if DEBUG_DRAGNDROP - Debug.WriteLine(this.ToString() + " : END DRAG => " + e.ToString()); -#endif } public virtual void onDrop (object sender, DragDropEventArgs e){ + DbgLogger.AddEvent (DbgEvtType.Drop, this, e); + IsDragged = false; Drop.Raise (this, e); - //e.DropTarget.onDragLeave (this, e);//raise drag leave in target -#if DEBUG_DRAGNDROP - Debug.WriteLine(this.ToString() + " : DROP => " + e.ToString()); -#endif } public bool IsDropTarget => IFace.DragAndDropOperation?.DropTarget == this; #endregion