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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }