Example #1
0
        // Starting and stopping the AGV's moviment a
        void btnRun_Click(object sender, System.EventArgs e)
        {
            Alt.GUI.Temporary.Gwen.Control.Button b = (sender as Alt.GUI.Temporary.Gwen.Control.Button);

            if (b.Text == RunLabel)
            {
                b.Text              = "Stop";
                b.NormalTextColor   = Color.Red * 0.8;
                btnStep.Enabled     = false;
                btnReset.Enabled    = false;
                txtInterval.Enabled = false;
                cbLasers.Enabled    = false;
                cbTrajeto.Enabled   = false;
                pbTerrain.Enabled   = false;
                pbRobot.Hide();
                StartMovement();
            }
            else
            {
                StopMovement();
                b.Text              = RunLabel;
                b.NormalTextColor   = Color.Green;
                btnReset.Enabled    = true;
                btnStep.Enabled     = true;
                txtInterval.Enabled = true;
                cbLasers.Enabled    = true;
                cbTrajeto.Enabled   = true;
                pbTerrain.Enabled   = true;
                pbRobot.Show();
                pbTerrain.Image = CopyImage(OriginalMap);
                pbTerrain.Refresh();
            }
        }
Example #2
0
        protected Example_PDFGenerator_Base(Base parent, string plain, string buutonText) :
            base(parent)
        {
            //  GUI
            m_TopPanel        = new Alt.GUI.Temporary.Gwen.Control.Base(this);
            m_TopPanel.Height = 25;
            m_TopPanel.Margin = new Margin(0, 2, 2, 2);
            m_TopPanel.Dock   = Pos.Top;

#if SILVERLIGHT
            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
            label.AutoSizeToContents = true;
            label.Text = "Processing is not yet available in Silverlight, but all functionality supported!";
#else
#if UNITY_WEBPLAYER
            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
            label.AutoSizeToContents = true;
            label.Text = "Processing is not yet available in Unity Web Player, but all functionality supported!";
#else
            Alt.GUI.Temporary.Gwen.Control.Button button = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
            button.Text = buutonText;
            button.AutoSizeToContents = true;
            button.NormalTextColor    = Color.Green;
            button.Click += new EventHandler(button_Click);
#endif
#endif

            Base bg = new Base(this);
            bg.Dock            = Pos.Fill;
            bg.ClientBackColor = Color.FromArgb(128, Color.Black);
            bg.DrawBorder      = true;
            bg.BorderColor     = Color.DodgerBlue;

            Alt.GUI.Temporary.Gwen.Control.ScrollControl scrollControl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(bg);
            scrollControl.Dock = Pos.Fill;
            scrollControl.EnableScroll(true, true);
            scrollControl.AutoHideBars         = true;
            scrollControl.Margin               = Margin.Five;
            scrollControl.ShouldDrawBackground = false;

            m_LabelText                    = new Alt.GUI.Temporary.Gwen.Control.Label(scrollControl);
            m_LabelText.Margin             = Margin.Two;
            m_LabelText.Location           = PointI.Zero;
            m_LabelText.AutoSizeToContents = true;
            m_LabelText.TextColor          = Color.White;
            m_LabelText.MouseInputEnabled  = true;

            System.IO.Stream src = Alt.IO.VirtualFile.OpenRead("AltData/PdfSharp/plain/" + plain + ".plain");
            if (src == null)
            {
                src = Alt.IO.VirtualFile.OpenRead("AltData/MigraDoc/plain/" + plain + ".plain");
            }
            if (src != null)
            {
                using (System.IO.StreamReader stream = new System.IO.StreamReader(src))
                {
                    m_LabelText.Text = stream.ReadToEnd();
                }
            }
        }
Example #3
0
        Alt.GUI.Temporary.Gwen.Control.Button RegisterDemo(string name, CollapsibleCategory cat, Type exampleType, Example__Base example, Color textColor)
        {
            Alt.GUI.Temporary.Gwen.Control.Button btn = RegisterDemo(name, cat, exampleType, example);
            btn.TextColor = textColor;
            btn.UseCurrentColorAsNormal = true;

            return(btn);
        }
Example #4
0
        Alt.GUI.Temporary.Gwen.Control.Button RegisterDemo(string name, CollapsibleCategory cat, Type exampleType, Example__Base example)
        {
            Alt.GUI.Temporary.Gwen.Control.Button btn = cat.Add(name);
            btn.UserData = new ExampleNode(exampleType, example, m_Center, this);
            btn.Clicked += OnExampleSelect;

            return(btn);
        }
Example #5
0
 public void RegisterUnitTest(String name, CollapsibleCategory cat, GUnit test)
 {
     Alt.GUI.Temporary.Gwen.Control.Button btn = cat.Add(name);
     test.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;
     test.Hide();
     test.UnitTest = this;
     btn.UserData  = test;
     btn.Clicked  += OnCategorySelect;
 }
Example #6
0
            public Example_BSpline_FlowGeometryContainer(Base parent)
                : base(parent)
            {
                ClientBackColor   = Color.FromArgb(50, Color.Black);
                DrawClientBorder  = true;
                ClientBorderColor = Color.DodgerBlue;


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


                //  Flip
                m_Flip        = new Alt.GUI.Temporary.Gwen.Control.Button(this);
                m_Flip.Dock   = Pos.Bottom;
                m_Flip.Text   = "Flip";
                m_Flip.Click += new EventHandler(Flip_Click);
                m_Flip.Margin = new Margin(0, 5, 0, 0);


                //  PointsNumberSlider
                m_PointsNumberSlider = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
                //slider.SetPosition(10, 40);
                m_PointsNumberSlider.Dock = Pos.Bottom;
                m_PointsNumberSlider.SetSize(150, 20);
                m_PointsNumberSlider.SetRange(1, 40);
                m_PointsNumberSlider.NotchCount    = (int)(m_PointsNumberSlider.Max - m_PointsNumberSlider.Min);
                m_PointsNumberSlider.SnapToNotches = true;
                m_PointsNumberSlider.ValueChanged += PointsNumberSlider_ValueChanged;

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

                m_PointsNumberSlider.Value = 30;


                //  CloseCheckBox
                m_CloseCheckBox        = new LabeledCheckBox(this);
                m_CloseCheckBox.Text   = "Close";
                m_CloseCheckBox.Dock   = Pos.Bottom;
                m_CloseCheckBox.Margin = new Margin(0, 7, 0, 0);


                //  Graphics
                m_BSplinePen = new Pen(Color.Cyan, 2);
            }
