mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-18 10:37:41 -05:00
Edit > Cut (Ctrl+X) and Copy (Ctrl+C) start the shared place tool with the selected parts, as the WinForms Clone Parts action: the copy follows the pointer, drawn selected and unnumbered, and a left click, Enter or F1 places it as one Add Part/Add Parts step. Shift settles it toward the plate's corner on geometry and Ctrl alone on bounding boxes, in the order saved in Tools > Options > Clone push placement, read at each placement. Arrow keys, X/Y, a middle click and Shift+wheel move or turn the copy without an undo step; a middle double-click turns it rather than fitting the view. Delete removes the copied parts. Escape returns to Select. Cut also removes the parts as one Cut step. As in WinForms, the part under the cursor is highlighted only in Select, nothing is copied or placed while Auto Nest runs on the nest (a middle double-click then fits the view), and Undo or Redo ends the tool, which holds the old nest's parts, so Escape cannot bring it back. An ended tool's copies leave the drawing cache. The view keeps the keyboard after a menu click so Enter and the arrows reach the tool.
106 lines
5.9 KiB
XML
106 lines
5.9 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
x:Class="OpenNest.Avalonia.MainWindow"
|
|
Title="OpenNest (Avalonia prototype)"
|
|
Width="1400" Height="860">
|
|
<DockPanel>
|
|
<Menu DockPanel.Dock="Top">
|
|
<MenuItem Header="_File">
|
|
<MenuItem x:Name="NewMenuItem" Header="_New" InputGesture="Ctrl+N" Click="OnNew" />
|
|
<MenuItem x:Name="OpenMenuItem" Header="_Open..." InputGesture="Ctrl+O" Click="OnOpen" />
|
|
<Separator />
|
|
<MenuItem x:Name="SaveMenuItem" Header="_Save" InputGesture="Ctrl+S" Click="OnSave" />
|
|
<MenuItem x:Name="SaveAsMenuItem" Header="Save _As..." Click="OnSaveAs" />
|
|
<MenuItem x:Name="ExportNestMenuItem" Header="Save _Copy as .nest File..." Click="OnExportNest" />
|
|
<Separator />
|
|
<MenuItem x:Name="ExportPlateMenuItem" Header="_Export Plate..." Click="OnExportPlate" />
|
|
<MenuItem x:Name="ExportAllPlatesMenuItem" Header="Export All _Plates..." Click="OnExportAllPlates" />
|
|
<Separator />
|
|
<MenuItem x:Name="ViewNestReportMenuItem" Header="Nest _Report..." Click="OnViewNestReport" />
|
|
<Separator />
|
|
<MenuItem x:Name="CloseMenuItem" Header="_Close" Click="OnCloseNest" />
|
|
<MenuItem x:Name="CloseAllMenuItem" Header="Close A_ll" Click="OnCloseAll" />
|
|
<Separator />
|
|
<MenuItem Header="E_xit" InputGesture="Ctrl+Q" Click="OnExit" />
|
|
</MenuItem>
|
|
<MenuItem x:Name="EditMenu" Header="_Edit" SubmenuOpened="OnEditMenuOpened">
|
|
<!-- Ctrl+Z, Ctrl+Y and Ctrl+Shift+Z are routed in MainWindow.Undo.cs, so text boxes keep theirs. -->
|
|
<MenuItem x:Name="UndoMenuItem" Header="_Undo" InputGesture="Ctrl+Z" Click="OnUndo" />
|
|
<MenuItem x:Name="RedoMenuItem" Header="_Redo" InputGesture="Ctrl+Y" Click="OnRedo" />
|
|
<Separator />
|
|
<!-- Into the place tool, not the system clipboard, as WinForms. -->
|
|
<MenuItem x:Name="CutMenuItem" Header="Cu_t" InputGesture="Ctrl+X" Click="OnCut" />
|
|
<MenuItem x:Name="CopyMenuItem" Header="_Copy" InputGesture="Ctrl+C" Click="OnCopy" />
|
|
<Separator />
|
|
<MenuItem x:Name="SelectAllMenuItem" Header="Select _All" InputGesture="Ctrl+A" Click="OnSelectAll" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Nest">
|
|
<MenuItem x:Name="AutoNestMenuItem" Header="_Auto Nest" Click="OnAutoNest" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Plate">
|
|
<MenuItem x:Name="ViewInCadMenuItem" Header="View in _CAD" Click="OnViewInCad" />
|
|
</MenuItem>
|
|
<MenuItem Header="_View">
|
|
<MenuItem x:Name="DrawRapidsMenuItem" Header="Draw _Rapids" ToggleType="CheckBox"
|
|
Click="OnToggleDrawRapids" />
|
|
<MenuItem x:Name="DrawPiercePointsMenuItem" Header="Draw _Pierce Points" ToggleType="CheckBox"
|
|
Click="OnToggleDrawPiercePoints" />
|
|
<MenuItem x:Name="DrawBoundsMenuItem" Header="Draw _Bounds" ToggleType="CheckBox"
|
|
Click="OnToggleDrawBounds" />
|
|
<MenuItem x:Name="DrawOffsetMenuItem" Header="Draw _Offset" ToggleType="CheckBox"
|
|
Click="OnToggleDrawOffset" />
|
|
<MenuItem x:Name="DrawCutDirectionMenuItem" Header="Draw _Cut Direction" ToggleType="CheckBox"
|
|
Click="OnToggleDrawCutDirection" />
|
|
<MenuItem x:Name="DrawSupportMenuItem" Header="Draw _Support" ToggleType="CheckBox"
|
|
Click="OnToggleDrawSupport" />
|
|
<Separator />
|
|
<MenuItem Header="Zoom to _Fit" InputGesture="F" Click="OnFit" />
|
|
<MenuItem Header="_Previous Plate" InputGesture="PageUp" Click="OnPreviousPlate" />
|
|
<MenuItem Header="_Next Plate" InputGesture="PageDown" Click="OnNextPlate" />
|
|
<Separator />
|
|
<MenuItem Header="Next N_est" InputGesture="Ctrl+Tab" Click="OnNextNest" />
|
|
<MenuItem Header="Previous Ne_st" InputGesture="Ctrl+Shift+Tab" Click="OnPreviousNest" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Tools">
|
|
<MenuItem x:Name="OptionsMenuItem" Header="_Options..." Click="OnOptions" />
|
|
<Separator />
|
|
<MenuItem x:Name="SetOffsetIncrementMenuItem" Header="Set Offset Increment" InputGesture="F5" Click="OnSetOffsetIncrement" />
|
|
<MenuItem x:Name="SetRotationIncrementMenuItem" Header="Set Rotation Increment" InputGesture="F6" Click="OnSetRotationIncrement" />
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<Border DockPanel.Dock="Top" Padding="4" BorderThickness="0,0,0,1" BorderBrush="#D0D0D0">
|
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
|
<Button x:Name="NewButton" Content="New" Click="OnNew" />
|
|
<Button x:Name="OpenButton" Content="Open" Click="OnOpen" />
|
|
<Button x:Name="SaveButton" Content="Save" Click="OnSave" />
|
|
<Button x:Name="SaveAsButton" Content="Save As" Click="OnSaveAs" />
|
|
<Button Content="Fit" Click="OnFit" />
|
|
<Button Content="Previous" Click="OnPreviousPlate" />
|
|
<Button Content="Next" Click="OnNextPlate" />
|
|
<Button x:Name="AutoNestButton" Content="Auto Nest" Click="OnAutoNest" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border DockPanel.Dock="Bottom" Padding="6,3" Background="#F0F0F0">
|
|
<TextBlock x:Name="Status" Text="Create a new nest or open a .nest file to begin." />
|
|
</Border>
|
|
|
|
<!-- One tab per open nest, along the bottom of the window. -->
|
|
<Border DockPanel.Dock="Bottom" Background="#E4E7EA">
|
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
|
|
<StackPanel x:Name="TabStrip" Orientation="Horizontal" Margin="6,0,6,6" />
|
|
</ScrollViewer>
|
|
</Border>
|
|
|
|
<Panel>
|
|
<!-- The empty workspace, as in the WinForms app: the Windows AppWorkspace gray, with the OpenNest logo centered. -->
|
|
<Panel x:Name="EmptyHint" Background="#ABABAB">
|
|
<Image Source="avares://OpenNest.Avalonia/Assets/watermark.png" Stretch="None"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Panel>
|
|
<ContentControl x:Name="NestHost" />
|
|
</Panel>
|
|
</DockPanel>
|
|
</Window>
|