]> O.S.I.I.S - jp/crow.git/commitdiff
DbgEvtType.DragNDrop, removed DEBUG_DRAGNDROP preproc
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 18 Sep 2021 09:45:17 +0000 (09:45 +0000)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 18 Sep 2021 09:45:17 +0000 (09:45 +0000)
Crow/Crow.csproj
Crow/src/DebugUtils/DbgEvtType.cs
Crow/src/Interface.cs
Crow/src/Widgets/Widget.cs

index 1c61b00e902b5e1c9ecb3b68b003be3d9fce6383..d5912c8a7c3e0d8ff0e7f321d58a844d57dadac8 100644 (file)
@@ -31,7 +31,7 @@
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
                <DebugType>full</DebugType>
-               <DefineConstants>$(DefineConstants);DEBUG;TRACE;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_DRAGNDROP</DefineConstants>
+               <DefineConstants>$(DefineConstants);DEBUG;TRACE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE</DefineConstants>
                <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
        </PropertyGroup>
        <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
index dff68490c25545da549af31a41c60c070f88d65c..ed6bfea2c34d0092d5bedfe0947fb2e2ac535ab4 100644 (file)
@@ -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
        }
index 46645deea8366f5ebeba91b0bc66ae431c5f7eb6..250d2fb107cc29221386c86860a11bb018b5cd8e 100644 (file)
@@ -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) {
index 1f7c1b08ad1e091c60fedd11a638d019aa25d77b..da4d7c357d652a970fc75ff98e86804c1a9c9376 100644 (file)
@@ -1437,56 +1437,49 @@ namespace Crow
                /// equivalent to mouse move for a dragged widget, no bubbling.
                /// </summary>
                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
                }
 
                /// <summary>
                /// fired when drag and drop operation start
                /// </summary>
                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;
                }
                /// <summary>
                ///  Occured when dragging ends without dropping
                /// </summary>
                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