示例#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();
        }
        // Thread safe updating of control's text property
        void SetText(Alt.GUI.Temporary.Gwen.Control.TextBox control, string text)
        {
            GUI.MethodInvoker m = delegate()
            {
                control.Text = text;
            };

            Invoke(m);
        }
示例#3
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;
            }
        }
示例#4
0
 void OnSubmit(Base control)
 {
     Alt.GUI.Temporary.Gwen.Control.TextBox box = control as Alt.GUI.Temporary.Gwen.Control.TextBox;
     UnitPrint(String.Format("TextBox: OnSubmit: {0}", box.Text));
 }
示例#5
0
        void CreateUI2()
        {
            Base rightPanel = new Base(m_MainSplitter);

            rightPanel.Dock = Pos.Fill;
            //rightPanel.Margin = new Margin(0);
            m_MainSplitter.SetPanel(0, rightPanel);


            Alt.GUI.Temporary.Gwen.Control.Label label_TOP = new Alt.GUI.Temporary.Gwen.Control.Label(rightPanel);
            label_TOP.TextColor          = LabelColor;
            label_TOP.AutoSizeToContents = true;
            label_TOP.Text      = "GMap.NET Interactive Example (use right mouse button to pan map)";
            label_TOP.TextColor = Color.Yellow;
            label_TOP.Dock      = Pos.Top;
            label_TOP.Margin    = new Margin(0, 3, 0, 7);


            //  cache Tab
            Alt.GUI.Temporary.Gwen.Control.TabButton button = m_TabControl.AddPage("cache");
            Alt.GUI.Temporary.Gwen.Control.Base      page   = button.Page;
            {
                int btn_offset = 7;

                button2      = new Alt.GUI.Temporary.Gwen.Control.Button(page);
                button2.Text = "Clear tiles in disk cache";
                button2.Dock = Pos.Top;
                //  set top offset
                button2.Margin = new Margin(0, btn_offset, 0, 0);
                button2.Click += new EventHandler(button2_Click);


                //  memory cache usage
                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text = "memory cache usage:";
                label.Dock = Pos.Top;
                //  set top offset
                label.Margin = new Margin(0, 12, 0, 2);

                textBoxMemory          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxMemory.ReadOnly = true;
                textBoxMemory.Dock     = Pos.Top;


                //  disk cache size
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "disk cache size:";
                label.Dock               = Pos.Top;
                //  set top offset
                label.Margin = new Margin(0, 12, 0, 2);

                textBoxCacheSize          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxCacheSize.ReadOnly = true;
                textBoxCacheSize.Dock     = Pos.Top;


                //  disk cache status
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "disk cache status:";
                label.Dock               = Pos.Top;
                //  set top offset
                label.Margin = new Margin(0, 12, 0, 2);

                textBoxCacheStatus          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxCacheStatus.ReadOnly = true;
                textBoxCacheStatus.Dock     = Pos.Top;


                //  cache routing/geocodig/etc
                checkBoxUseRouteCache           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(page);
                checkBoxUseRouteCache.TextColor = LabelColor;
                checkBoxUseRouteCache.UseCurrentColorAsNormal = true;
                checkBoxUseRouteCache.Text = "cache routing/geocodig/etc";
                checkBoxUseRouteCache.Dock = Pos.Top;
                //  set top offset
                checkBoxUseRouteCache.Margin    = new Margin(0, 14, 0, 0);
                checkBoxUseRouteCache.IsChecked = true;
            }
#if UNITY_WEBPLAYER
            button.Hide();
#endif


            //  info Tab
            button = m_TabControl.AddPage("info");
            page   = button.Page;
            {
                //  lat
                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text = "lat:";
                label.Dock = Pos.Top;
                //  set top offset
                label.Margin = new Margin(0, 4, 0, 0);

                textBoxLatCurrent          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxLatCurrent.ReadOnly = true;
                textBoxLatCurrent.Dock     = Pos.Top;


                //  lng
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "lng:";
                label.Dock               = Pos.Top;

                textBoxLngCurrent          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxLngCurrent.ReadOnly = true;
                textBoxLngCurrent.Dock     = Pos.Top;


                //  zoom
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "zoom:";
                label.Dock               = Pos.Top;
                //  set top offset
                label.Margin = new Margin(0, 12, 0, 0);

                textBoxZoomCurrent          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxZoomCurrent.ReadOnly = true;
                textBoxZoomCurrent.Dock     = Pos.Top;


                //  markers
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "markers:";
                label.Dock               = Pos.Top;

                textBoxMarkerCount          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxMarkerCount.ReadOnly = true;
                textBoxMarkerCount.Dock     = Pos.Top;


                //  routes
                label                    = new Alt.GUI.Temporary.Gwen.Control.Label(page);
                label.TextColor          = LabelColor;
                label.AutoSizeToContents = true;
                label.Text               = "routes:";
                label.Dock               = Pos.Top;

                textBoxrouteCount          = new Alt.GUI.Temporary.Gwen.Control.TextBox(page);
                textBoxrouteCount.ReadOnly = true;
                textBoxrouteCount.Dock     = Pos.Top;
            }


            //  MAP
            MainMap      = new Map(rightPanel);
            MainMap.Dock = Pos.Fill;
            //MainMap.Margin = new Margin(1, 0, 1, 0);
            //MainMap.DrawClientBorder = true;
            MainMap.DrawBorder = true;


            //  Scale
            Base m_ScaleControl = new Base(MainMap);
            m_ScaleControl.SetBounds(10, 10, 20, 200);

            Alt.GUI.Temporary.Gwen.Control.Button plus = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            plus.Text   = "+";
            plus.Dock   = Pos.Top;
            plus.Click += new EventHandler(buttonZoomUp_Click);

            Alt.GUI.Temporary.Gwen.Control.Button minus = new Alt.GUI.Temporary.Gwen.Control.Button(m_ScaleControl);
            minus.Text   = "-";
            minus.Dock   = Pos.Bottom;
            minus.Click += new EventHandler(buttonZoomDown_Click);

            m_ScaleTrackBar               = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleTrackBar.Dock          = Pos.Fill;
            m_ScaleTrackBar.ValueChanged += new GwenEventHandler(trackBar1_ValueChanged);
        }
