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;
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            VerticalSplitter splitter = new VerticalSplitter(this);

            splitter.Dock = Pos.Fill;


            Alt.GUI.Temporary.Gwen.Control.Base leftContainer = new Alt.GUI.Temporary.Gwen.Control.Base(splitter);
            leftContainer.Dock   = Alt.GUI.Temporary.Gwen.Pos.Fill;
            leftContainer.Margin = new Alt.GUI.Temporary.Gwen.Margin(1);

            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(leftContainer);
            label.Margin             = new Alt.GUI.Temporary.Gwen.Margin(5, 3, 5, 9);
            label.Text               = "AltGUI.OxyPlot Demos";
            label.TextColor          = Color.Yellow;
            label.AutoSizeToContents = true;
            label.Dock               = Alt.GUI.Temporary.Gwen.Pos.Top;

            m_ExamplesTreeView                      = new TreeControl(leftContainer);
            m_ExamplesTreeView.Selected            += NodeSelected;
            m_ExamplesTreeView.ShouldDrawBackground = false;
            m_ExamplesTreeView.Dock                 = Alt.GUI.Temporary.Gwen.Pos.Fill;


            Base rightPanel = new Base(splitter);

            splitter.SetPanel(0, leftContainer);
            splitter.SetPanel(1, rightPanel);
            splitter.SetHValue(0.3);


            //  Caption
            m_Caption      = new Alt.GUI.Temporary.Gwen.Control.Label(rightPanel);
            m_Caption.Dock = Alt.GUI.Temporary.Gwen.Pos.Top;
            m_Caption.AutoSizeToContents = true;
            m_Caption.TextColor          = Color.Cyan;
            m_Caption.Margin             = new Alt.GUI.Temporary.Gwen.Margin(2, 3, 10, 5);
            m_Caption.Text = "";


            //  Info
            m_Info      = new Alt.GUI.Temporary.Gwen.Control.Label(rightPanel);
            m_Info.Dock = Alt.GUI.Temporary.Gwen.Pos.Bottom;
            m_Info.AutoSizeToContents = true;
            m_Info.TextColor          = Color.LightBlue;
            m_Info.Margin             = new Alt.GUI.Temporary.Gwen.Margin(2, 10, 3, 5);
            m_Info.Text = "Use the mouse-wheel or right mouse button to manipulate with graph";


            //  ZedGraphPanel
            m_OxyPlotPanel      = new Base(rightPanel);
            m_OxyPlotPanel.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;

            PlotModel plotModel = new PlotModel();

            plotModel.Annotations           = null;
            plotModel.AutoAdjustPlotMargins = true;
            plotModel.Axes                    = null;
            plotModel.AxisTierDistance        = 4D;
            plotModel.Background              = null;
            plotModel.Culture                 = null;
            plotModel.DefaultColors           = null;
            plotModel.DefaultFont             = "Arial";//Segoe UI";
            plotModel.DefaultFontSize         = 12D;
            plotModel.IsLegendVisible         = true;
            plotModel.LegendBackground        = null;
            plotModel.LegendBorder            = null;
            plotModel.LegendBorderThickness   = 1D;
            plotModel.LegendColumnSpacing     = 0D;
            plotModel.LegendFont              = null;
            plotModel.LegendFontSize          = 12D;
            plotModel.LegendFontWeight        = 400D;
            plotModel.LegendItemAlignment     = global::OxyPlot.HorizontalAlignment.Left;
            plotModel.LegendItemOrder         = global::OxyPlot.LegendItemOrder.Normal;
            plotModel.LegendItemSpacing       = 24D;
            plotModel.LegendMargin            = 8D;
            plotModel.LegendOrientation       = global::OxyPlot.LegendOrientation.Vertical;
            plotModel.LegendPadding           = 8D;
            plotModel.LegendPlacement         = global::OxyPlot.LegendPlacement.Inside;
            plotModel.LegendPosition          = global::OxyPlot.LegendPosition.RightTop;
            plotModel.LegendSymbolLength      = 16D;
            plotModel.LegendSymbolMargin      = 4D;
            plotModel.LegendSymbolPlacement   = global::OxyPlot.LegendSymbolPlacement.Left;
            plotModel.LegendTextColor         = null;
            plotModel.LegendTitle             = null;
            plotModel.LegendTitleColor        = null;
            plotModel.LegendTitleFont         = null;
            plotModel.LegendTitleFontSize     = 12D;
            plotModel.LegendTitleFontWeight   = 700D;
            plotModel.PlotAreaBackground      = null;
            plotModel.PlotAreaBorderColor     = null;
            plotModel.PlotAreaBorderThickness = 1D;
            plotModel.PlotType                = global::OxyPlot.PlotType.XY;
            plotModel.Series                  = null;
            plotModel.Subtitle                = null;
            plotModel.SubtitleColor           = null;
            plotModel.SubtitleFont            = null;
            plotModel.SubtitleFontSize        = 14D;
            plotModel.SubtitleFontWeight      = 400D;
            plotModel.TextColor               = null;
            plotModel.Title                   = null;
            plotModel.TitleColor              = null;
            plotModel.TitleFont               = null;
            plotModel.TitleFontSize           = 18D;
            plotModel.TitleFontWeight         = 700D;
            plotModel.TitlePadding            = 6D;

            m_Plot      = new Plot(rightPanel);
            m_Plot.Dock = Pos.Fill;
            m_Plot.KeyboardPanHorizontalStep = 0.1D;
            m_Plot.KeyboardPanVerticalStep   = 0.1D;
            m_Plot.Model                = plotModel;
            m_Plot.Name                 = "m_Plot";
            m_Plot.PanCursor            = GUI.Cursors.Hand;
            m_Plot.ZoomHorizontalCursor = GUI.Cursors.SizeWE;
            m_Plot.ZoomRectangleCursor  = GUI.Cursors.SizeNWSE;
            m_Plot.ZoomVerticalCursor   = GUI.Cursors.SizeNS;


            //
            InitTree();

            //  Start example
            foreach (var ex in vm.Examples)
            {
                if (ex.Category == "HeatMapSeries" &&
                    ex.Title == "Peaks")
                {
                    vm.SelectedExample = ex;
                    InitPlot();
                }
            }
        }
