From fa53cf658d60afbcfb0449eb525da5a847075aa9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 25 Mar 2018 16:26:36 +0300 Subject: Working on logging module. --- .../Tango.MachineStudio.UI/MainWindow.xaml | 2 +- .../Tango.MachineStudio.UI/MainWindow.xaml.cs | 30 ++++++++++++++++++++++ .../Tango.MachineStudio.UI.csproj | 4 +++ 3 files changed, 35 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml index 6b2bbaaec..6d8d86a8c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml @@ -15,7 +15,7 @@ - + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs index c4d9b4a28..48de019e8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/MainWindow.xaml.cs @@ -48,6 +48,36 @@ namespace Tango.MachineStudio.UI } this.Loaded += MainWindow_Loaded; + this.SizeChanged += MainWindow_SizeChanged; + } + + private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) + { + var screen = System.Windows.Forms.Screen.FromHandle(new WindowInteropHelper(this).Handle); + + double scr_width = screen.Bounds.Width; + double scr_height = screen.Bounds.Height; + + double ratio = scr_width / scr_height; + + List ratios = new List() { 16d / 9d, 16d / 10d, 4d / 3d }; + ratio = ratios.Closest(ratio); + + switch (ratio) + { + case 16d / 9d: + grid.Height = 1100; + break; + case 16d / 10d: + grid.Height = 1145; + break; + case 4d / 3d: + grid.Height = 1280; + break; + default: + grid.Height = 1145; + break; + } } private void MainWindow_Loaded(object sender, RoutedEventArgs e) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index 0a92f2c91..07b1f44fe 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -367,6 +367,10 @@ {69db0564-268c-4b3c-b5d6-a3cdc7d14eae} Tango.MachineStudio.HardwareDesigner + + {1674f726-0e66-414f-b9fd-c6f20d7f07c7} + Tango.MachineStudio.Logging + {d0ce8122-077d-42a2-9490-028ae4769b52} Tango.MachineStudio.MachineDesigner -- cgit v1.3.1