!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Tools / Statoscope / Statoscope / InputBox.cs
blobecb939aeb69ed487faa4691e883bb3c4246a7981
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 using System;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Text;
7 using System.Drawing;
8 using System.Windows.Forms;
10 namespace Statoscope
12 class InputBox
14 public static DialogResult Show(string title, string promptText, ref string value)
16 Form form = new Form();
17 Label label = new Label();
18 TextBox textBox = new TextBox();
19 Button buttonOk = new Button();
20 Button buttonCancel = new Button();
22 form.Text = title;
23 label.Text = promptText;
24 textBox.Text = value;
26 buttonOk.Text = "OK";
27 buttonCancel.Text = "Cancel";
28 buttonOk.DialogResult = DialogResult.OK;
29 buttonCancel.DialogResult = DialogResult.Cancel;
31 label.SetBounds(9, 20, 372, 13);
32 textBox.SetBounds(12, 36, 372, 20);
33 buttonOk.SetBounds(228, 72, 75, 23);
34 buttonCancel.SetBounds(309, 72, 75, 23);
36 label.AutoSize = true;
37 textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
38 buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
39 buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
41 form.ClientSize = new Size(396, 107);
42 form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
43 form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
44 form.FormBorderStyle = FormBorderStyle.FixedDialog;
45 form.StartPosition = FormStartPosition.CenterScreen;
46 form.MinimizeBox = false;
47 form.MaximizeBox = false;
48 form.AcceptButton = buttonOk;
49 form.CancelButton = buttonCancel;
50 DialogResult dialogResult = form.ShowDialog();
51 value = textBox.Text;
52 return dialogResult;