Skip to content

Commit d2f2a02

Browse files
committed
Add path name to Chart Window title.
Appends to the default title from the properties.
1 parent b6baa4c commit d2f2a02

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/Contrib/TrackViewer/Editing/Charts/DrawPathChart.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class DrawPathChart
5454

5555
private bool ChartWindowIsOpen { get { return chartWindow.Visibility == Visibility.Visible; } }
5656

57+
// save window title from properies, so that the window's title can be changed when the selected path is changed
58+
private readonly String WindowTitle;
59+
5760
/// <summary>
5861
/// Constructor
5962
/// </summary>
@@ -64,6 +67,7 @@ public DrawPathChart()
6467
OnJsonSaveClick = OnJsonSave
6568
};
6669
TrackViewer.Localize(chartWindow);
70+
if (WindowTitle == null) WindowTitle = chartWindow.Title;
6771
}
6872

6973
/// <summary>
@@ -113,6 +117,7 @@ public void Open()
113117
{ // it path is broken, OnPathChanged performed a close
114118
return;
115119
}
120+
chartWindow.Title = String.Format("{0}: {1}", WindowTitle, pathEditor.CurrentTrainPath.PathName);
116121
chartWindow.Show();
117122

118123
}
@@ -160,6 +165,7 @@ private void OnPathChanged()
160165
return;
161166
}
162167
pathData.Update(trainpath);
168+
chartWindow.Title = String.Format("{0}: {1}", WindowTitle, pathEditor.CurrentTrainPath.PathName);
163169
chartWindow.Draw();
164170
}
165171

0 commit comments

Comments
 (0)