示例#6
0
        void CreateUI1()
        {
            m_MainSplitter      = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(this);
            m_MainSplitter.Dock = Pos.Fill;


            m_TabControl = new Alt.GUI.Temporary.Gwen.Control.TabControl(m_MainSplitter);
            m_TabControl.SetBounds(0, 0, 220, 200);
            m_TabControl.Dock = Pos.Right;


            m_MainSplitter.SetPanel(1, m_TabControl);
            m_MainSplitter.SetHValue(0.73f);


            //  map Tab
            Alt.GUI.Temporary.Gwen.Control.TabButton button = m_TabControl.AddPage("map");
            Base page = button.Page;
            {
                m_Page_map_ScrollControl      = new ScrollControl(page);
                m_Page_map_ScrollControl.Dock = Pos.Fill;
                m_Page_map_ScrollControl.EnableScroll(false, true);
                m_Page_map_ScrollControl.AutoHideBars = true;

                m_Page_map_MainPanel = new Base(m_Page_map_ScrollControl);
                m_Page_map_MainPanel.SetBounds(0, 0, 100, 500);
                m_Page_map_MainPanel.Dock = Pos.Top;


                int btn_offset = 7;


                //  coordinates
                m_Page_map_GroupBox_coordinates                    = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel);
                m_Page_map_GroupBox_coordinates.TextColor          = LabelColor;
                m_Page_map_GroupBox_coordinates.Text               = "coordinates";
                m_Page_map_GroupBox_coordinates.Dock               = Pos.Top;
                m_Page_map_GroupBox_coordinates.AutoSizeToContents = true;
                {
                    //  lat
                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates);
                    label.TextColor          = LabelColor;
                    label.AutoSizeToContents = true;
                    label.Text = "lat:";
                    label.Dock = Pos.Top;
                    //  set top offset
                    label.Margin = new Margin(0, 5, 0, 2);

                    textBoxLat          = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates);
                    textBoxLat.ReadOnly = true;
                    textBoxLat.Dock     = Pos.Top;
                    textBoxLat.Text     = "54.6961334816182";


                    //  lng
                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates);
                    label.TextColor          = LabelColor;
                    label.AutoSizeToContents = true;
                    label.Text               = "lng:";
                    label.Dock               = Pos.Top;
                    label.Margin             = new Margin(0, 0, 0, 2);

                    textBoxLng          = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates);
                    textBoxLng.ReadOnly = true;
                    textBoxLng.Dock     = Pos.Top;
                    textBoxLng.Text     = "25.2985095977783";


                    //  goto
                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_coordinates);
                    label.TextColor          = LabelColor;
                    label.AutoSizeToContents = true;
                    label.Text               = "goto:";
                    label.Dock               = Pos.Top;
                    label.Margin             = new Margin(0, 0, 0, 2);

                    textBoxGeo          = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_Page_map_GroupBox_coordinates);
                    textBoxGeo.ReadOnly = true;
                    textBoxGeo.Dock     = Pos.Top;
                    textBoxGeo.Text     = "lietuva vilnius";


                    //  GoTo
                    button8      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_coordinates);
                    button8.Text = "GoTo !";
                    button8.Dock = Pos.Top;
                    //  set top offset
                    button8.Margin = new Margin(0, btn_offset, 0, 0);
                    button8.Click += new EventHandler(button8_Click);


                    //  Reload
                    button1      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_coordinates);
                    button1.Text = "Reload";
                    button1.Dock = Pos.Top;
                    //  set top offset
                    button1.Margin = new Margin(0, btn_offset, 0, 0);
                    button1.Click += new EventHandler(button1_Click);
                }


                //  gmap
                m_Page_map_GroupBox_gmap                    = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel);
                m_Page_map_GroupBox_gmap.TextColor          = LabelColor;
                m_Page_map_GroupBox_gmap.Text               = "gmap";
                m_Page_map_GroupBox_gmap.Dock               = Pos.Top;
                m_Page_map_GroupBox_gmap.AutoSizeToContents = true;
                //  set top offset
                m_Page_map_GroupBox_gmap.Margin = new Margin(0, 10, 0, 0);
                {
                    //  type
                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_gmap);
                    label.TextColor          = LabelColor;
                    label.AutoSizeToContents = true;
                    label.Text = "type:";
                    label.Dock = Pos.Top;
                    //  set top offset
                    label.Margin = new Margin(0, 5, 0, 0);

                    comboBoxMapType      = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_Page_map_GroupBox_gmap);
                    comboBoxMapType.Dock = Pos.Top;


                    //  mode
                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Page_map_GroupBox_gmap);
                    label.TextColor          = LabelColor;
                    label.AutoSizeToContents = true;
                    label.Text               = "mode:";
                    label.Dock               = Pos.Top;

                    comboBoxMode      = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_Page_map_GroupBox_gmap);
                    comboBoxMode.Dock = Pos.Top;
#if UNITY_WEBPLAYER || UNITY_5
                    comboBoxMode.Disable();
#endif


                    //  Current Marker
                    checkBoxCurrentMarker           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap);
                    checkBoxCurrentMarker.TextColor = LabelColor;
                    checkBoxCurrentMarker.UseCurrentColorAsNormal = true;
                    checkBoxCurrentMarker.Text = "Current Marker";
                    checkBoxCurrentMarker.Dock = Pos.Top;
                    //  set top offset
                    checkBoxCurrentMarker.Margin          = new Margin(0, btn_offset, 0, 0);
                    checkBoxCurrentMarker.CheckedChanged += new EventHandler(checkBoxCurrentMarker_CheckedChanged);


                    //  Grid
                    checkBoxDebug           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap);
                    checkBoxDebug.TextColor = LabelColor;
                    checkBoxDebug.UseCurrentColorAsNormal = true;
                    checkBoxDebug.Text = "Grid";
                    checkBoxDebug.Dock = Pos.Top;
                    //  set top offset
                    checkBoxDebug.Margin          = new Margin(0, btn_offset, 0, 0);
                    checkBoxDebug.CheckedChanged += new EventHandler(checkBoxDebug_CheckedChanged);


                    //  Drag Map
                    checkBoxCanDrag           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_gmap);
                    checkBoxCanDrag.TextColor = LabelColor;
                    checkBoxCanDrag.UseCurrentColorAsNormal = true;
                    checkBoxCanDrag.Text = "Drag Map (right mouse button)";
                    checkBoxCanDrag.Dock = Pos.Top;
                    //  set top offset
                    checkBoxCanDrag.Margin          = new Margin(0, btn_offset, 0, 0);
                    checkBoxCanDrag.CheckedChanged += new EventHandler(checkBoxCanDrag_CheckedChanged);
                }


                //  routing
                m_Page_map_GroupBox_routing                    = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel);
                m_Page_map_GroupBox_routing.TextColor          = LabelColor;
                m_Page_map_GroupBox_routing.Text               = "routing";
                m_Page_map_GroupBox_routing.Dock               = Pos.Top;
                m_Page_map_GroupBox_routing.AutoSizeToContents = true;
                //  set top offset
                m_Page_map_GroupBox_routing.Margin = new Margin(0, 10, 0, 0);
                {
                    //  set Start
                    buttonSetStart      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing);
                    buttonSetStart.Text = "set Start";
                    buttonSetStart.Dock = Pos.Top;
                    //  set top offset
                    buttonSetStart.Margin = new Margin(0, 7, 0, 0);
                    buttonSetStart.Click += new EventHandler(buttonSetStart_Click);


                    //  set End
                    buttonSetEnd      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing);
                    buttonSetEnd.Text = "set End";
                    buttonSetEnd.Dock = Pos.Top;
                    //  set top offset
                    buttonSetEnd.Margin = new Margin(0, btn_offset, 0, 0);
                    buttonSetEnd.Click += new EventHandler(buttonSetEnd_Click);


                    //  Add Route
                    button3      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing);
                    button3.Text = "Add Route";
                    button3.Dock = Pos.Top;
                    //  set top offset
                    button3.Margin = new Margin(0, btn_offset, 0, 10);
                    button3.Click += new EventHandler(button3_Click);


                    //  Clear Routes
                    button6      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing);
                    button6.Text = "Clear Routes";
                    button6.Dock = Pos.Top;
                    //  set top offset
                    button6.Margin = new Margin(0, btn_offset, 0, 0);
                    button6.Click += new EventHandler(button6_Click);


                    //  Clear Polygons
                    button15      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_routing);
                    button15.Text = "Clear Polygons";
                    button15.Dock = Pos.Top;
                    //  set top offset
                    button15.Margin = new Margin(0, btn_offset, 0, 0);
                    button15.Click += new EventHandler(button15_Click);
                }


                //  markers
                m_Page_map_GroupBox_markers                    = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_Page_map_MainPanel);
                m_Page_map_GroupBox_markers.TextColor          = LabelColor;
                m_Page_map_GroupBox_markers.Text               = "markers";
                m_Page_map_GroupBox_markers.Dock               = Pos.Top;
                m_Page_map_GroupBox_markers.AutoSizeToContents = true;
                //  set top offset
                m_Page_map_GroupBox_markers.Margin = new Margin(0, 10, 0, 0);
                {
                    //  Add Marker
                    button4      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers);
                    button4.Text = "Add Marker";
                    button4.Dock = Pos.Top;
                    //  set top offset
                    button4.Margin = new Margin(0, 7, 0, 0);
                    button4.Click += new EventHandler(button4_Click);


                    //  place info
                    checkBoxPlacemarkInfo           = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_Page_map_GroupBox_markers);
                    checkBoxPlacemarkInfo.TextColor = LabelColor;
                    checkBoxPlacemarkInfo.UseCurrentColorAsNormal = true;
                    checkBoxPlacemarkInfo.Text = "place info";
                    checkBoxPlacemarkInfo.Dock = Pos.Top;
                    //  set top offset
                    checkBoxPlacemarkInfo.Margin    = new Margin(0, btn_offset, 0, 0);
                    checkBoxPlacemarkInfo.IsChecked = true;


                    //  Zoom Center
                    button7      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers);
                    button7.Text = "Zoom Center";
                    button7.Dock = Pos.Top;
                    //  set top offset
                    button7.Margin = new Margin(0, btn_offset, 0, 0);
                    button7.Click += new EventHandler(button7_Click);


                    //  Clear All
                    button5      = new Alt.GUI.Temporary.Gwen.Control.Button(m_Page_map_GroupBox_markers);
                    button5.Text = "Clear All";
                    button5.Dock = Pos.Top;
                    //  set top offset
                    button5.Margin = new Margin(0, btn_offset, 0, 0);
                    button5.Click += new EventHandler(button5_Click);
                }
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  GUI
            {
                m_TopPanel = new Base(this);
                {
                    m_TopPanel.Dock   = Pos.Top;
                    m_TopPanel.Height = 30;

                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    label.Location           = new PointI(0, 2);
                    label.AutoSizeToContents = true;
                    label.TextColor          = Color.LightGreen;
                    label.Text = "Map";


                    label1            = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    citiesCountBox    = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_TopPanel);
                    generateMapButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);

                    label1.Location           = new PointI(33, 2);
                    label1.Text               = "Cities:";
                    label1.AutoSizeToContents = true;

                    citiesCountBox.Location  = new PointI(75, 1);
                    citiesCountBox.Width     = 50;
                    citiesCountBox.Min       = 5;
                    citiesCountBox.Max       = 50;
                    citiesCountBox.Increment = 10;

                    generateMapButton.Location           = new PointI(135, 0);
                    generateMapButton.Text               = "Generate";
                    generateMapButton.AutoSizeToContents = true;
                    generateMapButton.Click             += new System.EventHandler(generateMapButton_Click);
                    generateMapButton.NormalTextColor    = Color.Blue;
                }


                m_RightPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                {
                    m_RightPanel.Dock   = Pos.Right;
                    m_RightPanel.Width  = 140;
                    m_RightPanel.Margin = new Margin(5, 0, 0, 0);

                    groupBox2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox2.Location = new PointI(0, 0);
                        groupBox2.Size     = new SizeI(140, 273);
                        groupBox2.Text     = "Neural Network";


                        Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 10);
                        label.AutoSizeToContents = true;
                        label.Text = "Neurons:";

                        neuronsBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        neuronsBox.Location = new PointI(0, 30);
                        neuronsBox.Width    = 130;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 65);
                        label.AutoSizeToContents = true;
                        label.Text               = "Iteraions:";

                        iterationsBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        iterationsBox.Location = new PointI(0, 85);
                        iterationsBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 110);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial learning rate:";

                        rateBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        rateBox.Location = new PointI(0, 130);
                        rateBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 155);
                        label.AutoSizeToContents = true;
                        label.Text               = "Learning radius:";

                        radiusBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        radiusBox.Location = new PointI(0, 175);
                        radiusBox.Width    = 130;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 210);
                        label.AutoSizeToContents = true;
                        label.Text               = "Current iteration:";

                        currentIterationBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        currentIterationBox.Location = new PointI(0, 230);
                        currentIterationBox.Width    = 130;
                        currentIterationBox.ReadOnly = true;
                    }


                    startButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
                    stopButton  = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);

                    startButton.Location        = new PointI(5, 300);
                    startButton.Width           = 130;
                    startButton.Text            = "Start";
                    startButton.Click          += new System.EventHandler(startButton_Click);
                    startButton.NormalTextColor = Color.Green;

                    stopButton.Enabled         = false;
                    stopButton.Location        = new PointI(5, 325);
                    stopButton.Width           = 130;
                    stopButton.Text            = "Stop";
                    stopButton.Click          += new System.EventHandler(stopButton_Click);
                    stopButton.NormalTextColor = Color.Red * 0.8;
                }


                chart      = new Chart(this);
                chart.Dock = Pos.Fill;
            }


            // initialize chart
            chart.AddDataSeries("cities", Color.Red, Chart.SeriesType.Dots, 5, false);
            chart.AddDataSeries("path", Color.Blue, Chart.SeriesType.Line, 1, false);
            chart.RangeX = new Range(0, 1000);
            chart.RangeY = new Range(0, 1000);

            //
            UpdateSettings();
            GenerateMap();
        }
