This functionality is supported only if you are using the Classic Agent.
Suppose your application has an object that acts like a text box, but which is not implemented using your GUI’s standard text box object. The following example illustrates how you can derive a new class from AnyWin and define methods for the custom object. The example defines the ClearText, GetMultiText, SetMultiText, and GetMultiSelText methods.
// This new class defines methods that re-implement // the methods of the TextField class so that they will // work on custom text boxes. To be able to use these // methods, you must change the class of object in the // declarations from CustomWin to CustomTextField. winclass CustomTextField : AnyWin // This method clears the text box by moving the // cursor to the start of field, selecting the text // to the end of the file, and deleting the selected // text void ClearText () TypeKeys ("<Ctrl-Home>") TypeKeys ("<Ctrl-Shift-End>") TypeKeys ("<Backspace>") // This method writes text to the text field. // It first calls ClearText and then uses TypeKeys to // input the text passed in. void SetMultiText (STRING sText) ClearText () TypeKeys (sText) // This copies the currently selected text to the // clipboard and returns the clipboard contents. LIST OF STRING GetMultiSelText () Clipboard.SetText () // Clear the clipboard TypeKeys ("<Ctrl-Insert>") return (Clipboard.GetText ()) // This method highlights all of the text in the // text field, copies the highlighted text to the // clipboard, and returns the clipboard contents. LIST OF STRING GetMultiText () Clipboard.SetText () // Clear the clipboard TypeKeys ("<Ctrl-Home>") TypeKeys ("<Ctrl-Shift-End>") TypeKeys ("<Ctrl-Insert>") TypeKeys ("<Left>") return (Clipboard.GetText ())