Example #1
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(150, 105);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            invert = new Button(5, 80, (int)size.X - 10, 20, "Invert");
            invert.onClicked += new Button.ClickedEventHandler(invert_onClicked);
            controls.Add(invert);

            base.Initialize();
        }
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(200, 105);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max base current:");
            l.foreground = Color.White;
            controls.Add(l);

            baseCurrent = new TextBox(145, 80, (int)size.X - 150, 20);
            baseCurrent.MaxLength = 5;
            baseCurrent.Multiline = false;
            baseCurrent.Mask = TextBox.InputMask.Numbers;
            baseCurrent.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(baseCurrent);

            base.Initialize();
        }
Example #3
0
 public override void Dispose()
 {
     ok.Dispose();
     text.Dispose();
     ok = null;
     text = null;
     base.Dispose();
 }
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(170, 155);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Capasitance:");
            l.foreground = Color.White;
            controls.Add(l);

            capacitance = new TextBox(115, 80, (int)size.X - 120, 20);
            capacitance.MaxLength = 5;
            capacitance.Multiline = false;
            capacitance.Mask = TextBox.InputMask.Numbers;
            capacitance.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(capacitance);

            l = new Label(5, 105, "Voltage:");
            l.foreground = Color.White;
            controls.Add(l);

            voltage = new TextBox(115, 105, (int)size.X - 120, 20);
            voltage.MaxLength = 5;
            voltage.Multiline = false;
            voltage.Mask = TextBox.InputMask.Numbers;
            voltage.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(voltage);

            l = new Label(5, 130, "Current charge: ");
            l.foreground = Color.White;
            controls.Add(l);

            charge = new Label(5, 130, "100%");
            charge.foreground = Color.White;
            charge.TextAlignment = Renderer.TextAlignment.Right;
            charge.Size = new Vector2(Size.X - 10, charge.Size.Y);
            controls.Add(charge);

            base.Initialize();
        }
        public override void Initialize()
        {
            if (arrowDown == null)
            {
                LoadTextures();
            }

            WasInitialized = true;

            size = new Vector2(192, 145);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Ports:");
            l.foreground = Color.White;
            controls.Add(l);

            center = new MenuButton((int)(size.X - 20) / 2, 100, 20, 20, "");
            center.LeftTexture = ResourceManager.Load<Texture2D>("Components/Icons/AdvancedJoint");
            center.isEnabled = false;
            center.StretchLeftTextureToSize = true;
            center.disabledColor = Color.White;
            controls.Add(center);

            left = new MenuButton((int)center.Position.X - 20, 100, 20, 20, "");
            left.onClicked += new Button.ClickedEventHandler(left_onClicked);
            controls.Add(left);

            up = new MenuButton((int)center.Position.X, 80, 20, 20, "");
            up.onClicked += new Button.ClickedEventHandler(up_onClicked);
            controls.Add(up);

            right = new MenuButton((int)center.Position.X + 20, 100, 20, 20, "");
            right.onClicked += new Button.ClickedEventHandler(right_onClicked);
            controls.Add(right);

            down = new MenuButton((int)center.Position.X, 120, 20, 20, "");
            down.onClicked += new Button.ClickedEventHandler(down_onClicked);
            controls.Add(down);

            base.Initialize();
        }
Example #6
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(180, 150);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Luminosity:");
            l.foreground = Color.White;
            controls.Add(l);

            luminosity = new TextBox(125, 80, (int)size.X - 130, 20);
            luminosity.MaxLength = 5;
            luminosity.Multiline = false;
            luminosity.Mask = TextBox.InputMask.Numbers;
            luminosity.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(luminosity);

            l = new Label(5, 105, "Color: ");
            l.foreground = Color.White;
            controls.Add(l);

            color = new MicroWorld.Graphics.GUI.Elements.Button(125, 105, (int)size.X - 130, 20, "");
            color.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(color_onClicked);
            controls.Add(color);

            l = new Label(5, 130, "Brightness: ");
            l.foreground = Color.White;
            controls.Add(l);

            brightness = new Label(5, 130, "");
            brightness.foreground = Color.White;
            brightness.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(brightness);

            base.Initialize();
        }