示例#8
0
        public Example_AForge_Animat(Base parent)
            : base(parent)
        {
            //  GUI
            {
                m_TopPanel = new Base(this);
                {
                    m_TopPanel.Dock   = Pos.Top;
                    m_TopPanel.Height = 30;

                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    label.Location           = new PointI(0, 2);
                    label.AutoSizeToContents = true;
                    label.TextColor          = Color.LightGreen;
                    label.Text = "Map";


                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    label.Location           = new PointI(33, 2);
                    label.Text               = "World size:";
                    label.AutoSizeToContents = true;


                    worldSizeBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(m_TopPanel);
                    worldSizeBox.Location = new PointI(102, 0);
                    worldSizeBox.ReadOnly = true;
                    worldSizeBox.Width    = 40;


                    loadButton1                 = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    loadButton1.Location        = new PointI(160, 0);
                    loadButton1.Width           = 80;
                    loadButton1.Text            = "Sample 1";
                    loadButton1.Click          += new System.EventHandler(loadButton1_Click);
                    loadButton1.NormalTextColor = Color.Red * 0.8;

                    loadButton2                 = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    loadButton2.Location        = new PointI(250, 0);
                    loadButton2.Width           = 80;
                    loadButton2.Text            = "Sample 2";
                    loadButton2.Click          += new System.EventHandler(loadButton2_Click);
                    loadButton2.NormalTextColor = Color.Brown;

                    loadButton3                 = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    loadButton3.Location        = new PointI(340, 0);
                    loadButton3.Width           = 80;
                    loadButton3.Text            = "Test 1";
                    loadButton3.Click          += new System.EventHandler(loadButton3_Click);
                    loadButton3.NormalTextColor = Color.Green;

                    loadButton4                 = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    loadButton4.Location        = new PointI(430, 0);
                    loadButton4.Width           = 80;
                    loadButton4.Text            = "Test 2";
                    loadButton4.Click          += new System.EventHandler(loadButton4_Click);
                    loadButton4.NormalTextColor = Color.Blue;

                    loadButton5                 = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    loadButton5.Location        = new PointI(520, 0);
                    loadButton5.Width           = 80;
                    loadButton5.Text            = "Test 3";
                    loadButton5.Click          += new System.EventHandler(loadButton5_Click);
                    loadButton5.NormalTextColor = Color.Violet * 0.8;
                }


                m_RightPanel = new Base(this);
                {
                    m_RightPanel.Dock   = Pos.Right;
                    m_RightPanel.Width  = 140;
                    m_RightPanel.Margin = new Margin(5, 0, 0, 0);

                    Alt.GUI.Temporary.Gwen.Control.GroupBox groupBox = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox.Location = new PointI(0, 0);
                        groupBox.Size     = new SizeI(140, 363);
                        groupBox.Text     = "Settings";


                        Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 10);
                        label.AutoSizeToContents = true;
                        label.Text = "Learning algorithm:";

                        algorithmCombo          = new Alt.GUI.Temporary.Gwen.Control.ComboBox(groupBox);
                        algorithmCombo.Location = new PointI(0, 30);
                        algorithmCombo.Width    = 130;
                        algorithmCombo.AddItem("Q-Learning").UserData = 0;
                        algorithmCombo.AddItem("Sarsa").UserData      = 1;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 65);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial exploration rate:";

                        explorationRateBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        explorationRateBox.Location = new PointI(0, 85);
                        explorationRateBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 110);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial learning rate:";

                        learningRateBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        learningRateBox.Location = new PointI(0, 130);
                        learningRateBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 155);
                        label.AutoSizeToContents = true;
                        label.Text               = "Learning iterations:";

                        iterationsBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        iterationsBox.Location = new PointI(0, 175);
                        iterationsBox.Width    = 130;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 210);
                        label.AutoSizeToContents = true;
                        label.Text               = "Move reward:";

                        moveRewardBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        moveRewardBox.Location = new PointI(0, 230);
                        moveRewardBox.Width    = 130;
                        moveRewardBox.ReadOnly = true;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 255);
                        label.AutoSizeToContents = true;
                        label.Text               = "Wall reward:";

                        wallRewardBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        wallRewardBox.Location = new PointI(0, 275);
                        wallRewardBox.Width    = 130;
                        wallRewardBox.ReadOnly = true;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 300);
                        label.AutoSizeToContents = true;
                        label.Text               = "Goal reward:";

                        goalRewardBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        goalRewardBox.Location = new PointI(0, 320);
                        goalRewardBox.Width    = 130;
                        goalRewardBox.ReadOnly = true;
                    }



                    groupBox = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox.Location = new PointI(0, 380);
                        groupBox.Size     = new SizeI(140, 173);
                        groupBox.Text     = "Learning";


                        Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox);
                        label.Location           = new PointI(0, 10);
                        label.AutoSizeToContents = true;
                        label.Text = "Iteration:";

                        iterationBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox);
                        iterationBox.Location = new PointI(0, 30);
                        iterationBox.Width    = 130;
                        iterationBox.ReadOnly = true;


                        startLearningButton                 = new Alt.GUI.Temporary.Gwen.Control.Button(groupBox);
                        startLearningButton.Location        = new PointI(5, 70);
                        startLearningButton.Width           = 120;
                        startLearningButton.Text            = "Start";
                        startLearningButton.Click          += new System.EventHandler(startLearningButton_Click);
                        startLearningButton.NormalTextColor = Color.Green;

                        stopButton                 = new Alt.GUI.Temporary.Gwen.Control.Button(groupBox);
                        stopButton.Location        = new PointI(5, 100);
                        stopButton.Width           = 120;
                        stopButton.Text            = "Stop";
                        stopButton.Click          += new System.EventHandler(stopButton_Click);
                        stopButton.NormalTextColor = Color.Red;

                        showSolutionButton                 = new Alt.GUI.Temporary.Gwen.Control.Button(groupBox);
                        showSolutionButton.Location        = new PointI(5, 130);
                        showSolutionButton.Width           = 120;
                        showSolutionButton.Text            = "Show solution";
                        showSolutionButton.Click          += new System.EventHandler(showSolutionButton_Click);
                        showSolutionButton.NormalTextColor = Color.Blue;
                    }
                }


                cellWorld          = new CellWorld(this);
                cellWorld.Coloring = null;
                cellWorld.Map      = null;
            }
        }
