Chapter 12: Basic Text Editing Facility
129
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
teRect.x0 = 0;
teRect.y0 = 2;
teRect.x1 = WinWidth(&myWindow);
teRect.y1 = teRect.y0 + LF_HEIGHT - 1;
TE_open(&myTE, &myWindow, &teRect, H_NULL,
0, 0, TE_NOWRAP|TE_MORE_ARROWS);
break;
case CM_QUIT:
/* Get text from edit record */
hText = TE_shrinkWrap(&myTE);
/* Do something with text
:
*/
/* Close text edit record */
TE_close(&myTE);
WinClose(&myWindow);
break;
case CM_ACTIVATE:
DrawWinBorder(&myWindow, &myWindow.Window);
EV_defaultHandler(event);
break;
default:
/* Allow the text editor the first attempt at handling the
event. If it does not know how to handle the event, then
pass it on to the OS default event handler.
*/
if (! TE_handleEvent(&myTE, event))
EV_defaultHandler(event);
}
}
12.3. Clipboard
The text editor moves text between the clipboard and edit buffer in response to
commands CM_CUT, CM_COPY, and CM_PASTE.
An application can manipulate the clipboard directly using routines
CB_replaceTEXT
and
CB_fetchTEXT
. Any text placed in the clipboard by an
app with a call to
CB_replaceTEXT
can later be pasted into a text edit field.
Likewise, text placed in the clipboard by the text editor can be retrieved by the
app with a call to
CB_fetchTEXT
.