C# Class LitDev.LDTextWindow

Show file Open project: litdev1/LitDev

Public Methods

Method Description
Capture ( Primitive fileName, Primitive border ) : Primitive

Save the TextWindow as an image file (png, jpg, bmp, gif, tiff or ico). The window must be visible and a short delay may be required after updating the window before calling.

Hide ( ) : void

Hide the TextWindow. Replacement for standard method that may fail (do not mix these methods).

Print ( Primitive border ) : void

Print the TextWindow contents. The window must be visible and a short delay may be required after updating the window before calling.

Read ( Primitive delay ) : Primitive

Read from a TextWindow with a maximum delay. This sends a Return (ENTER) to the TextWindow after the delay. If the user presses Return before the delay is completed, then no further action is taken.

ReadNumber ( Primitive delay ) : Primitive

Read a number from a TextWindow with a maximum delay. This sends a Return (ENTER) to the TextWindow after the delay. If the user presses Return before the delay is completed, then no further action is taken.

SendKey ( Primitive window, Primitive key ) : void

Send a key to a window. This is the same a typing the key into a window.

SetColour ( Primitive index, Primitive colour ) : void

Replace one of the standard TextWindow colours. There are 16 available colours, by default they are indexed 0 to 15: Black (0), DarkBlue (1), DarkGreen (2), DarkCyan (3), DarkRed (4), DarkMagenta (5), DarkYellow (6), Gray (7), DarkGray (8), Blue (9), Green (10), Cyan (11), Red (12), Magenta (13), Yellow (14), White (15). Note that you can still use TextWindow.BackgroundColor and TextWindow.ForegroundColor to use the new colours (with the original colour names), alternatively the colours can be selected using LDTextWindow.SetColours from the indices. The colours must be set using either method before they are applied.

SetColours ( Primitive fgIndex, Primitive bgIndex ) : void

Set the current foreground and background colour indices.

Show ( ) : void

Show the TextWindow and give it focus. Replacement for standard method that may fail (do not mix these methods).

Private Methods

Method Description
Delay ( Object delay ) : void
HookCallback ( int nCode, IntPtr wParam, IntPtr lParam ) : IntPtr
HookThread ( ) : void
SetHook ( ) : void

Method Details

Capture() public static method

Save the TextWindow as an image file (png, jpg, bmp, gif, tiff or ico). The window must be visible and a short delay may be required after updating the window before calling.
public static Capture ( Primitive fileName, Primitive border ) : Primitive
fileName Primitive /// The file to save the image to (*.png, *.jpg, *.bmp, *.gif, *.tiff or *.ico). /// If this is set to "", then the image is created internally as an ImageList. ///
border Primitive /// Include the window border ("True" or "False"). ///
return Primitive

Hide() public static method

Hide the TextWindow. Replacement for standard method that may fail (do not mix these methods).
public static Hide ( ) : void
return void

Print() public static method

Print the TextWindow contents. The window must be visible and a short delay may be required after updating the window before calling.
public static Print ( Primitive border ) : void
border Primitive /// Include the window border ("True" or "False"). ///
return void

Read() public static method

Read from a TextWindow with a maximum delay. This sends a Return (ENTER) to the TextWindow after the delay. If the user presses Return before the delay is completed, then no further action is taken.
public static Read ( Primitive delay ) : Primitive
delay Primitive A maximum delay in ms before the Read is terminated.
return Primitive

ReadNumber() public static method

Read a number from a TextWindow with a maximum delay. This sends a Return (ENTER) to the TextWindow after the delay. If the user presses Return before the delay is completed, then no further action is taken.
public static ReadNumber ( Primitive delay ) : Primitive
delay Primitive A maximum delay in ms before the Read is terminated.
return Primitive

SendKey() public static method

Send a key to a window. This is the same a typing the key into a window.
public static SendKey ( Primitive window, Primitive key ) : void
window Primitive The window title e.g. TextWindow.Title or GraphicsWindow.Title.
key Primitive The key to send e.g. "Return"
return void

SetColour() public static method

Replace one of the standard TextWindow colours. There are 16 available colours, by default they are indexed 0 to 15: Black (0), DarkBlue (1), DarkGreen (2), DarkCyan (3), DarkRed (4), DarkMagenta (5), DarkYellow (6), Gray (7), DarkGray (8), Blue (9), Green (10), Cyan (11), Red (12), Magenta (13), Yellow (14), White (15). Note that you can still use TextWindow.BackgroundColor and TextWindow.ForegroundColor to use the new colours (with the original colour names), alternatively the colours can be selected using LDTextWindow.SetColours from the indices. The colours must be set using either method before they are applied.
public static SetColour ( Primitive index, Primitive colour ) : void
index Primitive The stanadard colour index colour to replace.
colour Primitive Any colour to replace a standard colour with.
return void

SetColours() public static method

Set the current foreground and background colour indices.
public static SetColours ( Primitive fgIndex, Primitive bgIndex ) : void
fgIndex Primitive The foreground colour index (0 to 15).
bgIndex Primitive The background colour index (0 to 15).
return void

Show() public static method

Show the TextWindow and give it focus. Replacement for standard method that may fail (do not mix these methods).
public static Show ( ) : void
return void