lcl: update DBEdit.Text in SetFocus when widgetset does not support clipboard messages. Issue #29693

git-svn-id: trunk@51921 -
This commit is contained in:
blikblum 2016-03-11 22:32:07 +00:00
parent 1a67a8c6c8
commit 2be91bc1f5

View File

@ -195,16 +195,24 @@ begin
end;
procedure TDBEdit.WMSetFocus(var Message: TLMSetFocus);
var
EditOnFocus: Boolean;
begin
// update text before inherited so DoEnter has the new text
if not FFocusedDisplay then
begin
FFocusedDisplay := True;
// some widgetsets do not notify clipboard actions properly. Put at edit state at entry
EditOnFocus := WidgetSet.GetLCLCapability(lcReceivesLMClearCutCopyPasteReliably) = LCL_CAPABILITY_NO;
if EditOnFocus then
begin
if FDataLink.Edit then
RestoreMask(FDataLink.Field.Text);
end
else
FDataLink.Reset;
end;
inherited WMSetFocus(Message);
// some widgetsets do not notify clipboard actions properly. Put at edit state at entry
if FFocusedDisplay then
exit;
FFocusedDisplay := true;
if WidgetSet.GetLCLCapability(lcReceivesLMClearCutCopyPasteReliably) = LCL_CAPABILITY_YES then
FDataLink.Reset
else
FDataLink.Edit;
end;
procedure TDBEdit.WMKillFocus(var Message: TLMKillFocus);