Example #7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            buttonA      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonA.Text = "Event tester";
            buttonA.SetBounds(200, 30, 300, 200);
            buttonA.Pressed  += onButtonAp;
            buttonA.Clicked  += onButtonAc;
            buttonA.Released += onButtonAr;

            buttonB      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonB.Text = "\u0417\u0430\u043C\u0435\u0436\u043D\u0430\u044F \u043C\u043E\u0432\u0430";
            buttonB.SetPosition(0, 20);

            buttonC      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonC.Text = "Image button";
            buttonC.SetImage("AltData/Gwen/test16.png");
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonC, buttonB, 10);

            buttonD = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonD.SetImage("AltData/Gwen/test16.png");
            buttonD.SetSize(20, 20);
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonD, buttonC, 10);

            buttonE             = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonE.Text        = "Toggle me";
            buttonE.IsToggle    = true;
            buttonE.Toggled    += onToggle;
            buttonE.ToggledOn  += onToggleOn;
            buttonE.ToggledOff += onToggleOff;
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonE, buttonD, 10);

            buttonF            = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonF.Text       = "Disabled :D";
            buttonF.IsDisabled = true;
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonF, buttonE, 10);

            buttonG      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonG.Text = "With Tooltip";
            buttonG.SetToolTipText("This is tooltip");
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonG, buttonF, 10);

            buttonH      = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            buttonH.Text = "I'm autosized";
            buttonH.SizeToContents();
            Alt.GUI.Temporary.Gwen.Align.PlaceDownLeft(buttonH, buttonG, 10);
        }
Example #8
0
        public Example_AForge_TexturesDemo(Base parent)
            : base(parent)
        {
            //  GUI
            {
                m_TopPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                {
                    m_TopPanel.Dock   = Pos.Top;
                    m_TopPanel.Height = 20;
                    m_TopPanel.Margin = new Margin(0, 0, 0, 10);


                    label1           = new Alt.GUI.Temporary.Gwen.Control.Label(m_TopPanel);
                    texturesCombo    = new Alt.GUI.Temporary.Gwen.Control.ComboBox(m_TopPanel);
                    regenerateButton = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);


                    label1.AutoSizeToContents = true;
                    label1.Dock   = Pos.Left;
                    label1.Text   = "Texture:";
                    label1.Margin = new Margin(0, 2, 0, 0);


                    texturesCombo.AddItem("Clouds").UserData    = 0;
                    texturesCombo.AddItem("Marble").UserData    = 1;
                    texturesCombo.AddItem("Wood").UserData      = 2;
                    texturesCombo.AddItem("Labyrinth").UserData = 3;
                    texturesCombo.AddItem("Textile").UserData   = 4;
                    texturesCombo.Dock          = Pos.Left;
                    texturesCombo.ItemSelected += texturesCombo_SelectedIndexChanged;
                    texturesCombo.Margin        = new Margin(5, 0, 0, 0);


                    regenerateButton.Dock            = Pos.Left;
                    regenerateButton.Text            = "Regenerate";
                    regenerateButton.Click          += regenerateButton_Click;
                    regenerateButton.Margin          = new Margin(10, 0, 0, 0);
                    regenerateButton.NormalTextColor = Color.Green;
                }


                pictureBox             = new Alt.GUI.Temporary.Gwen.Control.PictureBox(this);
                pictureBox.Dock        = Pos.Fill;
                pictureBox.DrawBorder  = true;
                pictureBox.BorderColor = Color.DodgerBlue;
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = (float)(m_Opacity = 0.05f);


            //
            m_SVGPath = new SVGPath();

            m_x        = ClientWidth / 2;
            m_y        = ClientHeight / 2;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/lion.svg");
            }
            catch (SVGException)
            {
                //TEMP  message(.ToString(e.Message));

                return;
            }
        }
Example #10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            rand = new Random();

            Alt.GUI.Temporary.Gwen.Control.Button button1 = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            button1.SetText("Open a Window");
            button1.Clicked += OpenWindow;
            button1.SizeToContents();

            Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(this);
            button2.SetText("Open a MessageBox");
            button2.SizeToContents();
            button2.Clicked += OpenMsgbox;
            Alt.GUI.Temporary.Gwen.Align.PlaceRightBottom(button2, button1, 10);

            m_WindowCount = 1;
        }
Example #11
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Alt.GUI.Temporary.Gwen.Control.StatusBar sb   = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            Alt.GUI.Temporary.Gwen.Control.Label     left = new Alt.GUI.Temporary.Gwen.Control.Label(sb);
            left.Text = "Label added to left";
            sb.AddControl(left, false);

            Alt.GUI.Temporary.Gwen.Control.Label right = new Alt.GUI.Temporary.Gwen.Control.Label(sb);
            right.Text = "Label added to right";
            sb.AddControl(right, true);

            Alt.GUI.Temporary.Gwen.Control.Button bl = new Alt.GUI.Temporary.Gwen.Control.Button(sb);
            bl.Text = "Left button";
            sb.AddControl(bl, false);

            Alt.GUI.Temporary.Gwen.Control.Button br = new Alt.GUI.Temporary.Gwen.Control.Button(sb);
            br.Text = "Right button";
            sb.AddControl(br, true);
        }
Example #12
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


            //  Scale
            m_ScaleControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_ScaleControl.SetBounds(10, 30, 20, 200);

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

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

            m_ScaleSlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            m_OpacitySlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged   += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);
            //  Preview
            m_OpacitySlider.ValueChanged += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);



            //
            m_SVGPath = new SVGPath();

            int k = 30;

            m_x        = m_DrawingPanel.ClientWidth / 2 + k;
            m_y        = m_DrawingPanel.ClientHeight / 2 + k;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/longhorn.svg");
                //LoadSVG("AltData/SVG/lion.svg");
            }
            catch (Exception)
            {
                return;
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


#if !SILVERLIGHT
            m_OpenExternalViewButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_LeftPanel);
            m_OpenExternalViewButton.Text   = "Open External View";
            m_OpenExternalViewButton.Dock   = Pos.Bottom;
            m_OpenExternalViewButton.Margin = new Margin(2, 5, 2, 0);
            m_OpenExternalViewButton.Click += new EventHandler(OnOpenExternalViewButtonClick);

            m_ShowGeneratedHtmlCB           = new LabeledCheckBox(m_LeftPanel);
            m_ShowGeneratedHtmlCB.Text      = "Show generated HTML";
            m_ShowGeneratedHtmlCB.Dock      = Pos.Bottom;
            m_ShowGeneratedHtmlCB.Margin    = new Margin(2, 10, 2, 2);
            m_ShowGeneratedHtmlCB.IsChecked = true;
#endif

            m_ShowTooltip        = new LabeledCheckBox(m_LeftPanel);
            m_ShowTooltip.Text   = "Show Tooltip";
            m_ShowTooltip.Dock   = Pos.Bottom;
            m_ShowTooltip.Margin = new Margin(2, 10, 2, 2);
            //m_ShowTooltip.IsChecked = true;
            m_ShowTooltip.CheckChanged += new GwenEventHandler(ShowTooltip_CheckChanged);

