Exemple #1
0
            public Box2DContainer(Alt.GUI.Temporary.Gwen.Control.Base parent, Alt.Box2D.AltSketchDebugDraw debugDraw) :
                base(parent)
            {
                m_DebugDraw = debugDraw;

                DoubleBuffered       = false;
                KeyboardInputEnabled = true;
            }
Exemple #2
0
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);


                Cursor = Alt.GUI.Cursors.Hand;

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

                    Alt.GUI.Temporary.Gwen.Control.Base controlsMain = new Alt.GUI.Temporary.Gwen.Control.Base(m_PanelTop);
                    controlsMain.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;


                    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.Font      = new Alt.Sketch.Font("Arial", 10, Alt.Sketch.FontStyle.Bold);
                    label.TextColor = Alt.Sketch.Color.LightBlue * 1.23;
                    label.Margin    = new Alt.GUI.Temporary.Gwen.Margin(5, 3, 5, 0);


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

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


                Focus();


                viewZoom  = 1.0;
                m_OffsetX = 0;
                m_OffsetY = 0;
            }
Exemple #3
0
 protected virtual void OnDestroy()
 {
     GwenChild = null;
     Child     = null;
 }
        internal static Alt.GUI.Temporary.Gwen.Control.OxyPlot.Plot Create_OxyPlotControl(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            Alt.GUI.Temporary.Gwen.Control.OxyPlot.Plot plot = new Alt.GUI.Temporary.Gwen.Control.OxyPlot.Plot(parent);

            plot.KeyboardPanHorizontalStep = 0.1D;
            plot.KeyboardPanVerticalStep   = 0.1D;
            plot.Model                = CreateOxyPlotModel();
            plot.Name                 = "Plot";
            plot.PanCursor            = Alt.GUI.Cursors.Hand;
            plot.ZoomHorizontalCursor = Alt.GUI.Cursors.SizeWE;
            plot.ZoomRectangleCursor  = Alt.GUI.Cursors.SizeNWSE;
            plot.ZoomVerticalCursor   = Alt.GUI.Cursors.SizeNS;

            return(plot);
        }
Exemple #5
0
 internal static Box2DContainer Create_Box2DContainer(Alt.GUI.Temporary.Gwen.Control.Base parent, Alt.Box2D.AltSketchDebugDraw debugDraw)
 {
     return(new Box2DContainer(parent, debugDraw));
 }
Exemple #6
0
        internal static Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlLabel Create_HtmlLabel(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlLabel htmlLabel = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlLabel(parent);

            htmlLabel.AutoSize           = false;
            htmlLabel.AutoSizeHeightOnly = true;
            htmlLabel.BackColor          = Alt.Sketch.Color.Transparent;
            htmlLabel.BaseStylesheet     = null;

            return(htmlLabel);
        }
Exemple #7
0
        internal static Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel Create_HtmlPanel(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel htmlPanel = new Alt.GUI.HtmlRenderer.Temporary.Gwen.HtmlPanel(parent);

            htmlPanel.ShouldDrawBackground = false;
            htmlPanel.TextRenderingHint    = TextRenderingHint.Default;

            htmlPanel.AutoScroll     = true;
            htmlPanel.BackColor      = Alt.Sketch.Color.White;
            htmlPanel.BaseStylesheet = null;

            return(htmlPanel);
        }
 internal static FarseerPhysicsContainer Create_FarseerPhysicsContainer(Alt.GUI.Temporary.Gwen.Control.Base parent)
 {
     return(new FarseerPhysicsContainer(parent));
 }
 public FarseerPhysicsContainer(Alt.GUI.Temporary.Gwen.Control.Base parent) :
     base(parent)
 {
     DoubleBuffered       = false;
     KeyboardInputEnabled = true;
 }