示例#9
0
        public Example_AForge_2DOrganizing(Base parent)
            : base(parent)
        {
            //  GUI
            {
                m_RightPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                {
                    m_RightPanel.Dock   = Pos.Right;
                    m_RightPanel.Width  = 140;
                    m_RightPanel.Margin = new Margin(5, 0, 0, 0);

                    groupBox2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox2.Location = new PointI(0, 0);
                        groupBox2.Size     = new SizeI(140, 287);
                        groupBox2.Text     = "Neural Network";


                        Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 10);
                        label.AutoSizeToContents = true;
                        label.Text = "Size:";

                        sizeBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        sizeBox.Location = new PointI(0, 30);
                        sizeBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 50);
                        label.AutoSizeToContents = true;
                        label.Text               = "(neurons count = size * size)";


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 80);
                        label.AutoSizeToContents = true;
                        label.Text               = "Iteraions:";

                        iterationsBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        iterationsBox.Location = new PointI(0, 100);
                        iterationsBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 125);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial learning rate:";

                        rateBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        rateBox.Location = new PointI(0, 145);
                        rateBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 170);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial radius:";

                        radiusBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        radiusBox.Location = new PointI(0, 190);
                        radiusBox.Width    = 130;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 225);
                        label.AutoSizeToContents = true;
                        label.Text               = "Current iteration:";

                        currentIterationBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        currentIterationBox.Location = new PointI(0, 245);
                        currentIterationBox.Width    = 130;
                        currentIterationBox.ReadOnly = true;
                    }


                    startButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
                    stopButton  = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);

                    startButton.Location        = new PointI(5, 315);
                    startButton.Width           = 130;
                    startButton.Text            = "Start";
                    startButton.Click          += new System.EventHandler(startButton_Click);
                    startButton.NormalTextColor = Color.Green;

                    stopButton.Enabled         = false;
                    stopButton.Location        = new PointI(5, 340);
                    stopButton.Width           = 130;
                    stopButton.Text            = "Stop";
                    stopButton.Click          += new System.EventHandler(stopButton_Click);
                    stopButton.NormalTextColor = Color.Red * 0.8;


                    Alt.GUI.Temporary.Gwen.Control.VerticalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(this);
                    {
                        splitter.Dock = Pos.Fill;
                        splitter.SetHValue(0.5);


                        Alt.GUI.Temporary.Gwen.Control.Base leftPanel = new Alt.GUI.Temporary.Gwen.Control.Base(splitter);
                        {
                            leftPanel.Dock = Pos.Fill;

                            m_TopPanel1 = new Base(leftPanel);
                            {
                                m_TopPanel1.Dock   = Pos.Top;
                                m_TopPanel1.Height = 70;

                                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel1);
                                label.Location           = new PointI(0, 2);
                                label.AutoSizeToContents = true;
                                label.TextColor          = Color.LightPink;
                                label.Text = "Points";


                                generateButton                    = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel1);
                                generateButton.Location           = new PointI(0, 25);
                                generateButton.Text               = "Generate";
                                generateButton.AutoSizeToContents = true;
                                generateButton.Click             += new System.EventHandler(generateButton_Click);
                                generateButton.NormalTextColor    = Color.Blue;
                            }


                            pointsPanel                 = new Base(leftPanel);
                            pointsPanel.Dock            = Pos.Fill;
                            pointsPanel.Paint          += new GUI.PaintEventHandler(this.pointsPanel_Paint);
                            pointsPanel.ClientBackColor = Color.White;
                            pointsPanel.DrawBorder      = true;
                            pointsPanel.BorderColor     = Color.DodgerBlue;


                            splitter.SetPanel(0, leftPanel);
                        }


                        Base rightPanel = new Base(splitter);
                        {
                            rightPanel.Dock = Pos.Fill;

                            m_TopPanel2 = new Base(rightPanel);
                            {
                                m_TopPanel2.Dock   = Pos.Top;
                                m_TopPanel2.Height = 70;

                                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel2);
                                label.Location           = new PointI(0, 2);
                                label.AutoSizeToContents = true;
                                label.TextColor          = Color.LightPink;
                                label.Text = "Map";


                                showConnectionsCheck                 = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_TopPanel2);
                                showConnectionsCheck.Location        = new PointI(0, 23);
                                showConnectionsCheck.Text            = "Show Connections";
                                showConnectionsCheck.IsChecked       = true;
                                showConnectionsCheck.CheckedChanged += new System.EventHandler(this.showConnectionsCheck_CheckedChanged);

                                showInactiveCheck                 = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_TopPanel2);
                                showInactiveCheck.Location        = new PointI(0, 45);
                                showInactiveCheck.Text            = "Show Inactive Neurons";
                                showInactiveCheck.IsChecked       = true;
                                showInactiveCheck.CheckedChanged += new System.EventHandler(this.showInactiveCheck_CheckedChanged);
                            }


                            mapPanel                 = new Base(rightPanel);
                            mapPanel.Dock            = Pos.Fill;
                            mapPanel.Paint          += new GUI.PaintEventHandler(this.mapPanel_Paint);
                            mapPanel.ClientBackColor = Color.White;
                            mapPanel.DrawBorder      = true;
                            mapPanel.BorderColor     = Color.DodgerBlue;


                            splitter.SetPanel(1, rightPanel);
                        }
                    }
                }
            }
        }
