OWLNext 7.0
Borland's Object Windows Library for the modern age
|
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 function | Menu command | Description |
TEdit::Copy | CM_EDITCOPY | Copy text to Clipboard. |
TEdit::Cut | CM_EDITCUT | Cut text to Clipboard. |
TEdit::Undo | CM_EDITUNDO | Undo last edit. |
TEdit::Paste | CM_EDITPASTE | Paste text from Clipboard. |
TEdit::DeleteSelection | CM_EDITDELETE | Delete selected text. |
TEdit::Clear | CM_EDITCLEAR | Clear 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.