Esempio n. 1
0
        public static void StartupGUI()
        {
            int StackPointer = Stack.Add("UI.StartupGUI()");

            ClearWindow();
            LDScrollBars.Add(GlobalStatic.Listview_Width + 370, GlobalStatic.Listview_Height);
            LDGraphicsWindow.State = 2;
            PreMainMenu();
            MainMenu();
            //AutoUpdate Code
            if (GlobalStatic.AutoUpdate == true && GlobalStatic.LastUpdateCheck + 14 <= GlobalStatic.ISO_Today)
            {
                Events.LogMessage("Autoupdate Check", "Updater");
                Updater.CheckForUpdates(GlobalStatic.UpdaterDBpath, GlobalStatic.OnlineDB_Refrence_Location, false);
            }
            Stack.Exit(StackPointer);
        }
Esempio n. 2
0
        private void buttonShapes_Click(object sender, EventArgs e)
        {
            GraphicsWindow.Show();
            LDScrollBars.Rasterize    = "True";
            GraphicsWindow.MouseDown += OnMouseDown;
            LDScrollBars.Add(GraphicsWindow.Width, 10000);
            int       cogRadius    = 100;
            int       cogNumTeeth  = 10;
            int       cogToothSize = 10;
            Primitive cog          = Shapes.AddEllipse(2 * cogRadius, 2 * cogRadius);
            Primitive points       = "";
            Primitive point        = "";

            LDPhysics.AddMovingShape(cog, 0.5, 0.8, 1);
            for (int i = 1; i <= 1; i++)
            {
                double angle       = (i - 1) / cogNumTeeth * 2 * SBMath.Pi;
                double innerSector = 0.7 / cogNumTeeth * 2 * SBMath.Pi;
                double outerSector = 0.5 / cogNumTeeth * 2 * SBMath.Pi;
                point["X"] = cogRadius + cogRadius * SBMath.Cos(angle);
                point["Y"] = cogRadius + cogRadius * SBMath.Sin(angle);
                points[1]  = point;
                point["X"] = cogRadius + cogRadius * SBMath.Cos(angle + innerSector);
                point["Y"] = cogRadius + cogRadius * SBMath.Sin(angle + innerSector);
                points[2]  = point;
                point["X"] = cogRadius + (cogRadius + cogToothSize) * SBMath.Cos(angle + outerSector);
                point["Y"] = cogRadius + (cogRadius + cogToothSize) * SBMath.Sin(angle + outerSector);
                points[3]  = point;
                point["X"] = cogRadius + (cogRadius + cogToothSize) * SBMath.Cos(angle + innerSector - outerSector);
                point["Y"] = cogRadius + (cogRadius + cogToothSize) * SBMath.Sin(angle + innerSector - outerSector);
                points[4]  = point;
                Primitive tooth = LDShapes.AddPolygon(points);
                LDPhysics.AddMovingShape(tooth, 0.5, 0.8, 1);
                //LDPhysics.GroupShapes(cog, tooth);
            }

            LDPhysics.DoTimestep();

            Primitive ball = Shapes.AddEllipse(100, 50);

            //Shapes.Move(ball, 112, 112);
            //Shapes.Zoom(ball, 1, 1);
            //Shapes.Rotate(ball, -60);
            Shapes.Move(ball, 100, 112);
            //Shapes.Zoom(ball, 1.2, 1);
            //Shapes.Rotate(ball, -60);

            Primitive gradient = "";

            gradient[1] = "Red";
            gradient[2] = "Yellow";
            gradient[3] = "Blue";
            Primitive brush = LDShapes.BrushGradient(gradient, "H");

            LDShapes.BrushShape(ball, brush);

            LDUtilities.GWCapture("C:\\temp\\test.jpg", "False");

            Primitive rect = Shapes.AddRectangle(60, 60);

            Shapes.Move(rect, 25, 95);
            Shapes.Zoom(rect, 1.5, 1);
            Shapes.Rotate(rect, 45);
            //Shapes.Move(rect, 75, 75);
            //Shapes.Zoom(rect, 1.5, 1);
            //Shapes.Rotate(rect, 45);

            TextWindow.WriteLine(LDShapes.Overlap(ball, rect));
            //TextWindow.WriteLine(LDShapes.Overlap(rect, ball));

            Primitive image1 = Shapes.AddImage("C:\\temp\\test2.jpg");

            Shapes.Move(image1, 100, 100);
            TextWindow.WriteLine(LDShapes.Overlap(ball, image1));

            //LDShapes.AnimatedGifInterval = 0;
            Primitive gifShape = LDShapes.AddAnimatedGif("http://www.animatedgif.net//animals//birds//batana1_e0.gif", "True");

            Shapes.Move(gifShape, 100, 300);
            Primitive rectangle = Shapes.AddRectangle(100, 100);

            LDShapes.BrushColour(rectangle, "Red");
            Primitive img    = SBImageList.LoadImage("C:\\temp\\test.jpg");
            Primitive img2   = "C:\\temp\\test2.jpg";
            Primitive button = SBControls.AddButton("TEST", 100, 100);

            SBControls.SetSize(button, 50, 50);
            Primitive image = Shapes.AddImage(img);

            LDShapes.ReSize(image, 50, 50);
            LDShapes.Centre(image, 400, 25);
            SBProgram.Delay(1000);
            LDShapes.SetImage(image, img2);
            LDShapes.SetImage(button, img);
            SBProgram.Delay(1000);
            LDShapes.AnimationInterval = 0;
            LDShapes.AnimationSet(gifShape, LDShapes.AnimationCount(gifShape) / 3);
            SBProgram.Delay(1000);
            LDShapes.AnimationInterval = 50;
            LDShapes.AnimationPause(gifShape);
            SBProgram.Delay(2000);
            Shapes.HideShape(gifShape);
            LDShapes.AnimationResume(gifShape);
            SBProgram.Delay(2000);
            Shapes.ShowShape(gifShape);
        }
