Contents Up Previous Next

wxTextWindow is-a wxWindow

To display a lot of text, use this subwindow as the child of a wxFrame. It is capable of loading and saving files of ASCII text, and the text can be edited directly.

The following callbacks are valid for the dialog box class:

OnChar
(Not XView.) The function is called with the text window identifier, key code, and key event identifier. If the event is an ASCII keypress, the code will correspond to the ASCII code; otherwise, the programmer must refer to the constants defined in common.h, in the wxWindows library.

To invoke default processing, call text-window-on-char (to be implemented).

OnSize
The function is called with the text window identifier, width and height.

wxTextWindow clear
wxTextWindow copy
wxTextWindow cut
wxTextWindow create
wxTextWindow discard-edits
wxTextWindow get-contents
wxTextWindow load-file
wxTextWindow modified
wxTextWindow paste
wxTextWindow save-file
wxTextWindow set-editable
wxTextWindow write


wxTextWindow clear

bool ( clear)

Clears the contents of a text subwindow. Returns TRUE if successful, FALSE otherwise.


wxTextWindow copy

bool ( copy)

Copies the selected text to the clipboard.


wxTextWindow cut

bool ( cut)

Copies the selected text to the clipboard, then removes the selection.


wxTextWindow create

void ( create)

Creates a text subwindow. The following slots may be initialized.

style is a bit list of some of the following:

wxBORDER Use this style to draw a thin border in Windows (non-native implementation only).
wxNATIVE_IMPL Use this style to allow editing under Windows, albeit with a 64K limitation.


wxTextWindow discard-edits

void ( discard-edits)

Discard any edits in the text window.


wxTextWindow get-contents

string ( get-contents)

Returns the contents (up to a maximum of 1000 characters).


wxTextWindow load-file

bool ( load-file string filename)

Load the file onto the text subwindow, returning TRUE for success, FALSE for failure.


wxTextWindow modified

bool ( modified)

Returns TRUE if the text has been modified, FALSE otherwise.


wxTextWindow paste

bool ( paste)

Pastes the text (if any) from the clipboard to the text window.


wxTextWindow save-file

bool ( save-file string filename)

Saves the text in the subwindow to the given file, returning TRUE for success, FALSE for failure.


wxTextWindow set-editable

Bool ( set-editable bool editable)

Sets the text window to be editable or read-only.


wxTextWindow write

bool ( write string text)

Writes the given string into the text window, at the current cursor point.