示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Color color = Color.White;

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb.TextColor = color;
                gb.Text      = "Group Box (centered)";
                gb.SetBounds(10, 10, 200, 100);
                //Align.Center(gb);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb.TextColor          = color;
                gb.AutoSizeToContents = true;
                gb.Text = "With Label (autosized)";
                gb.SetPosition(250, 10);
                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
                label.TextColor          = color;
                label.AutoSizeToContents = true;
                label.Text = "I'm a label";
            }

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb.TextColor          = color;
                gb.AutoSizeToContents = true;
                gb.Text = "With Label (autosized)";
                gb.SetPosition(250, 50);
                Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
                label.TextColor          = color;
                label.AutoSizeToContents = true;
                label.Text = "I'm a label. I'm a really long label!";
            }

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb.TextColor          = color;
                gb.AutoSizeToContents = true;
                gb.Text = "Two docked Labels (autosized)";
                gb.SetPosition(250, 100);
                Alt.GUI.Temporary.Gwen.Control.Label label1 = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
                label1.TextColor          = color;
                label1.AutoSizeToContents = true;
                label1.Text = "I'm a label";
                label1.Dock = Alt.GUI.Temporary.Gwen.Pos.Top;
                Alt.GUI.Temporary.Gwen.Control.Label label2 = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
                label2.TextColor          = color;
                label2.AutoSizeToContents = true;
                label2.Text = "I'm a label. I'm a really long label!";
                label2.Dock = Alt.GUI.Temporary.Gwen.Pos.Top;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb.TextColor          = color;
                gb.AutoSizeToContents = true;
                gb.Text = "Empty (autosized)";
                gb.SetPosition(10, 150);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.GroupBox gb1 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
                gb1.TextColor = color;
                //Control.Label gb1 = new Label(this);
                gb1.Padding = Alt.GUI.Temporary.Gwen.Padding.Five;
                gb1.Text    = "Yo dawg,";
                gb1.SetPosition(10, 200);
                gb1.SetSize(350, 200);
                //gb1.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb1);
                gb2.TextColor = color;
                gb2.Text      = "I herd";
                gb2.Dock      = Alt.GUI.Temporary.Gwen.Pos.Left;
                gb2.Margin    = Alt.GUI.Temporary.Gwen.Margin.Three;
                gb2.Padding   = Alt.GUI.Temporary.Gwen.Padding.Five;
                //gb2.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb3 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb1);
                gb3.TextColor = color;
                gb3.Text      = "You like";
                gb3.Dock      = Alt.GUI.Temporary.Gwen.Pos.Fill;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb4 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb3);
                gb4.TextColor          = color;
                gb4.Text               = "Group Boxes,";
                gb4.Dock               = Alt.GUI.Temporary.Gwen.Pos.Top;
                gb4.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb5 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb3);
                gb5.TextColor = color;
                gb5.Text      = "So I put Group";
                gb5.Dock      = Alt.GUI.Temporary.Gwen.Pos.Fill;
                //gb5.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb6 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb5);
                gb6.TextColor          = color;
                gb6.Text               = "Boxes in yo";
                gb6.Dock               = Alt.GUI.Temporary.Gwen.Pos.Left;
                gb6.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb7 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb5);
                gb7.TextColor = color;
                gb7.Text      = "Boxes so you can";
                gb7.Dock      = Alt.GUI.Temporary.Gwen.Pos.Top;
                gb7.SetSize(100, 100);

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb8 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb7);
                gb8.TextColor          = color;
                gb8.Text               = "Group Box while";
                gb8.Dock               = Alt.GUI.Temporary.Gwen.Pos.Top;
                gb8.Margin             = Alt.GUI.Temporary.Gwen.Margin.Five;
                gb8.AutoSizeToContents = true;

                Alt.GUI.Temporary.Gwen.Control.GroupBox gb9 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(gb7);
                gb9.TextColor          = color;
                gb9.Text               = "u Group Box";
                gb9.Dock               = Alt.GUI.Temporary.Gwen.Pos.Bottom;
                gb9.Padding            = Alt.GUI.Temporary.Gwen.Padding.Five;
                gb9.AutoSizeToContents = true;
            }

            // at the end to apply to all children
            DrawDebugOutlines = true;
        }
