Skip to content

Commit ec9ecee

Browse files
committed
before fix
1 parent 49390fd commit ec9ecee

File tree

3 files changed

+73
-48
lines changed

3 files changed

+73
-48
lines changed

SimpleStateMachineNodeEditor/View/MainWindow.xaml

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<Grid.RowDefinitions>
1212
<RowDefinition Height="auto" />
1313
<RowDefinition Height="auto"/>
14-
<RowDefinition></RowDefinition>
15-
<RowDefinition Height="auto"/>
16-
<RowDefinition Height="auto" x:Name="Fotter" MinHeight="18"/>
14+
<RowDefinition MinHeight="50"></RowDefinition>
15+
<RowDefinition Height="auto"/>
16+
<RowDefinition Height="auto" x:Name="Fotter" MinHeight="18"/>
1717
</Grid.RowDefinitions>
1818
<view:ViewDialog x:Name="Dialog"/>
1919

@@ -172,49 +172,68 @@
172172
<!--#endregion ToolBar-->
173173

174174
<!--#region Tabs-->
175+
<Grid Grid.Row="2">
176+
<Grid.ColumnDefinitions>
177+
<ColumnDefinition MinWidth="50"/>
178+
<ColumnDefinition Width="auto"/>
179+
<ColumnDefinition Width="auto" x:Name="TableOfTransitionsColumn" />
180+
</Grid.ColumnDefinitions>
175181
<!--BorderBrush - it's color on IsMouseOver, OpacityMask - it's color on IsPressed-->
176-
<TabControl Grid.Row="2" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="Green" TabStripPlacement="Top" Padding="2,2,2,0" >
177-
<TabItem Header="Node editor" Style="{DynamicResource StyleTabItem}" Background="{DynamicResource ColorWindowHeader}" Foreground="{DynamicResource ColorWindowHeaderTabItemForeground}" BorderBrush="{DynamicResource ColorElementMouseOver}" OpacityMask="{DynamicResource ColorElementMouseOver}">
178-
<view:ViewNodesCanvas x:Name="NodesCanvas" />
179-
</TabItem>
180-
<!--<TabItem Header="Transitions table" ToolTip="" Style="{DynamicResource StyleTabItem}" Foreground="{DynamicResource ColorForeground}"/>-->
181-
<TabItem Header="Transitions table" Style="{DynamicResource StyleTabItem}" Background="{DynamicResource ColorWindowHeader}" Foreground="{DynamicResource ColorWindowHeaderTabItemForeground}" BorderBrush="{DynamicResource ColorElementMouseOver}" OpacityMask="{DynamicResource ColorElementMouseOver}">
182-
<Grid Grid.IsSharedSizeScope="True">
183-
<Grid.ColumnDefinitions>
184-
<ColumnDefinition SharedSizeGroup="StateFrom"/>
185-
<ColumnDefinition Width="*"/>
186-
<ColumnDefinition SharedSizeGroup="TransitionName"/>
187-
<ColumnDefinition Width="*"/>
188-
<ColumnDefinition SharedSizeGroup="StateTo"/>
189-
<ColumnDefinition Width="*"/>
190-
</Grid.ColumnDefinitions>
191-
<Grid.RowDefinitions>
192-
<RowDefinition Height="auto"/>
193-
<RowDefinition/>
194-
</Grid.RowDefinitions>
195-
<Label Grid.Column="0" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconStateFrom}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="11" MinWidth="11">State from</Label>
196-
<Label Grid.Column="2" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconTransitionName}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="14" MinWidth="14">Transition name</Label>
197-
<Label Grid.Column="4" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconStateTo}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="11" MinWidth="11">State To</Label>
182+
<TabControl Grid.Column="0" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="Green" TabStripPlacement="Top" Padding="2,2,2,0" >
183+
<TabItem Header="Node editor" Style="{DynamicResource StyleTabItem}" Background="{DynamicResource ColorWindowHeader}" Foreground="{DynamicResource ColorWindowHeaderTabItemForeground}" BorderBrush="{DynamicResource ColorElementMouseOver}" OpacityMask="{DynamicResource ColorElementMouseOver}">
184+
<view:ViewNodesCanvas x:Name="NodesCanvas" />
185+
</TabItem>
186+
</TabControl>
187+
<GridSplitter Grid.Column="1" HorizontalAlignment="Center" x:Name="TableOfTransitionsSplitter" VerticalAlignment="Stretch" Background="{DynamicResource ColorWindowHeader}" Width="3" ShowsPreview="False" IsEnabled="False" />
188+
<Expander Grid.Column="2" x:Name="TableOfTransitionsExpander" Style="{DynamicResource StyleExpander}" Grid.Row="4" HorizontalContentAlignment="Stretch" ExpandDirection="Left" >
189+
<Expander.Header>
190+
<Label Grid.Column="0" Style="{DynamicResource StyleLabelWithIcon}" OpacityMask="{DynamicResource ColorElementMouseOver}">
191+
Table of transitions
192+
<Label.LayoutTransform >
193+
<RotateTransform Angle="90"/>
194+
</Label.LayoutTransform>
195+
</Label>
196+
</Expander.Header>
197+
<Expander.Content>
198+
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Style="{DynamicResource StyleScrollViewer}">
199+
<Grid Grid.IsSharedSizeScope="True" >
200+
<Grid.ColumnDefinitions>
201+
<ColumnDefinition SharedSizeGroup="StateFrom"/>
202+
<ColumnDefinition Width="*"/>
203+
<ColumnDefinition SharedSizeGroup="TransitionName"/>
204+
<ColumnDefinition Width="*"/>
205+
<ColumnDefinition SharedSizeGroup="StateTo"/>
206+
<ColumnDefinition Width="*"/>
207+
</Grid.ColumnDefinitions>
208+
<Grid.RowDefinitions>
209+
<RowDefinition Height="auto"/>
210+
<RowDefinition/>
211+
</Grid.RowDefinitions>
212+
<Label Grid.Column="0" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconStateFrom}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="11" MinWidth="11">State from</Label>
213+
<Label Grid.Column="2" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconTransitionName}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="14" MinWidth="14">Transition name</Label>
214+
<Label Grid.Column="4" Style="{DynamicResource StyleLabelWithIcon}" BorderBrush="{DynamicResource IconStateTo}" OpacityMask="{DynamicResource ColorMessagesForeground}" MinHeight="11" MinWidth="11">State To</Label>
198215

