コード例 #1
0
        public StatusBar(Base parent)
            : base(parent)
        {
            Control.StatusBar sb   = new Control.StatusBar(this);
            Control.Label     left = new Control.Label(sb)
            {
                Text = "Label added to left"
            };
            sb.AddControl(left, false);

            Control.Label right = new Control.Label(sb)
            {
                Text = "Label added to right"
            };
            sb.AddControl(right, true);

            Control.Button bl = new Control.Button(sb)
            {
                Text = "Left button"
            };
            sb.AddControl(bl, false);

            Control.Button br = new Control.Button(sb)
            {
                Text = "Right button"
            };
            sb.AddControl(br, true);
        }
コード例 #2
0
        public StatusBar(Base parent)
            : base(parent)
        {
            Control.StatusBar sb = new Control.StatusBar(this);
            Control.Label left = new Control.Label(sb);
            left.Text = "Label added to left";
            sb.AddControl(left, false);

            Control.Label right = new Control.Label(sb);
            right.Text = "Label added to right";
            sb.AddControl(right, true);

            Control.Button bl = new Control.Button(sb);
            bl.Text = "Left button";
            sb.AddControl(bl, false);

            Control.Button br = new Control.Button(sb);
            br.Text = "Right button";
            sb.AddControl(br, true);
        }
コード例 #3
0
ファイル: Window.cs プロジェクト: slagusev/Gwen.CS
        private void OpenWindowWithMenuAndStatusBar(ControlBase control, EventArgs args)
        {
            Control.Window window = new Control.Window(this);
            window.Title   = String.Format("Window ({0})", ++m_WindowCount);
            window.Size    = new Size(m_Rand.Next(200, 400), m_Rand.Next(200, 400));
            window.Left    = m_Rand.Next(700);
            window.Top     = m_Rand.Next(400);
            window.Padding = new Padding(1, 0, 1, 1);

            Control.Layout.DockLayout layout = new Control.Layout.DockLayout(window);

            Control.MenuStrip menuStrip = new Control.MenuStrip(layout);
            menuStrip.Dock = Dock.Top;

            /* File */
            {
                Control.MenuItem root = menuStrip.AddItem("File");
                root.Menu.AddItem("Load", "test16.png", "Ctrl+L");
                root.Menu.AddItem("Save", String.Empty, "Ctrl+S");
                root.Menu.AddItem("Save As..", String.Empty, "Ctrl+A");
                root.Menu.AddItem("Quit", String.Empty, "Ctrl+Q").SetAction((c, a) => window.Close());
            }
            /* Resizing */
            {
                Control.MenuItem root = menuStrip.AddItem("Resizing");
                root.Menu.AddItem("Disabled").SetAction((c, a) => window.Resizing = Resizing.None);
                root.Menu.AddItem("Width").SetAction((c, a) => window.Resizing    = Resizing.Width);
                root.Menu.AddItem("Height").SetAction((c, a) => window.Resizing   = Resizing.Height);
                root.Menu.AddItem("Both").SetAction((c, a) => window.Resizing     = Resizing.Both);
            }

            Control.StatusBar statusBar = new Control.StatusBar(layout);
            statusBar.Dock = Dock.Bottom;
            statusBar.Text = "Status bar";

            {
                Control.Button br = new Control.Button(statusBar);
                br.Text = "Right button";
                statusBar.AddControl(br, true);
            }
        }
