diff --git a/TabletDriverGUI/MainWindow.Areas.cs b/TabletDriverGUI/MainWindow.Areas.cs
index a660d7d..9904e28 100644
--- a/TabletDriverGUI/MainWindow.Areas.cs
+++ b/TabletDriverGUI/MainWindow.Areas.cs
@@ -1514,7 +1514,29 @@ private void CanvasArea_ContextMenuOpening(object sender, ContextMenuEventArgs e
}
-
+ private void ConvertMouse_Click(object sender, RoutedEventArgs e)
+ {
+ var wcm = new WindowConvertMouse();
+ wcm.ShowDialog();
+ if (!wcm.DialogResult.HasValue || !wcm.DialogResult.Value) return;
+
+ const double inchesToMm = 25.4;
+ var width = config.DesktopSize.Width / wcm.Dpi * inchesToMm;
+ var height = config.DesktopSize.Height / wcm.Dpi * inchesToMm;
+ var x = config.TabletFullArea.Width / 2;
+ var y = config.TabletFullArea.Height / 2;
+
+ textTabletAreaWidth.Text = width.ToString();
+ textTabletAreaHeight.Text = height.ToString();
+ textTabletAreaX.Text = x.ToString();
+ textTabletAreaY.Text = y.ToString();
+ config.SelectedTabletArea.Width = width;
+ config.SelectedTabletArea.Height = height;
+ config.SelectedTabletArea.X = x;
+ config.SelectedTabletArea.Y = y;
+
+ UpdateSettingsToConfiguration();
+ }
#region Wacom / Draw area
diff --git a/TabletDriverGUI/MainWindow.xaml b/TabletDriverGUI/MainWindow.xaml
index f20350b..20a4af3 100644
--- a/TabletDriverGUI/MainWindow.xaml
+++ b/TabletDriverGUI/MainWindow.xaml
@@ -411,7 +411,17 @@
-
+
+
+
+ WindowConvertMouse.xaml
+
WindowTabletViewSettings.xaml
@@ -106,6 +109,10 @@
WindowAreaEditor.xaml
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/TabletDriverGUI/WindowConvertMouse.xaml b/TabletDriverGUI/WindowConvertMouse.xaml
new file mode 100644
index 0000000..4d6fa62
--- /dev/null
+++ b/TabletDriverGUI/WindowConvertMouse.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TabletDriverGUI/WindowConvertMouse.xaml.cs b/TabletDriverGUI/WindowConvertMouse.xaml.cs
new file mode 100644
index 0000000..fbb8657
--- /dev/null
+++ b/TabletDriverGUI/WindowConvertMouse.xaml.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace TabletDriverGUI
+{
+ ///
+ /// Interaction logic for WindowConvertMouse.xaml
+ ///
+ public partial class WindowConvertMouse : Window
+ {
+ public double Dpi;
+
+ public WindowConvertMouse()
+ {
+ InitializeComponent();
+ }
+
+ private void Window_Activated(object sender, EventArgs e)
+ {
+ FocusManager.SetFocusedElement(this, DpiText);
+ }
+
+ private void Ok_Click(object sender, RoutedEventArgs e)
+ {
+ bool valid = double.TryParse(DpiText.Text, out Dpi);
+ if (valid)
+ {
+ DialogResult = true;
+ Close();
+ }
+ else
+ {
+ MessageBox.Show("The entered value is not a number.");
+ }
+ }
+
+ private void Cancel_Click(object sender, RoutedEventArgs e)
+ {
+ DialogResult = false;
+ Close();
+ }
+ }
+}