An edit box created using %eb provides a wide range of advanced text editing
features. See Edit box (%eb) for
details.
N represents the width of the box in average characters. M represents
the depth which, if omitted, defaults to 1.
buffer is a character string for the text which must be terminated with
chr(0).
buff_size is the size of the buffer. A zero value may be supplied to
allow the edit box to allocate its own memory re-sizing as required (buffer
is ignored).
%eb will take a pivot (%pv - Pivot).
If the caret modifier (^) is used and the call-back function does not handle the
response to control keys such as Delete, Backspace, etc., then it should return
a zero value.
Routines such as OPEN_EDIT_FILE@ that take an EDIT_INFO block as their first argument can now alternatively use the
Windows handle (HWND) of the control for this first argument. This handle is typically obtained by using %lc - Handle of Last Control.
The following functions may be used with this enhanced control.
These functions take an INTEGER(7) value HWND, typically obtained via %lc - Handle of Last Control. If HWND is zero (0_7) then the control that
has the current focus is used.
INTEGER FUNCTION GetEditText@(HWND, BUFFER, SIZE)
CHARACTER(*) BUFFER
INTEGER SIZE
Gets the contents of the control. Returns zero if the HWND is not valid or the buffer is not large enough.
SIZE is the size of the buffer. Edit controls are limited to a maximum of 32K characters.
INTEGER FUNCTION OpenEditFile@(HWND, FILENAME)
CHARACTER(*) FILENAME
Opens and reads the text file into the control and associates the control with this FILENAME.
Return zero if the HWND is not valid or the file cannot be opened and read.
This function can be used in a callback associated with the "FILE_OPENR" standard callback and the %ft - Filter for File Dialog format
code for file "filters".
INTEGER FUNCTION EditFileSave@(HWND)
The function uses the file name associated with the control if it has one, otherwise it opens a standard "Open file"
dialog and creates the file association. No action is taken if an association exists and the text has not changed.
Returns zero if the HWND is not valid or the file cannot be saved. File "filters" can be provided via the %ft - Filter for File Dialog
format code.
INTEGER FUNCTION EditFileSaveAs@(HWND)
The function opens a standard "Open file" dialog to get a full path for a file and then saves it, creating a new
file association for the control. Returns zero if the HWND is not valid or the file cannot be saved. File "filters"
can be provided via the %FT format code.
INTEGER FUNCTION EditFileClosePrompt@(HWND, CAPTION, MESSAGE)
CHARACTER(*) CAPTION,MESSAGE
Used when closing the control's window (e.g. within a %cc - Control Closure callback). If the text has changed since the last "save"
operation then a dialog is presented prompting for a save before closing. The possible responses are Yes, No and Cancel.
CAPTION is the title for the prompting dialog and MESSAGE is its message. If %s is used within this MESSAGE string
then %s is replaced by the short name of the associated file if there is one.
The function returns zero for "No" and for "Yes" when the save is successful. This return value can be used directly
as the return value of a %cc callback.
INTEGER FUNCTION EditFileModified@(HWND)
Returns 1 if the text has been changed since the last save operation, otherwise it returns zero.
|