Skip to content

Commit 25b3d86

Browse files
committed
changed StackPanel to Grid (but it didn't help), added log to output window (didn't work either)
1 parent 46016c8 commit 25b3d86

6 files changed

Lines changed: 49 additions & 19 deletions

File tree

GraphAlgorithmRenderer/GraphAlgorithmRenderer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<ResourceName>Menus.ctmenu</ResourceName>
146146
</VSCTCompile>
147147
<Content Include="Samples\Components\dfs.png" />
148+
<Content Include="Samples\Components\in.txt" />
148149
<Content Include="Samples\Components\new_comp.png" />
149150
<Content Include="Samples\Components\Source.cpp" />
150151
<Content Include="Samples\DSU\join.png" />

GraphAlgorithmRenderer/GraphRenderer/DebuggerOperations.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ public static StackFrames GetStackFrames(Debugger debugger)
163163

164164
public static void WriteDebugOutput()
165165
{
166-
Debug.WriteLine($"Got {_numberOfGetExpressionCalls} expressions in {_timeSpanGetExpressions}");
167-
Debug.WriteLine($"Set {_numberOfSetStackFrameCalls} stack frames in {_timeSpanSetStackFrame}");
168-
Debug.WriteLine(
166+
ThreadHelper.ThrowIfNotOnUIThread();
167+
Log.OutputString($"Got {_numberOfGetExpressionCalls} expressions in {_timeSpanGetExpressions}");
168+
Log.OutputString($"Set {_numberOfSetStackFrameCalls} stack frames in {_timeSpanSetStackFrame}");
169+
Log.OutputString(
169170
$"Get {_numberOfCurrentStackFrameCalls} current stack frames in {_timeSpanCurrentStackFrame}");
170-
Debug.WriteLine($"Get {_numberOfFunctionNameCalls} function names {_timeSpanFunctionName}");
171+
Log.OutputString($"Get {_numberOfFunctionNameCalls} function names {_timeSpanFunctionName}");
172+
171173
}
172174

173175
public static void Reset()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
13 15
2+
1 2
3+
2 3
4+
3 4
5+
4 5
6+
5 3
7+
5 13
8+
13 7
9+
13 6
10+
6 8
11+
8 9
12+
9 7
13+
4 11
14+
11 10
15+
4 10
16+
10 12

GraphAlgorithmRenderer/SettingsWindow.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public SettingsWindow() : base(null)
6060
base.Content = _control;
6161
_control.Load.Click += LoadOnClick;
6262
_control.Export.Click += ExportOnClick;
63+
6364
}
6465

6566
private void ExportOnClick(object sender, RoutedEventArgs e)
@@ -118,6 +119,20 @@ private void InitializeLog(DTE dte)
118119
var outputWindowPane = ow.OutputWindowPanes.Add("Graph Visualization");
119120
outputWindowPane.Activate();
120121
DebuggerOperations.Log = outputWindowPane;
122+
_control.MainControl.OnTop.Checked += (sender, args) =>
123+
{
124+
if (_form != null)
125+
{
126+
_form.TopMost = true;
127+
}
128+
};
129+
_control.MainControl.OnTop.Unchecked += (sender, args) =>
130+
{
131+
if (_form != null)
132+
{
133+
_form.TopMost = false;
134+
}
135+
};
121136
}
122137

123138
protected override void Initialize()

GraphAlgorithmRenderer/UIControls/MainControl.xaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
xmlns:local="clr-namespace:GraphAlgorithmRenderer.UIControls"
77
mc:Ignorable="d"
88
d:DesignHeight="450" d:DesignWidth="800">
9-
<StackPanel Orientation="Horizontal">
10-
<local:PropertiesControl x:Name="Nodes"/>
11-
<local:PropertiesControl x:Name="Edges"></local:PropertiesControl>
12-
<StackPanel>
9+
<Grid>
10+
<Grid.ColumnDefinitions>
11+
<ColumnDefinition></ColumnDefinition>
12+
<ColumnDefinition></ColumnDefinition>
13+
<ColumnDefinition></ColumnDefinition>
14+
</Grid.ColumnDefinitions>
15+
<local:PropertiesControl x:Name="Nodes" Grid.Row="0" Grid.Column="0"/>
16+
<local:PropertiesControl x:Name="Edges" Grid.Row="0" Grid.Column="1"></local:PropertiesControl>
17+
<StackPanel Grid.Row="0" Grid.Column="2">
1318
<Button x:Name="GenerateConfig" Content="Generate config" VerticalAlignment="Center" HorizontalAlignment="Center"></Button>
1419
<CheckBox x:Name="OnTop" Margin="10" IsChecked="True">Draw graph window on top</CheckBox>
1520
</StackPanel>
16-
</StackPanel>
21+
</Grid>
1722
</UserControl>

GraphAlgorithmRenderer/UIControls/MainControl.xaml.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,13 @@ namespace GraphAlgorithmRenderer.UIControls
2121
/// Interaction logic for MainControl.xaml
2222
/// </summary>
2323
public partial class MainControl : UserControl
24-
{
25-
private void Align()
26-
{
27-
Debug.WriteLine("Align");
28-
var height = Math.Max(Edges.ActualHeight, Nodes.ActualHeight);
29-
Edges.MinHeight = height;
30-
Nodes.MinHeight = height;
31-
}
24+
{
3225

3326
public MainControl()
3427
{
3528
InitializeComponent();
3629
Nodes.Label.Content = "Node families";
3730
Edges.Label.Content = "Edge families";
38-
Edges.properties.SizeChanged += (sender, args) => Align();
39-
Nodes.properties.SizeChanged += (sender, args) => Align();
4031

4132
Nodes.WindowGenerator = () => new NodeFamilyWindow();
4233
Nodes.Description = w => ((NodeFamilyWindow) w).familyName.Text;

0 commit comments

Comments
 (0)