Exemple #10
0
        internal static Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl Create_NPlotSurface(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl plotSurface = new Alt.GUI.NPlot.Temporary.Gwen.PlotSurface2DControl(parent);

            plotSurface.AutoScaleAutoGeneratedAxes = false;
            plotSurface.AutoScaleTitle             = false;
            plotSurface.DateTimeToolTip            = false;
            plotSurface.Legend          = null;
            plotSurface.LegendZOrder    = -1;
            plotSurface.Name            = "plotSurface";
            plotSurface.RightMenu       = null;
            plotSurface.ShowCoordinates = false;
            plotSurface.SmoothingMode   = SmoothingMode.AntiAlias;          // None;
            plotSurface.SurfacePadding  = 10;
            plotSurface.Title           = "";
            plotSurface.TitleFont       = new Alt.Sketch.Font("Arial", 14F, Alt.Sketch.FontStyle.Regular, GraphicsUnit.Pixel);
            plotSurface.XAxis1          = null;
            plotSurface.XAxis2          = null;
            plotSurface.YAxis1          = null;
            plotSurface.YAxis2          = null;

            SetNPlotSurfaceDefaultBackColor(plotSurface);

            return(plotSurface);
        }
Exemple #11
0
        internal static Alt.Sketch.Demo.GMap.NET.Map Create_GMap(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            GMap.NET.GMaps.Instance.UseMemoryCache = true;
            GMap.NET.GMaps.Instance.Mode           =
                //#if !UNITY_WEBPLAYER && !UNITY_5
                //                AccessMode.ServerAndCache;
                //#else
                GMap.NET.AccessMode.CacheOnly;
            //#endif

            Alt.Sketch.Demo.GMap.NET.Map map = new Alt.Sketch.Demo.GMap.NET.Map(parent);

            MapInfo.Instance.SetMap(map);
            map.DrawBorder = true;


            Alt.GUI.Temporary.Gwen.Control.Base           m_ScaleControl;
            Alt.GUI.Temporary.Gwen.Control.VerticalSlider m_ScaleTrackBar;


            //  Scale
            {
                m_ScaleControl = new Alt.GUI.Temporary.Gwen.Control.Base(map);
                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 = Alt.GUI.Temporary.Gwen.Pos.Top;

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

                m_ScaleTrackBar      = new Alt.GUI.Temporary.Gwen.Control.VerticalSlider(m_ScaleControl);
                m_ScaleTrackBar.Dock = Alt.GUI.Temporary.Gwen.Pos.Fill;

                plus.Click += //new EventHandler(buttonZoomUp_Click);
                              delegate(object sender, EventArgs e)
                {
                    double p  = m_ScaleTrackBar.Maximum - m_ScaleTrackBar.Minimum;
                    double dp = p / m_ScaleTrackBar.NotchCount;
                    m_ScaleTrackBar.Value += (float)(dp * 1.01);
                };

                minus.Click += //new EventHandler(buttonZoomDown_Click);
                               delegate(object sender, EventArgs e)
                {
                    double p  = m_ScaleTrackBar.Maximum - m_ScaleTrackBar.Minimum;
                    double dp = p / m_ScaleTrackBar.NotchCount;
                    m_ScaleTrackBar.Value -= (float)(dp * 0.99);
                };

                m_ScaleTrackBar.ValueChanged += //new Alt.GUI.Temporary.Gwen.Control.Base.GwenEventHandler(scaleTrackBar_ValueChanged);
                                                delegate(Alt.GUI.Temporary.Gwen.Control.Base control)
                {
                    map.Zoom = m_ScaleTrackBar.Value / 100.0;
                };
            }


#if !UNITY_WEBPLAYER
            if (!Alt.Sketch.Demo.GMap.NET.Stuff.PingNetwork("pingtest.com", false)
#if UNITY_WEBPLAYER || UNITY_5
                && !Alt.GUI.Config.IsRunningOnMono
#endif
                )
            {
                map.Manager.Mode = GMap.NET.AccessMode.CacheOnly;
                new Alt.GUI.Temporary.Gwen.Control.MessageBox(map, "No internet connection available, going to CacheOnly mode.", "GMap.NET");
            }
#endif

            // config map
            map.MapProvider = GMap.NET.MapProviders.GMapProviders.BingSatelliteMap;
            map.MinZoom     = 0;
            map.MaxZoom     = 24;
            map.Zoom        = 5;

            GMap.NET.GMaps.Instance.PrimaryCache = new SqliteLoadImage();
            map.Position = new GMap.NET.PointLatLng(50, 50);

            // get zoom
            m_ScaleTrackBar.Minimum = map.MinZoom * 100;
            m_ScaleTrackBar.Maximum = map.MaxZoom * 100;
            //m_ScaleTrackBar.TickFrequency = 100;
            m_ScaleTrackBar.NotchCount    = (int)(m_ScaleTrackBar.Maximum - m_ScaleTrackBar.Minimum) / 100;
            m_ScaleTrackBar.SnapToNotches = true;

            m_ScaleTrackBar.Value = (int)map.Zoom * 100;

            // map events
            map.OnMapZoomChanged += //new GMap.NET.MapZoomChanged(MainMap_OnMapZoomChanged);
                                    delegate()
            {
                m_ScaleTrackBar.Value = (int)(map.Zoom * 100.0);
            };
            map.OnMapTypeChanged += //new GMap.NET.MapTypeChanged(MainMap_OnMapTypeChanged);
                                    delegate(GMap.NET.MapProviders.GMapProvider type)
            {
                m_ScaleTrackBar.Minimum = map.MinZoom * 100;
                m_ScaleTrackBar.Maximum = map.MaxZoom * 100;
            };
            map.OnTileLoadComplete += delegate(long ElapsedMilliseconds) {
                MapInfo.Instance.LoadComplete();
                //MapInfo.Instance.RegisterMapEvent();
            };

            //GMapOverlay overlay = new GMapOverlay("icon");
            //Bitmap bitmap = Bitmap.FromFile("E:\\Work_Project\\TwoMap\\Formal_Map\\ErSituation\\Assets\\Resources\\Texture\\02Button\\01BtnHeight.png") as Bitmap;
            //Bitmap bg_map = Bitmap.FromFile("E:\\Work_Project\\TwoMap\\Formal_Map\\ErSituation\\Assets\\Resources\\Texture\\02Button\\BtnEntityPress.png");
            //Marker_Test marker = new Marker_Test(new GMap.NET.PointLatLng(40, 120), bitmap);
            //marker.name = "first";
            //marker.ToolTip = new MapStringTest(marker, bg_map);
            //marker.ToolTipMode = MarkerTooltipMode.Always;

            ////marker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
            //marker.ToolTipText += "hello world\n";
            //marker.ToolTipText += "hello world\n";
            //marker.ToolTipText += "hello world\n";
            //marker.ToolTipText += "hello world\n";
            //map.Overlays.Add(overlay);
            //overlay.Markers.Add(marker);

            return(map);
        }
Exemple #12
0
 internal static Alt.GUI.ZedGraph.Temporary.Gwen.ZedGraphControl Create_ZedGraphControl(Alt.GUI.Temporary.Gwen.Control.Base parent)
 {
     return(new Alt.GUI.ZedGraph.Temporary.Gwen.ZedGraphControl(parent));
 }
Exemple #13
0
        internal static Alt.GUI.Temporary.Gwen.Control.Awesomium Create_AwesomiumControl(Alt.GUI.Temporary.Gwen.Control.Base parent)
        {
            Alt.GUI.Temporary.Gwen.Control.Awesomium awesomiumControl = new Alt.GUI.Temporary.Gwen.Control.Awesomium(parent);

            return(awesomiumControl);
        }
Exemple #14
0
 internal static Alt.GUI.PieChart.Temporary.Gwen.PieChartControl Create_PieChartControl(Alt.GUI.Temporary.Gwen.Control.Base parent)
 {
     Alt.GUI.PieChart.Temporary.Gwen.PieChartControl pieChartControl = new Alt.GUI.PieChart.Temporary.Gwen.PieChartControl(parent);
     return(pieChartControl);
 }