#if !SILVERLIGHT
            m_AntiAliasText        = new LabeledCheckBox(m_LeftPanel);
            m_AntiAliasText.Text   = "AntiAlias Text";
            m_AntiAliasText.Dock   = Pos.Bottom;
            m_AntiAliasText.Margin = new Margin(2, 10, 2, 2);
            //m_AntiAliasText.IsChecked = true;
            m_AntiAliasText.CheckChanged += new GwenEventHandler(AntiAliasText_CheckChanged);
#endif



            //  HtmlPanel
            m_HtmlPanel      = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel(m_RightPanel);
            m_HtmlPanel.Dock = Pos.Fill;
            m_HtmlPanel.ShouldDrawBackground = false;
            m_HtmlPanel.TextRenderingHint    = TextRenderingHint.Default;

            m_HtmlPanel.AutoScroll     = true;
            m_HtmlPanel.BackColor      = Color.White;
            m_HtmlPanel.BaseStylesheet = null;

            m_HtmlPanel.RenderError    += OnRenderError;
            m_HtmlPanel.LinkClicked    += OnLinkClicked;
            m_HtmlPanel.StylesheetLoad += OnStylesheetLoad;
            m_HtmlPanel.ImageLoad      += OnImageLoad;



            //  HtmlToolTip
            m_HtmlToolTip            = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlToolTip(m_HtmlPanel);
            m_HtmlToolTip.ImageLoad += OnImageLoad;
            //m_HtmlToolTip.SetToolTip(m_HtmlPanel, HtmlRenderer.Resources.Tooltip);


            SelectFirstExample();
        }
        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_Top1 = new Base(this);
                {
                    m_Top1.Dock   = Pos.Top;
                    m_Top1.Height = 30;

                    loadDemoImage1ToolStripMenuItem = new Alt.GUI.Temporary.Gwen.Control.Button(m_Top1);
                    loadDemoImage2ToolStripMenuItem = new Alt.GUI.Temporary.Gwen.Control.Button(m_Top1);
                    loadDemoImage3ToolStripMenuItem = new Alt.GUI.Temporary.Gwen.Control.Button(m_Top1);
                    loadDemoImage4ToolStripMenuItem = new Alt.GUI.Temporary.Gwen.Control.Button(m_Top1);

                    loadDemoImage1ToolStripMenuItem.Text   = "Load demo image 1";
                    loadDemoImage1ToolStripMenuItem.Click += new System.EventHandler(loadDemoImage1ToolStripMenuItem_Click);
                    loadDemoImage1ToolStripMenuItem.Dock   = Pos.Left;
                    loadDemoImage1ToolStripMenuItem.AutoSizeToContents = true;
                    loadDemoImage1ToolStripMenuItem.NormalTextColor    = Color.Red * 0.8;

                    loadDemoImage2ToolStripMenuItem.Text               = "Load demo image 2";
                    loadDemoImage2ToolStripMenuItem.Click             += new System.EventHandler(loadDemoImage2ToolStripMenuItem_Click);
                    loadDemoImage2ToolStripMenuItem.Dock               = Pos.Left;
                    loadDemoImage2ToolStripMenuItem.Margin             = new Margin(10, 0, 0, 0);
                    loadDemoImage2ToolStripMenuItem.AutoSizeToContents = true;
                    loadDemoImage2ToolStripMenuItem.NormalTextColor    = Color.Brown;

                    loadDemoImage3ToolStripMenuItem.Text               = "Load demo image 3";
                    loadDemoImage3ToolStripMenuItem.Click             += new System.EventHandler(loadDemoImage3ToolStripMenuItem_Click);
                    loadDemoImage3ToolStripMenuItem.Dock               = Pos.Left;
                    loadDemoImage3ToolStripMenuItem.Margin             = new Margin(10, 0, 0, 0);
                    loadDemoImage3ToolStripMenuItem.AutoSizeToContents = true;
                    loadDemoImage3ToolStripMenuItem.NormalTextColor    = Color.Green;

                    loadDemoImage4ToolStripMenuItem.Text               = "Load demo image 4";
                    loadDemoImage4ToolStripMenuItem.Click             += new System.EventHandler(loadDemoImage4ToolStripMenuItem_Click);
                    loadDemoImage4ToolStripMenuItem.Dock               = Pos.Left;
                    loadDemoImage4ToolStripMenuItem.Margin             = new Margin(10, 0, 0, 0);
                    loadDemoImage4ToolStripMenuItem.AutoSizeToContents = true;
                    loadDemoImage4ToolStripMenuItem.NormalTextColor    = Color.Blue;
                }


                m_Top2 = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                {
                    m_Top2.Dock   = Pos.Top;
                    m_Top2.Height = 25;

                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.AutoSizeToContents = true;
                    label.Text      = "Legend:";
                    label.Dock      = Pos.Left;
                    label.TextColor = Color.Orange;
                    label.Margin    = new Margin(0, 4, 0, 0);


                    SizeI  boxSize     = new SizeI(m_Top2.Height, m_Top2.Height);
                    Margin boxMargin   = new Margin(10, 0, 0, 0);
                    Margin labelMargin = new Margin(5, 4, 0, 0);


                    //  1
                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.ClientBackColor = Color.Yellow;
                    label.DrawBorder      = true;
                    label.BorderColor     = Color.DodgerBlue;
                    label.Dock            = Pos.Left;
                    label.Margin          = boxMargin;
                    label.Size            = boxSize;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.Dock               = Pos.Left;
                    label.Margin             = labelMargin;
                    label.AutoSizeToContents = true;
                    label.Text               = "Circles";


                    //  2
                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.ClientBackColor = Color.Red;
                    label.DrawBorder      = true;
                    label.BorderColor     = Color.DodgerBlue;
                    label.Dock            = Pos.Left;
                    label.Margin          = boxMargin;
                    label.Size            = boxSize;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.Dock               = Pos.Left;
                    label.Margin             = labelMargin;
                    label.AutoSizeToContents = true;
                    label.Text               = "Quadrilaterals";


                    //  3
                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.ClientBackColor = Color.Brown;
                    label.DrawBorder      = true;
                    label.BorderColor     = Color.DodgerBlue;
                    label.Dock            = Pos.Left;
                    label.Margin          = boxMargin;
                    label.Size            = boxSize;
                    label.SetToolTipText("Trapezoid, Parallelogram, Rectangle, Rhombus or Square");
                    label.MouseInputEnabled = true;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.Dock               = Pos.Left;
                    label.Margin             = labelMargin;
                    label.AutoSizeToContents = true;
                    label.Text               = "Known quadrilaterals";
                    label.SetToolTipText("Trapezoid, Parallelogram, Rectangle, Rhombus or Square");
                    label.MouseInputEnabled = true;


                    //  4
                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.ClientBackColor = Color.Blue;
                    label.DrawBorder      = true;
                    label.BorderColor     = Color.DodgerBlue;
                    label.Dock            = Pos.Left;
                    label.Margin          = boxMargin;
                    label.Size            = boxSize;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.Dock               = Pos.Left;
                    label.Margin             = labelMargin;
                    label.AutoSizeToContents = true;
                    label.Text               = "Triangles";


                    //  5
                    label = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.ClientBackColor = Color.Green;
                    label.DrawBorder      = true;
                    label.BorderColor     = Color.DodgerBlue;
                    label.Dock            = Pos.Left;
                    label.Margin          = boxMargin;
                    label.Size            = boxSize;
                    label.SetToolTipText("Equilateral, Isosceles, Rectangled or Rectangled Isosceles Triangle");
                    label.MouseInputEnabled = true;

                    label                    = new Alt.GUI.Temporary.Gwen.Control.Label(m_Top2);
                    label.Dock               = Pos.Left;
                    label.Margin             = labelMargin;
                    label.AutoSizeToContents = true;
                    label.Text               = "Known triangles";
                    label.SetToolTipText("Equilateral, Isosceles, Rectangled or Rectangled Isosceles Triangle");
                    label.MouseInputEnabled = true;
                }


                pictureBox          = new Alt.GUI.Temporary.Gwen.Control.PictureBox(this);
                pictureBox.Dock     = Pos.Fill;
                pictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
            }


            LoadDemo("coins.jpg");
        }
