lcl: Enter edit state for LM_PASTE / Clear / Cut for TDBComboBox. Part of 20326

git-svn-id: trunk@32483 -
This commit is contained in:
blikblum 2011-09-24 01:29:42 +00:00
parent b73550e311
commit d73f175065
2 changed files with 25 additions and 0 deletions

View File

@ -660,6 +660,7 @@ Type
procedure Change; override;
procedure UpdateData(Sender: TObject); virtual;
procedure UpdateText; virtual;
procedure WndProc(var Message: TLMessage); override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;

View File

@ -140,6 +140,30 @@ begin
Text := '';
end;
procedure TCustomDBComboBox.WndProc(var Message: TLMessage);
begin
case Message.Msg of
LM_CLEAR,
LM_CUT,
LM_PASTE:
begin
if FDataLink.CanModify then
begin
//LCL changes the Text before LM_PASTE is called and not after like Delphi. Issue 20330
//When Edit is called the Text property is reset to the previous value
//Add a workaround while bug is not fixed
FDataLink.OnDataChange := nil;
FDatalink.Edit;
FDataLink.Modified;
FDataLink.OnDataChange := @DataChange;
inherited WndProc(Message);
end;
end;
else
inherited WndProc(Message);
end;
end;
constructor TCustomDBComboBox.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);