public static void CreateTableUI() { int StackPointer = Stack.Add("UI.CreateTableUI()"); Controls.HideControl(GlobalStatic.Dataview); Controls.HideControl(GlobalStatic.ListView); GlobalStatic.ListView = null; HideDisplayResults(); ClearWindow(); LDGraphicsWindow.CancelClose = true; LDGraphicsWindow.ExitOnClose = false; GlobalStatic.Dataview = LDControls.AddDataView((Desktop.Width - 10), (Desktop.Height - 100), "1=Field;2=Type;3=PK;4=AI;5=Unique;6=Not_Null;"); GraphicsWindow.DrawText(1, 4, "Name: "); Controls.Move(GlobalStatic.Dataview, 1, 30); _TextBox["Table_Name"] = Controls.AddTextBox(50, 1); Controls.SetTextBoxText(_TextBox["Table_Name"], "Table1"); _Buttons.AddOrReplace("Commit", Controls.AddButton("Commit", 250, 1)); _Buttons.AddOrReplace("Exit", Controls.AddButton("Exit", 350, 1)); LDControls.DataViewSetColumnComboBox(GlobalStatic.Dataview, 2, "1=Integer;2=Text;3=Blob;4=Real;5=Numeric;"); for (int i = 3; i <= 6; i++) { LDControls.DataViewSetColumnCheckBox(GlobalStatic.Dataview, i); } Controls.ButtonClicked -= Events.BC; Controls.ButtonClicked += CreateTableHandler; Stack.Exit(StackPointer); }
static void Main(string[] args) { GraphicsWindow.KeyDown += GraphicsWindow_KeyDown; Turtle.PenUp(); GraphicsWindow.BrushColor = "Green"; var eat = Shapes.AddRectangle(10, 10); int x, y, life = 3; int score = 0; Random rand = new Random(); x = rand.Next(0, GraphicsWindow.Width); y = rand.Next(0, GraphicsWindow.Height); Shapes.Move(eat, x, y); while (life > 0) { Turtle.Move(1); if (Turtle.X >= x && Turtle.X <= x + 10 && Turtle.Y >= y && Turtle.Y <= y + 10) { x = rand.Next(0, GraphicsWindow.Width); y = rand.Next(0, GraphicsWindow.Height); Shapes.Move(eat, x, y); Turtle.Speed++; score++; GraphicsWindow.DrawText(GraphicsWindow.Width - 100, GraphicsWindow.Height - 100, score); } else if (Turtle.X < 0 || Turtle.X > GraphicsWindow.Width || Turtle.Y < 0 || Turtle.Y > GraphicsWindow.Height) { Turtle.X = GraphicsWindow.Width / 2; Turtle.Y = GraphicsWindow.Height / 2; life--; } } }
static void Main(string[] args) { GraphicsWindow.KeyDown += GraphicsWindow_KeyDown; GraphicsWindow.MouseDown += GraphicsWindow_MouseDown; GraphicsWindow.MouseUp += GraphicsWindow_MouseUp; Turtle.PenUp(); GraphicsWindow.BrushColor = "Red"; var eat = Shapes.AddRectangle(10, 10); Shapes.Move(eat, 200, 200); int eatX = 200; int eatY = 200; Random rnd = new Random(); int count = 0; double step = 3; GraphicsWindow.DrawText(0, 0, "Очки: " + Convert.ToString(count)); while (true) { Turtle.Move(step); if ((Turtle.X <= eatX + 15) && (Turtle.X >= eatX - 5) && (Turtle.Y <= eatY + 15) && (Turtle.Y >= eatY - 5)) { GraphicsWindow.BrushColor = "White"; GraphicsWindow.DrawText(0, 0, "Очки: " + Convert.ToString(count)); eatX = rnd.Next(10, GraphicsWindow.Width); eatY = rnd.Next(10, GraphicsWindow.Height); Shapes.Move(eat, eatX, eatY); count++; Turtle.Speed = Turtle.Speed + 0.1; step = step + 0.1; GraphicsWindow.BrushColor = "Red"; GraphicsWindow.DrawText(0, 0, "Очки: " + Convert.ToString(count)); } if (Turtle.X < 0) { break; } else if (Turtle.X > GraphicsWindow.Width) { break; } else if (Turtle.Y < 0) { break; } else if (Turtle.Y > GraphicsWindow.Height) { break; } //GraphicsWindow.DrawText(10, 10, "Очки: " + Convert.ToString(count)); } GraphicsWindow.ShowMessage("Ваши очки: " + Convert.ToString(count), "Игра окончена!"); }
static void Main(string[] args) { GraphicsWindow.KeyDown += GraphicsWindow_KeyDown; GraphicsWindow.BrushColor = "Yellow"; Turtle.PenUp(); var eat = Shapes.AddRectangle(10, 10); int x1 = 200; int y1 = 200; int counter = 0; GraphicsWindow.BrushColor = "Red"; GraphicsWindow.DrawText(10, 10, "Очки: " + counter); //Создание объекта для генерации чисел Random rnd = new Random(); Shapes.Move(eat, x1, y1); while (true) { Turtle.Move(5); if ((Turtle.X <= x1 + 10) && (Turtle.X >= x1) && (Turtle.Y <= y1 + 10) && (Turtle.Y >= y1)) { GraphicsWindow.BrushColor = "White"; GraphicsWindow.DrawText(10, 10, "Очки: " + counter); counter++; GraphicsWindow.BrushColor = "Red"; GraphicsWindow.DrawText(10, 10, "Очки: " + counter); x1 = rnd.Next(10, GraphicsWindow.Width); y1 = rnd.Next(10, GraphicsWindow.Height); Shapes.Move(eat, x1, y1); Turtle.Speed = Turtle.Speed + 0.3; } if (Turtle.X > GraphicsWindow.Width) { Turtle.X = 0; } else if (Turtle.X < 0) { Turtle.X = GraphicsWindow.Width; } if (Turtle.Y < 0) { Turtle.Y = GraphicsWindow.Height; } else if (Turtle.Y > GraphicsWindow.Height) { Turtle.Y = 0; } } }
static void DisplayHelper() { int StackPointer = Stack.Add("UI.DisplayHelper"); string Default_Brush = GraphicsWindow.BrushColor; GraphicsWindow.BrushColor = "WHITE"; GraphicsWindow.FillRectangle(GlobalStatic.UIx - 5, 45, 320, 350); GraphicsWindow.BrushColor = Default_Brush; GraphicsWindow.DrawRectangle(GlobalStatic.UIx, 50, 310, 340); GraphicsWindow.FontSize = GlobalStatic.DefaultFontSize + 3; GraphicsWindow.DrawText(GlobalStatic.UIx + 100, 52, Language.Localization["Display Settings"]); GraphicsWindow.DrawText(GlobalStatic.UIx + 20, 78, Language.Localization["Sort by"]); GraphicsWindow.DrawText(GlobalStatic.UIx + 100, 150, Language.Localization["Search Settings"]); GraphicsWindow.DrawText(GlobalStatic.UIx + 20, 180, Language.Localization["Search in"]); GraphicsWindow.DrawText(GlobalStatic.UIx + 20, 210, Language.Localization["Search"] + ":"); GraphicsWindow.DrawText(GlobalStatic.UIx + 127, 290, Language.Localization["Functions"] + ":"); Stack.Exit(StackPointer); }
static void Main(string[] args) { GraphicsWindow.KeyDown += GraphicsWindow_KeyDown; Console.Title = "Догони куб 3 раза"; Turtle.PenUp(); Turtle.Speed = 4; // (food) - объект который нужно поймать 3 Раза. var food = Shapes.AddRectangle(10, 10); int x = 30; int y = 40; Shapes.Move(food, x, y); Random rnd = new Random(); // Синий куб ускорения. GraphicsWindow.BrushColor = "Blue"; var speed = Shapes.AddRectangle(40, 50); int x1 = 200; int y1 = 300; Shapes.Move(speed, x1, y1); GraphicsWindow.DrawText(200, 280, "Ускорься)"); while (true) { // | //если координаты Черепахи и food пересекаются--+-- , food исчезает , затем рандомно(rnd) появляется на карте. /* | * скорость черепахи снижатся на 1, при каждом касании food'а. */ if (Turtle.X >= x && Turtle.X <= x + 20 && Turtle.Y >= y && Turtle.Y <= y + 20) { x = rnd.Next(0, GraphicsWindow.Width); y = rnd.Next(0, GraphicsWindow.Height); Shapes.Move(food, x, y); Turtle.Speed--; GraphicsWindow.BrushColor = "Red"; GraphicsWindow.DrawText(200, 260, "Осталось 2 раза =)"); if (Turtle.X >= x && Turtle.X <= x + 20 && Turtle.Y >= y && Turtle.Y <= y + 20) { GraphicsWindow.BrushColor = "Red"; GraphicsWindow.DrawText(200, 260, "Осталось 2 раза =)"); } } // Синий куб ускорения. if (Turtle.X >= x1 && Turtle.X <= x1 + 35 && Turtle.Y >= y1 && Turtle.Y <= y1 + 35) { Turtle.Speed = 7; } Turtle.Move(10); } }
public void WriteGameOver() { GraphicsWindow.BrushColor = "DarkBlue"; GraphicsWindow.FontSize = 20; GraphicsWindow.DrawText((Field.Width / 2 - 4) * SIZE, (Field.Height / 2) * SIZE, "G A M E O V E R"); }
public static void Display() { int StackPointer = Stack.Add("UI.Settings.Display()"); ClearWindow(); GraphicsWindow.Title = Language.Localization["Settings"]; GraphicsWindow.CanResize = false; LDGraphicsWindow.CancelClose = true; LDGraphicsWindow.ExitOnClose = false; LDGraphicsWindow.Closing += Events.Closing; LDGraphicsWindow.ExitButtonMode(Language.Localization["Settings"], "Disabled"); GraphicsWindow.FontSize = GlobalStatic.DefaultFontSize + 8; GraphicsWindow.DrawText(10, 10, Language.Localization["Listview Width"]); _TextBox["Settings_Width"] = Controls.AddTextBox(200, 10); GraphicsWindow.DrawText(10, 50, Language.Localization["Listview Height"]); _TextBox["Settings_Height"] = Controls.AddTextBox(200, 50); GraphicsWindow.DrawText(10, 90, Language.Localization["Extensions"]); _TextBox["Settings_Extensions"] = Controls.AddTextBox(200, 90); GraphicsWindow.DrawText(10, 130, Language.Localization["Deliminator"]); _TextBox["Settings_Deliminator"] = Controls.AddTextBox(200, 130); GraphicsWindow.DrawText(10, 175, Language.Localization["Language"]); GlobalStatic.ComboBox["Language"] = LDControls.AddComboBox(Language.ISO_Text.ToPrimitiveArray(), 200, 120); Controls.Move(GlobalStatic.ComboBox["Language"], 200, 175); GraphicsWindow.DrawText(10, 280, Language.Localization["LOG CSV Path"]); _Buttons.AddOrReplace("Log_CSV", Controls.AddButton(Language.Localization["Browse"], 320, 280)); GraphicsWindow.DrawText(10, 330, Language.Localization["LOG DB PATH"]); _Buttons.AddOrReplace("Log_DB", Controls.AddButton(Language.Localization["Browse"], 320, 330)); GraphicsWindow.DrawText(10, 380, Language.Localization["Transaction DB Path"]); _Buttons.AddOrReplace("Transaction_DB", Controls.AddButton(Language.Localization["Browse"], 320, 380)); for (int i = 0; i < Language.ISO_LangCode.Count; i++) { if (Language.ISO_LangCode[i] == GlobalStatic.LanguageCode) { int Index = i + 1; LDControls.ComboBoxSelect(GlobalStatic.ComboBox["Language"], Index); } } _Buttons.AddOrReplace("Settings Save", Controls.AddButton(Language.Localization["Save and Close"], 50, 450)); _Buttons.AddOrReplace("Settings Close", Controls.AddButton(Language.Localization["Close wo saving"], 50, 500)); Controls.SetSize(_Buttons["Settings Save"], 280, 40); Controls.SetSize(_Buttons["Settings Close"], 280, 40); Controls.SetTextBoxText(_TextBox["Settings_Width"], GlobalStatic.Listview_Width); Controls.SetTextBoxText(_TextBox["Settings_Height"], GlobalStatic.Listview_Height); Controls.SetTextBoxText(_TextBox["Settings_Extensions"], GlobalStatic.Extensions); Controls.SetTextBoxText(_TextBox["Settings_Deliminator"], GlobalStatic.Deliminator); GraphicsWindow.FontSize = GlobalStatic.DefaultFontSize; LDControls.ComboBoxItemChanged -= Events.CB; Controls.ButtonClicked -= Events.BC; Controls.ButtonClicked += Handler; Stack.Exit(StackPointer); }
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); }