示例#1
0
        public void Tool4()
        {
            Engine.Initialize("Tool4", 960, 720, new Configuration()
            {
                EnabledCoreModules = CoreModules.Default | CoreModules.Tool
            });
            ToolHelper.Name = "Tool4";
            ToolHelper.Size = new Vector2F(250, 350);
            var tabbar   = new TabBar("TabBar");
            var tabItem1 = new TabItem("A");

            tabItem1.AddComponent(new Text("A1"));
            tabItem1.AddComponent(new Text("A2"));
            tabItem1.AddComponent(new Text("A3"));
            tabbar.AddTabItem(tabItem1);
            var tabItem2 = new TabItem("B");

            tabItem2.AddComponent(new InputInt1("B1", 0));
            tabItem2.AddComponent(new InputInt1("B2", 0));
            tabItem2.AddComponent(new InputInt1("B3", 0));
            tabbar.AddTabItem(tabItem2);
            var tabItem3 = new TabItem("C");

            tabItem3.AddComponent(new Combo <int>("C1", new [] { 1, 2, 3, 4, 5 }));
            tabItem3.AddComponent(new Combo <double>("C2", new [] { 0.1, 0.2, 0.3, 0.4, 0.5 }));
            tabItem3.AddComponent(new Combo <char>("C3", new [] { 'a', 'b', 'c', 'd', 'e' }));
            tabbar.AddTabItem(tabItem3);
            ToolHelper.AddComponent(tabbar);
            var node1   = new TreeNode("1");
            var node1_1 = new TreeNode("1-1");

            node1_1.AddComponent(new Text("1-1-1"));
            node1_1.AddComponent(new Text("1-1-2"));
            var node1_2 = new TreeNode("1-2");

            node1_2.AddComponent(new Text("1-2"));
            node1.AddComponent(node1_1);
            node1.AddComponent(node1_2);
            ToolHelper.AddComponent(node1);
            while (Engine.DoEvents())
            {
                ToolHelper.Update();
                Engine.Update();
                if (Engine.Keyboard.GetKeyState(Key.Escape) == ButtonState.Push)
                {
                    break;
                }
            }
            Engine.Terminate();
        }