public GvShell(ref DisplayDriver43 displayTE35, ref IDriveProvider sdCard, ref GHIElectronics.TinyCLR.Devices.UsbHost.UsbHostController usbHost) { this.displayTE35 = displayTE35; this.usbHost = usbHost; //this.usbClientEDP = usbClientEdp; this.sdCard = sdCard; Screen = displayTE35.Screen; //new Bitmap(ScreenWidth, ScreenHeight); ClearScreen(); MaxLine = ScreenHeight / 20; CurrentLine = 0; CurrentFont = Resources.GetFont(Resources.FontResources.NinaB); CurrentPath = "\\";// "\\SD\\"; DataLines = new ArrayList(); for (int i = 0; i < MaxLine; i++) { DataLines.Add(string.Empty); } TypedCommand = string.Empty; if (basic == null) { if (basic == null) { basic = new SBASIC(); basic.Print += Basic_Print; basic.ClearScreen += Basic_ClearScreen; } } }
public override void Init(params string[] Param) { LinesOfCode = new ArrayList(); LineCounter = 0; bmp = new Bitmap(WidthScreen, HeightScreen); MainWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ExecuteForm)); imgCode = (GHI.Glide.UI.Image)MainWindow.GetChildByName("imgCode"); btnBack = (GHI.Glide.UI.Button)MainWindow.GetChildByName("btnBack"); Glide.MainWindow = MainWindow; myFont = Resources.GetFont(Resources.FontResources.NinaB); SBASIC s = new SBASIC(); Thread.Sleep(500); s.Print += S_Print; s.ClearScreen += S_ClearScreen; btnBack.PressEvent += (sender) => { s.Print -= S_Print; s.ClearScreen -= S_ClearScreen; CallFormRequestEvent(ScreenTypes.Editor); }; //execute the code s.Run(Param[0]); //MainWindow.Invalidate(); }
public GvShell(ref SDCard sdCard, ref USBHost usbHost, ref DisplayTE35 displayT35, ref USBClientEDP usbClientEdp, ref WiFiRS21 wifiRS21) { //initial / default params ForeGround = GT.Color.White; BackGround = GT.Color.Black; ScreenWidth = 320; ScreenHeight = 240; this.wifiRS21 = wifiRS21; this.displayTE35 = displayT35; this.usbHost = usbHost; this.usbClientEDP = usbClientEdp; this.sdCard = sdCard; Screen = new Bitmap(ScreenWidth, ScreenHeight); ClearScreen(); MaxLine = ScreenHeight / 20; CurrentLine = 0; CurrentFont = Resources.GetFont(Resources.FontResources.NinaB); CurrentPath = "\\SD\\"; DataLines = new ArrayList(); for (int i = 0; i < MaxLine; i++) { DataLines.Add(string.Empty); } TypedCommand = string.Empty; if (basic == null) { if (basic == null) { basic = new SBASIC(); basic.Print += Basic_Print; basic.ClearScreen += Basic_ClearScreen; } } //setup network wifiRS21.DebugPrintEnabled = true; NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged; NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged; //setup network wifiRS21.NetworkInterface.Open(); wifiRS21.NetworkInterface.EnableDhcp(); wifiRS21.NetworkInterface.EnableDynamicDns(); }
private void S_Print(SBASIC sender, string value) { bmp.Clear(); //clean screen bmp.DrawRectangle(Color.Black, 0, 0, 0, WidthScreen, HeightScreen, 0, 0, Color.Black, 0, 0, Color.Black, 0, 0, 100); if (LineCounter > 7) { //reset LineCounter = 0; LinesOfCode.Clear(); } LinesOfCode.Add(value); for (int i = 0; i <= LineCounter; i++) { bmp.DrawText(LinesOfCode[i].ToString(), myFont, GT.Color.Green, 5, 5 + (i * LineSpacing)); } bmp.Flush(); imgCode.Bitmap = bmp; imgCode.Invalidate(); LineCounter++; Thread.Sleep(200); }
private void Basic_Print(SBASIC sender, string value) { PrintLine(value); Screen.Flush(); //CallPrintEvent(Screen); }
private void Basic_ClearScreen(SBASIC sender) { ClearScreen(); }
private void S_ClearScreen(SBASIC sender) { bmp.DrawRectangle(Color.Black, 0, 0, 0, WidthScreen, HeightScreen, 0, 0, Color.Black, 0, 0, Color.Black, 0, 0, 100); imgCode.Bitmap = bmp; imgCode.Invalidate(); }