コード例 #4
0
        public string Note; // additional text to display in status bar

        public UnitTest(Base parent) : base(parent)
        {
            Dock = Pos.Fill;
            SetSize(1024, 768);
            m_List = new Control.CollapsibleList(this);

            LeftDock.TabControl.AddPage("Unit tests", m_List);
            LeftDock.Width = 150;

            m_TextOutput      = new Control.ListBox(BottomDock);
            m_Button          = BottomDock.TabControl.AddPage("Output", m_TextOutput);
            BottomDock.Height = 200;

            m_DebugCheck = new Control.LabeledCheckBox(m_List)
            {
                Text = "Debug outlines"
            };
            m_DebugCheck.CheckChanged += DebugCheckChanged;

            m_StatusBar = new Control.StatusBar(this)
            {
                Dock = Pos.Bottom
            };
            m_StatusBar.AddControl(m_DebugCheck, true);

            m_Center = new Center(this)
            {
                Dock = Pos.Fill
            };
            GUnit test;

            {
                CollapsibleCategory cat = m_List.Add("Non-Interactive");
                {
                    test = new Label(m_Center);
                    RegisterUnitTest("Label", cat, test);
                    test = new RichLabel(m_Center);
                    RegisterUnitTest("RichLabel", cat, test);
                    test = new GroupBox(m_Center);
                    RegisterUnitTest("GroupBox", cat, test);
                    test = new ProgressBar(m_Center);
                    RegisterUnitTest("ProgressBar", cat, test);
                    test = new ImagePanel(m_Center);
                    RegisterUnitTest("ImagePanel", cat, test);
                    test = new StatusBar(m_Center);
                    RegisterUnitTest("StatusBar", cat, test);
                }
            }

            {
                CollapsibleCategory cat = m_List.Add("Standard");
                {
                    test = new Button(m_Center);
                    RegisterUnitTest("Button", cat, test);
                    test = new TextBox(m_Center);
                    RegisterUnitTest("TextBox", cat, test);
                    test = new CheckBox(m_Center);
                    RegisterUnitTest("CheckBox", cat, test);
                    test = new RadioButton(m_Center);
                    RegisterUnitTest("RadioButton", cat, test);
                    test = new ComboBox(m_Center);
                    RegisterUnitTest("ComboBox", cat, test);
                    test = new ListBox(m_Center);
                    RegisterUnitTest("ListBox", cat, test);
                    test = new NumericUpDown(m_Center);
                    RegisterUnitTest("NumericUpDown", cat, test);
                    test = new Slider(m_Center);
                    RegisterUnitTest("Slider", cat, test);
                    test = new Menu(m_Center);
                    RegisterUnitTest("Menu", cat, test);
                    test = new CrossSplitter(m_Center);
                    RegisterUnitTest("CrossSplitter", cat, test);
                }
            }

            {
                CollapsibleCategory cat = m_List.Add("Containers");
                {
                    test = new Window(m_Center);
                    RegisterUnitTest("Window", cat, test);
                    test = new TreeControl(m_Center);
                    RegisterUnitTest("TreeControl", cat, test);
                    test = new Properties(m_Center);
                    RegisterUnitTest("Properties", cat, test);
                    test = new TabControl(m_Center);
                    RegisterUnitTest("TabControl", cat, test);
                    test = new ScrollControl(m_Center);
                    RegisterUnitTest("ScrollControl", cat, test);
                    test = new Docking(m_Center);
                    RegisterUnitTest("Docking", cat, test);
                }
            }

            {
                CollapsibleCategory cat = m_List.Add("Non-standard");
                {
                    test = new CollapsibleList(m_Center);
                    RegisterUnitTest("CollapsibleList", cat, test);
                    test = new ColorPickers(m_Center);
                    RegisterUnitTest("Color pickers", cat, test);
                }
            }

            m_StatusBar.SendToBack();
            PrintText("Unit Test started!");
        }
コード例 #5
0
        public String Note; // additional text to display in status bar

        public UnitTest(ZGE.Components.ZComponent parent) : base(parent)
        {
            Dock = Pos.Fill;
            SetSize(1024, 768);
            m_List = new Control.CollapsibleList(this);

            LeftDock.TabControl.AddPage("Unit tests", m_List);
            LeftDock.Width = 150;

            m_TextOutput = new Control.ListBox(BottomDock);
            m_Button = BottomDock.TabControl.AddPage("Output", m_TextOutput);
            BottomDock.Height = 200;

            m_DebugCheck = new Control.LabeledCheckBox(m_List);
            m_DebugCheck.Text = "Debug outlines";
            m_DebugCheck.CheckChanged += DebugCheckChanged;

            m_StatusBar = new Control.StatusBar(this);
            m_StatusBar.Dock = Pos.Bottom;
            m_StatusBar.AddControl(m_DebugCheck, true);

            //m_Center = new Center(this);
            //m_Center.Dock = Pos.Fill;
            GUnit test;

            {
                CollapsibleCategory cat = m_List.Add("Non-Interactive");
                {
                    test = new Label(this);
                    RegisterUnitTest("Label", cat, test);
                    test = new RichLabel(this);
                    RegisterUnitTest("RichLabel", cat, test);
                    test = new GroupBox(this);
                    RegisterUnitTest("GroupBox", cat, test);
                    test = new ProgressBar(this);
                    RegisterUnitTest("ProgressBar", cat, test);
                    test = new ImagePanel(this);
                    RegisterUnitTest("ImagePanel", cat, test);
                    test = new StatusBar(this);
                    RegisterUnitTest("StatusBar", cat, test);
                }
            }

            {
                CollapsibleCategory cat = m_List.Add("Standard");
                {
                    test = new Button(this);
                    RegisterUnitTest("Button", cat, test);
                    test = new TextBox(this);
                    RegisterUnitTest("TextBox", cat, test);
                    test = new CheckBox(this);
                    RegisterUnitTest("CheckBox", cat, test);
                    test = new RadioButton(this);
                    RegisterUnitTest("RadioButton", cat, test);
                    test = new ComboBox(this);
                    RegisterUnitTest("ComboBox", cat, test);
                    test = new ListBox(this);
                    RegisterUnitTest("ListBox", cat, test);
                    test = new NumericUpDown(this);
                    RegisterUnitTest("NumericUpDown", cat, test);
                    test = new Slider(this);
                    RegisterUnitTest("Slider", cat, test);
                    test = new MenuStrip(this);
                    RegisterUnitTest("MenuStrip", cat, test);
                    test = new CrossSplitter(this);
                    RegisterUnitTest("CrossSplitter", cat, test);
                }
            }
            
            {
                CollapsibleCategory cat = m_List.Add("Containers");
                {
                    test = new Window(this);
                    RegisterUnitTest("Window", cat, test);
                    test = new TreeControl(this);
                    RegisterUnitTest("TreeControl", cat, test);
                    test = new Properties(this);
                    RegisterUnitTest("Properties", cat, test);
                    test = new TabControl(this);
                    RegisterUnitTest("TabControl", cat, test);
                    test = new ScrollControl(this);
                    RegisterUnitTest("ScrollControl", cat, test);
                    test = new Docking(this);
                    RegisterUnitTest("Docking", cat, test);
                }
            }
            
            {
                CollapsibleCategory cat = m_List.Add("Non-standard");
                {
                    test = new CollapsibleList(this);
                    RegisterUnitTest("CollapsibleList", cat, test);
                    test = new ColorPickers(this);
                    RegisterUnitTest("Color pickers", cat, test);
                }
            }

            m_StatusBar.SendToBack();
            PrintText("Unit Test started!");
        }