Example #15
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //
            HorizontalSplitter splitter = new HorizontalSplitter(this);

            splitter.Dock = Pos.Fill;

            Base topContainer = new Base(splitter);

            topContainer.Dock = Pos.Fill;

            Base bottomContainer = new Base(splitter);

            bottomContainer.Dock = Pos.Fill;

            splitter.SetPanel(0, topContainer);
            splitter.SetPanel(1, bottomContainer);
            splitter.SetVValue(0.35f);
            splitter.Margin = new Margin(5);


            //  Top
            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(topContainer);
            label.Text               = "HtmlLabel:";
            label.Dock               = Pos.Top;
            label.Alignment          = Pos.Center;
            label.AutoSizeToContents = true;
            label.TextColor          = Color.Green;
            label.Margin             = new Margin(2, 2, 2, 5);

            _htmlLabelHostingPanel        = new DoubleBufferedControl(topContainer);
            _htmlLabelHostingPanel.Dock   = Pos.Fill;
            _htmlLabelHostingPanel.Paint += new GUI.PaintEventHandler(OnHtmlLabelHostingPanelPaint);

            _htmlLabel                    = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlLabel(_htmlLabelHostingPanel);
            _htmlLabel.Dock               = Pos.Fill;
            _htmlLabel.AutoSize           = false;
            _htmlLabel.AutoSizeHeightOnly = true;
            _htmlLabel.BackColor          = Color.Empty;// Transparent;
            _htmlLabel.BaseStylesheet     = null;
            _htmlLabel.Text               = "This is an <b>HtmlLabel</b> on transparent background with <span style=\"color: re" +
                                            "d\">colors</span> and links: <a href=\"http://htmlrenderer.codeplex.com/\">HTML Renderer</a>";


            //  Bottom
            label                    = new Alt.GUI.Temporary.Gwen.Control.Label(bottomContainer);
            label.Text               = "HtmlPanel:";
            label.Dock               = Pos.Top;
            label.Alignment          = Pos.Center;
            label.AutoSizeToContents = true;
            label.TextColor          = Color.Green;
            label.Margin             = new Margin(2, 2, 2, 5);

            _changeTooltipButton        = new Alt.GUI.Temporary.Gwen.Control.Button(bottomContainer);
            _changeTooltipButton.Dock   = Pos.Bottom;
            _changeTooltipButton.Text   = "Click me to change tooltip";
            _changeTooltipButton.Click += new System.EventHandler(OnButtonClick);

            _htmlToolTip = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlToolTip(_changeTooltipButton);
            _htmlToolTip.SetToolTip(_changeTooltipButton, "When you click this button, this tooltip will be replaced for the text of the <b>HtmlLabel</b>");

            _htmlPanel                = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel(bottomContainer);
            _htmlPanel.Dock           = Pos.Fill;
            _htmlPanel.AutoScroll     = true;
            _htmlPanel.BackColor      = Color.White;
            _htmlPanel.BaseStylesheet = null;
            _htmlPanel.Text           = HtmlRenderer.Resources.SampleForm_HtmlPanel;


            //
            Center();


            //
            Bitmap bmp = new Bitmap(10, 10);

            using (Graphics g = Graphics.FromImage(bmp))
            {
                g.Clear(Color.White);
                g.FillRectangle(Brushes.LightGray, new RectI(0, 0, 5, 5));
                g.FillRectangle(Brushes.LightGray, new RectI(5, 5, 5, 5));
            }

            m_TransparentBGBrush = new TextureBrush(bmp, WrapMode.Tile);
        }
Example #16
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;
            }
        }
Example #17
0
        void CreateUI2()
        {
            Base rightPanel = new Base(m_MainSplitter);

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


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


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

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


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

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


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

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


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

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


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


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

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


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

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


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

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


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

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


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

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


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


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

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

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

            m_ScaleTrackBar               = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleTrackBar.Dock          = Pos.Fill;
            m_ScaleTrackBar.ValueChanged += new GwenEventHandler(trackBar1_ValueChanged);
        }
