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


            m_Splitter      = new VerticalSplitter(this);
            m_Splitter.Dock = Pos.Fill;


            Alt.GUI.Temporary.Gwen.Control.Base leftContainer = new Alt.GUI.Temporary.Gwen.Control.Base(m_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               = "Examples";
            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(m_Splitter);

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


            //  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 = "";


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


            RegisterExamples();
            m_ExamplesTreeView.ExpandAll();
        }
コード例 #2
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);
                }
            }
        }
コード例 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            m_CurZoom = 0;

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

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

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

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

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

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

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

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

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

            {
                Alt.GUI.Temporary.Gwen.Control.Button pButton = new Alt.GUI.Temporary.Gwen.Control.Button(pStatus);
                pButton.SetText("Splitters");
                pButton.Clicked += ToggleSplitters;
                pStatus.AddControl(pButton, true);
            }
        }
コード例 #4
0
ファイル: Example_Clipper.cs プロジェクト: CrazyLiu00/GMap
        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);
        }
コード例 #5
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);
                        }
                    }
                }
            }
        }
コード例 #6
0
        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);
        }