Exemple #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);


            m_HtmlContainer                 = new HtmlContainer();
            m_HtmlContainer.Refresh        += OnRefresh;
            m_HtmlContainer.RenderError    += OnRenderError;
            m_HtmlContainer.StylesheetLoad += OnStylesheetLoad;
            m_HtmlContainer.ImageLoad      += OnImageLoad;


            //  FillBackground
            m_FillBackground               = new LabeledCheckBox(m_LeftPanel);
            m_FillBackground.Text          = "Fill Background";
            m_FillBackground.Dock          = Pos.Bottom;
            m_FillBackground.Margin        = new Margin(2, 10, 2, 0);
            m_FillBackground.IsChecked     = true;
            m_FillBackground.CheckChanged += new GwenEventHandler(FillBackground_CheckChanged);


#if !SILVERLIGHT
            //  AntiAlias Text
            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


            //  Width
            m_WidthSlider      = new HorizontalSlider(m_RightPanel);
            m_WidthSlider.Dock = Pos.Bottom;
            m_WidthSlider.SetRange(200, 1000);
            m_WidthSlider.Height        = 20;
            m_WidthSlider.ValueChanged += new GwenEventHandler(WidthSlider_ValueChanged);

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


            //  Image
            Base imageMainPanel = new Base(m_RightPanel);
            imageMainPanel.Dock = Pos.Fill;


            m_ImageScrollControl        = new Alt.GUI.Temporary.Gwen.Control.ScrollControl(imageMainPanel);
            m_ImageScrollControl.Margin = Margin.One;
            m_ImageScrollControl.Dock   = Pos.Fill;
            m_ImageScrollControl.EnableScroll(true, true);
            m_ImageScrollControl.AutoHideBars         = true;
            m_ImageScrollControl.ShouldDrawBackground = false;


            m_ImagePanel          = new Base(m_ImageScrollControl);
            m_ImagePanel.Margin   = Margin.Two;
            m_ImagePanel.Location = PointI.Zero;
            m_ImagePanel.Size     = new SizeI(100, 100);
            m_ImagePanel.Paint   += new GUI.PaintEventHandler(ImagePanel_Paint);
            m_ImagePanel.Hide();


            m_WidthSlider.Value = 500;


            SelectFirstExample();
        }