199-
<ListBox Grid.Row="1" Grid.ColumnSpan="6" x:Name="TableOfTransitions" Template="{DynamicResource TemplateListBox}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorMessagesBorder}" Foreground="{DynamicResource ColorMessagesForeground}" ItemContainerStyle="{DynamicResource StyleListBoxTransitionsItem}" AlternationCount="2"
216+
<ListBox Grid.Row="1" Grid.ColumnSpan="6" x:Name="TableOfTransitions" Template="{DynamicResource TemplateListBox}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorMessagesBorder}" Foreground="{DynamicResource ColorMessagesForeground}" ItemContainerStyle="{DynamicResource StyleListBoxTransitionsItem}" AlternationCount="2"
200217
VirtualizingStackPanel.IsVirtualizing="True"
201218
VirtualizingStackPanel.VirtualizationMode="Recycling"
202219
VirtualizingStackPanel.CacheLength="1"
203220
VirtualizingStackPanel.CacheLengthUnit="Page"
204221
VirtualizingStackPanel.ScrollUnit="Pixel">
205-
<ListBox.ItemTemplate>
206-
<DataTemplate>
207-
<view:ViewTableOfTransitionsItem ViewModel="{Binding}" />
208-
</DataTemplate>
209-
</ListBox.ItemTemplate>
210-
</ListBox>
211-
</Grid>
212-
</TabItem>
213-
</TabControl>
222+
<ListBox.ItemTemplate>
223+
<DataTemplate>
224+
<view:ViewTableOfTransitionsItem ViewModel="{Binding}" />
225+
</DataTemplate>
226+
</ListBox.ItemTemplate>
227+
</ListBox>
228+
</Grid>
229+
</ScrollViewer>
230+
</Expander.Content>
231+
</Expander>
232+
</Grid>
214233
<!--#endregion Tabs-->
215234

216235
<!--#region Error List-->
217-
<GridSplitter Grid.Row="3" x:Name="ErrorListSplitter" HorizontalAlignment="Stretch" Background="{DynamicResource ColorWindowHeader}" Height="3" ShowsPreview="False" IsEnabled="False"/>
236+
<GridSplitter Grid.Row="3" x:Name="ErrorListSplitter" HorizontalAlignment="Stretch" VerticalAlignment="Center" Background="{DynamicResource ColorWindowHeader}" Height="3" ShowsPreview="False" IsEnabled="False"/>
218237
<Expander Style="{DynamicResource StyleExpander}" x:Name="ErrorListExpander" Grid.Row="4" HorizontalContentAlignment="Stretch" ExpandDirection="Up" Margin="3,0,0,0" >
219238
<Expander.Header>
220239
<Grid >

