mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 13:49:32 +02:00
lcl: call UpdateRecord in TDBListBox only when loosing focus so selection can be canceled (Delphi compatible)
git-svn-id: trunk@30338 -
This commit is contained in:
parent
da0e5e00ab
commit
28c3707917
@ -149,7 +149,7 @@ procedure TCustomDBListBox.Click;
|
||||
begin
|
||||
//make sure we are in modify mode if can edit
|
||||
//so if a user changed the selection it can be
|
||||
//updated, and if not canel out ala ReadOnly
|
||||
//updated, and if not cancel out ala ReadOnly
|
||||
if not FDataLink.Edit then
|
||||
begin
|
||||
// restore value
|
||||
@ -162,7 +162,10 @@ end;
|
||||
|
||||
procedure TCustomDBListBox.EditingDone;
|
||||
begin
|
||||
FDataLink.UpdateRecord;
|
||||
//update record only when loosing focus to keep the ability to cancel
|
||||
//after changing the selection more than one time
|
||||
if not Focused then
|
||||
FDataLink.UpdateRecord;
|
||||
inherited EditingDone;
|
||||
end;
|
||||
|
||||
@ -179,8 +182,7 @@ end;
|
||||
|
||||
destructor TCustomDBListBox.Destroy;
|
||||
begin
|
||||
FDataLink.Free;
|
||||
FDataLink := nil;
|
||||
FDataLink.Destroy;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user