Esempio n. 1
0
        public Button(string Text, Window window)
            : base(window)
        {
            Selected = new ButtonSelectedEvent(ButtonSelected);
            Margin = 4;
            FlowLayout layout = new FlowLayout(true);
            layout.centered = false;
            label = new Label(Text, window);
            label.Color = Color.LightGray;
            this.AddControl(label);
            this.Name = "Button";
            Color = System.Drawing.Color.White;

            atlas = new HagsAtlas("window-theme/button/button.png");
            atlas["topleft"] = new Rectangle(0, 0, 3, 3);
            atlas["left"] = new Rectangle(0, 3, 3, 15);
            atlas["bottomleft"] = new Rectangle(0, 18, 3, 3);
            atlas["top"] = new Rectangle(3, 0, 34, 3);
            atlas["middle"] = new Rectangle(3, 3, 34, 15);
            atlas["bottom"] = new Rectangle(3, 18, 34, 3);
            atlas["topright"] = new Rectangle(37,0,3,3);
            atlas["right"] = new Rectangle(37, 3, 3, 15);
            atlas["bottomright"] = new Rectangle(37, 18, 3, 3);
            stateOffets.Add(ButtonState.HOVER, new Point(0, 21));
            stateOffets.Add(ButtonState.DOWN, new Point(0, 43));
        }
Esempio n. 2
0
        public InfoUI()
        {
            this.AlwaysVisible = true;
            panel.ScrollbarStyle = Misc.ScrollbarStyle.BOTH;
            this.panel.Layout = new FlowLayout(false);
            this.Title = "Hags Windowing system";
            MouseFocus = new Label("MouseFocus: No", this);
            this.panel.AddControl(MouseFocus);
            Info = new Label("Info her", this);
            panel.AddControl(Info);
            //this.panel.AddControl(new Label("TEsttt", this));
            //this.panel.AddControl(new Label("TEstttasdddddd", this));
            //this.panel.AddControl(new Label("TEstttsss", this));
            //this.panel.AddControl();
            //Button button = new Button("Load Sourcemap", this);
            //button.Selected += new Button.ButtonSelectedEvent(LoadMapEvent);
            //this.panel.AddControl(button);
            //Button button2 = new Button("Unload Sourcemap", this);
            //button2.Selected += new Button.ButtonSelectedEvent(UnLoadMapEvent);
            //this.panel.AddControl(button2);
            //button3 = new Button("Clicks: 0", this);
            //button3.Selected += new Button.ButtonSelectedEvent(IncrementClickCount);

            //this.panel.AddControl(button3);

            //Button button4 = new Button("Take Screenshot", this);
            //this.panel.AddControl(button4);

            //TextBox textbox = new TextBox(this);

            //this.panel.AddControl(textbox);
        }
Esempio n. 3
0
 public FPSCounter()
 {
     panel.Layout = new FlowLayout(false);
     Title = "FPS Counter";
     label = new Label("FPS: N/A", this);
     panel.AddControl(label);
     Resizeable = false;
     WindowSpawnPosition = Corner.TOPRIGHT;
 }
Esempio n. 4
0
 public ServerListItemUI(Window window, serverInfo_t info)
     : base(window)
 {
     this.Layout = new FlowLayout(true);
     this.info = info;
     this.joinButton = new Button("Join", window);
     joinButton.Selected += new Button.ButtonSelectedEvent(JoinServer);
     serverIP = new Label("Address: " + info.adr.ToString(), window);
     this.AddControl(serverIP);
     this.AddControl(joinButton);
 }
Esempio n. 5
0
        public RibbonGroup(string Name, RibbonMenu menu)
            : base(menu)
        {
            label = new Label(Name, 8f, Color.Gray, menu);

            label.Size = label.GetPreferredSize();
            this.Name = Name;
            Layout = new FlowLayout(false);
            this.menu = menu;
            this.PreferredSize = new System.Drawing.Size(20, 66);
            this.MaxSize = new Size(Renderer.Instance.RenderSize.Width, 66);
        }
Esempio n. 6
0
        public ConnectGUI()
        {
            this.panel.Layout = new FlowLayout(false);
            this.Title = "Connecting...";
            this.WindowSpawnPosition = Corner.MIDDLE;

            ConnectStatus = new Label("Connecting... ", this);
            this.panel.AddControl(ConnectStatus);

            infoLabel = new Label(".", this);
            panel.AddControl(infoLabel);

            cancelButton = new Button("Cancel", this);
            cancelButton.Selected += new Button.ButtonSelectedEvent(Cancel);
            this.panel.AddControl(cancelButton);
            Visible = false;
        }
Esempio n. 7
0
        void Init()
        {
            GameName = new Label("Cube!", this);
            GameName.LabelFont = "biggerlabel";
            StartGameButton = new Button("Create Game", this);
            StartGameButton.label.LabelFont = "biglabel";
            StartGameButton.Selected += new Button.ButtonSelectedEvent(StartGameHandler);
            JoinGameButton = new Button("Join Game", this);
            JoinGameButton.label.LabelFont = "biglabel";
            JoinGameButton.Selected += new Button.ButtonSelectedEvent(JoinGameHandler);
            SettingsButton = new Button("Settings", this);
            SettingsButton.label.LabelFont = "biglabel";
            SettingsButton.Selected += new Button.ButtonSelectedEvent(SettingsHandler);
            ExitButton = new Button("Exit", this);
            ExitButton.label.LabelFont = "biglabel";
            ExitButton.Selected += new Button.ButtonSelectedEvent(ExitHandler);

            panel.AddControl(GameName);
            panel.AddControl(StartGameButton);
            panel.AddControl(JoinGameButton);
            panel.AddControl(SettingsButton);
            panel.AddControl(ExitButton);
        }
Esempio n. 8
0
        public override void Render()
        {
            Dictionary<string, long> timings = Profiler.Instance.GetTimings();
            foreach (string str in timings.Keys)
            {
                if (!labels.ContainsKey(str))
                {
                    Label label = new Label(str, this);
                    ProgressBar prog = new ProgressBar(this);
                    prog.MaxValue = 1000;
                    labels.Add(str, label);
                    progressBars.Add(str, prog);
                    panel.AddControl(label);
                    panel.AddControl(prog);
                }
                else
                {

                    progressBars[str].Value = (int)(timings[str] / (System.Diagnostics.Stopwatch.Frequency/(1000L*1000L)));
                }

            }
            base.Render();
        }