MainWindow.xaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <Window x:Class="SketchAssistantWPF.MainWindow"
  2. xmlns:local="clr-namespace:SketchAssistantWPF"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Title="Sketch Assistant" Height="612" Width="914" SizeChanged="Window_SizeChanged">
  7. <Grid>
  8. <Grid.ColumnDefinitions>
  9. <ColumnDefinition Width="auto"/>
  10. <ColumnDefinition Width="auto"/>
  11. <ColumnDefinition Width="170*"/>
  12. <ColumnDefinition Width="55*"/>
  13. <ColumnDefinition Width="225*"/>
  14. <ColumnDefinition Width="5"/>
  15. <ColumnDefinition Width="226*"/>
  16. <ColumnDefinition Width="225*"/>
  17. <ColumnDefinition Width="auto"/>
  18. <ColumnDefinition Width="auto"/>
  19. </Grid.ColumnDefinitions>
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto"/>
  22. <RowDefinition Height="*"/>
  23. <RowDefinition Height="auto"/>
  24. </Grid.RowDefinitions>
  25. <ToolBar x:Name="MenuToolbar" Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Background="LightGray">
  26. <Menu Background="LightGray">
  27. <MenuItem x:Name="LoadMenuButton" Header="Load">
  28. <MenuItem x:Name="ISADMenuButton" Header="Load Template (.isad)" Click="ISADMenuItem_Click"/>
  29. <MenuItem x:Name="SVGMenuButton" Header="Load Template (.svg)" Click="SVGMenuItem_Click"/>
  30. </MenuItem>
  31. <MenuItem x:Name="EditMenuButton" Header="Edit">
  32. <MenuItem x:Name="CanvasMenuButton" Header="New Canvas" Click="CanvasButton_Click"/>
  33. <MenuItem x:Name="UndoMenuButton" Header="Undo" Click="UndoButton_Click"/>
  34. <MenuItem x:Name="RedoMenuButton" Header="Redo" Click="RedoButton_Click"/>
  35. <MenuItem x:Name="DebugMode" Header="Debug Input">
  36. <MenuItem x:Name="DebugOne" Header="Debug 1" Click="DebugOne_Click"/>
  37. <MenuItem x:Name="DebugTwo" Header="Debug 2" Click="DebugTwo_Click"/>
  38. <MenuItem x:Name="DebugThree" Header="Debug 3" Click="DebugThree_Click"/>
  39. <MenuItem x:Name="DebugFour" Header="Debug 4" Click="DebugFour_Click"/>
  40. </MenuItem>
  41. </MenuItem>
  42. </Menu>
  43. </ToolBar>
  44. <!-- All Icons in the Toolbar taken from openclipart.org -->
  45. <ToolBar x:Name="DrawingToolBar" Grid.Column="6" Grid.Row="0" Grid.ColumnSpan="2" Background="LightGray">
  46. <Button x:Name="CanvasButton" ToolTip="Create a new Canvas" Click="CanvasButton_Click">
  47. <Rectangle Width="30" Height="30">
  48. <Rectangle.Fill>
  49. <DrawingBrush>
  50. <DrawingBrush.Drawing>
  51. <DrawingGroup ClipGeometry="M0,0 V60 H60 V0 H0 Z">
  52. <DrawingGroup Transform="1.0513,0,0,1.0513,-1.5376,-1.5376">
  53. <GeometryDrawing Geometry="F1 M60,60z M0,0z M11.75,54.375L11.75,5.625 39.438,5.625 48.25,14.438 48.25,54.375 11.75,54.375z">
  54. <GeometryDrawing.Pen>
  55. <Pen Brush="#FFFFFFFF" Thickness="7.1343" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  56. </GeometryDrawing.Pen>
  57. </GeometryDrawing>
  58. <GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M60,60z M0,0z M11.75,54.375L11.75,5.625 39.438,5.625 48.25,14.438 48.25,54.375 11.75,54.375z">
  59. <GeometryDrawing.Pen>
  60. <Pen Brush="#FF000000" Thickness="2.3781" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  61. </GeometryDrawing.Pen>
  62. </GeometryDrawing>
  63. <GeometryDrawing Brush="#FF000000" Geometry="F1 M60,60z M0,0z M39.437,14.438L39.437,5.625 48.25,14.438 39.437,14.438z">
  64. <GeometryDrawing.Pen>
  65. <Pen Brush="#FF000000" Thickness="2.3781" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  66. </GeometryDrawing.Pen>
  67. </GeometryDrawing>
  68. </DrawingGroup>
  69. </DrawingGroup>
  70. </DrawingBrush.Drawing>
  71. </DrawingBrush>
  72. </Rectangle.Fill>
  73. </Rectangle>
  74. </Button>
  75. <ToggleButton x:Name="DrawButton" ToolTip="Enter Drawing Mode" Click="DrawButton_Click">
  76. <Rectangle Width="30" Height="30">
  77. <Rectangle.Fill>
  78. <DrawingBrush>
  79. <DrawingBrush.Drawing>
  80. <DrawingGroup ClipGeometry="M0,0 V100 H100 V0 H0 Z">
  81. <GeometryDrawing Brush="#FF000000" Geometry="F1 M100,100z M0,0z M69.172,11.265C68.981,11.073,68.67,11.073,68.477,11.265L11.639,68.029C11.447,68.22,11.447,68.53,11.639,68.721L30.846,87.905C30.942,88 31.068,88.048 31.194,88.048 31.319,88.048 31.445,88 31.541,87.905L88.38,31.14C88.473,31.048 88.525,30.924 88.525,30.793 88.525,30.662 88.473,30.538 88.38,30.446L69.172,11.265z" />
  82. <GeometryDrawing Brush="#FF000000" Geometry="F1 M100,100z M0,0z M96.846,9.12L90.527,2.809C88.713,0.997999999999999 86.301,-8.88178419700125E-16 83.735,-8.88178419700125E-16 81.171,-8.88178419700125E-16 78.758,0.997999999999999 76.945,2.809L70.626,9.12C70.533,9.212 70.481,9.336 70.481,9.467 70.481,9.597 70.533,9.721 70.626,9.813L89.833,28.995C89.925,29.087 90.051,29.139 90.181,29.139 90.312,29.139 90.436,29.087 90.527,28.995L96.846,22.684C98.66,20.872 99.659,18.464 99.659,15.901 99.659,13.34 98.66,10.932 96.846,9.12z" />
  83. <GeometryDrawing Brush="#FF000000" Geometry="F1 M100,100z M0,0z M10.358,69.967C10.236,69.846 10.062,69.795 9.894,69.838 9.727,69.878 9.594,70.003 9.543,70.168L0.363,99.363C0.308,99.541 0.357,99.732 0.49,99.861 0.584,99.952 0.707,100 0.832,100 0.886,100 0.942,99.989 0.996,99.971L29.383,89.959C29.542,89.903 29.661,89.771 29.698,89.605 29.735,89.441 29.686,89.268 29.566,89.15L10.358,69.967z" />
  84. </DrawingGroup>
  85. </DrawingBrush.Drawing>
  86. </DrawingBrush>
  87. </Rectangle.Fill>
  88. </Rectangle>
  89. </ToggleButton>
  90. <ToggleButton x:Name="DeleteButton" ToolTip="Enter Deletion Mode" Click="DeleteButton_Click">
  91. <Rectangle Width="30" Height="30">
  92. <Rectangle.Fill>
  93. <DrawingBrush>
  94. <DrawingBrush.Drawing>
  95. <DrawingGroup ClipGeometry="M0,0 V60 H60 V0 H0 Z">
  96. <DrawingGroup>
  97. <GeometryDrawing Geometry="F1 M60,60z M0,0z M41.312,11.031L6.438,32.5C5.407,33.151,4.6875,34.249,4.6875,35.562L4.6875,45.281C4.6875,47.32,6.3367,48.969,8.375,48.969L24.656,48.969C25.444,48.969,26.121,48.669,26.719,48.25L54.312,26.719 55.312,11.094 41.312,11.031z">
  98. <GeometryDrawing.Pen>
  99. <Pen Brush="#FFFFFFFF" Thickness="8.125" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  100. </GeometryDrawing.Pen>
  101. </GeometryDrawing>
  102. <DrawingGroup Transform="0.99664,0,0,0.99664,-0.3563,-0.39594">
  103. <GeometryDrawing Brush="#FF000000" Geometry="F0 M60,60z M0,0z M27.173,48.89L54.852,27.221 55.857,11.533 27.522,33.19 27.173,48.89z">
  104. <GeometryDrawing.Pen>
  105. <Pen Brush="#FF000000" Thickness="3.1356" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  106. </GeometryDrawing.Pen>
  107. </GeometryDrawing>
  108. <GeometryDrawing Brush="#FFFFFFFF" Geometry="F0 M60,60z M0,0z M6.6373,32.995L41.8073,11.464 55.8573,11.533 27.5223,33.19 6.63729999999999,32.995z">
  109. <GeometryDrawing.Pen>
  110. <Pen Brush="#FF000000" Thickness="3.1356" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  111. </GeometryDrawing.Pen>
  112. </GeometryDrawing>
  113. <GeometryDrawing>
  114. <GeometryDrawing.Brush>
  115. <SolidColorBrush Color="#FFFFFFFF" Opacity="1" Transform="1.8458,0,0,1.8458,-121.06,-6.2579" />
  116. </GeometryDrawing.Brush>
  117. <GeometryDrawing.Pen>
  118. <Pen Brush="#FF000000" Thickness="1.6987" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Round" />
  119. </GeometryDrawing.Pen>
  120. <GeometryDrawing.Geometry>
  121. <PathGeometry FillRule="EvenOdd" Transform="1.8458,0,0,1.8458,-121.06,-6.2579" Figures="M60,60z M0,0z M70.328,20.937C69.22,20.937,68.328,21.829,68.328,22.937L68.328,28.226C68.328,29.334,69.22,30.226,70.328,30.226L79.18,30.226C80.288,30.226,81.18,29.334,81.18,28.226L81.18,22.937C81.18,21.829,80.288,20.937,79.18,20.937L70.328,20.937z" />
  122. </GeometryDrawing.Geometry>
  123. </GeometryDrawing>
  124. </DrawingGroup>
  125. </DrawingGroup>
  126. </DrawingGroup>
  127. </DrawingBrush.Drawing>
  128. </DrawingBrush>
  129. </Rectangle.Fill>
  130. </Rectangle>
  131. </ToggleButton>
  132. <Button x:Name="UndoButton" ToolTip="Undo the last action" Click="UndoButton_Click">
  133. <Rectangle Width="30" Height="30">
  134. <Rectangle.Fill>
  135. <DrawingBrush>
  136. <DrawingBrush.Drawing>
  137. <DrawingGroup ClipGeometry="M0,0 V60 H60 V0 H0 Z">
  138. <GeometryDrawing Geometry="F1 M60,60z M0,0z M25.063,4.6882L9.445,20.1632 25.063,35.6012 25.063,25.9792C25.442,25.9292 25.778,25.7632 26.176,25.7632 33.176,25.7632 38.85,31.4742 38.85,38.4732 38.85,41.7872 37.521,44.7602 35.439,47.0182L43.733,55.3122C47.934,50.9322 50.555,45.0212 50.555,38.4732 50.555,25.0092 39.64,14.0592 26.176,14.0592 25.797,14.0592 25.437,14.1452 25.063,14.1672L25.063,4.68840000000001z">
  139. <GeometryDrawing.Pen>
  140. <Pen Brush="#FFFFFFFF" Thickness="8.125" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  141. </GeometryDrawing.Pen>
  142. </GeometryDrawing>
  143. <GeometryDrawing Brush="#FF000000" Geometry="F0 M60,60z M0,0z M25.063,4.6882L9.445,20.1632 25.063,35.6012 25.063,25.9792C25.442,25.9292 25.778,25.7632 26.176,25.7632 33.176,25.7632 38.85,31.4742 38.85,38.4732 38.85,41.7872 37.521,44.7602 35.439,47.0182L43.733,55.3122C47.934,50.9322 50.555,45.0212 50.555,38.4732 50.555,25.0092 39.64,14.0592 26.176,14.0592 25.797,14.0592 25.437,14.1452 25.063,14.1672L25.063,4.68840000000001z">
  144. <GeometryDrawing.Pen>
  145. <Pen Brush="#FF000000" Thickness="3.125" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  146. </GeometryDrawing.Pen>
  147. </GeometryDrawing>
  148. </DrawingGroup>
  149. </DrawingBrush.Drawing>
  150. </DrawingBrush>
  151. </Rectangle.Fill>
  152. </Rectangle>
  153. </Button>
  154. <Button x:Name="RedoButton" ToolTip="Redo the last undone action" Click="RedoButton_Click">
  155. <Rectangle Width="30" Height="30">
  156. <Rectangle.Fill>
  157. <DrawingBrush>
  158. <DrawingBrush.Drawing>
  159. <DrawingGroup ClipGeometry="M0,0 V60 H60 V0 H0 Z">
  160. <DrawingGroup Transform="-1,0,0,1,60,0">
  161. <GeometryDrawing Geometry="F1 M60,60z M0,0z M25.063,4.6882L9.445,20.1632 25.063,35.6012 25.063,25.9792C25.442,25.9292 25.778,25.7632 26.176,25.7632 33.176,25.7632 38.85,31.4742 38.85,38.4732 38.85,41.7872 37.521,44.7602 35.439,47.0182L43.733,55.3122C47.934,50.9322 50.555,45.0212 50.555,38.4732 50.555,25.0092 39.64,14.0592 26.176,14.0592 25.797,14.0592 25.437,14.1452 25.063,14.1672L25.063,4.68840000000001z">
  162. <GeometryDrawing.Pen>
  163. <Pen Brush="#FFFFFFFF" Thickness="8.125" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  164. </GeometryDrawing.Pen>
  165. </GeometryDrawing>
  166. <GeometryDrawing Brush="#FF000000" Geometry="F0 M60,60z M0,0z M25.063,4.6882L9.445,20.1632 25.063,35.6012 25.063,25.9792C25.442,25.9292 25.778,25.7632 26.176,25.7632 33.176,25.7632 38.85,31.4742 38.85,38.4732 38.85,41.7872 37.521,44.7602 35.439,47.0182L43.733,55.3122C47.934,50.9322 50.555,45.0212 50.555,38.4732 50.555,25.0092 39.64,14.0592 26.176,14.0592 25.797,14.0592 25.437,14.1452 25.063,14.1672L25.063,4.68840000000001z">
  167. <GeometryDrawing.Pen>
  168. <Pen Brush="#FF000000" Thickness="3.125" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
  169. </GeometryDrawing.Pen>
  170. </GeometryDrawing>
  171. </DrawingGroup>
  172. </DrawingGroup>
  173. </DrawingBrush.Drawing>
  174. </DrawingBrush>
  175. </Rectangle.Fill>
  176. </Rectangle>
  177. </Button>
  178. <ToggleButton x:Name="DrawWithOptiButton" ToolTip="Enter Drawing Mode (OptiTrack)" Click="DrawWithOptiButton_Click">
  179. <Rectangle Width="30" Height="30">
  180. <Rectangle.Fill>
  181. <DrawingBrush>
  182. <DrawingBrush.Drawing>
  183. <DrawingGroup Transform="1,0,0,1,-30.972436,-202.26931">
  184. <GeometryDrawing Brush="#FF000000">
  185. <GeometryDrawing.Pen>
  186. <Pen Brush="#FF000000" Thickness="1.01090431" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
  187. </GeometryDrawing.Pen>
  188. <GeometryDrawing.Geometry>
  189. <RectangleGeometry RadiusX="11.1847" RadiusY="11.1847" Rect="92.1615,202.7748,95.2826,53.7929" />
  190. </GeometryDrawing.Geometry>
  191. </GeometryDrawing>
  192. <GeometryDrawing Brush="#FF000000">
  193. <GeometryDrawing.Pen>
  194. <Pen Brush="#FF000000" Thickness="2.57952762" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
  195. </GeometryDrawing.Pen>
  196. <GeometryDrawing.Geometry>
  197. <RectangleGeometry RadiusX="32.2622" RadiusY="32.2622" Rect="32.2622,219.6902,215.0813,155.1658" />
  198. </GeometryDrawing.Geometry>
  199. </GeometryDrawing>
  200. <GeometryDrawing>
  201. <GeometryDrawing.Pen>
  202. <Pen Brush="#FFFFFFFF" Thickness="10.62992096" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
  203. </GeometryDrawing.Pen>
  204. <GeometryDrawing.Geometry>
  205. <EllipseGeometry RadiusX="48.8035" RadiusY="48.8035" Center="139.8029,297.2731" />
  206. </GeometryDrawing.Geometry>
  207. </GeometryDrawing>
  208. <GeometryDrawing Brush="#FFFFFFFF">
  209. <GeometryDrawing.Geometry>
  210. <EllipseGeometry RadiusX="11.2372" RadiusY="11.2372" Center="66.1719,256.4501" />
  211. </GeometryDrawing.Geometry>
  212. </GeometryDrawing>
  213. </DrawingGroup>
  214. </DrawingBrush.Drawing>
  215. </DrawingBrush>
  216. </Rectangle.Fill>
  217. </Rectangle>
  218. </ToggleButton>
  219. </ToolBar>
  220. <local:CustomCanvas x:Name="LeftCanvas" Background="SlateGray" Grid.Column="2" Grid.Row="1" Height="auto" Grid.ColumnSpan="3"/>
  221. <Canvas Name="CanvasSeperator" Grid.Column="5" Grid.Row="1" Background="LightGray" />
  222. <InkCanvas x:Name="RightCanvas" Background="SlateGray" Grid.Column="6" Grid.Row="1" Height="auto" PreviewMouseDown="RightCanvas_MouseDown" MouseUp="RightCanvas_MouseUp" MouseMove="RightCanvas_MouseMove" Grid.ColumnSpan="2" StrokeCollected="RightCanvas_StrokeCollection" EditingMode="None"/>
  223. <DockPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="8">
  224. <StatusBar DockPanel.Dock="Bottom" Name="StatusBar" Background="LightGray">
  225. <TextBox Name="LoadStatusBox" Text="nothing loaded" Background="LightGray"/>
  226. <Separator/>
  227. <TextBox Name="LastActionBox" Text="none" Background="LightGray"/>
  228. <Separator/>
  229. <TextBox Name="OptiTrackBox" Text="none" Background="LightGray"/>
  230. </StatusBar>
  231. </DockPanel>
  232. </Grid>
  233. </Window>