示例#2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  GUI
            {
                m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
                m_TopLabel.AutoSizeToContents = true;
                m_TopLabel.Text      = "Left click the image to draw passages (white), right click the image to draw walls (black).";
                m_TopLabel.Dock      = Pos.Top;
                m_TopLabel.TextColor = Color.Yellow;
                m_TopLabel.Margin    = new Margin(0, 5, 0, 5);


                m_ControlsPanel       = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                m_ControlsPanel.Width = 139;
                m_ControlsPanel.Dock  = Pos.Right;


                pbTerrain              = new Alt.GUI.Temporary.Gwen.Control.PictureBox(this);
                pbTerrain.Dock         = Pos.Fill;
                pbTerrain.ErrorImage   = null;
                pbTerrain.Image        = Bitmap.FromFile("AltData/AForge/FuzzyAGV_BG.gif");
                pbTerrain.InitialImage = null;
                pbTerrain.SizeMode     = PictureBoxSizeMode.Normal;            // AutoSize;
                pbTerrain.MouseMove   += new GUI.MouseEventHandler(pbTerrain_MouseMove);
                pbTerrain.MouseDown   += new GUI.MouseEventHandler(pbTerrain_MouseDown);


                int groupBox_dy = -10;
                groupBox1 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_ControlsPanel);
                {
                    groupBox1.Location = new PointI(0, 0);
                    groupBox1.Name     = "groupBox1";
                    groupBox1.Size     = new SizeI(139, 83);
                    groupBox1.Text     = "Sensor readings:";


                    lbl    = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);
                    label2 = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);
                    label1 = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);

                    lbl.Location           = new PointI(0, 54 + groupBox_dy);
                    lbl.AutoSizeToContents = true;
                    lbl.Text = "Right (pixels):";

                    label2.Location           = new PointI(0, 35 + groupBox_dy);
                    label2.AutoSizeToContents = true;
                    label2.Text = "Left (pixels):";

                    label1.Location           = new PointI(0, 16 + groupBox_dy);
                    label1.AutoSizeToContents = true;
                    label1.Text = "Frontal (pixels):";


                    txtRight = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);
                    txtLeft  = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);
                    txtFront = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox1);

                    txtRight.Location           = new PointI(100, 54 + groupBox_dy);
                    txtRight.AutoSizeToContents = true;
                    txtRight.Text      = "0";
                    txtRight.TextAlign = ContentAlignment.MiddleLeft;

                    txtLeft.Location           = new PointI(100, 35 + groupBox_dy);
                    txtLeft.AutoSizeToContents = true;
                    txtLeft.Text      = "0";
                    txtLeft.TextAlign = ContentAlignment.MiddleLeft;

                    txtFront.Location           = new PointI(100, 16 + groupBox_dy);
                    txtFront.AutoSizeToContents = true;
                    txtFront.Text      = "0";
                    txtFront.TextAlign = ContentAlignment.MiddleLeft;
                }

                groupBox2 = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_ControlsPanel);
                {
                    groupBox2.Location = new PointI(0, 94);
                    groupBox2.Size     = new SizeI(139, 45);
                    groupBox2.Text     = "Output:";


                    label3   = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);
                    txtAngle = new Alt.GUI.Temporary.Gwen.Control.Label(groupBox2);

                    label3.Location           = new PointI(0, 16 + groupBox_dy);
                    label3.AutoSizeToContents = true;
                    label3.Text = "Angle (degrees):";

                    txtAngle.Location           = new PointI(98, 16 + groupBox_dy);
                    txtAngle.AutoSizeToContents = true;
                    txtAngle.Text      = "0,00";
                    txtAngle.TextAlign = ContentAlignment.MiddleLeft;
                }

                gbComandos = new Alt.GUI.Temporary.Gwen.Control.GroupBox(m_ControlsPanel);
                {
                    gbComandos.Location = new PointI(0, 150);
                    gbComandos.Size     = new SizeI(139, 205);
                    gbComandos.Text     = "Tools:";


                    btnStep     = new Alt.GUI.Temporary.Gwen.Control.Button(gbComandos);
                    btnRun      = new Alt.GUI.Temporary.Gwen.Control.Button(gbComandos);
                    txtInterval = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(gbComandos);
                    cbLasers    = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(gbComandos);

                    cbTrajeto = new Alt.GUI.Temporary.Gwen.Control.LabeledCheckBox(gbComandos);
                    btnReset  = new Alt.GUI.Temporary.Gwen.Control.Button(gbComandos);
                    label4    = new Alt.GUI.Temporary.Gwen.Control.Label(gbComandos);

                    btnStep.Location        = new PointI(0, 109 + groupBox_dy);
                    btnStep.Size            = new SizeI(128, 23);
                    btnStep.Text            = "One Step";
                    btnStep.Click          += new System.EventHandler(button3_Click);
                    btnStep.NormalTextColor = Color.Blue;

                    btnRun.Location        = new PointI(0, 138 + groupBox_dy);
                    btnRun.Size            = new SizeI(128, 23);
                    btnRun.Text            = "Run";
                    btnRun.Click          += new System.EventHandler(btnRun_Click);
                    btnRun.NormalTextColor = Color.Green;

                    txtInterval.Location = new PointI(0, 83 + groupBox_dy);
                    txtInterval.Size     = new SizeI(127, 20);
                    txtInterval.Min      = 1;
                    txtInterval.Max      = 100;
                    txtInterval.Value    = 20;

                    cbLasers.IsChecked = true;
                    cbLasers.Location  = new PointI(0, 40 + groupBox_dy);
                    cbLasers.Text      = "Show Beams";

                    cbTrajeto.Location = new PointI(0, 16 + groupBox_dy);
                    cbTrajeto.Text     = "Track Path";

                    btnReset.Location        = new PointI(0, 167 + groupBox_dy);
                    btnReset.Size            = new SizeI(128, 23);
                    btnReset.Text            = "Restart";
                    btnReset.Click          += new System.EventHandler(btnReset_Click);
                    btnReset.NormalTextColor = Color.Red * 0.8;

                    label4.Location           = new PointI(0, 65 + groupBox_dy);
                    label4.AutoSizeToContents = true;
                    label4.Text = "Move Interval (ms):";
                }


                Bitmap robot = new Bitmap(10, 10);
                using (Graphics graphics = Graphics.FromImage(robot))
                {
                    graphics.FillCircle(Brushes.Blue, robot.PixelRectangle);
                }
                pbRobot       = new Alt.GUI.Temporary.Gwen.Control.PictureBox(pbTerrain);
                pbRobot.Image = robot;
                pbRobot.Size  = robot.PixelSize;
            }


            Angle       = 0;
            OriginalMap = new Bitmap(pbTerrain.Image);
            InitialMap  = new Bitmap(pbTerrain.Image);

            InitFuzzyEngine();
            FirstInference = true;
            pbRobot.Top    = InitialMap.PixelHeight - 55;
            pbRobot.Left   = 60;
            InitialPos     = pbRobot.Location;
            RunLabel       = btnRun.Text;
        }
