Skip to content

Class TextWindow

Kristian Virtanen edited this page Oct 28, 2024 · 4 revisions

Description:

The TextWindow class provides methods and properties for interacting with the console (text) window, including window manipulation, cursor control, and reading/writing text. It also includes error handling via the LastError property, which stores the most recent error message if an operation fails.

Properties

TextWindow.LastError

  • Description: Stores the last error message, if any operation fails, including a timestamp in yyyy-MM-dd HH:mm:ss format.
  • Example: "2024-10-16 14:30:00: Invalid number received."
  • Changes from orig. SB: New feature for SBOE.

TextWindow.ForegroundColor

  • Description: Gets or sets the foreground color of the text in the console window.
  • Changes from orig. SB: none.

TextWindow.BackgroundColor

  • Description: Gets or sets the background color of the console window.
  • Changes from orig. SB: none.

TextWindow.CursorLeft

  • Description: Gets or sets the cursor's column position in the console window.
  • Changes from orig. SB: none.

TextWindow.CursorTop

  • Description: Gets or sets the cursor's row position in the console window.
  • Changes from orig. SB: none.

TextWindow.Title

  • Description: Gets or sets the title of the console window.
  • Changes from orig. SB: none.

Methods

TextWindow.Show()

  • Description: Shows and restores the text window if it is minimized or hidden.
  • Returns: true if successful, false if an error occurs.
  • Changes from orig. SB: SBOE returns true or false by succes.

TextWindow.Hide()

  • Description: Hides the text window.
  • Returns: true if successful, false if an error occurs.
  • Changes from orig. SB: SBOE returns true or false by succes.

TextWindow.Clear()

  • Description: Clears all the content of the console text window.
  • Changes from orig. SB: none.

TextWindow.Pause()

  • Description: Pauses execution and waits for user input, displaying the message "Press any key to continue...".
  • Changes from orig. SB: none.

TextWindow.PauseIfVisible()

  • Description: Pauses execution and waits for user input, displaying the message "Press any key to continue..." if the console window is visible.
  • Changes from orig. SB: none.

TextWindow.PauseWithoutMessage()

  • Description: Pauses execution without displaying a message, waiting for a key press.
  • Changes from orig. SB: none.

TextWindow.Read()

  • Description: Reads a line of text from the console window.
  • Returns: The string input from the console.
  • Changes from orig. SB: none.

TextWindow.ReadKey()

  • Description: Reads a single key press from the console window.
  • Returns: The character corresponding to the key pressed.
  • Changes from orig. SB: none.

TextWindow.ReadNumber()

  • Description: Reads a number from the console window.
  • Returns: The number input from the console, or null if the input is not a valid number.
  • Changes from orig. SB: SBOE returns null incase of error.

TextWindow.WriteLine(data)

  • Description: Writes data to the console window, followed by a new line.
  • Parameters:
    • data: The data to write.
  • Changes from orig. SB: none.

TextWindow.Write(data)

  • Description: Writes data to the console window without appending a new line.
  • Parameters:
    • data: The data to write.
  • Changes from orig. SB: none.

TextWindow.VerifyAccess()

  • Description: Simulates verifying access to the text window.
  • Returns: true if access to the console window is verified; otherwise, false.
  • Changes from orig. SB: none.

Top

Clone this wiki locally