Example #7
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(220, 155);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            title.font = TitleFont;
            controls.Add(title);

            size.X = Math.Max(title.font.MeasureString(title.text).X + 80, size.X);

            title.size.X = size.X - 20;

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max current:");
            l.foreground = Color.White;
            controls.Add(l);

            maxCurrent = new TextBox(165, 80, (int)size.X - 170, 20);
            maxCurrent.MaxLength = 8;
            maxCurrent.Multiline = false;
            maxCurrent.Mask = TextBox.InputMask.Numbers;
            maxCurrent.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(maxCurrent);

            l = new Label(5, 105, "Current:");
            l.foreground = Color.White;
            controls.Add(l);

            current = new Label(5, 105, "");
            current.foreground = Color.White;
            current.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(current);

            l = new Label(5, 130, "Voltage drop:");
            l.foreground = Color.White;
            controls.Add(l);

            voltage = new Label(5, 130, "");
            voltage.foreground = Color.White;
            voltage.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(voltage);

            base.Initialize();
        }
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(250, 155);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max charge:");
            l.foreground = Color.White;
            controls.Add(l);

            maxCharge = new TextBox(185, 80, (int)size.X - 190, 20);
            maxCharge.MaxLength = 5;
            maxCharge.Multiline = false;
            maxCharge.Mask = TextBox.InputMask.Numbers;
            maxCharge.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(maxCharge);

            l = new Label(5, 105, "Initial charge:");
            l.foreground = Color.White;
            controls.Add(l);

            pb_startCharge = new ProgressBar(140, 105, (int)size.X - 145, 20, true);
            pb_startCharge.Foreground = ResourceManager.Load<Texture2D>("RedYellowLimeGradient");
            pb_startCharge.onValueChanged += new ProgressBar.ValueChangedEventHandler(pb_startCharge_onValueChanged);
            controls.Add(pb_startCharge);

            l = new Label(5, 130, "Charge:");
            l.foreground = Color.White;
            controls.Add(l);

            pb_charge = new ProgressBar(140, 130, (int)size.X - 145, 20, false);
            pb_charge.Foreground = ResourceManager.Load<Texture2D>("RedYellowLimeGradient");
            controls.Add(pb_charge);

            base.Initialize();
        }
Example #9
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(190, 155);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            title.font = TitleFont;
            controls.Add(title);

            size.X = Math.Max(title.font.MeasureString(title.text).X + 80, size.X);

            title.size.X = size.X - 20;

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Ticks: ");
            l.foreground = Color.White;
            controls.Add(l);

            ticks = new TextBox(135, 80, (int)size.X - 140, 20, "0");
            ticks.MaxLength = 5;
            ticks.Multiline = false;
            ticks.Mask = TextBox.InputMask.Numbers;
            ticks.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(ticks);

            l = new Label(5, 105, "Accuracy (%): ");
            l.foreground = Color.White;
            controls.Add(l);

            accuracy = new TextBox(135, 105, (int)size.X - 140, 20, "0");
            accuracy.MaxLength = 3;
            accuracy.Multiline = false;
            accuracy.Mask = TextBox.InputMask.Numbers;
            accuracy.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(accuracy);

            record = new CheckBox(5, 130, (int)size.X - 10, 20, "Record: ", false);
            record.foreground = Color.White;
            controls.Add(record);

            base.Initialize();
        }
