mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-18 12:26:20 +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
|
private
|
||||||
FDataLink: TFieldDataLink;
|
FDataLink: TFieldDataLink;
|
||||||
FCustomEditMask: Boolean;
|
FCustomEditMask: Boolean;
|
||||||
|
FFocusedDisplay: boolean;
|
||||||
procedure DataChange(Sender: TObject);
|
procedure DataChange(Sender: TObject);
|
||||||
procedure UpdateData(Sender: TObject);
|
procedure UpdateData(Sender: TObject);
|
||||||
function GetDataField: string;
|
function GetDataField: string;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// included by dbctrls.pp
|
// included by dbctrls.pp
|
||||||
|
{.$define UpdDisplay}
|
||||||
|
|
||||||
{ Private Methods }
|
{ Private Methods }
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ begin
|
|||||||
|
|
||||||
//if we are focused its possible to edit,
|
//if we are focused its possible to edit,
|
||||||
//if the field is currently modifiable
|
//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
|
//display the real text since we can modify it
|
||||||
RestoreMask(DatalinkField.Text);
|
RestoreMask(DatalinkField.Text);
|
||||||
end else
|
end else
|
||||||
@ -194,6 +195,9 @@ procedure TDBEdit.WMSetFocus(var Message: TLMSetFocus);
|
|||||||
begin
|
begin
|
||||||
inherited WMSetFocus(Message);
|
inherited WMSetFocus(Message);
|
||||||
// some widgetsets do not notify clipboard actions properly. Put at edit state at entry
|
// 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
|
if WidgetSet.GetLCLCapability(lcReceivesLMClearCutCopyPasteReliably) = LCL_CAPABILITY_YES then
|
||||||
FDataLink.Reset
|
FDataLink.Reset
|
||||||
else
|
else
|
||||||
@ -203,6 +207,9 @@ end;
|
|||||||
procedure TDBEdit.WMKillFocus(var Message: TLMKillFocus);
|
procedure TDBEdit.WMKillFocus(var Message: TLMKillFocus);
|
||||||
begin
|
begin
|
||||||
inherited WMKillFocus(Message);
|
inherited WMKillFocus(Message);
|
||||||
|
|
||||||
|
FFocusedDisplay := False;
|
||||||
|
|
||||||
if FDatalink.Editing then
|
if FDatalink.Editing then
|
||||||
begin
|
begin
|
||||||
FDatalink.UpdateRecord;
|
FDatalink.UpdateRecord;
|
||||||
|
Loading…
Reference in New Issue
Block a user