示例#3
0
        Base CreateControls(Base subject, int dock_idx, String name, int x, int y)
        {
            Alt.GUI.Temporary.Gwen.Control.GroupBox gb = new Alt.GUI.Temporary.Gwen.Control.GroupBox(this);
            gb.TextColor = labelColor;
            gb.SetBounds(x, y, 200, 150);
            gb.Text = name;

            Alt.GUI.Temporary.Gwen.Control.Label l_width = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_width.TextColor = labelColor;
            l_width.SetSize(35, 15);
            l_width.Text = "Width:";

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider width = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            width.Name     = "Width";
            width.UserData = subject;
            width.Min      = 50;
            width.Max      = 350;
            width.Value    = 100;
            width.SetSize(55, 15);
            width.ValueChanged += WidthChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(width, l_width);

            Alt.GUI.Temporary.Gwen.Control.Label l_height = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_height.TextColor = labelColor;
            l_height.SetSize(35, 15);
            l_height.Text = "Height:";
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(l_height, width, 10);

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider height = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            height.Name     = "Height";
            height.UserData = subject;
            height.Min      = 50;
            height.Max      = 350;
            height.Value    = 100;
            height.SetSize(55, 15);
            height.ValueChanged += HeightChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(height, l_height);

            Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup dock = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(gb, "Dock");
            dock.TextColor = labelColor;
            dock.UserData  = subject; // store control that we are controlling
            dock.AddOption("Left");
            dock.AddOption("Top");
            dock.AddOption("Right");
            dock.AddOption("Bottom");
            dock.AddOption("Fill");
            dock.SetSelection(dock_idx);
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(dock, l_width, 5);
            //dock.DrawDebugOutlines = true;
            dock.Invalidate();

            Alt.GUI.Temporary.Gwen.Control.Label l_margin = new Alt.GUI.Temporary.Gwen.Control.Label(gb);
            l_margin.TextColor = labelColor;
            l_margin.Text      = "Margin:";
            l_margin.SetBounds(75, 20, 35, 15);
            //Align.PlaceRightBottom(l_margin, dock);
            // can't use Align to anchor with 'dock' because radio group is resized only after layout ~_~
            // this is become really cumbersome
            //l_margin.DrawDebugOutlines = true;

            Alt.GUI.Temporary.Gwen.Control.HorizontalSlider margin = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(gb);
            margin.Name     = "Margin";
            margin.UserData = subject;
            margin.Min      = 0;
            margin.Max      = 50;
            margin.Value    = 10;
            margin.SetSize(55, 15);
            margin.ValueChanged += MarginChanged;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(margin, l_margin);

            dock.SelectionChanged += DockChanged;

            return(gb);
        }
        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();
        }
示例#5
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);
                }
            }
        }
示例#6
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;
            }
        }
示例#7
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);
                        }
                    }
                }
            }
        }
        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();
        }
示例#9
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();
        }
示例#10
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();
        }