Esempio n. 3
0
            public static void Display(Google_Charts.Chart chart)
            {
                int StackPointer = Stack.Add("UI.Charts.Display()");

                Charts.chart = chart;
                ClearWindow();
                GraphicsWindow.Title = "Charts";

                LDGraphicsWindow.CancelClose = true;
                LDGraphicsWindow.ExitOnClose = false;
                LDGraphicsWindow.Closing    += Events.Closing;
                LDGraphicsWindow.ExitButtonMode(GraphicsWindow.Title, "Disabled");

                XColumns.Clear();
                YColumns.Clear();
                Schema = Export.GenerateSchemaListFromLastQuery();

                //UI Stuff
                GraphicsWindow.FontSize = GlobalStatic.DefaultFontSize + 12;

                GraphicsWindow.DrawText(5, 10, string.Format("Min Columns {0}", chart.MinColumns));
                GraphicsWindow.DrawText(5, 30, string.Format("Max Columns {0}", chart.MaxColumns));

                Inequality = Shapes.AddText("Equation");
                Shapes.Move(Inequality, 400, 5);

                GraphicsWindow.DrawText(5, 70, "X:");
                GraphicsWindow.DrawText(300 + 100, 70, "Columns:");
                GraphicsWindow.DrawText(600 + 200, 70, "Y:");

                GraphicsWindow.DrawText(5, 450, "Title");
                GraphicsWindow.DrawText(5, 500, "SubTitle");
                GraphicsWindow.DrawText(5, 550, "X axis");
                GraphicsWindow.DrawText(5, 600, "Y axis");

                GraphicsWindow.FontSize = GlobalStatic.DefaultFontSize;

                XListBox      = LDControls.AddListBox("", 300, 300);
                SchemaListBox = LDControls.AddListBox(Schema.ToPrimitiveArray(), 300, 300);
                YListBox      = LDControls.AddListBox("", 300, 300);

                DataView = LDControls.AddDataView(300, 300, "1=Column;2=Type;");
                LDControls.DataViewSetColumnComboBox(DataView, 2, "1=Text;2=Number;");

                if (Desktop.Width < 1500)
                {
                    LDScrollBars.Add(1920, 0);
                }

                Controls.Move(XListBox, 5, 100);
                Controls.Move(SchemaListBox, 300 + 100, 100);
                Controls.Move(YListBox, 600 + 200, 100);
                Controls.Move(DataView, 1200, 100);

                Left1  = Controls.AddButton("<", 325, 200);
                Right1 = Controls.AddButton(">", 325, 250);

                Left2  = Controls.AddButton("<", 725, 200);
                Right2 = Controls.AddButton(">", 725, 250);

                GenerateChartButton = Controls.AddButton("Generate Chart", 300, 500);
                Controls.Move(GenerateChartButton, 800, 550);
                Controls.SetSize(GenerateChartButton, 100, 30);

                //TODO Add TextBoxes for Title,SubTitle,X axis caption, and y axis caption
                TitleTB        = Controls.AddTextBox(130, 450);
                SubTitleTB     = Controls.AddTextBox(130, 500);
                XaxisCaptionTB = Controls.AddTextBox(130, 550);
                YaxisCaptionTB = Controls.AddTextBox(130, 600);

                Controls.SetSize(TitleTB, 200, 30);
                Controls.SetSize(SubTitleTB, 200, 30);
                Controls.SetSize(XaxisCaptionTB, 200, 30);
                Controls.SetSize(YaxisCaptionTB, 200, 30);

                Escape = Controls.AddButton("Esc", 50, 500);
                Controls.Move(Escape, 800, 500);
                Controls.SetSize(Escape, 100, 30);

                //TODO Add Region options for GeoCharts
                //TODO Allow users to specify data type (Number,string,eventually Datetime etc).
                //Otherwise attempt to grab that data from the db?
                Controls.SetSize(Left1, 50, 30);
                Controls.SetSize(Right1, 50, 30);
                Controls.SetSize(Left2, 50, 30);
                Controls.SetSize(Right2, 50, 30);

                //Event Handler Unhooking
                Controls.ButtonClicked -= Events.BC;
                //Event Handler Hooking
                Controls.ButtonClicked += Handler;
                AutoHide();
                Stack.Exit(StackPointer);
            }