Skip to content

Commit ee2bb8e

Browse files
committed
table of transitions
1 parent ec9ecee commit ee2bb8e

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

SimpleStateMachineNodeEditor/View/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Grid.RowDefinitions>
1212
<RowDefinition Height="auto" />
1313
<RowDefinition Height="auto"/>
14-
<RowDefinition MinHeight="50"></RowDefinition>
14+
<RowDefinition x:Name="MainColumn" MinHeight="50"></RowDefinition>
1515
<RowDefinition Height="auto"/>
1616
<RowDefinition Height="auto" x:Name="Fotter" MinHeight="18"/>
1717
</Grid.RowDefinitions>
@@ -176,7 +176,7 @@
176176
<Grid.ColumnDefinitions>
177177
<ColumnDefinition MinWidth="50"/>
178178
<ColumnDefinition Width="auto"/>
179-
<ColumnDefinition Width="auto" x:Name="TableOfTransitionsColumn" />
179+
<ColumnDefinition MinWidth="18" Width="auto" x:Name="TableOfTransitionsColumn" />
180180
</Grid.ColumnDefinitions>
181181
<!--BorderBrush - it's color on IsMouseOver, OpacityMask - it's color on IsPressed-->
182182
<TabControl Grid.Column="0" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="Green" TabStripPlacement="Top" Padding="2,2,2,0" >
@@ -257,7 +257,7 @@
257257
<Label Grid.Column="6" x:Name="LabelInformation" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconInformation}" OpacityMask="{DynamicResource ColorElementMouseOver}" MinHeight="14" MinWidth="14">Messages</Label>
258258
<Separator Grid.Column="7" Visibility="{Binding ElementName=LabelDebug, Path=Visibility}" Style="{DynamicResource TemplateSeparator}" Height="Auto" BorderThickness="0,0,1,0" />
259259
<Label Grid.Column="8" x:Name="LabelDebug" Visibility="Hidden" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconDebug}" OpacityMask="{DynamicResource ColorElementMouseOver}" MinHeight="14" MinWidth="14">Debug</Label>
260-
<Label Grid.Column="9" x:Name="LabelErrorListUpdate" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconUpdate}" OpacityMask="{DynamicResource ColorElementMouseOver}" HorizontalAlignment="Right" Margin="0,0,5,0">Update/Clear</Label>
260+
<Label Grid.Column="9" x:Name="LabelErrorListUpdate" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconUpdate}" OpacityMask="{DynamicResource ColorElementMouseOver}" HorizontalAlignment="Right" Margin="0,0,5,0" MinHeight="14" MinWidth="14">Update/Clear</Label>
261261
</Grid>
262262
</Expander.Header>
263263
<Expander.Content>

SimpleStateMachineNodeEditor/View/MainWindow.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ private void SetupSubscriptions()
132132
this.WhenAnyValue(x => x.NodesCanvas.ViewModel.NeedExit).Where(x=>x).Subscribe(_ => this.Close()).DisposeWith(disposable);
133133
this.WhenAnyValue(x => x.ViewModel.CountError).Buffer(2, 1).Where(x => x[1] > x[0]).Subscribe(_ => ShowError()).DisposeWith(disposable);
134134
this.WhenAnyValue(x => x.ViewModel.NodesCanvas.Theme).Subscribe(_ => UpdateButton()).DisposeWith(disposable);
135+
136+
this.WhenAnyValue(x => x.ActualWidth).Subscribe(value => TableOfTransitionsColumn.MaxWidth = value - 50).DisposeWith(disposable);
137+
this.WhenAnyValue(x => x.ActualHeight).Subscribe(value => Fotter.MaxHeight = value - 150).DisposeWith(disposable);
135138
});
136139
}
137140
private void UpdateSchemeName(string newName)
@@ -183,25 +186,26 @@ private void ErrorListCollapse()
183186
this.ErrorListSplitter.IsEnabled = false;
184187
this.Fotter.Height = new GridLength();
185188
this.Fotter.MinHeight = 18;
189+
186190
}
187191
private void ErrorListExpanded()
188192
{
189193
this.ErrorListSplitter.IsEnabled = true;
190-
this.Fotter.Height = new GridLength(this.ViewModel.MaxHeightMessagePanel);
194+
this.Fotter.Height = new GridLength(this.ViewModel.DefaultHeightMessagePanel);
191195
this.Fotter.MinHeight = 52;
192196
}
193197