SimpleStateMachineNodeEditor/View/MainWindow.xaml.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ private void SetupEvents()
159159
this.ErrorListExpander.Events().Collapsed.Subscribe(_=> ErrorListCollapse()).DisposeWith(disposable);
160160
this.ErrorListExpander.Events().Expanded.Subscribe(_ => ErrorListExpanded()).DisposeWith(disposable);
161161

162+
this.TableOfTransitionsExpander.Events().Collapsed.Subscribe(_ => TableOfTransitionsCollapse()).DisposeWith(disposable);
163+
this.TableOfTransitionsExpander.Events().Expanded.Subscribe(_ => TableOfTransitionsExpanded()).DisposeWith(disposable);
164+
162165
this.LabelError.Events().PreviewMouseLeftButtonDown.Subscribe(e => SetDisplayMessageType(e, TypeMessage.Error)).DisposeWith(disposable);
163166
this.LabelWarning.Events().PreviewMouseLeftButtonDown.Subscribe(e => SetDisplayMessageType(e, TypeMessage.Warning)).DisposeWith(disposable);
164167
this.LabelInformation.Events().PreviewMouseLeftButtonDown.Subscribe(e => SetDisplayMessageType(e, TypeMessage.Information)).DisposeWith(disposable);
@@ -179,11 +182,26 @@ private void ErrorListCollapse()
179182
{
180183
this.ErrorListSplitter.IsEnabled = false;
181184
this.Fotter.Height = new GridLength();
185+
this.Fotter.MinHeight = 18;
182186
}
183187
private void ErrorListExpanded()
184188
{
185189
this.ErrorListSplitter.IsEnabled = true;
186190
this.Fotter.Height = new GridLength(this.ViewModel.MaxHeightMessagePanel);
191+
this.Fotter.MinHeight = 52;
192+
}
193+
194+
private void TableOfTransitionsCollapse()
195+
{
196+
this.TableOfTransitionsSplitter.IsEnabled = false;
197+
this.TableOfTransitionsColumn.Width = new GridLength();
198+
//this.Fotter.MinHeight = 18;
199+
}
200+
private void TableOfTransitionsExpanded()
201+
{
202+
this.TableOfTransitionsSplitter.IsEnabled = true;
203+
//this.TableOfTransitionsColumn.Width = new GridLength(this.ViewModel.MaxHeightMessagePanel);
204+
//this.Fotter.MinHeight = 52;
187205
}
188206
private void ShowError()
189207
{

SimpleStateMachineNodeEditor/View/ViewTableOfTransitionsItem.xaml.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,9 @@ private void SetupBinding()
5252
this.OneWayBind(this.ViewModel, x => x.Node.Name, x => x.TextBoxElementStateTo.Text).DisposeWith(disposable);
5353
else
5454
this.OneWayBind(this.ViewModel, x => x.Connect.ToConnector.Node.Name, x => x.TextBoxElementStateTo.Text).DisposeWith(disposable);
55-
//this.WhenAnyValue(x=>x.GridElement.ActualWidth).Subscribe(value=>UpdateWidth(value)).DisposeWith(disposable);
5655
});
5756

5857
}
59-
private void UpdateWidth(double value)
60-
{
61-
//value *= 0.33;
62-
//if(TextBoxElementStateFrom.ActualWidth-10<value)
63-
// TextBoxElementStateFrom.Width = value;
64-
//if (TextBoxElementStateTo.ActualWidth - 10 < value)
65-
// TextBoxElementStateTo.Width = value;
66-
//if (TextBoxElementTransitionName.ActualWidth - 10 < value)
67-
// TextBoxElementTransitionName.Width = value;
68-
}
6958
#endregion SetupBinding
7059

7160
#region SetupEvents
@@ -79,7 +68,6 @@ private void SetupEvents()
7968
this.TextBoxElementStateTo.Events().LostFocus.Subscribe(e => ValidateStateTo(e)).DisposeWith(disposable);
8069
});
8170
}
82-
8371
private void ValidateTransitionName(RoutedEventArgs e)
8472
{
8573
if (TextBoxElementTransitionName.Text != ViewModel.Name)

0 commit comments

Comments
 (0)