public void Call(FairyGUI.TreeNode param0) { func.BeginPCall(); func.PushObject(param0); func.PCall(); func.EndPCall(); }
public FairyGUI.GComponent Call(FairyGUI.TreeNode param0) { func.BeginPCall(); func.PushObject(param0); func.PCall(); FairyGUI.GComponent ret = (FairyGUI.GComponent)func.CheckObject(typeof(FairyGUI.GComponent)); func.EndPCall(); return(ret); }
public void CallWithSelf(FairyGUI.TreeNode param0, bool param1) { func.BeginPCall(); func.Push(self); func.PushObject(param0); func.Push(param1); func.PCall(); func.EndPCall(); }
static public int get_numChildren(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); pushValue(l, true); pushValue(l, self.numChildren); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int GetNextSibling(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); var ret = self.GetNextSibling(); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int set_data(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); System.Object v; checkType(l, 2, out v); self.data = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_expanded(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); bool v; checkType(l, 2, out v); self.expanded = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
/// <summary> /// /// </summary> /// <param name="list"></param> public TreeView(GList list) { this.list = list; list.onClickItem.Add(__clickItem); list.RemoveChildrenToPool(); root = new TreeNode(true); root.SetTree(this); root.cell = list; root.expanded = true; indent = 30; onClickNode = new EventListener(this, "onClickNode"); }
static public int AddChild(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); FairyGUI.TreeNode a1; checkType(l, 2, out a1); var ret = self.AddChild(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int constructor(IntPtr l) { try { FairyGUI.TreeNode o; System.Boolean a1; checkType(l, 2, out a1); o = new FairyGUI.TreeNode(a1); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
static int GetSelectedNode(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); FairyGUI.TreeView obj = (FairyGUI.TreeView)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeView)); FairyGUI.TreeNode o = obj.GetSelectedNode(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int RemoveChildAt(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); var ret = self.RemoveChildAt(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int CollapseAll(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.TreeView obj = (FairyGUI.TreeView)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeView)); FairyGUI.TreeNode arg0 = (FairyGUI.TreeNode)ToLua.CheckObject(L, 2, typeof(FairyGUI.TreeNode)); obj.CollapseAll(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetChildAt(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeNode)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); FairyGUI.TreeNode o = obj.GetChildAt(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetNodeIndex(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.TreeView obj = (FairyGUI.TreeView)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeView)); FairyGUI.TreeNode arg0 = (FairyGUI.TreeNode)ToLua.CheckObject(L, 2, typeof(FairyGUI.TreeNode)); int o = obj.GetNodeIndex(arg0); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RemoveChild(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeNode)); FairyGUI.TreeNode arg0 = (FairyGUI.TreeNode)ToLua.CheckObject(L, 2, typeof(FairyGUI.TreeNode)); FairyGUI.TreeNode o = obj.RemoveChild(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SwapChildrenAt(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeNode)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); int arg1 = (int)LuaDLL.luaL_checknumber(L, 3); obj.SwapChildrenAt(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int SwapChildrenAt(IntPtr l) { try { FairyGUI.TreeNode self = (FairyGUI.TreeNode)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); System.Int32 a2; checkType(l, 3, out a2); self.SwapChildrenAt(a1, a2); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static int AddSelection(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); FairyGUI.TreeView obj = (FairyGUI.TreeView)ToLua.CheckObject(L, 1, typeof(FairyGUI.TreeView)); FairyGUI.TreeNode arg0 = (FairyGUI.TreeNode)ToLua.CheckObject(L, 2, typeof(FairyGUI.TreeNode)); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); obj.AddSelection(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_expanded(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.expanded = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index expanded on a nil value" : e.Message)); } }
static int get_isFolder(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; bool ret = obj.isFolder; LuaDLL.lua_pushboolean(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isFolder on a nil value" : e.Message)); } }
static int get_cell(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; FairyGUI.GComponent ret = obj.cell; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index cell on a nil value" : e.Message)); } }
static int set_data(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; object arg0 = ToLua.ToVarObject(L, 2); obj.data = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index data on a nil value" : e.Message)); } }
static int get_numChildren(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; int ret = obj.numChildren; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index numChildren on a nil value" : e.Message)); } }
static int get_root(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeView obj = (FairyGUI.TreeView)o; FairyGUI.TreeNode ret = obj.root; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index root on a nil value" : e.Message)); } }
static int get_text(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); FairyGUI.TreeNode obj = (FairyGUI.TreeNode)o; string ret = obj.text; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index text on a nil value" : e.Message)); } }
static int _CreateFairyGUI_TreeNode(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { bool arg0 = LuaDLL.luaL_checkboolean(L, 1); FairyGUI.TreeNode obj = new FairyGUI.TreeNode(arg0); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: FairyGUI.TreeNode.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// /// </summary> /// <param name="node"></param> public void UpdateNode(TreeNode node) { if (node.cell == null) return; if (treeNodeRender != null) treeNodeRender(node); }
/// <summary> /// /// </summary> /// <param name="folderNode"></param> public void ExpandAll(TreeNode folderNode) { folderNode.expanded = true; int cnt = folderNode.numChildren; for (int i = 0; i < cnt; i++) { TreeNode node = folderNode.GetChildAt(i); if (node.isFolder) ExpandAll(node); } }
/// <summary> /// /// </summary> /// <param name="node"></param> void CreateCell(TreeNode node) { if (treeNodeCreateCell != null) node.cell = treeNodeCreateCell(node); else node.cell = list.itemPool.GetObject(list.defaultItem) as GComponent; if (node.cell == null) throw new Exception("Unable to create tree cell"); node.cell.data = node; GObject indentObj = node.cell.GetChild("indent"); if (indentObj != null) indentObj.width = (node.level - 1) * indent; GButton expandButton = (GButton)node.cell.GetChild("expandButton"); if (expandButton != null) { if (node.isFolder) { expandButton.visible = true; expandButton.onClick.Add(__clickExpandButton); expandButton.data = node; expandButton.selected = node.expanded; } else expandButton.visible = false; } if (treeNodeRender != null) treeNodeRender(node); }
/// <summary> /// /// </summary> /// <param name="node"></param> /// <returns></returns> int GetInsertIndexForNode(TreeNode node) { TreeNode prevNode = node.GetPrevSibling(); if (prevNode == null) prevNode = node.parent; int insertIndex = list.GetChildIndex(prevNode.cell) + 1; int myLevel = node.level; int cnt = list.numChildren; for (int i = insertIndex; i < cnt; i++) { TreeNode testNode = (TreeNode)list.GetChildAt(i).data; if (testNode.level <= myLevel) break; insertIndex++; } return insertIndex; }
/// <summary> /// /// </summary> /// <param name="node"></param> internal void AfterCollapsed(TreeNode node) { if (node != root && treeNodeWillExpand != null) treeNodeWillExpand(node, false); if (node.cell == null) return; if (node != root) { if (treeNodeRender != null) treeNodeRender(node); GButton expandButton = (GButton)node.cell.GetChild("expandButton"); if (expandButton != null) expandButton.selected = false; } if (node.cell.parent != null) HideFolderNode(node); }
/// <summary> /// /// </summary> /// <param name="child"></param> /// <param name="index"></param> public void SetChildIndex(TreeNode child, int index) { int oldIndex = _children.IndexOf(child); if (oldIndex == -1) throw new Exception("Not a child of this container"); int cnt = _children.Count; if (index < 0) index = 0; else if (index > cnt) index = cnt; if (oldIndex == index) return; _children.RemoveAt(oldIndex); _children.Insert(index, child); if (this.cell != null && this.cell.parent != null && _expanded) tree.AfterMoved(child); }
/// <summary> /// /// </summary> /// <param name="child1"></param> /// <param name="child2"></param> public void SwapChildren(TreeNode child1, TreeNode child2) { int index1 = _children.IndexOf(child1); int index2 = _children.IndexOf(child2); if (index1 == -1 || index2 == -1) throw new Exception("Not a child of this container"); SwapChildrenAt(index1, index2); }
/// <summary> /// /// </summary> /// <param name="folderNode"></param> /// <param name="index"></param> /// <returns></returns> int CheckChildren(TreeNode folderNode, int index) { int cnt = folderNode.numChildren; for (int i = 0; i < cnt; i++) { index++; TreeNode node = folderNode.GetChildAt(i); if (node.cell == null) CreateCell(node); if (node.cell.parent == null) list.AddChildAt(node.cell, index); if (node.isFolder && node.expanded) index = CheckChildren(node, index); } return index; }
/// <summary> /// /// </summary> /// <param name="child"></param> /// <returns></returns> public TreeNode RemoveChild(TreeNode child) { int childIndex = _children.IndexOf(child); if (childIndex != -1) { RemoveChildAt(childIndex); } return child; }
/// <summary> /// /// </summary> /// <param name="node"></param> /// <param name="scrollItToView"></param> public void AddSelection(TreeNode node, bool scrollItToView = false) { TreeNode parentNode = node.parent; while (parentNode != null && parentNode != root) { parentNode.expanded = true; parentNode = parentNode.parent; } list.AddSelection(list.GetChildIndex(node.cell), scrollItToView); }
/// <summary> /// /// </summary> /// <param name="node"></param> internal void AfterMoved(TreeNode node) { if (!node.isFolder) list.RemoveChild(node.cell); else HideFolderNode(node); int index = GetInsertIndexForNode(node); list.AddChildAt(node.cell, index); if (node.isFolder && node.expanded) CheckChildren(node, index); }
/// <summary> /// /// </summary> /// <param name="folderNode"></param> void HideFolderNode(TreeNode folderNode) { int cnt = folderNode.numChildren; for (int i = 0; i < cnt; i++) { TreeNode node = folderNode.GetChildAt(i); if (node.cell != null) { if(node.cell.parent != null) list.RemoveChild(node.cell); list.itemPool.ReturnObject(node.cell); node.cell.data = null; node.cell = null; } if (node.isFolder && node.expanded) HideFolderNode(node); } }
/// <summary> /// /// </summary> /// <param name="node"></param> /// <returns></returns> public int GetNodeIndex(TreeNode node) { return list.GetChildIndex(node.cell); }
/// <summary> /// /// </summary> /// <param name="node"></param> void RemoveNode(TreeNode node) { if (node.cell != null) { if (node.cell.parent != null) list.RemoveChild(node.cell); list.itemPool.ReturnObject(node.cell); node.cell.data = null; node.cell = null; } if (node.isFolder) { int cnt = node.numChildren; for (int i = 0; i < cnt; i++) { TreeNode node2 = node.GetChildAt(i); RemoveNode(node2); } } }
/// <summary> /// /// </summary> /// <param name="node"></param> internal void AfterExpanded(TreeNode node) { if (node != root && treeNodeWillExpand != null) treeNodeWillExpand(node, true); if (node.cell == null) return; if (node != root) { if (treeNodeRender != null) treeNodeRender(node); GButton expandButton = (GButton)node.cell.GetChild("expandButton"); if (expandButton != null) expandButton.selected = true; } if (node.cell.parent != null) CheckChildren(node, list.GetChildIndex(node.cell)); }
/// <summary> /// /// </summary> /// <param name="node"></param> internal void AfterInserted(TreeNode node) { CreateCell(node); int index = GetInsertIndexForNode(node); list.AddChildAt(node.cell, index); if (treeNodeRender != null) treeNodeRender(node); if (node.isFolder && node.expanded) CheckChildren(node, index); }
/// <summary> /// /// </summary> /// <param name="folderNode"></param> public void CollapseAll(TreeNode folderNode) { if (folderNode != root) folderNode.expanded = false; int cnt = folderNode.numChildren; for (int i = 0; i < cnt; i++) { TreeNode node = folderNode.GetChildAt(i); if (node.isFolder) CollapseAll(node); } }
/// <summary> /// /// </summary> /// <param name="child"></param> /// <returns></returns> public TreeNode AddChild(TreeNode child) { AddChildAt(child, _children.Count); return child; }
/// <summary> /// /// </summary> /// <param name="child"></param> /// <param name="index"></param> /// <returns></returns> public TreeNode AddChildAt(TreeNode child, int index) { if (child == null) throw new Exception("child is null"); int numChildren = _children.Count; if (index >= 0 && index <= numChildren) { if (child.parent == this) { SetChildIndex(child, index); } else { if (child.parent != null) child.parent.RemoveChild(child); int cnt = _children.Count; if (index == cnt) _children.Add(child); else _children.Insert(index, child); child.parent = this; child.level = this.level + 1; child.SetTree(this.tree); if (this.cell != null && this.cell.parent != null && _expanded) tree.AfterInserted(child); } return child; } else { throw new Exception("Invalid child index"); } }
/// <summary> /// /// </summary> /// <param name="child"></param> /// <returns></returns> public int GetChildIndex(TreeNode child) { return _children.IndexOf(child); }
/// <summary> /// /// </summary> /// <param name="node"></param> public void RemoveSelection(TreeNode node) { list.RemoveSelection(list.GetChildIndex(node.cell)); }
/// <summary> /// /// </summary> /// <param name="node"></param> internal void AfterRemoved(TreeNode node) { RemoveNode(node); }