示例#10
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();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            Alt.GUI.Temporary.Gwen.Control.Label label;
#if SILVERLIGHT || UNITY_WEBPLAYER
            label = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            label.AutoSizeToContents = true;
            label.Text = //Description + "\n" + "(This example is not available in this Demo, please download SDK)";
                         "THIS EXAMPLE IS NOT AVAILABLE IN THIS DEMO,\nPLEASE DOWNLOAD AltGUI SDK";
            label.TextColor = Color.Orange * 1.2;
            label.Dock      = Pos.Top;
            label.Margin    = new Margin(0, 0, 0, 5);
            label.Font      = Example_NotAvailable_ScreenShot.Font;
#endif


            //  GUI
            {
                m_TopPanel = new Base(this);
                {
                    m_TopPanel.Dock   = Pos.Top;
                    m_TopPanel.Height = 30;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    label.Location           = new PointI(0, 2);
                    label.AutoSizeToContents = true;
                    label.TextColor          = Color.LightGreen;
                    label.Text               = "Map";


                    label1            = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    citiesCountBox    = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_TopPanel);
                    generateMapButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);

                    label1.Location           = new PointI(33, 2);
                    label1.Text               = "Cities:";
                    label1.AutoSizeToContents = true;

                    citiesCountBox.Location  = new PointI(75, 1);
                    citiesCountBox.Width     = 50;
                    citiesCountBox.Min       = 5;
                    citiesCountBox.Max       = 50;
                    citiesCountBox.Increment = 10;

                    generateMapButton.Location           = new PointI(135, 0);
                    generateMapButton.Text               = "Generate";
                    generateMapButton.AutoSizeToContents = true;
                    generateMapButton.Click             += new System.EventHandler(generateMapButton_Click);
                    generateMapButton.NormalTextColor    = Color.Blue;
                }


                m_RightPanel = new Base(this);
                {
                    m_RightPanel.Dock   = Pos.Right;
                    m_RightPanel.Width  = 140;
                    m_RightPanel.Margin = new Margin(5, 0, 0, 0);

                    groupBox2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox2.Location = new PointI(0, 0);
                        groupBox2.Size     = new SizeI(140, 223);
                        groupBox2.Text     = "Settings";

                        greedyCrossoverBox = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(groupBox2);
                        label5             = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        iterationsBox      = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox2);
                        label4             = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        selectionBox       = new Alt.GUI.Temporary.Gwen.Control.ComboBox(groupBox2);
                        label3             = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        populationSizeBox  = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox2);
                        label2             = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);


                        label2.Location           = new PointI(0, 10);
                        label2.AutoSizeToContents = true;
                        label2.Text = "Population size:";

                        populationSizeBox.Location  = new PointI(0, 30);
                        populationSizeBox.Width     = 130;
                        populationSizeBox.Min       = 10;
                        populationSizeBox.Max       = 100;
                        populationSizeBox.Increment = 10;


                        label3.Location           = new PointI(0, 60);
                        label3.AutoSizeToContents = true;
                        label3.Text = "Selection method:";

                        selectionBox.AddItem("Elite").UserData    = 0;
                        selectionBox.AddItem("Rank").UserData     = 1;
                        selectionBox.AddItem("Roulette").UserData = 2;
                        selectionBox.Location = new PointI(0, 80);
                        selectionBox.Width    = 130;


                        greedyCrossoverBox.Location = new PointI(0, 115);
                        greedyCrossoverBox.Text     = "Greedy crossover";


                        label4.Location = new PointI(0, 145);
                        label4.Size     = new SizeI(60, 16);
                        label4.Text     = "Iterations:";

                        iterationsBox.Location  = new PointI(0, 165);
                        iterationsBox.Width     = 130;
                        iterationsBox.Min       = 0;
                        iterationsBox.Max       = 100000;
                        iterationsBox.Increment = 100;

                        label5.Location           = new PointI(0, 185);
                        label5.AutoSizeToContents = true;
                        label5.Text = "( 0 - inifinity )";
                    }


                    groupBox3 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox3.Location = new PointI(0, 230);
                        groupBox3.Size     = new SizeI(140, 122);
                        groupBox3.Text     = "Current iteration";

                        pathLengthBox       = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox3);
                        label7              = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox3);
                        currentIterationBox = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox3);
                        label6              = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox3);


                        label6.Location           = new PointI(0, 10);
                        label6.AutoSizeToContents = true;
                        label6.Text = "Iteration:";

                        currentIterationBox.Location = new PointI(0, 30);
                        currentIterationBox.ReadOnly = true;
                        currentIterationBox.Width    = 130;
                        currentIterationBox.Text     = "";


                        label7.Location           = new PointI(0, 60);
                        label7.AutoSizeToContents = true;
                        label7.Text = "Path length:";

                        pathLengthBox.Location = new PointI(0, 80);
                        pathLengthBox.ReadOnly = true;
                        pathLengthBox.Width    = 130;
                        pathLengthBox.Text     = "";
                    }


                    startButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
                    stopButton  = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);

                    startButton.Location        = new PointI(5, 370);
                    startButton.Width           = 130;
                    startButton.Text            = "Start";
                    startButton.Click          += new System.EventHandler(startButton_Click);
                    startButton.NormalTextColor = Color.Green;

                    stopButton.Enabled         = false;
                    stopButton.Location        = new PointI(5, 395);
                    stopButton.Width           = 130;
                    stopButton.Text            = "Stop";
                    stopButton.Click          += new System.EventHandler(stopButton_Click);
                    stopButton.NormalTextColor = Color.Red * 0.8;
                }


                mapControl      = new Chart(this);
                mapControl.Dock = Pos.Fill;
            }


            // set up map control
            mapControl.RangeX = new Range(0, 1000);
            mapControl.RangeY = new Range(0, 1000);
            mapControl.AddDataSeries("map", Color.Red, Chart.SeriesType.Dots, 5, false);
            mapControl.AddDataSeries("path", Color.Blue, Chart.SeriesType.Line, 1, false);


            //
            greedyCrossoverBox.IsChecked = greedyCrossover;
            UpdateSettings();
            GenerateMap();
        }
