Example #1
0
        public RibbonMenuItem(string name, RibbonMenu main)
            : base(name, main)
        {
            this.main = main;

            FlowLayout flow = new FlowLayout(true);
            flow.Margin = 10;

            // Set up panel area
            panel = new Panel(main);
            panel.Layout = flow;
            panel.Position = new Dimension(10, 23);
            panel.Size = new Size(Renderer.Instance.RenderSize.Width - 20, 77);

            //sprite = new Sprite(Renderer.Instance.device);
        }
Example #2
0
        void Init()
        {
            BackButton = new Button("Back...", this);
            BackButton.label.LabelFont = "biglabel";
            BackButton.Selected += new Button.ButtonSelectedEvent(BackHandler);

            // Vsync
            Panel vsyncContainer = new Panel(this);
            vsyncContainer.AddControl(new Label("Toggle VSync:", this) { LabelFont = "biglabel" });
            VSyncButton = new Button(CVars.Instance.Get("r_vsync", "1", CVarFlags.ARCHIVE).Integer == 1? "On" : "Off", this);
            VSyncButton.label.LabelFont = "biglabel";
            VSyncButton.Selected += new Button.ButtonSelectedEvent(VSyncHandler);
            vsyncContainer.AddControl(VSyncButton);
            this.panel.AddControl(vsyncContainer);

            // Fullscreen
            Panel fsPanel = new Panel(this);
            fsPanel.AddControl(new Label("Fullscreen:", this) { LabelFont = "biglabel" });
            FullscreenButton = new Button(CVars.Instance.Get("r_fs", "1", CVarFlags.ARCHIVE).Integer == 1 ? "Yes" : "No", this);
            FullscreenButton.label.LabelFont = "biglabel";
            FullscreenButton.Selected += new Button.ButtonSelectedEvent(FSHandler);
            fsPanel.AddControl(FullscreenButton);
            this.panel.AddControl(fsPanel);

            // Resolution
            Panel resPanel = new Panel(this);
            resPanel.AddControl(new Label("Resolution", this) { LabelFont = "biglabel" });
            ResolutionButton = new Button(CVars.Instance.Get("r_res", "1", CVarFlags.ARCHIVE).String, this);
            ResolutionButton.label.LabelFont = "biglabel";
            ResolutionButton.Selected += new Button.ButtonSelectedEvent(ResolutionHandler);
            resPanel.AddControl(ResolutionButton);
            this.panel.AddControl(resPanel);

            // Show FPS
            Panel fpsPanel = new Panel(this);
            fpsPanel.AddControl(new Label("Show FPS", this) { LabelFont = "biglabel" });
            ShowFPSButton = new Button(CVars.Instance.Get("r_showfps", "1", CVarFlags.ARCHIVE).Integer == 1 ? "Yes" : "No", this);
            ShowFPSButton.label.LabelFont = "biglabel";
            ShowFPSButton.Selected += new Button.ButtonSelectedEvent(ShowFPSHandler);
            fpsPanel.AddControl(ShowFPSButton);
            this.panel.AddControl(fpsPanel);

            this.panel.AddControl(BackButton);
        }
Example #3
0
        public Window()
            : base(null)
        {
            this.Window = this;
            panel = new Panel(this);

            // Load theme
            // "Untitled-1.png"
            atlas = new HagsAtlas("window-theme/window-borders.png");

            //HagsAtlas.SerializeToXML(atlas);
            atlas["topleft"] = new Rectangle(0, 0, 26, 26);
            atlas["top"] = new Rectangle(0, 81, 128, 26);
            atlas["topright"] = new Rectangle(27, 0, 27, 26);

            atlas["left"] = new Rectangle(0, 28, 25, 26);
            atlas["middle"] = new Rectangle(55, 28, 25, 25);
            atlas["right"] = new Rectangle(54, 1, 27, 26);

            atlas["bottomleft"] = new Rectangle(0, 54, 27, 27);
            atlas["bottom"] = new Rectangle(27, 55, 27, 26);
            atlas["bottomright"] = new Rectangle(54, 54, 27, 27);
            atlas["scale"] = new Rectangle(27, 27, 17, 17);

            LayoutUpdate(false);
        }