Example #18
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(10, 10, 100, 100);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Twice As Big");
                pTestButton.SetBounds(0, 0, 200, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(110, 10, 100, 100);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Same Size");
                pTestButton.SetBounds(0, 0, 100, 100);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new ScrollControl(this);
                ctrl.SetBounds(210, 10, 100, 100);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Wide");
                pTestButton.SetBounds(0, 0, 200, 50);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(310, 10, 100, 100);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Tall");
                pTestButton.SetBounds(0, 0, 50, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(410, 10, 100, 100);
                ctrl.EnableScroll(false, true);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Vertical");
                pTestButton.SetBounds(0, 0, 200, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(510, 10, 100, 100);
                ctrl.EnableScroll(true, false);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Horizontal");
                pTestButton.SetBounds(0, 0, 200, 200);
            }

            // Bottom Row

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(10, 110, 100, 100);
                ctrl.AutoHideBars = true;

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Twice As Big");
                pTestButton.SetBounds(0, 0, 200, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(110, 110, 100, 100);
                ctrl.AutoHideBars = true;

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Same Size");
                pTestButton.SetBounds(0, 0, 100, 100);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(210, 110, 100, 100);
                ctrl.AutoHideBars = true;

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Wide");
                pTestButton.SetBounds(0, 0, 200, 50);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(310, 110, 100, 100);
                ctrl.AutoHideBars = true;

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Tall");
                pTestButton.SetBounds(0, 0, 50, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(410, 110, 100, 100);
                ctrl.AutoHideBars = true;
                ctrl.EnableScroll(false, true);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Vertical");
                pTestButton.SetBounds(0, 0, 200, 200);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.ScrollControl ctrl = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(this);
                ctrl.SetBounds(510, 110, 100, 100);
                ctrl.AutoHideBars = true;
                ctrl.EnableScroll(true, false);

                Alt.GUI.Temporary.Gwen.Control.Button pTestButton = new Alt.GUI.Temporary.Gwen.Control.Button(ctrl);
                pTestButton.SetText("Horinzontal");
                pTestButton.SetBounds(0, 0, 200, 200);
            }
        }
Example #19
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


            //  Scale
            m_ScaleControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_ScaleControl.SetBounds(10, 30, 20, 200);

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

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

            m_ScaleSlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Alt.GUI.Temporary.Gwen.Control.Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            //  Magnification
            m_MagnificationSlider      = new HorizontalSlider(this);
            m_MagnificationSlider.Dock = Pos.Bottom;
            m_MagnificationSlider.SetRange(0.01f, 4);
            m_MagnificationSlider.ValueChanged += new GwenEventHandler(MagnificationSlider_ValueChanged);
            m_MagnificationSlider.Height        = 20;
            m_MagnificationSlider.Margin        = new Margin(0, 3, 0, 0);

            m_MagnificationLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_MagnificationLabel.AutoSizeToContents = true;
            m_MagnificationLabel.Dock = Pos.Bottom;

            m_MagnificationSlider.Value = 3.2f;


            //  Radius
            m_RadiusSlider      = new HorizontalSlider(this);
            m_RadiusSlider.Dock = Pos.Bottom;
            m_RadiusSlider.SetRange(10, 200);
            m_RadiusSlider.ValueChanged += new GwenEventHandler(RadiusSlider_ValueChanged);
            m_RadiusSlider.Height        = 20;
            m_RadiusSlider.Margin        = new Margin(0, 3, 0, 0);

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

            m_RadiusSlider.Value = 100;


            //  Sight
            m_ShowSightCheckBox               = new LabeledCheckBox(this);
            m_ShowSightCheckBox.Dock          = Pos.Bottom;
            m_ShowSightCheckBox.Text          = "Show Sight";
            m_ShowSightCheckBox.Margin        = new Margin(0, 3, 0, 0);
            m_ShowSightCheckBox.IsChecked     = true;
            m_ShowSightCheckBox.CheckChanged += new GwenEventHandler(ShowSightCheckBox_CheckChanged);



            m_OpacitySlider.ValueChanged       += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged         += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged        += new GwenEventHandler(Slider_ValueChanged);
            m_MagnificationSlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_RadiusSlider.ValueChanged        += new GwenEventHandler(Slider_ValueChanged);
            //  Preview
            m_OpacitySlider.ValueChanged += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(RotateAndOpacity_Slider_ValueChanged);



            //
            m_RadiusPen = new Pen(
                Color.FromArgb(0.7, Color.LimeGreen * 1.2),
                //Color.FromArgb(0.7, Color.Red),
                3);



            //
            m_SVGPath = new SVGPath();

            m_x        = m_DrawingPanel.ClientWidth / 2;
            m_y        = m_DrawingPanel.ClientHeight / 2;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/tiger.svg");
            }
            catch (SVGException)
            {
                //TEMP  message(.ToString(e.Message));

                return;
            }
        }
Example #20
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            /*TEMP
             * saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
             * saveFileDialog1.DefaultExt = "svg";
             * saveFileDialog1.Filter = "SVG Files (*.svg)|*.svg";*/


            //  Refresh
            bRefresh        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
            bRefresh.Text   = "Refresh";
            bRefresh.Dock   = Pos.Bottom;
            bRefresh.Margin = new Margin(0, 20, 5, GUI.Config.Logo.PixelHeight);

            bRefresh.Click += new EventHandler(bRefresh_Click);


            //  Save
            bSave          = new Alt.GUI.Temporary.Gwen.Control.Button(m_RightPanel);
            bSave.Text     = "Save as SVG File";
            bSave.Dock     = Pos.Top;
            bSave.Margin   = new Margin(0, 20, 0, 0);
            bSave.IsHidden = true;


            //  Drawing Panel
            Base DrawingPanelHolder = new Base(m_Splitter);

            m_DrawingPanel = new DoubleBufferedControl(DrawingPanelHolder);
            m_DrawingPanel.UseTransparentBackground = false;
            m_DrawingPanel.Dock        = Pos.Fill;
            m_DrawingPanel.Paint      += new GUI.PaintEventHandler(DrawingPanel_Paint);
            m_DrawingPanel.MouseWheel += new GUI.MouseEventHandler(DrawingPanel_MouseWheel);
            m_DrawingPanel.Resize     += new EventHandler(DrawingPanel_Resize);
            m_DrawingPanel.Margin      = new Margin(0, GUI.Config.Logo.PixelHeight, 0, GUI.Config.Logo.PixelHeight);
            m_DrawingPanel.DrawBorder  = true;
            m_DrawingPanel.BorderColor = Color.DodgerBlue * 0.6;


            //
            m_Splitter.SetPanel(1, m_RightPanel);
            m_Splitter.SetPanel(0, DrawingPanelHolder);
            m_Splitter.SetHValue(0.83f);


            //  Neet to correct groupBoxes
            groupBox_Geometry.AutoSizeToContents         = false;
            groupBox_BooleanOperation.AutoSizeToContents = false;
            groupBox_Options.AutoSizeToContents          = false;


            //  Core
            subjects = new Polygons();
            clips    = new Polygons();
            solution = new Polygons();


            this.Focus();
        }
        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();
        }
Example #22
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);
                        }
                    }
                }
            }
        }
