Пример #1
0
        public UITreeView(string name)
            : base(name)
        {
            // 创建缺省的根节点
            this.rootNode             = new UIComp_TreeNodeRoot(this);
            this.rootNode.EndUpdated += new EventHandler <TreeNodeEventArg>(rootNode_LayoutChanged);

            this.backgroundRenderComp = new UIComp_DrawTextureAtlas(this);

            this.backgroundRenderComp.ResourceAtlasLocation = new NexusEngine.NResourceLoc(@"engine_data:/ui/Atlas/engine_data1.txa");
            this.backgroundRenderComp.AtlasItemName         = "0";

            this.stickRenderComp = new UIComp_DrawTextureAtlas(this);
            this.stickRenderComp.ResourceAtlasLocation = new NexusEngine.NResourceLoc(@"engine_data:/ui/Atlas/engine_data1.txa");
            this.stickRenderComp.AtlasItemName         = @"N_sys-gb-a";

            this.resourceImages = new DrawTextureAtlasCollection();
            this.resourceImages.Add(new UIComp_DrawTextureAtlas(this));
            this.resourceImages.Add(new UIComp_DrawTextureAtlas(this));
            this.resourceImages[(int)ResourceImageType.CollapseIcon].ResourceAtlasLocation = new NexusEngine.NResourceLoc(@"engine_data:/ui/Atlas/engine_data1.txa");
            this.resourceImages[(int)ResourceImageType.CollapseIcon].AtlasItemName         = @"N_help-button-d";
            this.resourceImages[(int)ResourceImageType.ExpandIcon].ResourceAtlasLocation   = new NexusEngine.NResourceLoc(@"engine_data:/ui/Atlas/engine_data1.txa");
            this.resourceImages[(int)ResourceImageType.ExpandIcon].AtlasItemName           = @"N_help-button-c";
            this.resourceImages[(int)ResourceImageType.CollapseIcon].Width  = new UIDim(0, 9);
            this.resourceImages[(int)ResourceImageType.CollapseIcon].Height = new UIDim(0, 9);
            this.resourceImages[(int)ResourceImageType.ExpandIcon].Width    = new UIDim(0, 9);
            this.resourceImages[(int)ResourceImageType.ExpandIcon].Height   = new UIDim(0, 9);


            // 创建子控件
            this.verticalScrollBar   = CreateVerticalScrollBar();
            this.horizontalScrollBar = CreateHorizontalScrollBar();

            InitEventHandler();
        }
Пример #2
0
        protected virtual UIVerticalScrollBar CreateVerticalScrollBar()
        {
            UIVerticalScrollBar vsb = WindowManager.Instance.CreateWindow("Nexus.GUI.Widgets.UIVerticalScrollBar", name + "_VSB", this) as UIVerticalScrollBar;

            vsb.Width  = new UIDim(0, 28);
            vsb.Height = new UIDim(1.0f, 0);
            vsb.X      = new UIDim(1, 0);

            return(vsb);
        }