示例#12
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  GUI
            {
                m_RightPanel = new Base(this);
                {
                    m_RightPanel.Dock   = Pos.Right;
                    m_RightPanel.Width  = 140;
                    m_RightPanel.Margin = new Margin(5, 0, 0, 0);


                    Alt.GUI.Temporary.Gwen.Control.GroupBox groupBox = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox.Location = new PointI(0, 0);
                        groupBox.Size     = new SizeI(140, 50);
                        groupBox.Text     = "Map";


                        randomizeButton                 = new Alt.GUI.Temporary.Gwen.Control.Button(groupBox);
                        randomizeButton.Location        = new PointI(5, 7);
                        randomizeButton.Text            = "Generate";
                        randomizeButton.Width           = 120;
                        randomizeButton.Click          += new System.EventHandler(randomizeButton_Click);
                        randomizeButton.NormalTextColor = Color.Blue;
                    }


                    groupBox2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_RightPanel);
                    {
                        groupBox2.Location = new PointI(0, 60);
                        groupBox2.Size     = new SizeI(140, 219);
                        groupBox2.Text     = "Neural Network";


                        Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 10);
                        label.AutoSizeToContents = true;
                        label.Text = "Iteraions:";

                        iterationsBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        iterationsBox.Location = new PointI(0, 30);
                        iterationsBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 55);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial learning rate:";

                        rateBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        rateBox.Location = new PointI(0, 75);
                        rateBox.Width    = 130;

                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 100);
                        label.AutoSizeToContents = true;
                        label.Text               = "Initial radius:";

                        radiusBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        radiusBox.Location = new PointI(0, 120);
                        radiusBox.Width    = 130;


                        label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                        label.Location           = new PointI(0, 155);
                        label.AutoSizeToContents = true;
                        label.Text               = "Current iteration:";

                        currentIterationBox          = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox2);
                        currentIterationBox.Location = new PointI(0, 175);
                        currentIterationBox.Width    = 130;
                        currentIterationBox.ReadOnly = true;
                    }


                    startButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
                    stopButton  = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);

                    startButton.Location        = new PointI(5, 295);
                    startButton.Width           = 130;
                    startButton.Text            = "Start";
                    startButton.Click          += new System.EventHandler(startButton_Click);
                    startButton.NormalTextColor = Color.Green;

                    stopButton.Enabled         = false;
                    stopButton.Location        = new PointI(5, 320);
                    stopButton.Width           = 130;
                    stopButton.Text            = "Stop";
                    stopButton.Click          += new System.EventHandler(stopButton_Click);
                    stopButton.NormalTextColor = Color.Red * 0.8;
                }


                mapPanel        = new Base(this);
                mapPanel.Dock   = Pos.Fill;
                mapPanel.Paint += new GUI.PaintEventHandler(this.mapPanel_Paint);
            }


            // Create network
            network = new DistanceNetwork(3, 100 * 100);

            // Create map bitmap
            mapBitmap = new Bitmap(200, 200, PixelFormat.Format24bppRgb);

            //
            RandomizeNetwork();
            UpdateSettings();
        }