Example #23
0
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);


                Cursor = GUI.Cursors.Hand;

                //  GUI
                {
                    m_PanelTop                 = new Base(this);
                    m_PanelTop.Dock            = Pos.Top;
                    m_PanelTop.ClientBackColor = Color.FromArgb(96, Color.Black);
                    m_PanelTop.Height          = 38;

                    Base controlsMain = new Base(m_PanelTop);
                    controlsMain.Dock = Pos.Fill;

                    Alt.GUI.Temporary.Gwen.Control.Button backButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    backButton.Dock   = Pos.Left;
                    backButton.Click += new EventHandler(BackButton_Click);
                    backButton.SetToolTipText("Prev");
                    backButton.SetImage("AltData/Back.png", true);
                    backButton.Width  = 36;
                    backButton.Margin = new Margin(1, 1, 0, 1);

                    Alt.GUI.Temporary.Gwen.Control.Button forwardButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    forwardButton.Dock   = Pos.Left;
                    forwardButton.Click += new EventHandler(ForwardButton_Click);
                    forwardButton.SetToolTipText("Next");
                    forwardButton.SetImage("AltData/Forward.png", true);
                    forwardButton.Width  = 36;
                    forwardButton.Margin = new Margin(1, 1, 0, 1);


                    m_ExampleNumberLabel      = new Alt.GUI.Temporary.Gwen.Control.Label(controlsMain);
                    m_ExampleNumberLabel.Dock = Pos.Left;
                    m_ExampleNumberLabel.AutoSizeToContents = true;
                    m_ExampleNumberLabel.TextColor          = Color.White;
                    m_ExampleNumberLabel.Text   = "";
                    m_ExampleNumberLabel.Margin = new Margin(5, (m_PanelTop.Height - m_ExampleNumberLabel.Height) / 2 - 3, 5, 1);


                    Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(controlsMain);
                    label.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;
                    label.AutoSizeToContents = true;
                    label.Text      = "Use mouse device to operate with dynamic objects\nand scene zoom / offset";
                    label.TextColor = Color.Cyan;
                    label.Margin    = new Alt.GUI.Temporary.Gwen.Margin(5, //(m_PanelTop.Height - label.Height) / 2 -
                                                                        3, 5, 0);


                    Alt.GUI.Temporary.Gwen.Control.Button refreshButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    refreshButton.Dock   = Pos.Right;
                    refreshButton.Click += new EventHandler(RestartButton_Click);
                    refreshButton.SetToolTipText("Restart");
                    refreshButton.SetImage("AltData/Refresh.png", true);
                    refreshButton.Width  = 36;
                    refreshButton.Margin = new Margin(0, 1, 0, 1);
                }


                settings = new FarseerPhysicsGameSettings();

                testCount = 0;
                while (FarseerPhysicsTestEntries.TestList[testCount].CreateTest != null)
                {
                    testCount++;
                }

                testIndex     = -1;
                testSelection = Alt.Box2D.MathUtils.Clamp(testIndex, 0, testCount - 1);


                m_InfoFont = new Font("Arial", 10.01, FontStyle.Bold);


                Focus();
            }
Example #24
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            m_CurZoom = 0;

            m_Splitter = new Alt.GUI.Temporary.Gwen.Control.CrossSplitter(this);
            m_Splitter.SetPosition(0, 0);
            m_Splitter.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;

            {
                Alt.GUI.Temporary.Gwen.Control.VerticalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(m_Splitter);
                Alt.GUI.Temporary.Gwen.Control.Button           button1  = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button1.SetText("Vertical left");
                Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button2.SetText("Vertical right");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(0, splitter);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter(m_Splitter);
                Alt.GUI.Temporary.Gwen.Control.Button             button1  = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button1.SetText("Horizontal up");
                Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button2.SetText("Horizontal down");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(1, splitter);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.HorizontalSplitter(m_Splitter);
                Alt.GUI.Temporary.Gwen.Control.Button             button1  = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button1.SetText("Horizontal up");
                Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button2.SetText("Horizontal down");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(2, splitter);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.VerticalSplitter splitter = new Alt.GUI.Temporary.Gwen.Control.VerticalSplitter(m_Splitter);
                Alt.GUI.Temporary.Gwen.Control.Button           button1  = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button1.SetText("Vertical left");
                Alt.GUI.Temporary.Gwen.Control.Button button2 = new Alt.GUI.Temporary.Gwen.Control.Button(splitter);
                button2.SetText("Vertical right");
                splitter.SetPanel(0, button1);
                splitter.SetPanel(1, button2);
                m_Splitter.SetPanel(3, splitter);
            }

            //Status bar to hold unit testing buttons
            Alt.GUI.Temporary.Gwen.Control.StatusBar pStatus = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            pStatus.Dock = Alt.GUI.Temporary.Gwen.Pos.Bottom;

            {
                Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus);
                pButton.SetText("Zoom");
                pButton.Clicked += ZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus);
                pButton.SetText("UnZoom");
                pButton.Clicked += UnZoomTest;
                pStatus.AddControl(pButton, false);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus);
                pButton.SetText("CenterPanels");
                pButton.Clicked += CenterPanels;
                pStatus.AddControl(pButton, true);
            }

            {
                Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus);
                pButton.SetText("Splitters");
                pButton.Clicked += ToggleSplitters;
                pStatus.AddControl(pButton, true);
            }
        }
Example #25
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);
                }
            }
        }
Example #26
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  Opacity
            m_OpacityPlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityPlusButton.Text   = "+";
            m_OpacityPlusButton.Dock   = Pos.Top;
            m_OpacityPlusButton.Click += new EventHandler(OpacityPlusButton_Click);

            m_OpacityMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_OpacityControl);
            m_OpacityMinusButton.Text   = "-";
            m_OpacityMinusButton.Dock   = Pos.Bottom;
            m_OpacityMinusButton.Click += new EventHandler(OpacityMinusButton_Click);

            m_OpacitySlider      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_OpacityControl);
            m_OpacitySlider.Dock = Pos.Fill;
            m_OpacitySlider.SetRange(0.05f, 1);
            m_OpacitySlider.Value = 1;


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

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

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

            m_ScaleSlider      = new VerticalSlider(m_ScaleControl);
            m_ScaleSlider.Dock = Pos.Fill;
            m_ScaleSlider.SetRange(0.3f, 5);
            m_ScaleSlider.Value = 1;


            //  Rotate
            m_RotateControl = new Base(m_DrawingPanel);
            m_RotateControl.SetBounds(30, 10, 200, 20);

            m_RotatePlusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotatePlusButton.Text   = "+";
            m_RotatePlusButton.Dock   = Pos.Right;
            m_RotatePlusButton.Width  = m_RotateControl.Height;
            m_RotatePlusButton.Click += new EventHandler(RotatePlusButton_Click);

            m_RotateMinusButton        = new Alt.GUI.Temporary.Gwen.Control.Button(m_RotateControl);
            m_RotateMinusButton.Text   = "-";
            m_RotateMinusButton.Dock   = Pos.Left;
            m_RotateMinusButton.Width  = m_RotateControl.Height;
            m_RotateMinusButton.Click += new EventHandler(RotateMinusButton_Click);

            m_RotateSlider      = new HorizontalSlider(m_RotateControl);
            m_RotateSlider.Dock = Pos.Fill;
            m_RotateSlider.SetRange(-180, 180);
            m_RotateSlider.Value = 0;


            //  Expand
            m_ExpandSlider      = new Alt.GUI.Temporary.Gwen.Control.HorizontalSlider(this);
            m_ExpandSlider.Dock = Pos.Bottom;
            m_ExpandSlider.SetRange(-1, 1.2f);
            m_ExpandSlider.ValueChanged += new GwenEventHandler(ExpandSlider_ValueChanged);
            m_ExpandSlider.Height        = 20;
            m_ExpandSlider.Margin        = new Margin(0, 3, 0, 0);

            m_ExpandLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_ExpandLabel.AutoSizeToContents = true;
            m_ExpandLabel.Dock = Pos.Bottom;

            m_ExpandSlider.Value = 0;


            m_OpacitySlider.ValueChanged += new GwenEventHandler(Slider_ValueChanged);
            m_ScaleSlider.ValueChanged   += new GwenEventHandler(Slider_ValueChanged);
            m_RotateSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);
            m_ExpandSlider.ValueChanged  += new GwenEventHandler(Slider_ValueChanged);



            //
            m_SVGPath = new SVGPath();

            m_x        = m_DrawingPanel.ClientWidth / 2;
            m_y        = m_DrawingPanel.ClientHeight / 2;
            m_dx       = 0.0;
            m_dy       = 0.0;
            m_DragFlag = false;


            try
            {
                LoadSVG("AltData/SVG/tiger.svg");
            }
            catch (Exception)
            {
                return;
            }
        }