Exemple #4
0
 public Example_ProtectDocument(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_ProtectDocument")
 {
 }
Exemple #5
0
        void CreateUI2()
        {
            Base rightPanel = new Base(m_MainSplitter);

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


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


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

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


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

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


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

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


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

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


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


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

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


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

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


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

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


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

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


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

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


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


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

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

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

            m_ScaleTrackBar               = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
            m_ScaleTrackBar.Dock          = Pos.Fill;
            m_ScaleTrackBar.ValueChanged += new GwenEventHandler(trackBar1_ValueChanged);
        }
Exemple #6
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;
            }
        }
Exemple #7
0
 void CenterPanels(Alt.GUI.Temporary.Gwen.Control.Base control)
 {
     m_Splitter.CenterPanels();
     m_Splitter.UnZoom();
 }
        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);
        }
Exemple #9
0
 public Example_Watermark(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_Watermark")
 {
 }
Exemple #10
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);

                    Alt.GUI.Temporary.Gwen.Control.Button ballButton = new Alt.GUI.Temporary.Gwen.Control.Button(controlsMain);
                    ballButton.Dock            = Pos.Right;
                    ballButton.Click          += new EventHandler(BallButton_Click);
                    ballButton.Text            = "PUSH BALL";
                    ballButton.NormalTextColor = Color.Green;
                    ballButton.Margin          = new Margin(5, 1, 5, 1);
                }


                settings = new Alt.GUI.Box2D.Demo.Testbed.Framework.Settings();

                testCount = 0;
                while (TestEntries.g_testEntries[testCount].createFcn != null)
                {
                    testCount++;
                }

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


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


                Focus();
            }
Exemple #11
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);
                        }
                    }
                }
            }
        }
Exemple #12
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);
        }
Exemple #13
0
 public Example_HelloWorld(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_HelloWorld")
 {
 }
        public Example_CombinedGeometry(Base parent)
            : base(parent)
        {
            this.Margin = new Margin(0);


            //  Top Label
            m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Geometry Boolean Operations using CombinedGeometry (press the left mouse button to move the geometry)";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(0, 5, 0, 5);


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


            //  UI Panel
            m_UIPanel      = new Base(splitter);
            m_UIPanel.Dock = Pos.Fill;


            //  Geometry
            groupBox_Geometry      = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(m_UIPanel, string.Empty);
            groupBox_Geometry.Text = "Geometry:";
            //groupBox_Geometry.Margin = new Margin(0, 5, 0, 0);
            groupBox_Geometry.Margin = new Margin(0,
#if WINDOWS_PHONE_7 || WINDOWS_PHONE_71
                                                  5,
#else
                                                  GUI.Config.Logo.PixelHeight,
#endif
                                                  5, 0);
            groupBox_Geometry.Dock = Pos.Top;
            groupBox_Geometry.AutoSizeToContents = true;

            rbGeometry1        = groupBox_Geometry.AddOption("Spiral and Text");
            rbGeometry1.Margin = new Margin(0, 3, 0, 0);
            rbGeometry2        = groupBox_Geometry.AddOption("Great Britain and Spiral");
            rbGeometry3        = groupBox_Geometry.AddOption("Great Britain and Arrows");
            rbGeometry4        = groupBox_Geometry.AddOption("Closed Stroke");
            rbGeometry5        = groupBox_Geometry.AddOption("Two Simple Paths");
            rbGeometry5.Margin = new Margin(0, 0, 0,
#if SILVERLIGHT
                                            22
#else
                                            13
#endif
                                            );


            //  Boolean Op
            groupBox_BooleanOperation                    = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(m_UIPanel, string.Empty);
            groupBox_BooleanOperation.Text               = "Boolean Operation:";
            groupBox_BooleanOperation.Margin             = new Margin(0, 15, 5, 0);
            groupBox_BooleanOperation.Dock               = Pos.Top;
            groupBox_BooleanOperation.AutoSizeToContents = true;

            rbBminusA        = groupBox_BooleanOperation.AddOption("B-A");
            rbBminusA.Margin = new Margin(0, 3, 0, 0);
            rbAminusB        = groupBox_BooleanOperation.AddOption("A-B");
            rbXor            = groupBox_BooleanOperation.AddOption("XOR");
            rbAnd            = groupBox_BooleanOperation.AddOption("AND");
            rbOr             = groupBox_BooleanOperation.AddOption("OR");
            rbNone           = groupBox_BooleanOperation.AddOption("None");
            rbNone.Margin    = new Margin(0, 0, 0,
#if SILVERLIGHT
                                          27
#else
                                          15
#endif
                                          );


            //  Drawing Panel
            m_DrawingPanel        = new Base(splitter);
            m_DrawingPanel.Dock   = Pos.Fill;
            m_DrawingPanel.Margin = new Margin(-1);
            //m_DrawingPanel.ClientBackColor = Color.White;
            //m_DrawingPanel.DrawBorder = true;
            //m_DrawingPanel.BorderColor = Color.DodgerBlue;
            m_DrawingPanel.Paint     += new GUI.PaintEventHandler(panel2_Paint);
            m_DrawingPanel.MouseDown += new Alt.GUI.MouseEventHandler(panel2_MouseDown);
            m_DrawingPanel.MouseMove += new Alt.GUI.MouseEventHandler(panel2_MouseMove);


            //
            splitter.SetPanel(1, m_UIPanel);
            splitter.SetPanel(0, m_DrawingPanel);
            splitter.SetHValue(0.78f);
        }
        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");
        }
