Ver código fonte

UIElement: return children as PODVector

Used by AutoBinder
1vanK 5 anos atrás
pai
commit
23a6d24ac0
2 arquivos alterados com 10 adições e 0 exclusões
  1. 7 0
      Source/Urho3D/UI/UIElement.cpp
  2. 3 0
      Source/Urho3D/UI/UIElement.h

+ 7 - 0
Source/Urho3D/UI/UIElement.cpp

@@ -1607,6 +1607,13 @@ void UIElement::GetChildren(PODVector<UIElement*>& dest, bool recursive) const
         GetChildrenRecursive(dest);
 }
 
+PODVector<UIElement*> UIElement::GetChildren(bool recursive) const
+{
+    PODVector<UIElement*> dest;
+    GetChildren(dest, recursive);
+    return dest;
+}
+
 unsigned UIElement::GetNumChildren(bool recursive) const
 {
     if (!recursive)

+ 3 - 0
Source/Urho3D/UI/UIElement.h

@@ -572,6 +572,9 @@ public:
     /// Return child elements either recursively or non-recursively.
     void GetChildren(PODVector<UIElement*>& dest, bool recursive = false) const;
 
+    /// Return child elements, optionally recursive.
+    PODVector<UIElement*> GetChildren(bool recursive) const;
+
     /// Return parent element.
     UIElement* GetParent() const { return parent_; }