private void CacheOwnerData() { UITreeView treeView = this.owner as UITreeView; if (treeView != null) { if (treeView.ResourceImages != null && treeView.ResourceImages.Count >= 2) { this.expandComp = treeView.ResourceImages[(int)UITreeView.ResourceImageType.ExpandIcon]; this.collapseComp = treeView.ResourceImages[(int)UITreeView.ResourceImageType.CollapseIcon]; this.currentExpandComp = this.expand ? this.collapseComp : this.expandComp; } this.stickComp = treeView.StickRenderComp; } }
public UIComp_TreeNode(Window owner, UIComp_TreeNodeBase parent) : base(owner) { this.parentNode = parent; this.expand = true; this.indentation = DefaultIndentation; this.nodeIcon = new UIComp_DrawTextureAtlas(owner); this.nodeText = new UIComp_DrawText(owner); this.nodeIcon.ResourceAtlasLocation = new NexusEngine.NResourceLoc(@"engine_data:/ui/Atlas/engine_data1.txa"); this.nodeIcon.AtlasItemName = "0"; this.nodeIcon.Height = new UIDim(0, DefaultTreeNodeIconHeight); this.nodeIcon.Width = new UIDim(0, DefaultTreeNodeIconHeight); this.nodeText.TextFormat = DrawTextFormat.Left | DrawTextFormat.VerticalCenter | DrawTextFormat.NoClip; this.nodeText.Height = new UIDim(0, DefaultTreeNodeTextHeight); this.nodeText.Width = new UIDim(0, DefaultTreeNodeTextHeight); this.nodeText.TextChanged += new EventHandler <GUIEventArgs>(nodeText_TextChanged); this.nodeText.Text = "Tree Item"; CacheOwnerData(); }