Skip to content

Commit 894cc60

Browse files
committed
some fix
1 parent 4175c98 commit 894cc60

File tree

12 files changed

+34
-19
lines changed

12 files changed

+34
-19
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,6 @@ ASALocalRun/
337337
.localhistory/
338338

339339
# BeatPulse healthcheck temp database
340-
healthchecksdb
340+
healthchecksdb
341+
342+
CodeMap1.dgml

SimpleStateMachineNodeEditor/App.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<ResourceDictionary Source="Styles/MainWindow/CustomWindowTemplate.xaml"/>
4949

5050
<!--#region Header-->
51-
<ResourceDictionary Source="Styles/MainWindow/ToolBar/ToolButtonTemplate.xaml"/>
5251
<ResourceDictionary Source="Styles/MainWindow/ToolBar/TemplateSeparator.xaml"/>
5352
<ResourceDictionary Source="Styles/MainWindow/ToolBarTemplate.xaml"/>
5453
<ResourceDictionary Source="Styles/MainWindow/Header/StyleHeaderButton.xaml"/>

SimpleStateMachineNodeEditor/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Ctrl + Shift + S = Save As
44
Ctrl + Shift + O = Open
55
Ctrl + Shift + N = New
66
Alt + F4 = Exit
7+
Ctrl + Shift + Alt + P = Export to PNG
78
Ctrl + Shift + Alt + J = Export to JPEG
89
Ctrl + Z = Undo
910
Ctrl + Y = Redo

SimpleStateMachineNodeEditor/SimpleStateMachineNodeEditor.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
</ItemGroup>
4545

4646
<ItemGroup>
47-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
4847
<PackageReference Include="ReactiveUI" Version="11.4.1" />
4948
<PackageReference Include="ReactiveUI.Events.WPF" Version="11.4.1" />
5049
<PackageReference Include="ReactiveUI.Fody" Version="11.4.1" />

SimpleStateMachineNodeEditor/Styles/MainWindow/ToolBar/ToolButtonTemplate.xaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

SimpleStateMachineNodeEditor/Styles/StyleEmptyTextBox.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
<Setter Property="Template">
1212
<Setter.Value>
1313
<ControlTemplate TargetType="{x:Type TextBox}">
14-
<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
14+
<Border x:Name="border" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" >
15+
<Border.ContextMenu>
16+
<ContextMenu Visibility="Collapsed"/>
17+
</Border.ContextMenu>
1518
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" />
1619
</Border>
1720
</ControlTemplate>

SimpleStateMachineNodeEditor/View/MainWindow.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<Rectangle Fill="{DynamicResource IconExportScheme}" Height="15" Width="15"/>
5050
</MenuItem.Icon>
5151
<!--<MenuItem Header="Export to PNG" x:Name="ItemExportToPNG" Style="{DynamicResource StyleMenuItem}"/>-->
52-
<MenuItem Header="Export to JPEG" x:Name="ItemExportToJPEG" Style="{DynamicResource StyleMenuItem}"/>
52+
<MenuItem Header="Export to PNG" x:Name="ItemExportToPNG" Style="{DynamicResource StyleMenuItem}"/>
5353
</MenuItem>
5454
<Separator Background="{DynamicResource ColorSeparator}"/>
5555
<MenuItem Header="Exit" x:Name="ItemExit" InputGestureText="Alt+F4" Style="{DynamicResource StyleMenuItem}">
@@ -133,7 +133,7 @@
133133
<Button x:Name="ButtonSaveAs" ToolTip="Save As... (Ctrl+Shift+S)" Style="{DynamicResource StyleHeaderButton}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorWindowHeaderButtonBackgroundMouseOver}">
134134
<Rectangle Fill="{DynamicResource IconSaveAs}" Height="15" Width="15"/>
135135
</Button>
136-
<Button x:Name="ButtonExportToJPEG" ToolTip="Export To JPEG.. (Ctrl+Shift+Alt+J)" Style="{DynamicResource StyleHeaderButton}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorWindowHeaderButtonBackgroundMouseOver}">
136+
<Button x:Name="ButtonExportToPNG" ToolTip="Export To PNG.. (Ctrl+Shift+Alt+P)" Style="{DynamicResource StyleHeaderButton}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorWindowHeaderButtonBackgroundMouseOver}">
137137
<Rectangle Fill="{DynamicResource IconExportScheme}" Height="15" Width="15"/>
138138
</Button>
139139
<Separator Grid.Column="5" Style="{DynamicResource TemplateSeparator}" Height="Auto" BorderThickness="0,0,1,0" />
@@ -247,5 +247,6 @@
247247
<KeyBinding x:Name="BindingNew" Gesture="Ctrl+Shift+N"/>
248248
<KeyBinding x:Name="BindingExit" Gesture="Alt+F4"/>
249249
<KeyBinding x:Name="BindingExportToJPEG" Gesture="Ctrl+Shift+Alt+J"/>
250+
<KeyBinding x:Name="BindingExportToPNG" Gesture="Ctrl+Shift+Alt+P"/>
250251
</Window.InputBindings>
251252
</Window>

