Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
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();
        }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
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;
        }
Exemplo n.º 10
0
 void tbLink_onTextChanged(object sender, TextBox.TextChangedArgs e)
 {
     article.Link = e.NewText;
     goToLink.isEnabled = article.HasLink;
 }
        public override void Initialize()
        {
            if (arrowDown == null)
            {
                LoadTextures();
            }

            WasInitialized = true;

            size = new Vector2(192, 170);

            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, "Range:");
            l.foreground = Color.White;
            controls.Add(l);

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

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

            center = new MenuButton((int)(size.X - 20) / 2, 125, 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, 125, 20, 20, "");
            left.onClicked += new Button.ClickedEventHandler(left_onClicked);
            controls.Add(left);

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

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

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

            base.Initialize();
        }