Menu

#10 Make Cut/Paste etc as editing actions in DBSynEdit

open
nobody
None
5
2004-12-21
2004-12-21
Nashev
No

There are FDataLink.Edit in TDBSynEdit.DragDrop and
TDBSynEdit.ExecuteCommand only.

WMCut etc messages and ExecuteAction method is
calling clipboard functions directly and finally don't call
FDataLink.Edit.

One way to correct it - make my changes, written here
later.

Another (best, i think) way - write procedure
BeforeChange, call it in every proper places and override
it in TDBSynEdit for call FDataLink.Edit in it...

********
procedure TCustomSynEdit.WMCopy(var Message:
TMessage);
begin
4397c4397,4399
< CopyToClipboard;
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mode to
> ExecuteCommand(ecCopy, #0, nil);
> // -->> IC Nashev
Message.Result := ord(True);
end;
********
procedure TCustomSynEdit.WMCut(var Message:
TMessage);
begin
4403,4404c4405,4407
< if CanModify then
< CutToClipboard;
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mode to
> ExecuteCommand(ecCut, #0, nil);
> // -->> IC Nashev
Message.Result := ord(True);
end;
********
procedure TCustomSynEdit.WMPaste(var Message:
TMessage);
begin
4487,4488c4490,4492
< if CanModify then
< PasteFromClipboard;
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mode to
> ExecuteCommand(ecPaste, #0, nil);
> // -->> IC Nashev
Message.Result := ord(True);
end;
********
SpaceCount1: Integer;
SpaceCount2: Integer;
6078c6082
< SpaceCount3: Integer;
---
> //SpaceCount3: Integer;
ModCounter: Integer;
BackCounter: Integer;
********
if BackCounter = 0 then BackCounter :=
FTabWidth;

6294c6298
< SpaceCount3 := LeftSpaces(TabBuffer);
---
> {SpaceCount3 := }
LeftSpaces(TabBuffer);
SpaceCount1 := 0;
ModCounter := 0;
********
procedure TCustomSynEdit.ClearSelection;
begin
6962a6967
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mode to
if SelAvail then
6964c6969,6970
< SelText := '';
---
> ExecuteCommand(ecDeleteChar, #0, nil);
> // -->> IC Nashev
end;

********
Result := True;
if Action is TEditCut then
8510c8516,8518
< CutToClipboard
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mod
> ExecuteCommand(ecCut, #0, nil)
> // -->> IC Nashev
else if Action is TEditCopy then
8512c8520,8522
< CopyToClipboard
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mod
> ExecuteCommand(ecCopy, #0, nil)
> // -->> IC Nashev
else if Action is TEditPaste then
8514c8524,8526
< PasteFromClipboard
---
> // <<-- IC Nashev: to exec ExecuteCommand in
DBSynEdit to set Edit mod
> ExecuteCommand(ecPaste, #0, nil)
> // -->> IC Nashev
{$IFDEF SYN_COMPILER_5_UP}
else if Action is TEditDelete then

Discussion


Log in to post a comment.