Example #27
0
        public ExamplesHolder(Base parent) :
            base(parent)
        {
            Dock = Pos.Fill;


            Base mainLeftContainer = new Base(this);

            Base leftContainer = new Base(mainLeftContainer);

            leftContainer.Dock   = Pos.Fill;
            leftContainer.Margin = new Margin(1);

            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(leftContainer);
            label.Margin    = new Margin(7, 4, 5, 3);
            label.Text      = "AltGUI Examples";
            label.TextColor = Color.LimeGreen * 1.4;
            //label.Alignment = Pos.Center;
            label.AutoSizeToContents = true;
            label.Dock = Pos.Top;


            Base examplesContainer = new Base(leftContainer);

            examplesContainer.Dock = Pos.Fill;

            m_ExamplesList        = new CollapsibleList(examplesContainer);
            m_ExamplesList.Dock   = Pos.Fill;
            m_ExamplesList.Margin = new Margin(0, 6, 0, 3);
            m_ExamplesList.ShouldDrawBackground = false;


            m_StatusBar = new Alt.GUI.Temporary.Gwen.Control.StatusBar(this);
            m_StatusBar.ShouldDrawBackground = false;
#if !DEBUG
            m_StatusBar.Hide();
#endif
            m_StatusBar.Dock = Pos.Bottom;


            m_ExamplesList.ShouldCacheToTexture = true;


            m_Center        = new CenterControl(this);
            m_Center.Dock   = Pos.Fill;
            m_Center.Margin = new Margin(1, 1, 1, 1);


            VerticalSplitter splitter = new VerticalSplitter(this);
            splitter.Dock = Pos.Fill;
            splitter.SetPanel(0, mainLeftContainer);
            splitter.SetPanel(1, m_Center);
            splitter.SetHValue(0.21f);


            Alt.GUI.Temporary.Gwen.Control.Button startButton = null;


            bool cat_ShouldCacheToTexture = false;
            {
                Color categoryColor = Color.Cyan * 1.2;
                Color color         = Color.WhiteSmoke;
                CollapsibleCategory cat;


                cat = AddCategory("HTML", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer", cat, typeof(Example_HtmlRenderer_Multi), color);

                    //color = Color.Red;
                    RegisterDemo("HTML/CSS2 Renderer (Bitmap)", cat, typeof(Example_HtmlRenderer_RenderToBitmap), color);
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__ || SILVERLIGHT
                cat = AddCategory("GIS", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  GMap.NET Intractive Demo
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Interactive)", cat, typeof(Example_GMap), color);
#endif

                    //  GMap.NET
                    //color = Color.CadetBlue;
#if SILVERLIGHT || UNITY_WEBPLAYER
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker_NotAvailable), color);
#else
                    RegisterDemo("GMap.NET (Big Map Maker)", cat, typeof(Example_GMap_BigMapMaker), color);
#endif
                }
                //cat.IsCollapsed = true;