Exemple #16
0
 public Example_PageSizes(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_PageSizes")
 {
 }
Exemple #17
0
 public Example_TwoPagesOnOne(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_TwoPagesOnOne")
 {
 }
Exemple #18
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;
            }
        }
Exemple #19
0
 void UnZoomTest(Alt.GUI.Temporary.Gwen.Control.Base control)
 {
     m_Splitter.UnZoom();
 }
Exemple #20
0
 public Example_TextLayout(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_TextLayout")
 {
 }
Exemple #21
0
 void ToggleSplitters(Alt.GUI.Temporary.Gwen.Control.Base control)
 {
     m_Splitter.SplittersVisible = !m_Splitter.SplittersVisible;
 }
        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();
        }
Exemple #23
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);
                }
            }
        }
Exemple #24
0
        public Example_Clipper(Base parent)
            : base(parent)
        {
            this.Margin = new Margin(0);


            //  Top Label
            m_TopLabel = new Alt.GUI.Temporary.Gwen.Control.Label(this);
            m_TopLabel.AutoSizeToContents = true;
            m_TopLabel.Text      = "Clipper Demo. Use the mouse-wheel (or +, -, 0) to adjust the offset of the solution polygons.";
            m_TopLabel.TextColor = Color.Yellow;
            m_TopLabel.Dock      = Pos.Top;
            m_TopLabel.Margin    = new Margin(0, 5, 0, 5);



            m_Splitter      = new VerticalSplitter(this);
            m_Splitter.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;


            //  UI Panel
            m_RightPanel      = new Base(m_Splitter);
            m_RightPanel.Dock = Pos.Fill;


            //  Geometry
            groupBox_Geometry        = new RadioButtonGroup(m_RightPanel, string.Empty);
            groupBox_Geometry.Text   = "Geometry:";
            groupBox_Geometry.Dock   = Pos.Top;
            groupBox_Geometry.Margin = new Margin(0,
#if WINDOWS_PHONE_7 || WINDOWS_PHONE_71
                                                  5,
#else
                                                  GUI.Config.Logo.PixelHeight,
#endif
                                                  5, 0);

            rbGeometry1        = groupBox_Geometry.AddOption("Triangles");
            rbGeometry1.Margin = new Margin(0, 5, 0, 0);
            rbGeometry2        = groupBox_Geometry.AddOption("Geo - Circles");

            rbGeometry2.Select();

            groupBox_Geometry.SelectionChanged += new GwenEventHandler(groupBox_Geometry_SelectionChanged);


            //  Boolean Op
            groupBox_BooleanOperation        = new RadioButtonGroup(m_RightPanel, string.Empty);
            groupBox_BooleanOperation.Text   = "Boolean Operation:";
            groupBox_BooleanOperation.Dock   = Pos.Top;
            groupBox_BooleanOperation.Margin = new Margin(0, 15, 5, 0);

            rbIntersect        = groupBox_BooleanOperation.AddOption("Intersect");
            rbIntersect.Margin = new Margin(0, 5, 0, 0);
            rbUnion            = groupBox_BooleanOperation.AddOption("Union");
            rbDifference       = groupBox_BooleanOperation.AddOption("Difference");
            //NoNeed	rbXor =
            groupBox_BooleanOperation.AddOption("XOR");
            rbNone        = groupBox_BooleanOperation.AddOption("None");
            rbNone.Margin = new Margin(0, 0, 0, 7);

            rbIntersect.Select();

            groupBox_BooleanOperation.SelectionChanged += new GwenEventHandler(RefreshWORecreating);


            //  Options
            groupBox_Options      = new Alt.GUI.Temporary.Gwen.Control.RadioButtonGroup(m_RightPanel, string.Empty);
            groupBox_Options.Text = "Options:";
            groupBox_Options.Dock = Pos.Top;
            groupBox_Options.AutoSizeToContents = true;
            groupBox_Options.Margin             = new Margin(0, 15, 5, 0);

            rbEvenOdd        = groupBox_Options.AddOption("EvenOdd");
            rbEvenOdd.Margin = new Margin(0, 5, 0, 0);
            rbNonZero        = groupBox_Options.AddOption("NonZero");

            rbNonZero.Select();

            groupBox_Options.SelectionChanged += new GwenEventHandler(RefreshWORecreating);

            //  Vertex Count
            lblCount = new Alt.GUI.Temporary.Gwen.Control.Label(m_RightPanel);            //groupBox_Options);
            lblCount.AutoSizeToContents = true;
            lblCount.Text   = "Vertex Count:";
            lblCount.Dock   = Pos.Top;
            lblCount.Margin = new Margin(0, 17, 5, 7);
            //groupBox_Options.AddChild(lblCount);

            nudCount         = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_RightPanel);    //groupBox_Options);
            nudCount.Dock    = Pos.Top;
            nudCount.Minimum = 3;
            nudCount.Maximum = 100;
            nudCount.Value   = 50;
            nudCount.Margin  = new Margin(0, 0, 5, 7);
            //groupBox_Options.AddChild(nudCount);

            nudCount.ValueChanged += new GwenEventHandler(nudCount_ValueChanged);

            //  Offset
            Alt.GUI.Temporary.Gwen.Control.Label label = new Alt.GUI.Temporary.Gwen.Control.Label(m_RightPanel);            //groupBox_Options);
            label.AutoSizeToContents = true;
            label.Text   = "Offset:";
            label.Dock   = Pos.Top;
            label.Margin = new Margin(0, 0, 5, 7);
            //groupBox_Options.AddChild(label);

            nudOffset               = new Alt.GUI.Temporary.Gwen.Control.NumericUpDown(m_RightPanel);//groupBox_Options);
            nudOffset.Dock          = Pos.Top;
            nudOffset.Minimum       = -10;
            nudOffset.Maximum       = 10;
            nudOffset.Value         = 0;
            nudOffset.DecimalPlaces =
#if WINDOWS_PHONE_7 || WINDOWS_PHONE_71
                0;
#else
                1;
#endif
            nudOffset.Margin = new Margin(0, 0, 5, 7);
            //groupBox_Options.AddChild(nudOffset);

            nudOffset.ValueChanged += new GwenEventHandler(RefreshWORecreating);
        }
Exemple #25
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;
        }
Exemple #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;
            }
        }
 // On Size mode->Stretched menu item
 void stretchedSizeItem_Click(Alt.GUI.Temporary.Gwen.Control.Base control)
 {
     pictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
 }
Exemple #28
0
 public Example_Graphics(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent, "Example_Graphics")
 {
 }
Exemple #29
0
 void MenuItemSelect(Alt.GUI.Temporary.Gwen.Control.Base control)
 {
     Alt.GUI.Temporary.Gwen.Control.MenuItem item = control as Alt.GUI.Temporary.Gwen.Control.MenuItem;
     UnitPrint(String.Format("Menu item selected: {0}", item.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();
        }