Skip to content

Commit

Permalink
clean up desktop samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ctacke committed Apr 25, 2024
1 parent f646794 commit dd25a27
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 61 deletions.
7 changes: 6 additions & 1 deletion Source/Meadow.Desktop/HMI_Views/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public override Task Run()

private void ExecutePlatformDisplayRunner()
{
(Device.Display as SilkDisplay).Run();
if (Device.Display is SilkDisplay sd)
{
sd.Run();
}
MeadowOS.TerminateRun();
System.Environment.Exit(0);
}
}
5 changes: 0 additions & 5 deletions Source/Meadow.Desktop/HMI_Views/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ public class Program
{
public static async Task Main(string[] args)
{
#if WINDOWS
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
ApplicationConfiguration.Initialize();
#endif
await MeadowOS.Start(args);
}
}
17 changes: 6 additions & 11 deletions Source/Meadow.Desktop/PixelDisplay/MeadowAppDesktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,16 @@ public override Task Run()

public override Task OnShutdown()
{
#if WINDOWS
System.Windows.Forms.Application.Exit();
#endif
return Task.CompletedTask;
}

private void ExecutePlatformDisplayRunner()
{
(Device.Display as SilkDisplay).Run();
#if WINDOWS
System.Windows.Forms.Application.Run(Device.Display as System.Windows.Forms.Form);
#endif
// if (Device.Display is GtkDisplay gtk)
// {
// gtk.Run();
// }
if (Device.Display is SilkDisplay sd)
{
sd.Run();
}
MeadowOS.TerminateRun();
System.Environment.Exit(0);
}
}
5 changes: 0 additions & 5 deletions Source/Meadow.Desktop/PixelDisplay/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ public class Program
{
public static async Task Main(string[] args)
{
#if WINDOWS
// System.Windows.Forms.Application.EnableVisualStyles();
// System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
// ApplicationConfiguration.Initialize();
#endif
await MeadowOS.Start(args);
}
}
2 changes: 2 additions & 0 deletions Source/Meadow.Desktop/Touchscreen_Demo/CircleDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public CircleDemo(DisplayScreen display, ITouchScreen touchscreen)
{
_touchscreen = touchscreen;
_display = display;
_display.BackgroundColor = Color.White;
}

public void Start()
Expand Down Expand Up @@ -60,6 +61,7 @@ private void Touchscreen_TouchUp(ITouchScreen sender, TouchPoint point)
{
_inflateTimer?.Change(-1, -1);
_currentCircle = null;
_display.Invalidate();
}

private Color GetRandomColor()
Expand Down
32 changes: 0 additions & 32 deletions Source/Meadow.Desktop/Touchscreen_Demo/DisplayController.cs

This file was deleted.

9 changes: 7 additions & 2 deletions Source/Meadow.Desktop/Touchscreen_Demo/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public override Task Initialize()
var touchscreen = Device.Display as ITouchScreen;
var display = new DisplayScreen(
Device.Display,
touchScreen: touchscreen);
touchScreen: touchscreen);

_demo = new CircleDemo(display, touchscreen);

Expand All @@ -34,6 +34,11 @@ public override Task Run()

private void ExecutePlatformDisplayRunner()
{
(Device.Display as SilkDisplay).Run();
if (Device.Display is SilkDisplay sd)
{
sd.Run();
}
MeadowOS.TerminateRun();
System.Environment.Exit(0);
}
}
5 changes: 0 additions & 5 deletions Source/Meadow.Desktop/Touchscreen_Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ public class Program
{
public static async Task Main(string[] args)
{
#if WINDOWS
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
ApplicationConfiguration.Initialize();
#endif
await MeadowOS.Start(args);
}
}

0 comments on commit dd25a27

Please sign in to comment.