-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
137 lines (136 loc) · 8.4 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<Window x:Class="CircuitPro.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CircuitPro"
mc:Ignorable="d"
Title="CircuitPro" Height="600" Width="1000" Closing="Window_Closing">
<Window.CommandBindings>
<CommandBinding Command="New" CanExecute="CommandBinding_CanExecute" />
<CommandBinding Command="Open" CanExecute="CommandBinding_CanExecute" />
<CommandBinding Command="Save" CanExecute="CommandBinding_CanExecute" />
</Window.CommandBindings>
<Window.Resources>
<Style TargetType="{x:Type TreeView}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#CBE8F6" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#F6F6F6" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Black" />
</Style.Resources>
</Style>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="BorderThickness" Value="1" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="#26A0DA" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#E5F3FB" />
<Setter Property="BorderBrush" Value="#70C0E7" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
<Condition Property="IsSelectionActive" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="#DADADA" />
</MultiTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100*"/>
<ColumnDefinition Width="400*"/>
<ColumnDefinition Width="100*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="110"/>
</Grid.RowDefinitions>
<ToolBarTray x:Name="Menu" Orientation="Horizontal" Grid.ColumnSpan="3">
<ToolBar Height="30" ClipToBounds="True" Visibility="Visible">
<Button x:Name="NewToolBtn" Command="New" Content="Fișier Nou" Margin="5,0,5,0" Click="NewToolBtn_Click" />
<Button x:Name="OpenToolBtn" Command="Open" Content="Deschide" Margin="5,0,5,0" Click="OpenToolBtn_Click" />
<Button x:Name="SaveToolBtn" Command="Save" Content="Salvează" Margin="5,0,5,0" Click="SaveToolBtn_Click" />
<Separator />
<Button x:Name="ComponentNouToolBtn" Content="Componentă nouă" Margin="5,0,5,0" Click="ComponentNouToolBtn_Click" />
<Button x:Name="ModificareGeneratorBtn" Content="Modificare generator" Margin="5,0,5,0" Click="ModificareGeneratorBtn_Click"/>
<Separator />
<Button x:Name="HelpToolBtn" Content="Ajutor" Margin="5,0,5,0" Click="HelpToolBtn_Click" />
<Button x:Name="AboutToolBtn" Content="Despre" Margin="5,0,5,0" Click="AboutToolBtn_Click" />
</ToolBar>
</ToolBarTray>
<GroupBox x:Name="Draw" Header="Diagramă circuit" Grid.Column="1" Grid.Row="1" Margin="5,0,5,0" Padding="-5,-7,-5,-5" UseLayoutRounding="False" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ScrollViewer x:Name="canvasScroll" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Canvas x:Name="circuitCanvas" MouseWheel="CircuitCanvas_MouseWheel" MouseMove="CircuitCanvas_MouseMove" MouseLeftButtonUp="CircuitCanvas_MouseLeftButtonUp" MouseLeftButtonDown="CircuitCanvas_MouseLeftButtonDown" PreviewMouseLeftButtonUp="CircuitCanvas_PreviewMouseLeftButtonUp">
<Canvas.Background>
<DrawingBrush TileMode="Tile" Viewport="0, 0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,20,20"/>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="Gray" Thickness="0.05"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Canvas.Background>
</Canvas>
</ScrollViewer>
</GroupBox>
<GroupBox x:Name="ComponentList" Header="Componente" Grid.Row="1" Grid.RowSpan="2" Margin="5 0 0 5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<ListBox x:Name="componentList" BorderThickness="0,0,0,0" MouseDown="ComponentList_MouseDown" SelectionChanged="ComponentList_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value.Nume}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Stretch">
<Button x:Name="AddComponentBtn" Content="Adaugă" Margin="0,5,0,0" Click="AddComponentBtn_Click"/>
<Button x:Name="RemoveComponentBtn" Content="Șterge" Margin="0,5,0,0" Click="RemoveComponentBtn_Click"/>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox x:Name="Entry" Grid.Column="1" Grid.Row="2" Header="Descriere ciruit" Margin="5,5,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="DescriereCircutText" TextWrapping="Wrap" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" FlowDirection="LeftToRight" UseLayoutRounding="False" Grid.RowSpan="2" KeyDown="DescriereCircutText_KeyDown"/>
<Button x:Name="UpdateCircuitBtn" Content="Actualizează" Grid.Column="1" Margin="5,0,0,2" VerticalAlignment="Stretch" Click="UpdateCircuitBtn_Click"/>
<Button x:Name="ResetCircuitBtn" Content="Resetează" Margin="5,2,0,0" Grid.ColumnSpan="2" Grid.Row="1" Grid.Column="1" VerticalAlignment="Stretch" Click="ResetCircuitBtn_Click"/>
</Grid>
</GroupBox>
<GroupBox x:Name="Properties" Grid.Column="2" Header="Detalii" Grid.Row="2" Margin="0,0,5,5">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<TextBlock x:Name="PropertiesDenumire" FontWeight="Bold"/>
<TextBlock x:Name="PropertiesValoare"/>
<TextBlock x:Name="PropertiesDefazaj"/>
<TextBlock x:Name="PropertiesTensiune"/>
<TextBlock x:Name="PropertiesIntensitate"/>
</StackPanel>
</ScrollViewer>
</GroupBox>
<GroupBox x:Name="TreeView" Grid.Column="2" Header="Porțiuni circuit" Grid.Row="1" Margin="0,0,5,0">
<TreeView x:Name="circuitTree" HorizontalContentAlignment="Left" BorderThickness="0,0,0,0" MouseDown="CircuitTree_MouseDown" SelectedItemChanged="CircuitTree_SelectedItemChanged"/>
</GroupBox>
</Grid>
</Window>