/// <summary> /// /// Display all of the contents which are as children of this. /// /// </summary> public void Display() { Console.CursorVisible = false; if (!isInitialized) { if (Environment.OSVersion.Platform == PlatformID.Win32NT) { KernelWrapper.EnableVirtualTerminalProcessing(); } isInitialized = true; } var currentPos = ConsoleVec2.Current; m_StartPosition = currentPos; foreach (var ui in m_UIs) { currentPos.Move(); m_UIPos[ui] = currentPos; ui.Display(); currentPos.Y += ui.Size.Height; } }
/// <summary> /// /// This function invoked when `sender` resizes. /// /// </summary> private void OnReceiveResizeEvent(ConsoleUI sender) { var change = false; var currentPos = new ConsoleVec2(0, 0); foreach (var ui in m_UIs) { if (ui == sender) { change = true; currentPos = m_UIPos[ui]; EraseAfter(currentPos); } if (change) { currentPos.Move(); m_UIPos[ui] = currentPos; ui.Display(); currentPos.Y += ui.Size.Height; } } }
/// <summary> /// /// Erase all after the cursor position. /// /// </summary> private void EraseAfter(ConsoleVec2 vec2) { vec2.Move(); WordProcessor.ClearAfterCursor(); }