OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Using the Clipboard and the Edit Menu

You can directly transfer text between an edit control object and the Windows Clipboard using TEdit member functions.

You probably want to give users access to these member functions by giving your window an Edit menu.

Edit control objects have built-in responses to menu items like Edit|Copy and Edit|Undo. TEdit has command response member functions, such as CmEditCopy and CmEditUndo, which ObjectWindows invokes in response to users choosing items from the parent window's Edit menu.

The following table shows the Clipboard and editing member functions and the menu commands that invoke them:

TEdit member functions and Edit menu commands

Member functionMenu commandDescription
TEdit::CopyCM_EDITCOPYCopy text to Clipboard.
TEdit::CutCM_EDITCUTCut text to Clipboard.
TEdit::UndoCM_EDITUNDOUndo last edit.
TEdit::PasteCM_EDITPASTEPaste text from Clipboard.
TEdit::DeleteSelectionCM_EDITDELETEDelete selected text.
TEdit::ClearCM_EDITCLEARClear entire edit control.

To add an editing menu to a window that contains edit control objects, define a menu resource for the window using the menu commands listed above. You do not need to write any new member functions.

See Also