 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Shinco Guest
|
Posted: Fri Oct 17, 2003 10:53 am Post subject: RichEdit and FindDialog 's Paste (Ctrl+V) conflicted problem |
|
|
don't know how to deal with Ctrl+V (or WM_Paste) between RichEdit1 and
FindDialog1? Thanks
the following is my sample function:
I added a richEdit in the form ,and add a Main Menu ,which consists of the
following several menu item
MenuItem Hotkey
1)EditCut Ctrl+X
2)EditCopy Ctrl+C
3)EditPaste Ctrl+V
i also added a button1 (with "Search Text" caption) and FindDialog1.
the following is implementation code
procedure TForm1.EditCut1Execute(Sender: TObject);
begin
RichEdit1.CutToClipboard;
end;
procedure TForm1.EditCopy1Execute(Sender: TObject);
begin
RichEdit1.CopyToClipboard;
end;
procedure TForm1.EditPaste1Execute(Sender: TObject);
begin
RichEdit1.PasteFromClipboard;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FindDialog1.Execute;
end;
my problems is :
1)while editing the RichEdit, i cut the text to clipbord using striking
Ctrl+X .
2)Click Button1, so the FindDialog1 is opened
3) in the FindDialog1, i set the focus on the input edit box ,then strike
Ctrl+V,which intended to copy the text from clipboard to the edit box.
However the text is pasted to the richedit1 ?!
I don't know where i am wrong using the Hotkey and RichEdit1?
Thanks a lots again
P.s ,i am using Delphi 7 Ent.
Shinco
|
|
| Back to top |
|
 |
Ed Guest
|
Posted: Fri Oct 17, 2003 4:32 pm Post subject: Re: RichEdit and FindDialog 's Paste (Ctrl+V) conflicted pro |
|
|
Your problem is that your menu overrides the basic Windows hotkey behavior
for edits. So, since your code for your menu specifically references the
rich edit... that's where it works.
Ed Wilson
Training Technologies, Inc.
"Shinco" <shincolu (AT) sina (DOT) com> wrote
| Quote: | don't know how to deal with Ctrl+V (or WM_Paste) between RichEdit1 and
FindDialog1? Thanks
the following is my sample function:
I added a richEdit in the form ,and add a Main Menu ,which consists of the
following several menu item
MenuItem Hotkey
1)EditCut Ctrl+X
2)EditCopy Ctrl+C
3)EditPaste Ctrl+V
i also added a button1 (with "Search Text" caption) and FindDialog1.
the following is implementation code
procedure TForm1.EditCut1Execute(Sender: TObject);
begin
RichEdit1.CutToClipboard;
end;
procedure TForm1.EditCopy1Execute(Sender: TObject);
begin
RichEdit1.CopyToClipboard;
end;
procedure TForm1.EditPaste1Execute(Sender: TObject);
begin
RichEdit1.PasteFromClipboard;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FindDialog1.Execute;
end;
my problems is :
1)while editing the RichEdit, i cut the text to clipbord using striking
Ctrl+X .
2)Click Button1, so the FindDialog1 is opened
3) in the FindDialog1, i set the focus on the input edit box ,then strike
Ctrl+V,which intended to copy the text from clipboard to the edit box.
However the text is pasted to the richedit1 ?!
I don't know where i am wrong using the Hotkey and RichEdit1?
Thanks a lots again
P.s ,i am using Delphi 7 Ent.
Shinco
|
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Fri Oct 17, 2003 6:45 pm Post subject: Re: RichEdit and FindDialog 's Paste (Ctrl+V) conflicted pro |
|
|
In article <3f8fca50 (AT) newsgroups (DOT) borland.com>, Shinco wrote:
| Quote: | don't know how to deal with Ctrl+V (or WM_Paste) between RichEdit1 and
FindDialog1? Thanks
I don't know where i am wrong using the Hotkey and RichEdit1?
|
Actually you are completely blameless, this is a problem in the VCLs shortcut
handling. It has come up before, i think, so you may be able to find some
additional info in the newsgroup archives or on http://qc.borland.com .
A possible fix for the problem is this:
Override the IsShortcut method in the main form:
public
function IsShortCut(var Message: TWMKey): Boolean; override;
Implement it as this:
function TMainForm.IsShortCut(var Message: TWMKey): Boolean;
var
wnd: HWND;
begin
wnd:= GetLastactivePopup( application.handle );
if (wnd <> 0) and (wnd <> application.handle) then
result := false
else
result := inherited IsShortcut( Message );
end;
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Robert Guest
|
Posted: Wed Dec 03, 2003 9:52 am Post subject: Re: RichEdit and FindDialog 's Paste (Ctrl+V) conflicted pro |
|
|
Use the Delphi Action methods to implement this functionality
TEditCopy TEditCut etc.
Robert Clemenzi
"Shinco" <shincolu (AT) sina (DOT) com> wrote
| Quote: | don't know how to deal with Ctrl+V (or WM_Paste) between RichEdit1 and
FindDialog1? Thanks
the following is my sample function:
I added a richEdit in the form ,and add a Main Menu ,which consists of the
following several menu item
MenuItem Hotkey
1)EditCut Ctrl+X
2)EditCopy Ctrl+C
3)EditPaste Ctrl+V
i also added a button1 (with "Search Text" caption) and FindDialog1.
the following is implementation code
procedure TForm1.EditCut1Execute(Sender: TObject);
begin
RichEdit1.CutToClipboard;
end;
procedure TForm1.EditCopy1Execute(Sender: TObject);
begin
RichEdit1.CopyToClipboard;
end;
procedure TForm1.EditPaste1Execute(Sender: TObject);
begin
RichEdit1.PasteFromClipboard;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FindDialog1.Execute;
end;
my problems is :
1)while editing the RichEdit, i cut the text to clipbord using striking
Ctrl+X .
2)Click Button1, so the FindDialog1 is opened
3) in the FindDialog1, i set the focus on the input edit box ,then strike
Ctrl+V,which intended to copy the text from clipboard to the edit box.
However the text is pasted to the richedit1 ?!
I don't know where i am wrong using the Hotkey and RichEdit1?
Thanks a lots again
P.s ,i am using Delphi 7 Ent.
Shinco
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|