The EVENT structure event which represents the event to be processed. TE_handleEvent needs a pointer to the editor control structure te, and a pointer to If the event was sucessfully processed by the editor, else returns FALSE.
For example, the user can redefine keys,įorbid all keys except uppercase letters, etc. Keys will be processed and which will not be, and the user may program a lot of specialĪctions which are not pre-programmed in the editor. ThisĪpproach is much more flexible, because the user may decide which
In other words, the "main loop" is part of the user program. The editor will then process the keypress (for example, it will insert a newĬharacter, delete a character, scroll the editor area upwards/downwardsĮtc. Instead, the user need to collect keypresses, and to dispatch them to the editor It does not have a "main loop" in which keypresses are collected and The text editor is an event driven application (see events.h for more Short TE_handleEvent ( TEXT_EDIT *te, EVENT *event) ĭispatches an event to the text editor to be processed by it. So, it is sometimes used after calling TE_select Note: TE_focus also enables the cursor using CU_start Returns TRUE if focusing was performed, and returnsįALSE if not (for example, if the text was already focused). Gives the focus to it, so the selected text will becomeĪctive (after this, any keypress will replace selected text with the newly pressed Selected text in the editor (associated with the structure pointed to by te), and TE_focus is usually called after TE_select. Highlightes the selected text in the editor, and gives the focus to it. Updated when the next paint message arrives. clears its WF_DIRTY bit) so, the edit region will be eventually Note that this routine turns off cursor blink before emptying the edit buffer, butĭoes not repaint the edit region. TE_empty empties the text editor buffer (associated with the structure pointed to by te). It seems better to me to release the memory manually So, it seems that it tries to close out a text edit record and to If the editor was opened using TE_openFixed, and if the buffer
To free the memory occupied by the buffer (by calling HeapFreeIndir) I am not sure whetherĬalling this routine is necessary: it performs mainly some irrelevant operations TE_close closes the text editor structure pointed to by te. TE_openFixed if you want to use this function. Of course, the editor must not be opened with This function, except if it is necessary to check and eventually expand the buffer independently Keypresses using TE_handleEvent, so the user need not to call Note that the editor will expand buffer if necessary during normal processing of If there is not much space left, then the buffer is reallocated TE_checkSlack checks how much free space is present in the text editor buffer (associated with the Reallocates the text editor buffer if there is not much space left in it. WINDOW The main window-describing structure. WIN_RECT A structure for defining a rectangular area. TEXT_EDIT A structure used to coordinate all text editor operations. size_t A type to define sizes of strings and memory blocks. SCR_STATE A structure for saving the state of the graphics system. SCR_RECT A scructure for defining a rectangular area. HANDLE Represents a handle associated with an allocated memory block. EVENT A structure describing an event message. ETE_FLAGS Enumerates optional features for the TE_open function. Predefined Types Bool An enumeration to describe true or false values. Constants TE_FAR_RIGHT A constant defining the last cursor position in TE_open. TE_updateCommand Updates the command byte in the current line of the text. TE_unfocus Removes the focus from the selected text in the editor. TE_shrinkWrap Shrinks the text editor buffer. TE_select Selects a block of text in the editor, or positions the cursor.
TE_reopenPlain Re-opens the text editor (plain). TE_pasteText Pastes a text into the editor. TE_openFixed Initializes the text editor, with fixed buffer. TE_isBlank Check whether the editor buffer is empty. TE_indicateReadOnly Indicates read-only mode of the editor. TE_handleEvent Dispatches an event to the text editor to be processed by it. TE_focus Highlightes the selected text in the editor, and gives the focus to it. Routines to access the text editor Functions TE_checkSlack Reallocates the text editor buffer if there is not much space left in it.