Example #10
0
        private OKMessageBox(String txt)
        {
            text = new Label(0, 0, txt);
            text.TextAlignment = Graphics.Renderer.TextAlignment.Center;
            text.foreground = Color.White;
            position = new Vector2((Main.graphics.PreferredBackBufferWidth - text.size.X) / 2 - 5,
                (Main.graphics.PreferredBackBufferHeight - size.Y) / 2 - 15);
            size = new Vector2(text.size.X + 10, text.size.Y + 30);
            text.position = position + new Vector2(5, 5);
            ok = new MenuButton((int)position.X, (int)(position.Y + size.Y) - 20, (int)(size.X), 20, "OK");
            ok.Font = MenuFrameScene.ButtonFont;
            ok.TextOffset = new Vector2(5, 2);
            ok.onClicked += new Button.ClickedEventHandler(okClick);

            controls.Add(ok);
            controls.Add(text);
        }
Example #11
0
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(170, 170);//130

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            title.font = TitleFont;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Field range:");
            l.foreground = Color.White;
            controls.Add(l);

            fieldRange = new TextBox(125, 80, (int)size.X - 130, 20);
            fieldRange.MaxLength = 5;
            fieldRange.Multiline = false;
            fieldRange.Mask = TextBox.InputMask.Numbers;
            fieldRange.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(fieldRange);

            l = new Label(5, 105, "Power:");
            l.foreground = Color.White;
            controls.Add(l);

            power = new Label(5, 105, "");
            power.foreground = Color.White;
            power.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(power);

            base.Initialize();
        }
Example #12
0
 private YesNoMessageBox(String txt)
 {
     text = new Label(0, 0, txt);
     text.TextAlignment = Graphics.Renderer.TextAlignment.Center;
     text.foreground = Color.White;
     position = new Vector2((Main.graphics.PreferredBackBufferWidth - text.size.X) / 2 - 5,
         (Main.graphics.PreferredBackBufferHeight - size.Y) / 2 - 15);
     size = new Vector2(text.size.X + 10, text.size.Y + 30);
     text.position = position + new Vector2(5, 5);
     no = new MenuButton((int)position.X, (int)(position.Y + size.Y) - 23, (int)(size.X / 2), 23, "No");
     yes = new MenuButton((int)(position.X + size.X / 2), (int)(position.Y + size.Y) - 23, (int)(size.X / 2), 23, "Yes");
     yes.onClicked += new Button.ClickedEventHandler(yesClick);
     no.onClicked += new Button.ClickedEventHandler(noClick);
     yes.Font = MenuFrameScene.ButtonFont;
     no.Font = MenuFrameScene.ButtonFont;
     yes.TextOffset = new Vector2(5, 2);
     no.TextOffset = yes.TextOffset;
     no.Initialize();
     yes.Initialize();
 }
Example #13
0
        public HotkeyControl(int x, int y, int buttonOffset, String txt, IO.InputSequence key)
        {
            this.buttonOffset = buttonOffset;
            this.key = key;

            b_Key = new MenuButton(x + buttonOffset, y + 2, 240, 16, key.ToString());
            b_Key.Text = key.ToString(GUIEngine.font, (int)b_Key.size.X, false);
            b_Key.Font = GUIEngine.font;
            b_Key.TextOffset = new Vector2(0, 4);
            b_Key.DrawBottomLine = false;
            b_Key.onClicked += new Button.ClickedEventHandler(b_Key_onClicked);

            b_Text = new Label(x + 2, y - 1, txt);
            b_Text.foreground = Color.White;

            position = new Vector2(x, y);
            Size = new Vector2(buttonOffset + 240, 20);

            Key = key;
        }
