Esempio n. 1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Polar Transformer";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(10, 3, 0, 5);


            //  Spiral
            m_SpiralSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_SpiralSlider.Dock = Pos.Bottom;
            m_SpiralSlider.SetSize(150, 20);
            m_SpiralSlider.SetRange(-0.3f, 0.2f);
            m_SpiralSlider.ValueChanged += Slider_ValueChanged;

            m_SpiralSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_SpiralSliderLabel.AutoSizeToContents = true;
            m_SpiralSliderLabel.Dock   = Pos.Bottom;
            m_SpiralSliderLabel.Margin = new Margin(0, 5, 0, 0);


            //  BaseY
            m_BaseYSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_BaseYSlider.Dock = Pos.Bottom;
            m_BaseYSlider.SetSize(150, 20);
            m_BaseYSlider.SetRange(20, 200);
            m_BaseYSlider.NotchCount    = (int)(m_BaseYSlider.Max - m_BaseYSlider.Min);
            m_BaseYSlider.SnapToNotches = true;
            m_BaseYSlider.ValueChanged += Slider_ValueChanged;

            m_BaseYSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_BaseYSliderLabel.AutoSizeToContents = true;
            m_BaseYSliderLabel.Dock   = Pos.Bottom;
            m_BaseYSliderLabel.Margin = new Margin(0, 10, 0, 0);


            m_SpiralSlider.Value = -0.18f;
            m_BaseYSlider.Value  = 60;


            //  Text
            m_TextBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
            m_TextBox.SetText(Common.AltSketch_Vector_Graphics_Library);
            m_TextBox.Font      = new Font("Times New Roman", 42);
            m_TextBox.TextColor = Color.Red;
            m_TextBox.SizeToContents();
            m_TextBox.Dock     = Pos.Bottom;
            m_TextBox.Margin   = new Margin(5, 10, 5, 10);
            m_TextBox.ReadOnly = true;

            m_TextBox.CursorPos = 9;
            m_TextBox.CursorEnd = 3;
            m_TextBox.Focus();
        }
Esempio n. 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            int row = 0;

            double fontScale = 1;

#if SILVERLIGHT
            fontScale = 0.8;
#endif

            m_Font1 = new Font("Consolas", System.Math.Round(14 * fontScale)); // fixed width font!
            m_Font2 = new Font("Impact", System.Math.Round(50 * fontScale));
            m_Font3 = new Font("Arial", System.Math.Round(14 * fontScale));

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("Type something here");
                textBox.SetPosition(10, 10 + 25 * row);
                textBox.TextChanged   += OnEdit;
                textBox.SubmitPressed += OnSubmit;
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBoxPassword textBox = new Alt.GUI.Temporary.Gwen.Control.TextBoxPassword(this);
                //textBox.MaskCharacter = '@';
                textBox.SetText("secret");
                textBox.TextChanged += OnEdit;
                textBox.SetPosition(10, 10 + 25 * row);
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("Select All Text On Focus");
                textBox.SetPosition(10, 10 + 25 * row);
                textBox.SelectAllOnFocus = true;
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("Different Coloured Text, for some reason");
                textBox.TextColor = Color.ForestGreen;
                textBox.SetPosition(10, 10 + 25 * row);
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBoxNumeric(this);
                textBox.SetText("200456698");
                textBox.TextColor = Color.LightCoral;
                textBox.SetPosition(10, 10 + 25 * row);
                row++;
            }

            row++;

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font3;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("..............................................................");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font3;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("public override void SetText(string str, bool doEvents = true)");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font3;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("あおい うみから やってきた");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font3;
                textBox.SizeToContents();
                row++;
            }

            row++;

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font1;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("..............................................................");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font1;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("public override void SetText(string str, bool doEvents = true)");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font1;
                textBox.SizeToContents();
                row++;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("あおい うみから やってきた");
                textBox.TextColor = Color.Black;
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font1;
                textBox.SizeToContents();
                row++;
            }

            row++;

            {
                Alt.GUI.Temporary.Gwen.Control.TextBox textBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
                textBox.SetText("Different Font (autosized)");
                textBox.SetPosition(10, 10 + 28 * row);
                textBox.Font = m_Font2;
                textBox.SizeToContents();

                row += 2;
            }
        }
Esempio n. 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Top Label
            Alt.GUI.Temporary.Gwen.Control.Label m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Sin Transformer";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(10, 3, 0, 5);


            //  ShiftX
            m_ShiftSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_ShiftSlider.Dock = Pos.Bottom;
            m_ShiftSlider.SetSize(150, 20);
            m_ShiftSlider.SetRange(0, 500);
            m_ShiftSlider.NotchCount    = (int)(m_ShiftSlider.Max - m_ShiftSlider.Min);
            m_ShiftSlider.SnapToNotches = true;
            m_ShiftSlider.ValueChanged += Slider_ValueChanged;

            m_ShiftSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_ShiftSliderLabel.AutoSizeToContents = true;
            m_ShiftSliderLabel.Dock   = Pos.Bottom;
            m_ShiftSliderLabel.Margin = new Margin(0, 10, 0, 0);


            //  Period
            m_PeriodSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_PeriodSlider.Dock = Pos.Bottom;
            m_PeriodSlider.SetSize(150, 20);
            m_PeriodSlider.SetRange(100, 500);
            m_PeriodSlider.NotchCount    = (int)(m_PeriodSlider.Max - m_PeriodSlider.Min);
            m_PeriodSlider.SnapToNotches = true;
            m_PeriodSlider.ValueChanged += Slider_ValueChanged;

            m_PeriodSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_PeriodSliderLabel.AutoSizeToContents = true;
            m_PeriodSliderLabel.Dock   = Pos.Bottom;
            m_PeriodSliderLabel.Margin = new Margin(0, 10, 0, 0);


            //  Amplitude
            m_AmplitudeSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_AmplitudeSlider.Dock = Pos.Bottom;
            m_AmplitudeSlider.SetSize(150, 20);
            m_AmplitudeSlider.SetRange(10, 100);
            m_AmplitudeSlider.NotchCount    = (int)(m_AmplitudeSlider.Max - m_AmplitudeSlider.Min);
            m_AmplitudeSlider.SnapToNotches = true;
            m_AmplitudeSlider.ValueChanged += Slider_ValueChanged;

            m_AmplitudeSliderLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_AmplitudeSliderLabel.AutoSizeToContents = true;
            m_AmplitudeSliderLabel.Dock   = Pos.Bottom;
            m_AmplitudeSliderLabel.Margin = new Margin(0, 5, 0, 0);


            m_AmplitudeSlider.Value = 50;
            m_PeriodSlider.Value    = 500;
            m_ShiftSlider.Value     = 0;


            //  Text
            m_TextBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(this);
            m_TextBox.SetText(Common.AltSketch_Vector_Graphics_Library);
            m_TextBox.Font      = new Font("Times New Roman", 42);
            m_TextBox.TextColor = Color.OrangeRed;
            //m_TextBox.SelectionColor = Color.Yellow;
            m_TextBox.SizeToContents();
            m_TextBox.Dock     = Pos.Bottom;
            m_TextBox.Margin   = new Margin(5, 10, 5, 10);
            m_TextBox.ReadOnly = true;

            m_TextBox.CursorPos = 19;
            m_TextBox.CursorEnd = 7;
            m_TextBox.Focus();
        }