コード例 #6
0
        public CrossSplitter(ControlBase parent)
            : base(parent)
        {
            m_CurZoom = 0;

            m_Splitter      = new Control.CrossSplitter(this);
            m_Splitter.Dock = Dock.Fill;

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button   button1  = new Control.Button(splitter);
                button1.Text = "Vertical left";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Vertical right";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(0, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button     button1  = new Control.Button(splitter);
                button1.Text = "Horizontal up";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Horizontal down";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(1, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button     button1  = new Control.Button(splitter);
                button1.Text = "Horizontal up";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Horizontal down";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(2, splitter);
            }

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button   button1  = new Control.Button(splitter);
                button1.Text = "Vertical left";
                Control.Button button2 = new Control.Button(splitter);
                button2.Text = "Vertical right";
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(3, splitter);
            }

            //Status bar to hold unit testing buttons
            Control.StatusBar pStatus = new Control.StatusBar(this);
            pStatus.Dock = Dock.Bottom;

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "Zoom";
                pButton.Clicked += ZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "UnZoom";
                pButton.Clicked += UnZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "CenterPanels";
                pButton.Clicked += CenterPanels;
                pStatus.AddControl(pButton, true);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.Text     = "Splitters";
                pButton.Clicked += ToggleSplitters;
                pStatus.AddControl(pButton, true);
            }
        }
コード例 #7
0
        public CrossSplitter(Base parent)
            : base(parent)
        {
            m_CurZoom = 0;

            m_Splitter = new Control.CrossSplitter(this);
            m_Splitter.SetPosition(0, 0);
            m_Splitter.Dock = Pos.Fill;

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button button1 = new Control.Button(splitter);
                button1.SetText("Vertical left");
                Control.Button button2 = new Control.Button(splitter);
                button2.SetText("Vertical right");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(0, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button button1 = new Control.Button(splitter);
                button1.SetText("Horizontal up");
                Control.Button button2 = new Control.Button(splitter);
                button2.SetText("Horizontal down");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(1, splitter);
            }

            {
                HorizontalSplitter splitter = new HorizontalSplitter(m_Splitter);
                Control.Button button1 = new Control.Button(splitter);
                button1.SetText("Horizontal up");
                Control.Button button2 = new Control.Button(splitter);
                button2.SetText("Horizontal down");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(2, splitter);
            }

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Control.Button button1 = new Control.Button(splitter);
                button1.SetText("Vertical left");
                Control.Button button2 = new Control.Button(splitter);
                button2.SetText("Vertical right");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(3, splitter);
            }

            //Status bar to hold unit testing buttons
            Control.StatusBar pStatus = new Control.StatusBar(this);
            pStatus.Dock = Pos.Bottom;

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.SetText("Zoom");
                pButton.Clicked += ZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.SetText("UnZoom");
                pButton.Clicked += UnZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.SetText("CenterPanels");
                pButton.Clicked += CenterPanels;
                pStatus.AddControl(pButton, true);
            }

            {
                Control.Button pButton = new Control.Button(pStatus);
                pButton.SetText("Splitters");
                pButton.Clicked += ToggleSplitters;
                pStatus.AddControl(pButton, true);
            }
        }