Example #14
0
        public Tutorial()
        {
            String txt = "";
            _txt = txt;
            //position = new Vector2(ComponentSelector.ElementSize.X, 0);
            //size = new Vector2(Main.WindowWidth - ComponentSelector.ElementSize.X, 0);

            text = new Label(0, 0, txt);
            text.position = position;
            Vector2 v = new Vector2();
            FitText(ref txt, out v);
            size.Y = v.Y;
            text.text = txt;
            text.size = size;
            text.TextAlignment = Graphics.Renderer.TextAlignment.Center;
            text.foreground = Color.White;

            controls.Add(text);

            OnTutorialClicked += new TutorialClickedEventHandler(Tutorial_OnTutorialClicked);
        }
        public override void Initialize()
        {
            WasInitialized = true;

            size = new Vector2(220, 130);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            Label l = new Label(5, 80, "Max resistance:");
            l.foreground = Color.White;
            controls.Add(l);

            resistance = new TextBox(145, 80, (int)size.X - 150, 20);
            resistance.MaxLength = 7;
            resistance.Multiline = false;
            resistance.Mask = TextBox.InputMask.Numbers;
            resistance.onLooseFocus += new TextBox.FocusEventHandler(tb_onLooseFocus);
            controls.Add(resistance);

            loadSeq = new MicroWorld.Graphics.GUI.Elements.Button(5, 105, (int)size.X - 10, 20, "Load sequence");
            loadSeq.onClicked += new MicroWorld.Graphics.GUI.Elements.Button.ClickedEventHandler(loadSeq_onClicked);
            controls.Add(loadSeq);

            base.Initialize();
        }
Example #16
0
        public override void Initialize()
        {
            if (this.GetType() == typeof(GeneralProperties))
            {
                Label title;
                CheckBox removable;

                WasInitialized = true;

                size = new Vector2(120, 80);

                title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
                title.font = TitleFont;
                title.UpdateSizeToTextSize();
                title.TextAlignment = Renderer.TextAlignment.Center;
                title.foreground = Color.White;
                controls.Add(title);

                size.X = Math.Max(title.font.MeasureString(title.text).X + 80, size.X);

                title.size.X = size.X - 20;

                removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
                removable.foreground = Color.White;
                removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
                controls.Add(removable);
            }

            Label l = new Label(5, 30, "ID:");
            l.foreground = Color.White;
            controls.Add(l);

            ID = new Label(5, 30, "0");
            ID.foreground = Color.White;
            ID.TextAlignment = Renderer.TextAlignment.Right;
            controls.Add(ID);

            remove = new MenuButton(5, 5, 20, 20, "");
            remove.LeftTexture = ResourceManager.Load<Texture2D>("GUI/HUD/Properties/Remove");
            remove.onClicked += new Button.ClickedEventHandler(remove_onClicked);
            controls.Add(remove);

            close = new MenuButton((int)size.X - 25, 5, 20, 20, "");
            close.LeftTexture = ResourceManager.Load<Texture2D>("GUI/HUD/Properties/Close");
            close.onClicked += new Button.ClickedEventHandler(close_onClicked);
            controls.Add(close);

            help = new MenuButton((int)size.X - 45, 5, 20, 20, "");
            help.LeftTexture = ResourceManager.Load<Texture2D>("GUI/HUD/Properties/Help");
            help.onClicked += new Button.ClickedEventHandler(help_onClicked);
            controls.Add(help);

            base.Initialize();

            ReCreateFBO();
        }
