textedit(3w) — OLIT Widget Set
NAMES
OlTextEditClearBuffer, OlTextEditReadSubString, OlTextEditCopyBuffer, OlTextEditCopySelection, OlTextEditRedraw, OlTextEditGetCursorPosition, OlTextEditSetCursorPosition, OlTextEditGetLastPosition, OlTextEditTextBuffer, OlTextEditInsert, OlTextEditUpdate, OlTextEditPaste
SYNOPSIS and DESCRIPTION
OlTextEditClearBuffer
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditClearBuffer(
TextEditWidget ctx);
The OlTextEditClearBuffer function is used to delete all of the text associated with the TextEdit widget ctx.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget or if the clear operation fails; otherwise TRUE is returned.
OlTextEditReadSubString
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditReadSubString(
TextEditWidget ctx,
char ∗∗buffer,
TextPosition start,
TextPosition end);
The OlTextEditReadSubString function is used to retrieve a copy of a substring from the TextBuffer associated with the TextEdit Widget ctx between positions start through end inclusive. The storage required for the copy is allocated by this routine; it is the responsibility of the caller to free this storage when appropriate.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget or if the operation fails; otherwise TRUE is returned.
OlTextEditCopyBuffer
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditCopyBuffer(
TextEditWidget ctx,
char ∗∗buffer);
The OlTextEditCopyBuffer function is used to retrieve a copy of the TextBuffer ctx associated with the TextEdit widget The storage required for the copy is allocated by this routine; it is the responsibility of the caller to free this storage when appropriate.
Return
FALSE is returned if the widget supplied is not a TextEditWidget or if the buffer cannot be read; otherwise TRUE is returned.
OlTextEditCopySelection
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditCopySelection(
TextEditWidget ctx,
int delete);
The OlTextEditCopySelection function is used to Copy or Cut the current selection in the TextEdit ctx. If no selection exists or if the TextEdit cannot acquire the CLIPBOARD, FALSE is returned. Otherwise the selection is copied to the CLIPBOARD then, if the delete flag is non-zero, the text is then deleted from the TextBuffer associated with the TextEdit widget (i.e., a CUT operation is performed). Finally, TRUE is returned.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget or if the operation fails; otherwise TRUE is returned.
OlTextEditRedraw
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditRedraw(
TextEditWidget ctx);
The OlTextEditRedraw function is used to force a complete refresh of the TextEdit widget display. This routine does nothing if the TextEdit widget is not realized or if the update state is set to FALSE.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget or if the widget is not realized or if the update state is FALSE; otherwise TRUE is returned.
OlTextEditGetCursorPosition
Synopsis:
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditGetCursorPosition(
TextEditWidget ctx,
TextPosition ∗start,
TextPosition ∗end,
TextPosition ∗cursorPosition);
The OlTextEditGetCursorPosition function is used to retrieve the current selection start and end and cursorPosition. If there is no current selection start and end will both be equal to cursorPosition.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget; otherwise TRUE is returned.
OlTextEditSetCursorPosition
Synopsis:
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditSetCursorPosition(
TextEditWidget ctx,
TextPosition start,
TextPosition end,
TextPosition cursorPosition);
The OlTextEditSetCursorPosition function is used to change the current selection start and end and cursorPosition. The function does NOT check (for efficiency) the validity of the positions. If invalid values are given results are unpredictable. The function attempts to ensure that the cursorPosition is visible by scrolling the display.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget; otherwise TRUE is returned.
OlTextEditGetLastPosition
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditGetLastPosition(
TextEditWidget ctx,
TextPosition ∗position);
The OlTextEditGetLastPosition function is used to retrieve the position of the last character in the TextBuffer associated with the TextEdit widget ctx.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget; otherwise TRUE is returned.
OlTextEditTextBuffer
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern TextBuffer ∗OlTextEditTextBuffer(
TextEditWidget ctx);
The OlTextEditTextBuffer function is used to retrieve the TextBuffer pointer associated with the TextEdit widget ctx. This pointer can be used to access the facilities provided by the Text Buffer Utilities module.
OlTextEditInsert
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditInsert(
TextEditWidget ctx,
String buffer,
int length);
The OlTextEditInsert function is used to insert a NULL-terminated buffer containing length bytes in the TextBuffer associated with the TextEdit widget ctx. The inserted text replaces the current (if any) selection. Note: The value of length is not used internally, but is passed on as the length field in the XtNmodifyVerification callback.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget or if the insert operation fails; otherwise TRUE is returned.
OlTextEditUpdate
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditUpdate(
TextEditWidget ctx,
Boolean state);
The OlTextEditUpdate function is used to set the updateState of a TextEdit Widget. Setting the state to FALSE turns screen update off; setting the state to TRUE turns screen updates on and refreshes the display.
Return
FALSE is returned if the widget supplied is not a TextEdit Widget; otherwise TRUE is returned.
OlTextEditPaste
Synopsis:
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <Xol/Dynamic.h>
#include <Xol/TextEdit.h>
. . .
extern Boolean OlTextEditPaste(
TextEditWidget ctx);
The OlTextEditPaste function is used to paste the contents of the CLIPBOARD into the TextEdit widget ctx. The current (if any) selection is replaced by the contents of the CLIPBOARD,
Return
FALSE is returned if the widget supplied is not a TextEdit Widget; otherwise TRUE is returned.
SEE ALSO
regularexpression(3w), textbuffer(3w), textfield(3w) textselection(3w) TextEdit(3w) TextField(3w)
Version 3.0 — Last change: 19 July 91