LitDev Extension API
LDTextWindow
![](images/IntellisenseObject.png)
TextWindow utilities.
Includes low level keyboard events.
Capture
![]() |
Encoding
![]() |
Exit
![]() |
Hide
![]() |
KeyDown
![]() |
KeyUp
![]() |
LastKey
![]() |
Minimise
![]() |
Print
![]() |
Read
![]() |
ReadNumber
![]() |
SendKey
![]() |
SetColour
![]() |
SetColours
![]() |
Show
![]() |
UpdateShowHide
![]() |
Capture(fileName,border)
![](images/IntellisenseMethod.png)
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.
fileName 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 Include the window border ("True" or "False").
returns The ImageList image if fileName is "", otherwise if output to a file, then "" is returned.
Encoding
![](images/IntellisenseProperty.png)
Set extended encoding for the TextWindow.
Allowed values are:
"ASCII" (default), "Unicode", "UTF7", "UTF8"
Exit
![](images/IntellisenseEvent.png)
Event when TextWindow is closing.
You can perform any final actions here.
Hide()
![](images/IntellisenseMethod.png)
Completely hide the TextWindow.
Replacement for standard method that may fail if window manually changed by the user.
KeyDown
![](images/IntellisenseEvent.png)
Low level event when a key is pressed down.
This event is independent of any window focus, i.e. not just for TextWindow or GraphicsWindow.
KeyUp
![](images/IntellisenseEvent.png)
Low level event when a key is released.
This event is independent of any window focus, i.e. not just for TextWindow or GraphicsWindow.
LastKey
![](images/IntellisenseProperty.png)
Last key pressed or released.
Minimise()
![](images/IntellisenseMethod.png)
Minimise the TextWindow.
Print(border)
![](images/IntellisenseMethod.png)
Print the TextWindow contents.
The window must be visible and a short delay may be required after updating the window before calling.
border Include the window border ("True" or "False").
returns None.
Read(delay)
![](images/IntellisenseMethod.png)
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.
delay A maximum delay in ms before the Read is terminated.
returns The text that was read from the TextWindow.
ReadNumber(delay)
![](images/IntellisenseMethod.png)
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.
delay A maximum delay in ms before the Read is terminated.
returns The number that was read from the TextWindow.
SendKey(window,key)
![](images/IntellisenseMethod.png)
Send a key to a window. This is the same a typing the key into a window.
window The window title e.g. TextWindow.Title or GraphicsWindow.Title.
key The key to send e.g. "Return"
SetColour(index,colour)
![](images/IntellisenseMethod.png)
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.
index The stanadard colour index colour to replace.
colour Any colour to replace a standard colour with.
SetColours(fgIndex,bgIndex)
![](images/IntellisenseMethod.png)
Set the current foreground and background colour indices.
fgIndex The foreground colour index (0 to 15).
bgIndex The background colour index (0 to 15).
Show()
![](images/IntellisenseMethod.png)
Show the TextWindow and give it focus.
Replacement for standard method that may fail if window manually changed by the user.
UpdateShowHide
![](images/IntellisenseProperty.png)
Also update internal state when using Hide and Minimise methods, "True" (default) or "False".
If the internal state is updated as hidden or minimised, then methods like Read will automatically bring the window into focus.