#endif


                cat = AddCategory("Plot (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  NPlot
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("NPlot", cat, typeof(Example_NPlot_Multi), color);

                    //  OxyPlot
                    //color = Color.OliveDrab;
                    RegisterDemo("OxyPlot", cat, typeof(Example_OxyPlot_Multi), color);

                    //  PieChart
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("Pie Chart", cat, typeof(Example_PieChart), color);

                    //  ZedGraph
                    //color = Color.OliveDrab;
                    RegisterDemo("ZedGraph", cat, typeof(Example_ZedGraph_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("AltNETType = FreeType.NET", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    color = Color.WhiteSmoke;
                    RegisterDemo("FreeType 2 Step 1", cat, typeof(Example_AltNETType_FreeType2_Step1), color);
                    RegisterDemo("FreeType 2 Step 2 Simple", cat, typeof(Example_AltNETType_FreeType2_Step2_Simple), color);
                    RegisterDemo("FreeType 2 Step 2 Advanced", cat, typeof(Example_AltNETType_FreeType2_Step2_Advanced), color);
                    RegisterDemo("Simple Font Cache Manager", cat, typeof(Example_AltNETType_SimpleFontCacheManager), color);
                    RegisterDemo("Outline Transformations", cat, typeof(Example_AltNETType_Outline_Transformations), color);
                    RegisterDemo("Font Atlas", cat, typeof(Example_AltNETType_FontAtlas), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Geometry (Interactive)", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Vector Text
                    color       = Color.WhiteSmoke;
                    startButton = RegisterDemo("Transformed Text (Single Path)", cat, typeof(Example_VectorText_TransformedCurve1), color);
                    RegisterDemo("Transformed Text (Double Path)", cat, typeof(Example_VectorText_TransformedCurve2), color);
                    //TEMP  RegisterDemo("Vector Text Transformations", cat, typeof(Example_VectorText_Transformations), color);

                    //  Boolean
                    RegisterDemo("Boolean (CombinedGeometry)", cat, typeof(Example_CombinedGeometry), color);

                    //  Simple SVG
                    RegisterDemo("Simple SVG", cat, typeof(Example_SimpleSVG), color);

                    //  Lens Effect
                    RegisterDemo("Lens Effect SVG", cat, typeof(Example_LensEffectSVG), color);

                    //  Bilinear / Perspective Transformations
                    RegisterDemo("Bilinear / Perspective", cat, typeof(Example_Bilinear_Perspective), color);

                    //  Polar Transform
                    RegisterDemo("Polar Transform", cat, typeof(Example_PolarTransform), color);

                    //  Sin Transform
                    RegisterDemo("Sin Transform", cat, typeof(Example_SinTransform), color);

                    //  Outline
                    RegisterDemo("Outline SVG", cat, typeof(Example_Outline_SVG), color);

                    //  BSpline
                    RegisterDemo("Interactive B-Spline", cat, typeof(Example_BSpline), color);

                    //  Contour
                    RegisterDemo("Contour Tool & Poly Orientation", cat, typeof(Example_Contour), color);

                    //  Text Outline
                    RegisterDemo("Text Outline", cat, typeof(Example_TextOutline), color);

                    //  Affine Transformer
                    RegisterDemo("Affine Transformer", cat, typeof(Example_AffineTransformer), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Graphics", categoryColor);//"Drawing"
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

//#if !ANDROID //&& !SILVERLIGHT && !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
#if !UNITY_5
                    //  ExtBrush
                    color = Color.WhiteSmoke;
                    RegisterDemo("ExtBrush", cat, typeof(Example_ExtBrush), color);
#endif
//#endif

                    //  Clipper
                    color = Color.WhiteSmoke;
                    RegisterDemo("Clipper", cat, typeof(Example_Clipper), color);

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("SVG", cat, typeof(Example_SVG), color);

                    //  Alpha Mask
                    color = Color.WhiteSmoke;
                    //TEMP  RegisterDemo("Alpha Mask", cat, typeof(Example_AlphaMask), color);

                    //  Brushes
                    color = Color.WhiteSmoke;
                    //RegisterDemo("Brushes", cat, typeof(Example_Brushes), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Doc", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  PdfSharp
                    //color = Color.Red;
                    RegisterDemo("PdfSharp", cat, typeof(Example_PdfSharp_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Scientific Computing", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  AForge
                    color = Color.WhiteSmoke;// OliveDrab;
                    RegisterDemo("AForge.NET", cat, typeof(Example_AForge_Multi), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("GUI", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Gwen
                    color = Color.WhiteSmoke;// CadetBlue;
                    if (Alt.Sketch.Config.Font_NoAntiAliasMaxSize < 10)
                    {
                        color = Color.White;
                    }

                    RegisterDemo("Gwen Skinned", cat, typeof(Example_Gwen_UnitTest_Skin), color);
                    RegisterDemo("Gwen Simple", cat, typeof(Example_Gwen_UnitTest_Simple), color);

                    //  QuickFont
                    //color = Color.LightBlue;
                    RegisterDemo("QuickFont", cat, typeof(Example_QuickFont), color);
                    //	start long time background initialization
                    Example_QuickFont.Initialize();

                    //  Gif
                    color = Color.WhiteSmoke;
                    RegisterDemo("Animated Gif in PictureBox", cat, typeof(Example_GifInPictureBox), color);
                }
                //cat.IsCollapsed = true;


                cat = AddCategory("Game Physics", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  Phisics
                    color = Color.WhiteSmoke;
                    RegisterDemo("Box2D", cat, typeof(Example_Box2D), color);

                    //  Can't load type FarseerPhysics World (or some member of it) - needs researches
                                        #if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71
                    RegisterDemo("Farseer Physics", cat, typeof(Example_FarseerPhysics), color);
                                        #endif
                }
                //cat.IsCollapsed = true;


#if !WINDOWS_PHONE && !WINDOWS_PHONE_7 && !WINDOWS_PHONE_71 && !ANDROID && !__IOS__
                cat = AddCategory("THIRD PARTY", categoryColor);
                cat.CollapsingEnabled = false;
                {
                    cat.ShouldCacheToTexture = cat_ShouldCacheToTexture;

                    //  SVG
                    color = Color.WhiteSmoke;
                    RegisterDemo("Awesomium Web Browser", cat, typeof(Example_Awesomium), color);
                }
                //cat.IsCollapsed = true;
#endif
            }


            PrintText("AltGUI Gwen Demo Started!");


            OnExampleSelect(startButton);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            //  GUI
            {
                m_TopPanel = new Alt.GUI.Temporary.Gwen.Control.Base(this);
                {
                    m_TopPanel.Dock   = Pos.Top;
                    m_TopPanel.Height = 30;
                    m_TopPanel.Margin = new Margin(0, 7, 0, 3);


                    runFuzzySetTestButton      = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    runFuzzySetTestButton.Text = "Run Fuzzy Set Test";
                    runFuzzySetTestButton.AutoSizeToContents = true;
                    runFuzzySetTestButton.Dock            = Pos.Left;
                    runFuzzySetTestButton.Click          += new System.EventHandler(runFuzzySetTestButton_Click);
                    runFuzzySetTestButton.NormalTextColor = Color.Blue;

                    runLingVarTestButton      = new Alt.GUI.Temporary.Gwen.Control.Button(m_TopPanel);
                    runLingVarTestButton.Text = "Run Linguistic Variable Test";
                    runLingVarTestButton.AutoSizeToContents = true;
                    runLingVarTestButton.Dock            = Pos.Right;
                    runLingVarTestButton.Click          += new System.EventHandler(runLingVarTestButton_Click);
                    runLingVarTestButton.NormalTextColor = Color.Green;
                }


                Base bottomPanel = new Base(this);
                {
                    bottomPanel.Dock   = Pos.Bottom;
                    bottomPanel.Height = 30;
                    bottomPanel.Margin = new Margin(0, 10, 0, 0);


                    label1 = new Alt.GUI.Temporary.Gwen.Control.Label(bottomPanel);
                    label2 = new Alt.GUI.Temporary.Gwen.Control.Label(bottomPanel);
                    label4 = new Alt.GUI.Temporary.Gwen.Control.Label(bottomPanel);
                    label3 = new Alt.GUI.Temporary.Gwen.Control.Label(bottomPanel);

                    label1.ClientBackColor = Color.LightBlue;
                    label1.Width           = 100;
                    label1.Dock            = Pos.Left;
                    label1.DrawBorder      = true;
                    label1.BorderColor     = Color.DodgerBlue * 0.6;
                    label1.Text            = "Cool";
                    label1.TextAlign       = ContentAlignment.MiddleCenter;

                    label2.ClientBackColor = Color.LightCoral;
                    label2.Width           = 100;
                    label2.Dock            = Pos.Left;
                    label2.DrawBorder      = true;
                    label2.BorderColor     = Color.DodgerBlue * 0.6;
                    label2.Text            = "Warm";
                    label2.TextAlign       = ContentAlignment.MiddleCenter;
                    label2.Margin          = new Margin(7, 0, 0, 0);

                    label4.ClientBackColor = Color.Firebrick;
                    label4.Width           = 100;
                    label4.Dock            = Pos.Right;
                    label4.DrawBorder      = true;
                    label4.BorderColor     = Color.DodgerBlue * 0.6;
                    label4.Text            = "Hot";
                    label4.TextAlign       = ContentAlignment.MiddleCenter;

                    label3.ClientBackColor = Color.CornflowerBlue;
                    label3.Width           = 100;
                    label3.Dock            = Pos.Right;
                    label3.DrawBorder      = true;
                    label3.BorderColor     = Color.DodgerBlue * 0.6;
                    label3.Text            = "Cold";
                    label3.TextAlign       = ContentAlignment.MiddleCenter;
                    label3.Margin          = new Margin(0, 0, 7, 0);
                }


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


            chart.RangeX = new Range(0, 50);
            chart.AddDataSeries("COLD", Color.CornflowerBlue, Chart.SeriesType.Line, 3, true);
            chart.AddDataSeries("COOL", Color.LightBlue, Chart.SeriesType.Line, 3, true);
            chart.AddDataSeries("WARM", Color.LightCoral, Chart.SeriesType.Line, 3, true);
            chart.AddDataSeries("HOT", Color.Firebrick, Chart.SeriesType.Line, 3, true);
        }
Example #29
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;
        }
        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();
        }