示例#1
0
        public void CreateStatusbar()
        {
            StatusBar sb   = new StatusBar(this);
            Label     left = new Label(sb);

            left.Text = "Statusbar left";
            sb.AddControl(left, false);

            Button br = new Button(sb);

            br.Text = "Right button";
            sb.AddControl(br, true);
        }
示例#2
0
        public StatusBarTest(ControlBase parent)
            : base(parent)
        {
            StatusBar sb   = new StatusBar(this);
            Label     left = new Label(sb);

            left.Text = "Label added to left";
            sb.AddControl(left, false);

            Label right = new Label(sb);

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

            Button bl = new Button(sb);

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

            Button br = new Button(sb);

            br.Text = "Right button";
            sb.AddControl(br, true);
        }
示例#3
0
        private void OpenWindowWithMenuAndStatusBar(ControlBase control, EventArgs args)
        {
            Window window = new 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);

            DockLayout layout = new DockLayout(window);

            MenuStrip menuStrip = new MenuStrip(layout);

            menuStrip.Dock = Dock.Top;

            /* File */
            {
                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 */
            {
                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);
            }

            StatusBar statusBar = new StatusBar(layout);

            statusBar.Dock = Dock.Bottom;
            statusBar.Text = "Status bar";

            {
                Button br = new Button(statusBar);
                br.Text = "Right button";
                statusBar.AddControl(br, true);
            }
        }
示例#4
0
        public CrossSplitterTest(ControlBase parent)
            : base(parent)
        {
            m_CurZoom = 0;

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

            {
                VerticalSplitter splitter = new VerticalSplitter(m_Splitter);
                Button           button1  = new Button(splitter);
                button1.Text = "Vertical left";
                Button button2 = new 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);
                Button             button1  = new Button(splitter);
                button1.Text = "Horizontal up";
                Button button2 = new 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);
                Button             button1  = new Button(splitter);
                button1.Text = "Horizontal up";
                Button button2 = new 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);
                Button           button1  = new Button(splitter);
                button1.Text = "Vertical left";
                Button button2 = new 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
            StatusBar pStatus = new StatusBar(this);

            pStatus.Dock = Dock.Bottom;

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

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

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

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