Browse Source

Revert "removed handlingDragAndDrop_ variable, get drag object directly"

This reverts commit 7264e3976e34583ea7a443d47f851c10e0661714.
Josh Engebretson 10 years ago
parent
commit
1af36b113c
2 changed files with 9 additions and 3 deletions
  1. 7 3
      Source/Atomic/UI/UISelectList.cpp
  2. 2 0
      Source/Atomic/UI/UISelectList.h

+ 7 - 3
Source/Atomic/UI/UISelectList.cpp

@@ -227,6 +227,11 @@ void UISelectList::HandleUIUpdate(StringHash eventType, VariantMap& eventData)
                 select->GetScrollContainer()->ScrollBy(0, speed);
                 select->GetScrollContainer()->ScrollBy(0, speed);
 
 
         }
         }
+        handlingDragAndDrop_ = true;
+    }
+    else
+    {
+        handlingDragAndDrop_ = false;
     }
     }
 
 
 }
 }
@@ -239,10 +244,8 @@ bool UISelectList::OnEvent(const tb::TBWidgetEvent &ev)
     }
     }
     if (ev.type == EVENT_TYPE_POINTER_MOVE)
     if (ev.type == EVENT_TYPE_POINTER_MOVE)
     {
     {
-        UIDragDrop* dragDrop = GetSubsystem<UIDragDrop>();
-
         //if we handle drag and drop then return true, to avoid panning scroll widget by turbobadger, let the widget control scroll by itself
         //if we handle drag and drop then return true, to avoid panning scroll widget by turbobadger, let the widget control scroll by itself
-        if (dragDrop->GetDraggingObject())
+        if (handlingDragAndDrop_)
             return true;
             return true;
     }
     }
     return UIWidget::OnEvent(ev);
     return UIWidget::OnEvent(ev);
@@ -273,4 +276,5 @@ void UISelectList::SetUIListView(bool value)
 
 
 }
 }
 
 
+
 }
 }

+ 2 - 0
Source/Atomic/UI/UISelectList.h

@@ -77,6 +77,8 @@ protected:
     virtual bool OnEvent(const tb::TBWidgetEvent &ev);
     virtual bool OnEvent(const tb::TBWidgetEvent &ev);
 
 
 private:
 private:
+    //Returns true if we have drag and drop element on select list widget
+    bool handlingDragAndDrop_;
 };
 };