mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 21:29:50 +02:00
LCL: fix dbedit losing edit state on ALT+TAB and on just dragging the dbedit parent window, both seen in linux, issue #22475
git-svn-id: trunk@46276 -
This commit is contained in:
parent
f980457103
commit
17e9c7f7e6
@ -166,6 +166,7 @@ Type
|
||||
private
|
||||
FDataLink: TFieldDataLink;
|
||||
FCustomEditMask: Boolean;
|
||||
FFocusedDisplay: boolean;
|
||||
procedure DataChange(Sender: TObject);
|
||||
procedure UpdateData(Sender: TObject);
|
||||
function GetDataField: string;
|
||||
|
@ -14,6 +14,7 @@
|
||||
}
|
||||
|
||||
// included by dbctrls.pp
|
||||
{.$define UpdDisplay}
|
||||
|
||||
{ Private Methods }
|
||||
|
||||
@ -31,7 +32,7 @@ begin
|
||||
|
||||
//if we are focused its possible to edit,
|
||||
//if the field is currently modifiable
|
||||
if Focused and FDataLink.CanModify then begin
|
||||
if FFocusedDisplay and FDatalink.CanModify then begin
|
||||
//display the real text since we can modify it
|
||||
RestoreMask(DatalinkField.Text);
|
||||
end else
|
||||
@ -194,6 +195,9 @@ procedure TDBEdit.WMSetFocus(var Message: TLMSetFocus);
|
||||
begin
|
||||
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
|
||||
@ -203,6 +207,9 @@ end;
|
||||
procedure TDBEdit.WMKillFocus(var Message: TLMKillFocus);
|
||||
begin
|
||||
inherited WMKillFocus(Message);
|
||||
|
||||
FFocusedDisplay := False;
|
||||
|
||||
if FDatalink.Editing then
|
||||
begin
|
||||
FDatalink.UpdateRecord;
|
||||
|
Loading…
Reference in New Issue
Block a user