Board index » delphi » Implementing Edit menu in Menu Designer

Implementing Edit menu in Menu Designer

I have nearly completed my main menu, with the exception of the Edit menu.

Am I correct that to implement cut, copy and paste that I need to figure out
which field the user is in and then use the format "Field
Identifier.CutToClipboard" (using cut as an example)?  

The shortcut keys don't seem to care, but I apparently need to enter a field
identifier to use a command like 'CutToClipboard.'

I suspect I'm missing something obvious...

Thanks,
Stuart Kohler
<skoh...@aol.com>

 

Re:Implementing Edit menu in Menu Designer


On 10 Mar 1999 16:06:22 GMT, skoh...@aol.com (SKOHLER) wrote:

Quote
>I have nearly completed my main menu, with the exception of the Edit menu.

>Am I correct that to implement cut, copy and paste that I need to figure out
>which field the user is in and then use the format "Field
>Identifier.CutToClipboard" (using cut as an example)?  

>The shortcut keys don't seem to care, but I apparently need to enter a field
>identifier to use a command like 'CutToClipboard.'

>I suspect I'm missing something obvious...

The easiest way to implement cut, copy, and paste is

  SendMessage(ActiveControl.Handle, WM_CUT, 0, 0);

  SendMessage(ActiveControl.Handle, WM_COPY, 0, 0);

  SendMessage(ActiveControl.Handle, WM_PASTE, 0, 0);

--
"Oh, shootings.  Yes, but that doesn't mean Americans are more {*word*268}
than other people.  We're just better shots."

Re:Implementing Edit menu in Menu Designer


Hi Stuart,

The SetTextBuf method is used to copy text from a buffer
to the clipboard:
procedure SetTextBuf(Buffer: PChar);

The GetTextBuf method copies the text contents of the
clipboard into a buffer:
function GetTextBuf(Buffer: PChar; BufSize: Integer):Integer;

Also you can use AsText;
ex
if Sender is TEditbox then
   with Sender as TEditbox do
   Clipboard.AsText:= Text;     //copy
//or:) Clipboard.AsText:= Text;
//       Text:='';              //cut
//or:) Text:= Clipboard.Text;   //paste

Hope that I understood your problem,
Cheers,
Rudy
============================================================
SKOHLER schreef:

Quote

> I have nearly completed my main menu, with the exception of the Edit menu.

> Am I correct that to implement cut, copy and paste that I need to figure out
> which field the user is in and then use the format "Field
> Identifier.CutToClipboard" (using cut as an example)?

> The shortcut keys don't seem to care, but I apparently need to enter a field
> identifier to use a command like 'CutToClipboard.'

> I suspect I'm missing something obvious...

> Thanks,
> Stuart Kohler
> <skoh...@aol.com>

Re:Implementing Edit menu in Menu Designer


Thanks for the answers.

In this case the SendMessage code was exactly what I was looking for...

All the help is much appreciated!

Stuart Kohler
<skoh...@aol.com>

Other Threads