示例#13
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            m_panelDrawing = new PieChartControl(this);
            //m_panelDrawing.DoubleBuffered = false;
            m_panelDrawing.Dock            = Pos.Fill;
            m_panelDrawing.ClientBackColor = Color.FromArgb(0, 128, 128, 128);// Color.Transparent;// WhiteSmoke;
            m_panelDrawing.TextColor       = Color.Black;
            //m_panelDrawing.DrawBorder = true;
            //m_panelDrawing.BorderColor = Color.DodgerBlue;
            m_panelDrawing.Margin   = new Margin(8, 8, 8, 8);
            m_panelDrawing.ToolTips = null;


            groupBox6          = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_ControlsPanel);
            groupBox6.Location = new PointI(8, 8);
            groupBox6.Size     = new SizeI(320, 248);
            groupBox6.Text     = "Pie slices";

            int inGroupBoxOffset   = -12;
            int numericUpDownWidth = 45;

            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox6);
            label.Location           = new PointI(32, 20 + inGroupBoxOffset);
            label.Text               = "Value";
            label.TextAlign          = ContentAlignment.MiddleLeft;
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox6);
            label.Location           = new PointI(80, 20 + inGroupBoxOffset);
            label.Text               = "Offset";
            label.TextAlign          = ContentAlignment.MiddleLeft;
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox6);
            label.Location           = new PointI(128, 20 + inGroupBoxOffset);
            label.Text               = "Color";
            label.TextAlign          = ContentAlignment.MiddleCenter;
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox6);
            label.Location           = new PointI(168, 20 + inGroupBoxOffset);
            label.Text               = "Text";
            label.TextAlign          = ContentAlignment.MiddleLeft;
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox6);
            label.Location           = new PointI(248, 20 + inGroupBoxOffset);
            label.Text               = "ToolTip";
            label.TextAlign          = ContentAlignment.MiddleLeft;
            label.AutoSizeToContents = true;



            int checkBoxOffset = 4;

            checkBox1                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox1.IsChecked       = true;
            checkBox1.Location        = new PointI(8, 38 + inGroupBoxOffset + checkBoxOffset);
            checkBox1.CheckedChanged += new System.EventHandler(checkBox1_CheckedChanged);

            checkBox2                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox2.IsChecked       = true;
            checkBox2.Location        = new PointI(8, 73 + inGroupBoxOffset + checkBoxOffset);
            checkBox2.CheckedChanged += new System.EventHandler(checkBox2_CheckedChanged);

            checkBox3                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox3.IsChecked       = true;
            checkBox3.Location        = new PointI(8, 108 + inGroupBoxOffset + checkBoxOffset);
            checkBox3.CheckedChanged += new System.EventHandler(checkBox3_CheckedChanged);

            checkBox4                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox4.IsChecked       = true;
            checkBox4.Location        = new PointI(8, 143 + inGroupBoxOffset + checkBoxOffset);
            checkBox4.CheckedChanged += new System.EventHandler(checkBox4_CheckedChanged);

            checkBox5                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox5.IsChecked       = true;
            checkBox5.Location        = new PointI(8, 178 + inGroupBoxOffset + checkBoxOffset);
            checkBox5.CheckedChanged += new System.EventHandler(checkBox5_CheckedChanged);

            checkBox6                 = new Alt.GUI.Temporary.Gwen.Control.CheckBox(groupBox6);
            checkBox6.IsChecked       = true;
            checkBox6.Location        = new PointI(8, 213 + inGroupBoxOffset + checkBoxOffset);
            checkBox6.CheckedChanged += new System.EventHandler(checkBox6_CheckedChanged);


            numericUpDownValue1               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue1.Width         = numericUpDownWidth;
            numericUpDownValue1.Location      = new PointI(32, 40 + inGroupBoxOffset);
            numericUpDownValue1.Value         = 10;
            numericUpDownValue1.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);

            numericUpDownValue2               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue2.Width         = numericUpDownWidth;
            numericUpDownValue2.Location      = new PointI(32, 75 + inGroupBoxOffset);
            numericUpDownValue2.Value         = 15;
            numericUpDownValue2.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);

            numericUpDownValue3               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue3.Width         = numericUpDownWidth;
            numericUpDownValue3.Location      = new PointI(32, 110 + inGroupBoxOffset);
            numericUpDownValue3.Value         = 20;
            numericUpDownValue3.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);

            numericUpDownValue4               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue4.Width         = numericUpDownWidth;
            numericUpDownValue4.Location      = new PointI(32, 145 + inGroupBoxOffset);
            numericUpDownValue4.Value         = 60;
            numericUpDownValue4.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);

            numericUpDownValue5               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue5.Width         = numericUpDownWidth;
            numericUpDownValue5.Location      = new PointI(32, 180 + inGroupBoxOffset);
            numericUpDownValue5.Value         = 25;
            numericUpDownValue5.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);

            numericUpDownValue6               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownValue6.Width         = numericUpDownWidth;
            numericUpDownValue6.Location      = new PointI(32, 215 + inGroupBoxOffset);
            numericUpDownValue6.Value         = 25;
            numericUpDownValue6.ValueChanged += new GwenEventHandler(numericUpDownValue_ValueChanged);


            numericUpDownDisplacement1               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement1.Width         = numericUpDownWidth;
            numericUpDownDisplacement1.DecimalPlaces = 2;
            numericUpDownDisplacement1.Increment     = 0.05f;
            numericUpDownDisplacement1.Location      = new PointI(80, 40 + inGroupBoxOffset);
            numericUpDownDisplacement1.Maximum       = 1;
            numericUpDownDisplacement1.Minimum       = 0;
            numericUpDownDisplacement1.Value         = 0.2f;
            numericUpDownDisplacement1.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);

            numericUpDownDisplacement2               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement2.Width         = numericUpDownWidth;
            numericUpDownDisplacement2.DecimalPlaces = 2;
            numericUpDownDisplacement2.Increment     = 0.05f;
            numericUpDownDisplacement2.Location      = new PointI(80, 75 + inGroupBoxOffset);
            numericUpDownDisplacement2.Maximum       = 1;
            numericUpDownDisplacement2.Minimum       = 0;
            numericUpDownDisplacement2.Value         = 0.05f;
            numericUpDownDisplacement2.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);

            numericUpDownDisplacement3               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement3.Width         = numericUpDownWidth;
            numericUpDownDisplacement3.DecimalPlaces = 2;
            numericUpDownDisplacement3.Increment     = 0.05f;
            numericUpDownDisplacement3.Location      = new PointI(80, 110 + inGroupBoxOffset);
            numericUpDownDisplacement3.Maximum       = 1;
            numericUpDownDisplacement3.Minimum       = 0;
            numericUpDownDisplacement3.Value         = 0.05f;
            numericUpDownDisplacement3.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);

            numericUpDownDisplacement4               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement4.Width         = numericUpDownWidth;
            numericUpDownDisplacement4.DecimalPlaces = 2;
            numericUpDownDisplacement4.Increment     = 0.05f;
            numericUpDownDisplacement4.Location      = new PointI(80, 145 + inGroupBoxOffset);
            numericUpDownDisplacement4.Maximum       = 1;
            numericUpDownDisplacement4.Minimum       = 0;
            numericUpDownDisplacement4.Value         = 0.05f;
            numericUpDownDisplacement4.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);

            numericUpDownDisplacement5               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement5.Width         = numericUpDownWidth;
            numericUpDownDisplacement5.DecimalPlaces = 2;
            numericUpDownDisplacement5.Increment     = 0.05f;
            numericUpDownDisplacement5.Location      = new PointI(80, 180 + inGroupBoxOffset);
            numericUpDownDisplacement5.Maximum       = 1;
            numericUpDownDisplacement5.Minimum       = 0;
            numericUpDownDisplacement5.Value         = 0.05f;
            numericUpDownDisplacement5.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);

            numericUpDownDisplacement6               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox6);
            numericUpDownDisplacement6.Width         = numericUpDownWidth;
            numericUpDownDisplacement6.DecimalPlaces = 2;
            numericUpDownDisplacement6.Increment     = 0.05f;
            numericUpDownDisplacement6.Location      = new PointI(80, 215 + inGroupBoxOffset);
            numericUpDownDisplacement6.Maximum       = 1;
            numericUpDownDisplacement6.Minimum       = 0;
            numericUpDownDisplacement6.Value         = 0.05f;
            numericUpDownDisplacement6.ValueChanged += new GwenEventHandler(numericUpDownDisplacement_ValueChanged);


            buttonColor1          = new ColorButton(groupBox6);
            buttonColor1.Color    = Color.Red;
            buttonColor1.Location = new PointI(136, 40 + inGroupBoxOffset);
            buttonColor1.Size     = new SizeI(20, 20);
            buttonColor1.Click   += new System.EventHandler(buttonColor1_Click);

            buttonColor2          = new ColorButton(groupBox6);
            buttonColor2.Color    = Color.LimeGreen;
            buttonColor2.Location = new PointI(136, 75 + inGroupBoxOffset);
            buttonColor2.Size     = new SizeI(20, 20);
            buttonColor2.Click   += new System.EventHandler(buttonColor2_Click);

            buttonColor3          = new ColorButton(groupBox6);
            buttonColor3.Color    = Color.Blue;
            buttonColor3.Location = new PointI(136, 110 + inGroupBoxOffset);
            buttonColor3.Size     = new SizeI(20, 20);
            buttonColor3.Click   += new System.EventHandler(buttonColor3_Click);

            buttonColor4          = new ColorButton(groupBox6);
            buttonColor4.Color    = Color.Yellow;
            buttonColor4.Location = new PointI(136, 145 + inGroupBoxOffset);
            buttonColor4.Size     = new SizeI(20, 20);
            buttonColor4.Click   += new System.EventHandler(buttonColor4_Click);

            buttonColor5          = new ColorButton(groupBox6);
            buttonColor5.Color    = Color.Firebrick;
            buttonColor5.Location = new PointI(136, 180 + inGroupBoxOffset);
            buttonColor5.Size     = new SizeI(20, 20);
            buttonColor5.Click   += new System.EventHandler(buttonColor5_Click);

            buttonColor6          = new ColorButton(groupBox6);
            buttonColor6.Color    = Color.DeepSkyBlue;
            buttonColor6.Location = new PointI(136, 215 + inGroupBoxOffset);
            buttonColor6.Size     = new SizeI(20, 20);
            buttonColor6.Click   += new System.EventHandler(buttonColor6_Click);


            textBoxText1              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText1.Location     = new PointI(168, 40 + inGroupBoxOffset);
            textBoxText1.Size         = new SizeI(72, 20);
            textBoxText1.Text         = "red";
            textBoxText1.TextChanged += new GwenEventHandler(textBoxText_TextChanged);

            textBoxText2              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText2.Location     = new PointI(168, 75 + inGroupBoxOffset);
            textBoxText2.Size         = new SizeI(72, 20);
            textBoxText2.Text         = "green";
            textBoxText2.TextChanged += new GwenEventHandler(textBoxText_TextChanged);

            textBoxText3              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText3.Location     = new PointI(168, 110 + inGroupBoxOffset);
            textBoxText3.Size         = new SizeI(72, 20);
            textBoxText3.Text         = "blue";
            textBoxText3.TextChanged += new GwenEventHandler(textBoxText_TextChanged);

            textBoxText4              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText4.Location     = new PointI(168, 145 + inGroupBoxOffset);
            textBoxText4.Size         = new SizeI(72, 20);
            textBoxText4.Text         = "yellow";
            textBoxText4.TextChanged += new GwenEventHandler(textBoxText_TextChanged);

            textBoxText5              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText5.Location     = new PointI(168, 180 + inGroupBoxOffset);
            textBoxText5.Size         = new SizeI(72, 20);
            textBoxText5.Text         = "brown";
            textBoxText5.TextChanged += new GwenEventHandler(textBoxText_TextChanged);

            textBoxText6              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxText6.Location     = new PointI(168, 215 + inGroupBoxOffset);
            textBoxText6.Size         = new SizeI(72, 20);
            textBoxText6.Text         = "cyan";
            textBoxText6.TextChanged += new GwenEventHandler(textBoxText_TextChanged);


            textBoxToolTip1              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip1.Location     = new PointI(248, 40 + inGroupBoxOffset);
            textBoxToolTip1.Size         = new SizeI(64, 20);
            textBoxToolTip1.Text         = "";
            textBoxToolTip1.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);

            textBoxToolTip2              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip2.Location     = new PointI(248, 75 + inGroupBoxOffset);
            textBoxToolTip2.Size         = new SizeI(64, 20);
            textBoxToolTip2.Text         = "";
            textBoxToolTip2.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);

            textBoxToolTip3              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip3.Location     = new PointI(248, 110 + inGroupBoxOffset);
            textBoxToolTip3.Size         = new SizeI(64, 20);
            textBoxToolTip3.Text         = "";
            textBoxToolTip3.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);

            textBoxToolTip4              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip4.Location     = new PointI(248, 145 + inGroupBoxOffset);
            textBoxToolTip4.Size         = new SizeI(64, 20);
            textBoxToolTip4.Text         = "";
            textBoxToolTip4.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);

            textBoxToolTip5              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip5.Location     = new PointI(248, 180 + inGroupBoxOffset);
            textBoxToolTip5.Size         = new SizeI(64, 20);
            textBoxToolTip5.Text         = "";
            textBoxToolTip5.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);

            textBoxToolTip6              = new Alt.GUI.Temporary.Gwen.Control.TextBox(groupBox6);
            textBoxToolTip6.Location     = new PointI(248, 215 + inGroupBoxOffset);
            textBoxToolTip6.Size         = new SizeI(64, 20);
            textBoxToolTip6.Text         = "";
            textBoxToolTip6.TextChanged += new GwenEventHandler(textBoxToolTip_TextChanged);



            groupBox4          = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_ControlsPanel);
            groupBox4.Location = new PointI(336, 8);
            groupBox4.Size     = new SizeI(248, 72);
            groupBox4.Text     = "Margins";

            inGroupBoxOffset = -15;


            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox4);
            label.Location           = new PointI(12, 22 + inGroupBoxOffset);
            label.Size               = new SizeI(40, 16);
            label.Text               = "Left:";
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox4);
            label.Location           = new PointI(12, 46 + inGroupBoxOffset);
            label.Size               = new SizeI(40, 16);
            label.Text               = "Right:";
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox4);
            label.Location           = new PointI(132, 22 + inGroupBoxOffset);
            label.Size               = new SizeI(40, 16);
            label.Text               = "Top:";
            label.AutoSizeToContents = true;

            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox4);
            label.Location           = new PointI(132, 46 + inGroupBoxOffset);
            label.Size               = new SizeI(44, 16);
            label.Text               = "Bottom:";
            label.AutoSizeToContents = true;


            numericUpDownLeftMargin               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox4);
            numericUpDownLeftMargin.Location      = new PointI(64, 20 + inGroupBoxOffset);
            numericUpDownLeftMargin.Maximum       = 20;
            numericUpDownLeftMargin.Size          = new SizeI(48, 20);
            numericUpDownLeftMargin.Value         = 10;
            numericUpDownLeftMargin.ValueChanged += new GwenEventHandler(numericUpDownLeftMargin_ValueChanged);

            numericUpDownRightMargin               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox4);
            numericUpDownRightMargin.Location      = new PointI(64, 44 + inGroupBoxOffset);
            numericUpDownRightMargin.Maximum       = 20;
            numericUpDownRightMargin.Size          = new SizeI(48, 20);
            numericUpDownRightMargin.Value         = 10;
            numericUpDownRightMargin.ValueChanged += new GwenEventHandler(numericUpDownRightMargin_ValueChanged);

            numericUpDownTopMargin               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox4);
            numericUpDownTopMargin.Location      = new PointI(188, 20 + inGroupBoxOffset);
            numericUpDownTopMargin.Maximum       = 20;
            numericUpDownTopMargin.Size          = new SizeI(48, 20);
            numericUpDownTopMargin.Value         = 10;
            numericUpDownTopMargin.ValueChanged += new GwenEventHandler(numericUpDownTopMargin_ValueChanged);

            numericUpDownBottomMargin               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(groupBox4);
            numericUpDownBottomMargin.Location      = new PointI(188, 44 + inGroupBoxOffset);
            numericUpDownBottomMargin.Maximum       = 20;
            numericUpDownBottomMargin.Size          = new SizeI(48, 20);
            numericUpDownBottomMargin.Value         = 10;
            numericUpDownBottomMargin.ValueChanged += new GwenEventHandler(numericUpDownBottomMargin_ValueChanged);



            checkBoxFitChart                 = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(m_ControlsPanel);
            checkBoxFitChart.Location        = new PointI(336, 88);
            checkBoxFitChart.Text            = "Fit chart to panel";
            checkBoxFitChart.CheckedChanged += new System.EventHandler(checkBoxFitChart_CheckedChanged);



            groupBox1          = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(m_ControlsPanel, "Shadow style");
            groupBox1.Location = new PointI(485, 95); //84);
            groupBox1.Size     = new SizeI(104, 62);  //82);


            radioButtonShadowStyleNone                 = groupBox1.AddOption("None");
            radioButtonShadowStyleNone.Tag             = "";
            radioButtonShadowStyleNone.CheckedChanged += new System.EventHandler(radioButtonShadowStyle_Changed);

            radioButtonShadowStyleUniform = groupBox1.AddOption("Uniform");
            radioButtonShadowStyleUniform.Select();
            radioButtonShadowStyleUniform.Tag             = "";
            radioButtonShadowStyleUniform.CheckedChanged += new System.EventHandler(radioButtonShadowStyle_Changed);

            /*TEMP
             * radioButtonShadowStyleGradual = groupBox1.AddOption("Gradual");
             * //radioButtonShadowStyleGradual.Select();
             * radioButtonShadowStyleGradual.Tag = "";
             * radioButtonShadowStyleGradual.CheckedChanged += new System.EventHandler(radioButtonShadowStyle_Changed);*/



            numericUpDownPieHeight = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_ControlsPanel);
            numericUpDownPieHeight.DecimalPlaces = 2;
            numericUpDownPieHeight.Increment     = 0.05f;
            numericUpDownPieHeight.Location      = new PointI(408, 114);
            numericUpDownPieHeight.Maximum       = 0.5f;
            numericUpDownPieHeight.Size          = new SizeI(48, 20);
            numericUpDownPieHeight.Value         = 0.25f;
            numericUpDownPieHeight.ValueChanged += new GwenEventHandler(numericUpDownPieHeight_ValueChanged);


            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_ControlsPanel);
            label.Location           = new PointI(336, 116);
            label.Size               = new SizeI(72, 16);
            label.Text               = "Pie Height:";
            label.TextAlign          = ContentAlignment.MiddleLeft;
            label.AutoSizeToContents = true;


            numericUpDownAngle               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_ControlsPanel);
            numericUpDownAngle.Increment     = 10;
            numericUpDownAngle.Location      = new PointI(408, 144);
            numericUpDownAngle.Maximum       = 400;
            numericUpDownAngle.Minimum       = -360;
            numericUpDownAngle.Size          = new SizeI(48, 20);
            numericUpDownAngle.Value         = -30;
            numericUpDownAngle.ValueChanged += new GwenEventHandler(numericUpDownAngle_ValueChanged);


            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_ControlsPanel);
            label.Location           = new PointI(336, 146);
            label.Size               = new SizeI(72, 16);
            label.Text               = "Initial angle:";
            label.AutoSizeToContents = true;



            comboBoxEdgeType               = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_ControlsPanel);
            comboBoxEdgeType.Location      = new PointI(408, 178);
            comboBoxEdgeType.Size          = new SizeI(176, 21);
            comboBoxEdgeType.ItemSelected += new GwenEventHandler(comboBoxEdgeType_SelectedIndexChanged);


            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_ControlsPanel);
            label.Location           = new PointI(336, 180);
            label.Size               = new SizeI(72, 16);
            label.Text               = "Edge color:";
            label.AutoSizeToContents = true;



            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_ControlsPanel);
            label.Location           = new PointI(336, 208);
            label.Size               = new SizeI(72, 16);
            label.Text               = "Edge width:";
            label.AutoSizeToContents = true;


            numericUpDownEdgeLineWidth = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_ControlsPanel);
            numericUpDownEdgeLineWidth.DecimalPlaces = 1;
            numericUpDownEdgeLineWidth.Increment     = 0.5f;
            numericUpDownEdgeLineWidth.Location      = new PointI(408, 206);
            numericUpDownEdgeLineWidth.Maximum       = 5;
            numericUpDownEdgeLineWidth.Size          = new SizeI(48, 20);
            numericUpDownEdgeLineWidth.Value         = 3;
            numericUpDownEdgeLineWidth.ValueChanged += new GwenEventHandler(numericUpDownEdgeLineWidth_ValueChanged);


            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_ControlsPanel);
            label.Location           = new PointI(336, 236);
            label.Size               = new SizeI(48, 16);
            label.Text               = "Alpha:";
            label.AutoSizeToContents = true;


            m_numericUpDownAlpha               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_ControlsPanel);
            m_numericUpDownAlpha.Increment     = 5;
            m_numericUpDownAlpha.Location      = new PointI(408, 234);
            m_numericUpDownAlpha.Maximum       = 255;
            m_numericUpDownAlpha.Size          = new SizeI(48, 20);
            m_numericUpDownAlpha.Value         = 130;
            m_numericUpDownAlpha.ValueChanged += new GwenEventHandler(m_numericUpDownAlpha_ValueChanged);



            FillEdgeColorTypeListBox();

            InitializeChart();
        }