194198
private void TableOfTransitionsCollapse()
195199
{
196200
this.TableOfTransitionsSplitter.IsEnabled = false;
197201
this.TableOfTransitionsColumn.Width = new GridLength();
198-
//this.Fotter.MinHeight = 18;
202+
this.TableOfTransitionsColumn.MinWidth = 18;
199203
}
200204
private void TableOfTransitionsExpanded()
201205
{
202206
this.TableOfTransitionsSplitter.IsEnabled = true;
203-
//this.TableOfTransitionsColumn.Width = new GridLength(this.ViewModel.MaxHeightMessagePanel);
204-
//this.Fotter.MinHeight = 52;
207+
//this.TableOfTransitionsColumn.Width = new GridLength(this.ViewModel.DefaultWidthTransitionsTable);
208+
this.TableOfTransitionsColumn.MinWidth = 52;
205209
}
206210
private void ShowError()
207211
{

SimpleStateMachineNodeEditor/View/ViewTableOfTransitionsItem.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<Grid.RowDefinitions>
2020
<RowDefinition />
2121
</Grid.RowDefinitions>
22-
<styles:MyTextBox Grid.Column="0" Text="Test1" Grid.Row="0" Background="Red" x:Name="TextBoxElementStateFrom" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
23-
<styles:MyTextBox Grid.Column="2" Text="Test2" Grid.Row="0" Background="Green" x:Name="TextBoxElementTransitionName" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
24-
<styles:MyTextBox Grid.Column="4" Text="Test3" Grid.Row="0" Background="Blue" x:Name="TextBoxElementStateTo" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
22+
<styles:MyTextBox Grid.Column="0" Grid.Row="0" Background="Red" x:Name="TextBoxElementStateFrom" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
23+
<styles:MyTextBox Grid.Column="2" Grid.Row="0" Background="Green" x:Name="TextBoxElementTransitionName" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
24+
<styles:MyTextBox Grid.Column="4" Grid.Row="0" Background="Blue" x:Name="TextBoxElementStateTo" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" TextWrapping="NoWrap" Padding="3" />
2525
</Grid>
2626
</UserControl>
2727

SimpleStateMachineNodeEditor/ViewModel/MainWindow/ViewModelMainWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public partial class ViewModelMainWindow : ReactiveObject
3333
[Reactive] public int CountDebug { get; set; }
3434

3535
private IDisposable ConnectToMessages;
36-
public double MaxHeightMessagePanel = 150;
36+
public double DefaultHeightMessagePanel = 150;
37+
public double DefaultWidthTransitionsTable = 350;
3738
public ObservableCollectionExtended<ViewModelConnector> Transitions { get; set; } = new ObservableCollectionExtended<ViewModelConnector>();
3839

3940

SimpleStateMachineNodeEditor/ViewModel/NodesCanvas/ViewModelNodesCanvasCommands.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ private void ClearScheme()
289289
this.SchemePath = "";
290290
this.ImagePath = "";
291291
WithoutMessages = false;
292-
this.Messages.Clear();
292+
this.Messages.Clear();
293+
ItSaved = true;
293294
}
294295
private void Open()
295296
{
@@ -371,6 +372,7 @@ void Error(string errorMessage)
371372
ClearScheme();
372373
LogError("File is not valid. " + errorMessage);
373374
this.SetupStartState();
375+
Mouse.OverrideCursor = null;
374376
}
375377
}
376378
private void Save()

0 commit comments

Comments
 (0)