diff --git a/Source/RunActivity/Viewer3D/Popups/TrainDPUWindow.cs b/Source/RunActivity/Viewer3D/Popups/TrainDPUWindow.cs index 9cecab2b4..b8eb969ab 100644 --- a/Source/RunActivity/Viewer3D/Popups/TrainDPUWindow.cs +++ b/Source/RunActivity/Viewer3D/Popups/TrainDPUWindow.cs @@ -340,7 +340,7 @@ void VerticalWindow_Click(Control arg1, Point arg2) UpdateWindowSize(); } - private void UpdateWindowSize() + public void UpdateWindowSize() { labels = TrainDPUWindowList(Owner.Viewer, normalTextMode).ToList(); ModifyWindowSize(); diff --git a/Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchesOnPanel.cs b/Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchesOnPanel.cs index 459e162a9..b3889fb01 100644 --- a/Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchesOnPanel.cs +++ b/Source/RunActivity/Viewer3D/WebServices/SwitchPanel/SwitchesOnPanel.cs @@ -195,6 +195,9 @@ public bool IsPressed(UserCommand userCommand) case UserCommand.DisplayHUD: IsPressedDisplayHUD(); return false; + case UserCommand.DisplayTrainDpuWindow: + IsPressedDisplayDpuWindow(); + return false; default: return true; } @@ -328,6 +331,52 @@ private void IsPressedDisplayHUD() } } + private void IsPressedDisplayDpuWindow() + { + if (!Viewer.TrainDpuWindow.Visible) + { + // DpuWindow not visible + Viewer.TrainDpuWindow.normalTextMode = true; + Viewer.TrainDpuWindow.normalVerticalMode = true; + Viewer.TrainDpuWindow.Visible = true; + Viewer.TrainDpuWindow.UpdateWindowSize(); + } + else + { + // visible + if ((Viewer.TrainDpuWindow.normalTextMode == true) && (Viewer.TrainDpuWindow.normalVerticalMode == true)) + { + Viewer.TrainDpuWindow.normalVerticalMode = false; + Viewer.TrainDpuWindow.UpdateWindowSize(); + return; + } + + if ((Viewer.TrainDpuWindow.normalTextMode == true) && (Viewer.TrainDpuWindow.normalVerticalMode == false)) + { + Viewer.TrainDpuWindow.normalTextMode = false; + Viewer.TrainDpuWindow.normalVerticalMode = true; + Viewer.TrainDpuWindow.UpdateWindowSize(); + return; + } + + if ((Viewer.TrainDpuWindow.normalTextMode == false) && (Viewer.TrainDpuWindow.normalVerticalMode == true)) + { + Viewer.TrainDpuWindow.normalVerticalMode = false; + Viewer.TrainDpuWindow.UpdateWindowSize(); + return; + } + + if ((Viewer.TrainDpuWindow.normalTextMode == false) && (Viewer.TrainDpuWindow.normalVerticalMode == false)) + { + Viewer.TrainDpuWindow.normalTextMode = true; + Viewer.TrainDpuWindow.normalVerticalMode = true; + Viewer.TrainDpuWindow.Visible = false; + Viewer.TrainDpuWindow.UpdateWindowSize(); + return; + } + } + } + public bool IsChanged() { bool changed = false;