Example #17
0
        public override void Initialize()
        {
            #region NececarryStuff
            article = new Encyclopedia.Article();
            article.position = new Vector2(10, 10);
            article.Size = new Vector2(Main.WindowWidth - 20, Main.WindowHeight - 110);

            loadhtml = new EncyclopediaBrowserButton(Main.WindowWidth - 325, Main.WindowHeight - 25, 100, 20, "View page");
            (loadhtml as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            loadhtml.foreground = Color.White;
            loadhtml.onClicked += new Button.ClickedEventHandler(loadhtml_onClicked);
            controls.Add(loadhtml);

            goToLink = new EncyclopediaBrowserButton(Main.WindowWidth - 215, Main.WindowHeight - 25, 100, 20, "Go to link");
            (goToLink as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            goToLink.foreground = Color.White;
            goToLink.onClicked += new Button.ClickedEventHandler(goToLink_onClicked);
            controls.Add(goToLink);

            exit = new EncyclopediaBrowserButton(Main.WindowWidth - 105, Main.WindowHeight - 25, 100, 20, "Exit");
            (exit as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            exit.foreground = Color.White;
            exit.onClicked += new Button.ClickedEventHandler(exit_onClicked);
            controls.Add(exit);

            Label l1 = new Label(11, Main.WindowHeight - 80, "File:");
            l1.foreground = Color.White;
            controls.Add(l1);

            tbFile = new TextBox(60, Main.WindowHeight - 80,
                Main.WindowWidth - 20 - 50, 18);
            tbFile.BackgroundColor = new Color(32, 32, 32, 192);
            tbFile.ForegroundColor = Color.White;
            tbFile.CursorColor = new Color(200, 200, 200);
            tbFile.Multiline = false;
            controls.Add(tbFile);

            Label l = new Label(11, Main.WindowHeight - 50, "Link:");
            l.foreground = Color.White;
            controls.Add(l);

            tbLink = new TextBox(60, Main.WindowHeight - 50,
                Main.WindowWidth - 20 - 50, 20);
            tbLink.BackgroundColor = new Color(32, 32, 32, 192);
            tbLink.ForegroundColor = Color.White;
            tbLink.CursorColor = new Color(200, 200, 200);
            tbLink.Multiline = false;
            tbLink.onTextChanged += new TextBox.TextChangedEventHandler(tbLink_onTextChanged);
            controls.Add(tbLink);
            #endregion

            #region FileManagement
            save = new EncyclopediaBrowserButton(5, Main.WindowHeight - 25, 100, 20, "Save");
            (save as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            save.foreground = Color.White;
            save.onClicked += new Button.ClickedEventHandler(save_onClicked);
            controls.Add(save);

            saveas = new EncyclopediaBrowserButton(115, Main.WindowHeight - 25, 100, 20, "Save As");
            (saveas as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            saveas.foreground = Color.White;
            saveas.onClicked += new Button.ClickedEventHandler(saveas_onClicked);
            controls.Add(saveas);

            load = new EncyclopediaBrowserButton(225, Main.WindowHeight - 25, 100, 20, "Load");
            (load as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            load.foreground = Color.White;
            load.onClicked += new Button.ClickedEventHandler(load_onClicked);
            controls.Add(load);

            clear = new EncyclopediaBrowserButton(335, Main.WindowHeight - 25, 100, 20, "Clear");
            (clear as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            clear.foreground = Color.White;
            clear.onClicked += new Button.ClickedEventHandler(clear_onClicked);
            controls.Add(clear);
            #endregion

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Example #18
0
        public override void Initialize()
        {
            buttons = new List<Button>();
            arefiles = new List<bool>();

            lcurFolder = new Label(10, 10, curFolder);
            lcurFolder.size.X = Main.WindowWidth - 20;
            lcurFolder.foreground = Color.White;
            lcurFolder.TextAlignment = Renderer.TextAlignment.Center;
            controls.Add(lcurFolder);

            folderup = new EncyclopediaBrowserButton(20, (int)(lcurFolder.position.Y + lcurFolder.size.Y + 5), 400, 28, "    ..");
            folderup.onClicked += new Button.ClickedEventHandler(folderup_onClicked);
            folderup.background = Color.Transparent;
            folderup.foreground = Color.White;
            folderup.textAlignment = Renderer.TextAlignment.Left;
            controls.Add(folderup);

            bnext = new EncyclopediaBrowserButton(Main.WindowWidth - 85, Main.WindowHeight - 38, 80, 28, ">>");
            (bnext as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bnext.foreground = Color.White;
            //bnext.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bnext.onClicked += new Button.ClickedEventHandler(bnext_onClicked);
            controls.Add(bnext);

            bprev = new EncyclopediaBrowserButton(5, Main.WindowHeight - 38, 80, 28, "<<");
            (bprev as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bprev.foreground = Color.White;
            //bprev.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bprev.onClicked += new Button.ClickedEventHandler(bprev_onClicked);
            controls.Add(bprev);

            back = new EncyclopediaBrowserButton((Main.WindowWidth - 80) / 2, Main.WindowHeight - 38, 80, 28, "Back");
            (back as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            back.foreground = Color.White;
            //back.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            back.onClicked += new Button.ClickedEventHandler(back_onClicked);
            controls.Add(back);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
            ResetState();
        }
Example #19
0
        public override void Initialize()
        {
            font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_18");

            Layer = 5000;
            ShouldBeScaled = false;

            size = new Vector2(Main.WindowWidth / 4, Main.WindowHeight / 4);
            size = new Vector2(602, 338);
            position = new Vector2((Main.WindowWidth - size.X) / 2, (Main.WindowHeight - size.Y) / 2);

            menu = new MenuButton((int)position.X, (int)(position.Y + size.Y - size.Y / 3),
                (int)(size.X / 4), 30, "Menu");
            menu.Font = font;
            menu.TextOffset = new Vector2(0, 3);
            menu.onClicked += new Button.ClickedEventHandler(menu_onClicked);
            controls.Add(menu);

            replay = new MenuButton((int)(position.X + size.X / 4), (int)(position.Y + size.Y - size.Y / 3),
                (int)(size.X / 4), 30, "Replay");
            replay.Font = font;
            replay.TextOffset = menu.TextOffset;
            replay.onClicked += new Button.ClickedEventHandler(replay_onClicked);
            controls.Add(replay);

            stay = new MenuButton((int)(position.X + 2 * size.X / 4), (int)(position.Y + size.Y - size.Y / 3),
                (int)(size.X / 4), 30, "Stay");
            stay.Font = font;
            stay.TextOffset = menu.TextOffset;
            stay.onClicked += new Button.ClickedEventHandler(stay_onClicked);
            controls.Add(stay);

            next = new MenuButton((int)(position.X + 3 * size.X / 4), (int)(position.Y + size.Y - size.Y / 3),
                (int)(size.X / 4), 30, "Next");
            next.Font = font;
            next.TextOffset = menu.TextOffset;
            next.onClicked += new Button.ClickedEventHandler(next_onClicked);
            controls.Add(next);

            time = new Label((int)position.X + 5, (int)position.Y + 5,      "Time:                     ");
            time.foreground = Color.White;
            controls.Add(time);

            elements = new Label((int)position.X + 5, (int)position.Y + 35, "Components placed:        ");
            elements.foreground = Color.White;
            controls.Add(elements);

            base.Initialize();
        }
Example #20
0
        public override void Initialize()
        {
            l = new Label(0, 0, "");
            l.foreground = Color.White;
            if (Main.WindowHeight >= 720)
                l.font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_22_b");
            else
                l.font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_15_b");
            controls.Add(l);

            base.Initialize();
        }
Example #21
0
        public override void Initialize()
        {
            if (t_leftUp == null)
            {
                LoadTextures();
            }

            WasInitialized = true;

            size = new Vector2(155, 172);

            title = new Label(0, 5, AssociatedComponent.Graphics.GetCSToolTip());
            title.font = TitleFont;
            title.UpdateSizeToTextSize();
            title.TextAlignment = Renderer.TextAlignment.Center;
            title.foreground = Color.White;
            controls.Add(title);

            Size = new Vector2(Math.Max(title.font.MeasureString(title.text).X + 80, Size.X), Size.Y);

            title.Size = new Vector2(Size.X - 20, title.Size.Y);

            removable = new CheckBox(5, 55, (int)size.X - 10, 20, "Removable: ", false);
            removable.foreground = Color.White;
            removable.onCheckedChanged += new CheckBox.CheckBoxCheckedHandler(removable_onCheckedChanged);
            controls.Add(removable);

            leftUp = new MenuButton(5, 80, 20, 20, "");
            leftUp.onClicked += new Button.ClickedEventHandler(leftUp_onClicked);
            leftUp.LeftTexture = t_leftUp;
            controls.Add(leftUp);

            leftRight = new MenuButton(30, 80, 20, 20, "");
            leftRight.onClicked += new Button.ClickedEventHandler(leftRight_onClicked);
            leftRight.LeftTexture = t_leftRight;
            controls.Add(leftRight);

            leftDown = new MenuButton(55, 80, 20, 20, "");
            leftDown.onClicked += new Button.ClickedEventHandler(leftDown_onClicked);
            leftDown.LeftTexture = t_leftDown;
            controls.Add(leftDown);

            upRight = new MenuButton(80, 80, 20, 20, "");
            upRight.onClicked += new Button.ClickedEventHandler(upRight_onClicked);
            upRight.LeftTexture = t_upRight;
            controls.Add(upRight);

            upDown = new MenuButton(105, 80, 20, 20, "");
            upDown.onClicked += new Button.ClickedEventHandler(upDown_onClicked);
            upDown.LeftTexture = t_upDown;
            controls.Add(upDown);

            rightDown = new MenuButton(130, 80, 20, 20, "");
            rightDown.onClicked += new Button.ClickedEventHandler(rightDown_onClicked);
            rightDown.LeftTexture = t_rightDown;
            controls.Add(rightDown);

            portLeft = new ToggleButton((int)size.X / 2 - 30, 125, 20, 20);
            portLeft.Add(arrowLeftRight, "IO");
            portLeft.Add(arrowLeft, "O");
            portLeft.Add(arrowRight, "I");
            portLeft.onSelectedChanged += new ToggleButton.SelectedChanged(portLeft_onSelectedChanged);
            controls.Add(portLeft);

            portRight = new ToggleButton((int)size.X / 2 + 10, 125, 20, 20);
            portRight.Add(arrowLeftRight, "IO");
            portRight.Add(arrowRight, "O");
            portRight.Add(arrowLeft, "I");
            portRight.onSelectedChanged += new ToggleButton.SelectedChanged(portRight_onSelectedChanged);
            controls.Add(portRight);

            portUp = new ToggleButton((int)size.X / 2 - 10, 105, 20, 20);
            portUp.Add(arrowUpDown, "IO");
            portUp.Add(arrowUp, "O");
            portUp.Add(arrowDown, "I");
            portUp.onSelectedChanged += new ToggleButton.SelectedChanged(portUp_onSelectedChanged);
            controls.Add(portUp);

            portDown = new ToggleButton((int)size.X / 2 - 10, 145, 20, 20);
            portDown.Add(arrowUpDown, "IO");
            portDown.Add(arrowDown, "O");
            portDown.Add(arrowUp, "I");
            portDown.onSelectedChanged += new ToggleButton.SelectedChanged(portDown_onSelectedChanged);
            controls.Add(portDown);

            base.Initialize();
        }
Example #22
0
        public override void Initialize()
        {
            Label l = new Label(10, 10, "Game creators:\r\n -Gleb Boytsun\r\n -Stanislav Efremov\r\n\r\n" +
            "Music and sound effects from:\r\n  www.beatsuite.com");
            l.foreground = Color.White;
            controls.Add(l);

            back = new EncyclopediaBrowserButton(Main.WindowWidth - 130, Main.WindowHeight - 40, 120, 30, "Back");
            (back as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            back.foreground = Color.White;
            back.onClicked += new Button.ClickedEventHandler(back_onClicked);
            controls.Add(back);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Example #23
0
 public override void Dispose()
 {
     no.Dispose();
     yes.Dispose();
     text.Dispose();
     no = null;
     yes = null;
     text = null;
     base.Dispose();
 }