public Caret(Caret cpy)
 {
     this.textBox = cpy.textBox;
     this.position = cpy.position;
     this.IsSet = cpy.IsSet;
     this.column = cpy.column;
     this.row = cpy.row;
     this.realcolumn = cpy.realcolumn;
 }
        protected override void OnConstruct()
        {
            Size = new Vector2(1000, 600);
            Padding = new System.Windows.Forms.Padding(20);
            Anchor = global::Graphics.Orientation.Center;
            Clickable = true;
            ControlBox = false;
            ClearChildren();

            var topBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 70),
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Padding = new System.Windows.Forms.Padding(0, 0, 0, 5)
            };
            AddChild(topBar);

            Control topLeftBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Left,
                Size = new Vector2(500, 0)
            };
            topBar.AddChild(topLeftBar);
            var winLoseTextBox = new Label
            {
                Font = new Graphics.Content.Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color = System.Drawing.Color.Green,
                },
                AutoSize = AutoSizeMode.Full,
                TextAnchor = global::Graphics.Orientation.TopLeft,
                Dock = System.Windows.Forms.DockStyle.Top,
                Background = null,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            topLeftBar.AddChild(winLoseTextBox);

            if (GameState == GameState.Won)
            {
                winLoseTextBox.Text = Locale.Resource.ScoreVictory;
                winLoseTextBox.Font.Color = System.Drawing.Color.Green;
            }
            else
            {
                winLoseTextBox.Text = Locale.Resource.ScoreDefeat;
                winLoseTextBox.Font.Color = System.Drawing.Color.Red;
                topLeftBar.AddChild(new Label
                {
                    Font = new Font
                    {
                        SystemFont = Fonts.MediumSystemFont,
                        Color = System.Drawing.Color.White
                    },
                    Background = null,
                    Dock = System.Windows.Forms.DockStyle.Fill,
                    Text = LostGameReason,
                    TextAnchor = global::Graphics.Orientation.TopLeft,
                });
            }

            Control trPanel = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Right,
                Size = new Vector2(200, 40)
            };
            topBar.AddChild(trPanel);

            var gt = new DateTime(TimeSpan.FromSeconds(GameTime).Ticks);

            var timeLeftTextBox = new Label
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Background = null,
                Size = new Vector2(120, 20),
                TextAnchor = global::Graphics.Orientation.BottomRight,
            };
            timeLeftTextBox.Text = Locale.Resource.GenTime + ": " + gt.ToString("mm:ss");

            trPanel.AddChild(timeLeftTextBox);
            if (SilverEnabled)
            {
                Control silverTextContainer = new Control
                {
                    Dock = System.Windows.Forms.DockStyle.Bottom,
                    Size = new Vector2(0, 30),
                };
                trPanel.AddChild(silverTextContainer);
                silverTextContainer.AddChild(new SilverText
                {
                    Anchor = Orientation.BottomRight,
                    Size = new Vector2(120, 30),
                    Background = null,
                    SilverYield = SilverYield
                });
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Top,
                Size = new Vector2(0, 1)
            });

            Control bottomBar = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 50)
            };
            AddChild(bottomBar);

            FlowLayout leftBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomLeft
            };
            bottomBar.AddChild(leftBottomFlow);

            FlowLayout rightBottomFlow = new FlowLayout
            {
                AutoSize = true,
                HorizontalFill = true,
                Newline = false,
                Anchor = Orientation.BottomRight,
                Origin = FlowOrigin.BottomRight,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
            };
            bottomBar.AddChild(rightBottomFlow);

            ButtonBase mainMenuButton = new StoneButton
            {
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            if (FirstTimeCompletedMap)
                mainMenuButton.Text = Locale.Resource.GenContinue;
            else
                mainMenuButton.Text = Locale.Resource.GenMainMenu;
            rightBottomFlow.AddChild(mainMenuButton);
            mainMenuButton.Click += new EventHandler(mainMenuButton_Click);

            ButtonBase playAgainButton = new StoneButton
            {
                Text = Locale.Resource.GenPlayAgain,
                Visible = EarnedGoldCoins == 0,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            rightBottomFlow.AddChild(playAgainButton);
            playAgainButton.Click += new EventHandler(playAgainButton_Click);

            if (FirstTimeCompletedMap && Program.Settings.DisplayMapRatingDialog == MapRatingDialogSetup.Optional)
            {
                ButtonBase rateMapButton = new StoneButton
                {
                    Text = Locale.Resource.GenRateMap,
                    AutoSize = AutoSizeMode.Horizontal,
                    Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
                };
                rightBottomFlow.AddChild(rateMapButton);
                rateMapButton.Click += new EventHandler(rateMapButton_Click);
            }

            AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureConcretizer
                    {
                        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 255, 255))
                    },
                    SizeMode = SizeMode.AutoAdjust
                },
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Size = new Vector2(0, 1)
            });

            Control main = new Control
            {
                Dock = System.Windows.Forms.DockStyle.Fill
            };
            AddChild(main);

            //////////////////////////
            // STATS /////////////////
            //////////////////////////

            StatsControl stats = new StatsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                Visible = false
            };
            stats.GameState = GameState;
            stats.LostGameReason = LostGameReason;
            stats.Statistics = Statistics;
            stats.Map = Map;
            main.AddChild(stats);

            //////////////////////////
            // REWARDS ///////////////
            //////////////////////////

            ResultsAndRewardsControl rewards = new ResultsAndRewardsControl
            {
                Dock = System.Windows.Forms.DockStyle.Fill,
                //Background = new StretchingImageGraphic
                //{
                //    Texture = new TextureConcretizer
                //    {
                //        TextureDescription = new Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.FromArgb(50, 255, 0, 0))
                //    },
                //},
                Anchor = global::Graphics.Orientation.TopRight
            };
            rewards.GameState = GameState;
            rewards.EarnedGoldCoins = EarnedGoldCoins;
            rewards.NPlaythroughs = NPlaythroughs;
            rewards.AchievementsEarned = AchievementsEarned;
            rewards.SilverYield = SilverYield;
            rewards.PreviousMaxSilverYield = PreviousMaxSilverYield;
            rewards.FirstTimeCompletedMap = FirstTimeCompletedMap;
            rewards.CurrentStages = CurrentStages;
            rewards.BestStages = BestStages;
            rewards.Map = Map;
            main.AddChild(rewards);

            /////////////////////
            // Switch buttons
            /////////////////////

            CheckboxBase rnrButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreRewardsAndResults,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = true,
                AutoCheck = false,
                Size = new Vector2(200, 38),
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(rnrButton);

            CheckboxBase statsButton = new StoneCheckbox
            {
                Text = Locale.Resource.ScoreStats,
                Font = new Font
                {
                    SystemFont = Fonts.MediumSystemFont,
                    Color = System.Drawing.Color.White,
                    Backdrop = System.Drawing.Color.Black
                },
                Checked = false,
                AutoCheck = false,
                AutoSize = AutoSizeMode.Horizontal,
                Padding = new System.Windows.Forms.Padding(5, 0, 5, 0)
            };
            leftBottomFlow.AddChild(statsButton);

            if (HideStats)
            {
                leftBottomFlow.Visible = false;
                stats.Visible = false;
            }
            else
            {
                statsButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = false;
                    statsButton.Checked = stats.Visible = true;
                });
                rnrButton.Click += new EventHandler((o, e) =>
                {
                    rnrButton.Checked = rewards.Visible = true;
                    statsButton.Checked = stats.Visible = false;
                });
            }

            base.OnConstruct();
        }
 private Label HeaderText(string text, ref Vector2 elementPosition)
 {
     Label tb = new Label
     {
         Size = new Vector2(300, headerFont.SystemFont.Height),
         Text = text,
         Background = null,
         Font = headerFont,
         Position = elementPosition,
     };
     elementPosition.Y += tb.Size.Y + rowSpacing;
     return tb;
 }
 public void NewTextResults(Control f, string label, string text, ref Vector2 elementPosition)
 {
     Label tb = new Label
     {
         AutoSize = AutoSizeMode.Full,
         Size = new Vector2(rightHandWidth, descriptionTextBoxHeight),
         Text = text,
         Background = null,
         TextAnchor = global::Graphics.Orientation.Center,
         Font = statTextFont,
     };
     NewResults(f, label, tb, ref elementPosition);
 }
        public void NewResults(Control f, string label, Label rh, ref Vector2 elementPosition)
        {
            var tb = new Label
            {
                AutoSize = AutoSizeMode.Full,
                Size = new Vector2(150f, descriptionTextBoxHeight),
                Text = label,
                Background = null,
                Position = elementPosition,
            };
            f.AddChild(tb);

            rh.Position = elementPosition + new Vector2(250, 0);
            f.AddChild(rh);

            elementPosition.Y += System.Math.Max(tb.Size.Y, rh.Size.Y);
        }
        public override void Enter()
        {
            base.Enter();
            Program.Instance.Interface.AddChild(new Control
            {
                Background = new StretchingImageGraphic
                {
                    Texture = new TextureFromFile("mainmenubackground.png"),
                    Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height)
                },
                Dock = System.Windows.Forms.DockStyle.Fill
            });

            if (Common.ProgramConfigurationInformation.Warnings.Count > 0)
                Program.Instance.Interface.AddChild(
                    new Graphics.Interface.ProgramConfigurationInformationControl
                    {
                        Position = new Vector2(0, 150)
                    });

            form = new DeveloperMainMenuForm();
            Program.Instance.Interface.AddChild(form);

            Program.Instance.Interface.AddChild(new TestMaps());

            var buttonsGrid = new Grid
            {
                Size = new Vector2(800, 200),
                Anchor = Orientation.BottomLeft,
                NWidth = 4,
                NHeight = 8
            };
            Program.Instance.Interface.AddChild(buttonsGrid);

            var videoSettings = new Button
            {
                Size = new Vector2(200, 20),
                Text = "Options",
                Position = new Vector2(200, 60)
            };
            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler(videoSettings_Click3);

            videoSettings = new Button
            {
                Text = "Fullscreen",
            };
            buttonsGrid.AddChild(videoSettings);
            videoSettings.Click += new EventHandler((o, e) => { Program.Settings.WindowMode = WindowMode.Fullscreen; Program.UpdateWindowMode(); });

            Button exitGameButton = new Button
            {
                Position = new Vector2(200, 40),
                Size = new Vector2(200, 20),
                Text = "Exit",
            };
            buttonsGrid.AddChild(exitGameButton);
            exitGameButton.Click += new EventHandler(exitGameButton_Click);

            Button ratingTestPopup = new Button
            {
                Position = new Vector2(200, 0),
                Size = new Vector2(200, 20),
                Text = "Rating Test"
            };
            buttonsGrid.AddChild(ratingTestPopup);
            ratingTestPopup.Click += new EventHandler((o, e) =>
            {
                Client.Game.Interface.ScoreScreenControl ssc = new Client.Game.Interface.ScoreScreenControl
                {
                    GameState = new Client.Game.GameState { },
                    Map = new Client.Game.Map.Map { Settings = new Client.Game.Map.MapSettings { Name = "asdf" } },
                    GameTime = 123,
                    Statistics = new Client.Game.Statistics { },
                    EarnedGoldCoins = 1,
                    SilverEnabled = Program.Settings.SilverEnabled,
                    HideStats = Program.Settings.HideStats
                };
                ssc.AddChild(new Client.Game.Interface.RatingBox { Anchor = Orientation.TopRight, Position = new Vector2(0, 45) });
                Program.Instance.Interface.AddChild(ssc);
            });

            Button helpPopup = new Button
            {
                Position = new Vector2(200, 40),
                Size = new Vector2(200, 20),
                Text = "Help",
            };
            buttonsGrid.AddChild(helpPopup);
            helpPopup.Click += new EventHandler(helpPopup_Click);

            Button button = new Button
            {
                Text = "NormalWindow",
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                new Window { Anchor = Orientation.Center, Moveable = true });
            });

            button = new Button
            {
                Text = "LargeWindow",
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler((o, e) =>
            {
                Program.Instance.Interface.AddChild(
                new Window { Anchor = Orientation.Center, Moveable = true, LargeWindow = true });
            });

            button = new Button
            {
                Text = "Display settings form"
            };
            buttonsGrid.AddChild(button);
            button.Click += new EventHandler(button_Click);

            var currentStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600,
                },
                null,
                null,
                null
            };
            var bestStages = new Client.Game.Interface.StageInfo[]
            {
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 100,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3f,
                    Time = 150,
                    MaxHitPoints = 600,
                },
                null
            };

            Action<String, Func<Graphics.Entity>> addDialogTest = (text, dialog) =>
            {
                button = new Button
                {
                    Text = text,
                };
                buttonsGrid.AddChild(button);
                button.Click += new EventHandler((o, e) =>
                {
                    var d = dialog();
                    Program.Instance.Interface.AddChild(d);
                    System.Windows.Forms.Form f = new System.Windows.Forms.Form
                    {
                        Size = new System.Drawing.Size(200, 500)
                    };
                    var pg = new System.Windows.Forms.PropertyGrid
                    {
                        SelectedObject = d,
                        Dock = System.Windows.Forms.DockStyle.Fill
                    };
                    f.Controls.Add(pg);
                    pg.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler((o2, e2) =>
                    { d.Invalidate(); });
                    f.Show();
                });
            };

            addDialogTest("StartScreenControl", () => new Game.Interface.StartScreenControl
            {
                Anchor = Orientation.Center,
                Moveable = true,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
                AvailableRangedWeapons = Program.Instance.Profile.AvailableRangedWeapons,
                AvailableMeleeWeapons = Program.Instance.Profile.AvailableMeleeWeapons
            });
            addDialogTest("CreditsText", () => new Game.Interface.CreditsText
            {
                Title = "Entertainment",
                Text = "The muppets",
            });

            addDialogTest("LargeStoneButton", () => new LargeStoneButton
            {
                Text = "Button",
                Anchor = Orientation.Center
            });

            addDialogTest("StoneButton", () => new StoneButton
            {
                Text = "Button",
                Anchor = Orientation.Center
            });

            Random random = new Random();
            var stats = new Client.Game.Statistics();
            stats.CharacterActions.ShotgunFired = 40;
            stats.CharacterActions.ShotgunSlugHits = 67;
            stats.CharacterActions.GhostRifleFired = 20;
            stats.CharacterActions.GhostRifleHits = 18;
            stats.Actions.DamageDealt = random.Next(950);
            stats.Actions.DamageTaken = random.Next(340);
            stats.Actions.HitsTaken = random.Next(34);
            stats.Actions.TimesNetted = random.Next(40);
            stats.Kills.TotalKills = random.Next(12031);
            addDialogTest("ScoreScreenControl", () => new Game.Interface.ScoreScreenControl
            {
                Anchor = Orientation.Center,
                Map = new Client.Game.Map.Map
                {
                    Settings = new Client.Game.Map.MapSettings
                    {
                        Name = "The Challenge",
                        Stages = 5
                    }
                },
                Statistics = stats,
                Moveable = true,
                EarnedGoldCoins = 1,
                LostGameReason = "You were killed by a grunt",
                GameState = Client.Game.GameState.Won,
                AchievementsEarned = new List<Achievement>
                {
                    new Achievements.Make5TriesOnASingleMap(),
                    new Achievements.Kill70ZombiesInUnder10Seconds(),
                    new Achievements.Make10TriesOnASingleMap(),
                    new Achievements.Make20TriesOnASingleMap(),
                    new Achievements.Kill100ZombiesInUnder10Seconds(),
                },
                CurrentStages = currentStages,
                BestStages = bestStages,
                SilverEnabled = Program.Settings.SilverEnabled,
                HideStats = Program.Settings.HideStats
            });

            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
                Anchor = Orientation.Center,
                MapSettings = new Client.Game.Map.MapSettings
                {
                    Name = "The test map",
                },
            });

            addDialogTest("StoneDropDownBar", () =>
                {
                    var r = new StoneDropDownBar
                        {
                            Anchor = Orientation.Center,
                        };
                    r.AddItem("hello");
                    r.AddItem("cruel");
                    r.AddItem("world which sdlf jdsf klsdfadsflksda jödaskfj lsdjf lksafdjdöf kl sdkj\n\nslkfj");
                    return r;
                });
            addDialogTest("AchievementUnlockedPopup", () => new AchievementUnlockedPopup
            {
                DisplayName = "O needs medical attention?",
                Description = "Complete \"Reverse Gauntlet\" without killing any regular chests."
            });

            addDialogTest("UnlockButton", () => new UnlockButton
            {

            });

            addDialogTest("MapButton", () =>
            {
                var mb = new MapButton
                {
                    Map = "LevelA",
                };
                Program.Instance.Tooltip.SetToolTip(mb, new MapToolTip
                    {
                        Title = "Jahman",
                        Objective = "Killin them zombies",
                        Yield = 2

                    });
                return mb;
            });

            addDialogTest("RatingBox", () => new Game.Interface.RatingBox
            {
            });

            addDialogTest("ActionTipText", () => new Game.Interface.WarningFlashText
            {
                Text = "Press space!"
            });

            addDialogTest("TutorialText", () => new Game.Interface.TutorialText
            {
                Text = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission to obliterate the evil, by fighting your way through the islands and liberating the villagers before they are all consumed by a mystic plague. You'll have to act, think and move fast if you want to survive the horrors of these wicked parts of the world, and do not hope for any rescue or help, it's all up to you and you alone!",
                Title = "Tutorial"
            });

            addDialogTest("Dialog", () => new Dialog
            {
                Title = "Hello",
                Text = "Applications that load assemblies with this method will be affected by upgrades of those assemblies. Therefore, do not use this method; redesign the application to use the Load(String) method overload or the LoadFrom(String) method overload.",
            });

            addDialogTest("InGameMenu", () => new Game.Interface.InGameMenu
            {
            });

            addDialogTest("SpeachBubble", () => new Game.Interface.SpeachBubble
            {
                Text = "Dead Meets Lead is every bit and piece of what a zombie slaying, fast paced action game should be. Enter the role of the 18th century commander who's on a mission..."
            });

            addDialogTest("Rating", () => new Game.Interface.RatingControl
            {
                Anchor = global::Graphics.Orientation.Center
            });

            addDialogTest("StageInfo", () => new Game.Interface.StageInfoControl
            {
                Anchor = global::Graphics.Orientation.Center,
                Background = InterfaceScene.DefaultSlimBorder,
                CurrentStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints = 300,
                    Rage = 2.3f,
                    Time = 200,
                    MaxHitPoints = 600
                },
                BestStage = new Client.Game.Interface.StageInfo
                {
                    HitPoints = 500,
                    Rage = 3,
                    Time = 150,
                    MaxHitPoints = 600
                }
            });
            addDialogTest("StageCompleted", () =>
                {
                    var s = new Game.Interface.StageControl
                    {
                        Anchor = global::Graphics.Orientation.Center,
                        CurrentStage = new Client.Game.Interface.StageInfo
                        {
                            HitPoints = 300,
                            Rage = 2.3f,
                            Ammo = 15,
                            Time = 200,
                            MaxHitPoints = 600,
                            Stage = 2
                        },
                        BestStage = new Client.Game.Interface.StageInfo
                        {
                            HitPoints = 200,
                            Rage = 3,
                            Ammo = 5,
                            Time = 150,
                            MaxHitPoints = 600
                        },
                        Stage = 1,
                        Clickable = true
                    };
                    s.Click += new EventHandler((o, e) =>
                    {
                        if (s.State == Client.Game.Interface.StageCompletedState.Maximized)
                            s.State = Client.Game.Interface.StageCompletedState.Minimizing;
                        else
                            s.State = Client.Game.Interface.StageCompletedState.Maximizing;
                    });
                    return s;
                }
            );
            addDialogTest("ArrowIndicator", () => new ArrowIndicator
            {
                Anchor = global::Graphics.Orientation.Center,
                Size = new Vector2(100, 100)
            });
            addDialogTest("DefaultFormBorderOutlined", () => new Form
            {
                Anchor = global::Graphics.Orientation.Center,
                Size = new Vector2(250, 140),
                Background = InterfaceScene.DefaultFormBorderOutlined,
                Moveable = true
            });
            addDialogTest("Stages", () =>
                {
                    var s = new Client.Game.Interface.StagesControl
                    {
                        Anchor = global::Graphics.Orientation.Center,
                        Size = new Vector2(1000, 140),
                        NStages = 5
                    };
                    for (int i = 0; i < s.NStages; i++)
                    {
                        s.SetBestStage(i + 1, bestStages[i]);
                        s.SetCurrentStage(i + 1, currentStages[i]);
                    }
                    s.SetActive(1, true);
                    Program.Instance.Timeout(2, () => s.Maximize(2));
                    Program.Instance.Timeout(10, () => s.Minimize(2));
                    return s;
                });
            addDialogTest("Scaling", () =>
            {
                var s = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode= SizeMode.AutoAdjust,
                        Texture = new TextureFromFile("checker.png")
                    },
                    Size = new Vector2(512, 512),
                    Position = new Vector2(100, 100),
                    Updateable = true
                };
                var c = new Graphics.Interface.Control
                {
                    Background = new Graphics.Content.ImageGraphic
                    {
                        SizeMode = SizeMode.AutoAdjust,
                        Texture = new TextureFromFile("cornell.png")
                    },
                    Size = new Vector2(128, 128),
                    Position = new Vector2(100, 100),
                };
                s.AddChild(c);
                float v = 0;
                s.Update += new UpdateEventHandler((o, d) =>
                {
                    v += d.Dtime;
                    s.Scale = new Vector3((float)Math.Abs(Math.Sin(v)), (float)Math.Abs(Math.Sin(v)), 1);
                });
                return s;
            });

            addDialogTest("VideoOptionsWindow", () => new VideoOptionsWindow
            {
                AvailableAnimationQualities = new Graphics.Renderer.Settings.AnimationQualities[] { Graphics.Renderer.Settings.AnimationQualities.Low, Graphics.Renderer.Settings.AnimationQualities.Medium, Graphics.Renderer.Settings.AnimationQualities.High },
                AnimationQuality = Program.Settings.RendererSettings.AnimationQuality,
                AvailableVideoQualities = new VideoQualities[] { VideoQualities.Custom, VideoQualities.Low, VideoQualities.Medium, VideoQualities.High, VideoQualities.Ultra },
                OverallVideoQuality = Program.Settings.VideoQuality,
            });

            deviceRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(0, 50)
            };

            clientRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(80, 50)
            };

            windowRes = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(240, 50)
            };

            fps = new Label
            {
                Anchor = Orientation.BottomRight,
                Size = new Vector2(70, 70),
                Position = new Vector2(160, 50)
            };

            mousePos = new Label
            {
                Anchor = Orientation.TopLeft,
                Size = new Vector2(70, 70),
                Position = new Vector2(320, 50)
            };
            #if DEBUG_DEVELOPERMAINMENU
            i++;
            s[i] = new System.IO.StreamWriter("debugRESOLUTION" + i + ".txt");
            #endif
            Program.Instance.Interface.AddChild(deviceRes);
            Program.Instance.Interface.AddChild(clientRes);
            Program.Instance.Interface.AddChild(windowRes);
            Program.Instance.Interface.AddChild(fps);
            Program.Instance.Interface.AddChild(mousePos);

            fader = new Fader { State = FadeState.FadedOut };
            Program.Instance.Interface.AddChild(fader);
        }
        public Interface()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(IngameInterfaceContainer);
            if (Program.Settings.DisplayConsole)
            {
                AddChild(Console);
            }
            AddChild(HUD);
            AddChild(TextContainer);

            ButtonBase menu = new StoneButton
            {
                Text          = Locale.Resource.GenMenu,
                Anchor        = global::Graphics.Orientation.BottomLeft,
                DisplayHotkey = false,
                Position      = new Vector2(5, 3),
            };

            menu.Click += new EventHandler(menu_Click);
            AddChild(menu);

            if (Program.Settings.CanSelectCheckpoint)
            {
                AddChild(new CheckpointsControl());
            }

            if (Program.Settings.DisplayFPS)
            {
                AddChild(fpsTextBox = new Graphics.Interface.Label
                {
                    Size   = new Vector2(100, 60),
                    Anchor = global::Graphics.Orientation.TopRight,
                    Text   = "fps",
                });
            }

            if (Program.Settings.DisplayDPS)
            {
                AddChild(dpsMeter);
            }

            if (Program.Settings.UseCPUPerformanceCounter)
            {
                cpuCounter = new System.Diagnostics.PerformanceCounter
                {
                    CategoryName = "Process",
                    CounterName  = "% Processor Time",
                    InstanceName = "Client.vshost",
                };
            }
            //InformationPopupContainer.Size = Common.Math.ToVector2(Program.Instance.Size);
            InformationPopupContainer.Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height);
            AddChild(profilersResults);
            AddChild(silverText);
            AddChild(InformationPopupContainer);
            AddChild(PopupContainer);
            if (Program.Settings.DisplayRendererStatus)
            {
                AddChild(new RenderTreeVisualizer {
                    Anchor = Orientation.Top, Position = new Vector2(0, 40), Renderer = (Graphics.Renderer.Renderer)Game.Instance.SceneRendererConnector.Renderer
                });
            }
            Updateable = true;
        }
 public Caret(Label textBox)
 {
     this.textBox = textBox;
     this.Visible = true;
 }
 public RatingRow()
 {
     Size = new Vector2(430, 20);
     AddChild(nameBox = new Label { Background = null, Anchor = Orientation.Left, Size = new Vector2(120, 20) });
     AddChild(lowValueBox = new Label { Background = null, Anchor = Orientation.Left, Size = new Vector2(80, 20), Position = new Vector2(120, 0), TextAnchor = Orientation.Right });
     AddChild(ratingBox = new RatingControl { Size = new Vector2(140, 20), Position = new Vector2(205, 0) });
     AddChild(highValueBox = new Label { Background = null, Anchor = Orientation.Left, Size = new Vector2(80, 20), Position = new Vector2(355, 0) });
 }
        protected override void OnConstruct()
        {
            base.OnConstruct();
            ClearChildren();
            AddChild(new Label
            {
                Font = new Font
                {
                    SystemFont = Fonts.HugeSystemFont,
                    Color = System.Drawing.Color.FromArgb(200, 224, 227, 141),
                    Backdrop = System.Drawing.Color.FromArgb(0, 251, 253, 200)
                },
                Text = Locale.Resource.MenuAchievements,
                Anchor = Orientation.Top,
                AutoSize = AutoSizeMode.Full,
                Background = null,
                Position = new Vector2(0, 3)
            });
            //AddChild(new Control
            //{
            //    Background = new ImageGraphic
            //    {
            //        Texture = new TextureFromFile("Interface/Menu/AchievementsTextEng1.png") { DontScale = true },
            //        SizeMode = SizeMode.AutoAdjust
            //    },
            //    Position = new Vector2(135, 42)
            //});
            PagedFlowLayout layout = new PagedFlowLayout
            {
                Dock = System.Windows.Forms.DockStyle.Bottom,
                Margin = new System.Windows.Forms.Padding(16),
                Size = new Vector2(0, 695)
            };
            AddChild(layout);
            foreach (var v in Program.Instance.Profile.Achievements.All)
                if(v.Completed)
                {
                    var t = new Label
                    {
                        Text = v.DisplayName,
                        Clickable = true,
                        Font = Fonts.Default,
                        Overflow = TextOverflow.Ignore,
                        Size = new Vector2(433, 46),
                        TextAnchor = Orientation.Center
                    };

                    t.Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/AchievementSmallCompleted1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust
                    };

                    layout.AddControl(t);
                    Program.Instance.Tooltip.SetToolTip(t, v.Description);
                }

            foreach (var v in Program.Instance.Profile.Achievements.All)
                if (!v.Completed)
                {
                    var t = new Label
                    {
                        Text = v.DisplayName,
                        Clickable = true,
                        Font = Fonts.Default,
                        Overflow = TextOverflow.Ignore,
                        Size = new Vector2(433, 46),
                        TextAnchor = Orientation.Center
                    };

                    t.Background = new ImageGraphic
                    {
                        Texture = new TextureFromFile("Interface/Menu/AchievementSmall1.png") { DontScale = true },
                        SizeMode = SizeMode.AutoAdjust
                    };

                    layout.AddControl(t);
                    Program.Instance.Tooltip.SetToolTip(t, v.Description);
                }
        }
 public MalariaSign()
 {
     Background = new ImageGraphic
     {
         Texture = new TextureFromFile("Interface/IngameInterface/Malaria1.png") { DontScale = true },
     };
     Size = new Vector2(600, 300);
     Anchor = Orientation.Bottom;
     Position = new Vector2(0, 50);
     Updateable = true;
     AddChild(text = new Label
     {
         Font = new Font
         {
             Color = System.Drawing.Color.FromArgb(255, 0x8a, 0xdf, 0x39),
             Backdrop = System.Drawing.Color.FromArgb(100, 0, 0, 0),
             SystemFont = Fonts.HugeSystemFont
         },
         Text = Locale.Resource.HUDMalaria,
         Background = null,
         TextAnchor = Orientation.Center,
         Dock = System.Windows.Forms.DockStyle.Fill,
         Clickable = false,
     });
 }
        public Interface()
        {
            Dock = System.Windows.Forms.DockStyle.Fill;
            AddChild(IngameInterfaceContainer);
            if(Program.Settings.DisplayConsole)
                AddChild(Console);
            AddChild(HUD);
            AddChild(TextContainer);

            ButtonBase menu = new StoneButton
            {
                Text = Locale.Resource.GenMenu,
                Anchor = global::Graphics.Orientation.BottomLeft,
                DisplayHotkey = false,
                Position = new Vector2(5, 3),
            };
            menu.Click += new EventHandler(menu_Click);
            AddChild(menu);

            if (Program.Settings.CanSelectCheckpoint)
                AddChild(new CheckpointsControl());

            if(Program.Settings.DisplayFPS)
                AddChild(fpsTextBox = new Graphics.Interface.Label
                    {
                        Size = new Vector2(100, 60),
                        Anchor = global::Graphics.Orientation.TopRight,
                        Text = "fps",
                    });

            if (Program.Settings.DisplayDPS)
                AddChild(dpsMeter);

            if (Program.Settings.UseCPUPerformanceCounter)
            {
                cpuCounter = new System.Diagnostics.PerformanceCounter
                {
                    CategoryName = "Process",
                    CounterName = "% Processor Time",
                    InstanceName = "Client.vshost",

                };
            }
            //InformationPopupContainer.Size = Common.Math.ToVector2(Program.Instance.Size);
            InformationPopupContainer.Size = new Vector2(Program.Settings.GraphicsDeviceSettings.Resolution.Width, Program.Settings.GraphicsDeviceSettings.Resolution.Height);
            AddChild(profilersResults);
            AddChild(silverText);
            AddChild(InformationPopupContainer);
            AddChild(PopupContainer);
            if (Program.Settings.DisplayRendererStatus)
                AddChild(new RenderTreeVisualizer { Anchor = Orientation.Top, Position = new Vector2(0, 40), Renderer = (Graphics.Renderer.Renderer)Game.Instance.SceneRendererConnector.Renderer });
            Updateable = true;
        }
 public void MessageBox(String message)
 {
     Form f = new Form
     {
         Anchor = Orientation.Center,
         Size = new Vector2(200, 150),
         Clickable = true
     };
     Label t = new Label
     {
         Text = message,
         TextAnchor = Orientation.Center,
         Anchor = Orientation.Top,
         Size = new Vector2(200, 100),
         Background = null,
         Position = new Vector2(0, 10),
     };
     f.AddChild(t);
     Button b = new Button
     {
         Text = "Ok",
         Anchor = Orientation.Bottom,
         Position = new Vector2(0, 10),
         Size = new Vector2(100, 20)
     };
     b.MouseClick += new System.Windows.Forms.MouseEventHandler((e, o) => f.Remove());
     f.AddChild(b);
     Root.AddChild(f);
 }