SimpleStateMachineNodeEditor/View/MainWindow.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ private void SetupBinding()
8888
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandRedo, x => x.ItemRedo).DisposeWith(disposable);
8989
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandRedo, x => x.ButtonRedo).DisposeWith(disposable);
9090

91+
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToPNG, x => x.BindingExportToPNG).DisposeWith(disposable);
92+
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToPNG, x => x.ItemExportToPNG).DisposeWith(disposable);
93+
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToPNG, x => x.ButtonExportToPNG).DisposeWith(disposable);
94+
9195
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToJPEG, x => x.BindingExportToJPEG).DisposeWith(disposable);
92-
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToJPEG, x => x.ItemExportToJPEG).DisposeWith(disposable);
93-
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandExportToJPEG, x => x.ButtonExportToJPEG).DisposeWith(disposable);
9496

9597
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandNew, x => x.BindingNew).DisposeWith(disposable);
9698
this.BindCommand(this.ViewModel, x => x.NodesCanvas.CommandNew, x => x.ItemNew).DisposeWith(disposable);

SimpleStateMachineNodeEditor/View/ViewNodesCanvas.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private void SetupSubscriptions()
115115
{
116116
this.WhenAnyValue(x => x.ViewModel.Selector.Size).WithoutParameter().InvokeCommand(ViewModel, x => x.CommandSelectorIntersect).DisposeWith(disposable);
117117
this.WhenAnyValue(x => x.ViewModel.Cutter.EndPoint).WithoutParameter().InvokeCommand(ViewModel, x => x.CommandCutterIntersect).DisposeWith(disposable);
118-
this.WhenAnyValue(x => x.ViewModel.JPEGPath).Where(x => !string.IsNullOrEmpty(x)).Subscribe(value => SaveCanvasToImage(value, ImageFormats.JPEG)).DisposeWith(disposable);
118+
this.WhenAnyValue(x => x.ViewModel.ImagePath).Where(x => !string.IsNullOrEmpty(x)).Subscribe(value => SaveCanvasToImage(value, ImageFormats.JPEG)).DisposeWith(disposable);
119119
});
120120
}
121121

SimpleStateMachineNodeEditor/ViewModel/Connector/ViewModelConnector.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ private void SetupSubscriptions()
4848

4949
if (this.Name!="Input")
5050
{
51+
this.WhenAnyValue(x => x.Node.IsCollapse).Subscribe(value => UpdateSubscriptionForPosition(value));
5152
if (this.Name != "Output")
5253
{
5354
this.WhenAnyValue(x => x.Node.Transitions.Count).Subscribe(x => UpdatePositionOnTransitionCountChange());
54-
this.WhenAnyValue(x => x.Node.IsCollapse).Subscribe(value => UpdateSubscriptionForPosition(value));
55+
5556
}
5657

5758
}

0 commit comments

Comments
 (0)