mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 15:36:31 +02:00
LCL: Fix some data control regressions. Issue #35458, patch from Michal Gawrycki.
git-svn-id: trunk@61111 -
This commit is contained in:
parent
1d8e8b2751
commit
7de7e2642e
@ -473,6 +473,7 @@ Type
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure Loaded; override;
|
||||
procedure UpdateData(Sender: TObject); override;
|
||||
function IsUnbound: boolean;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
property KeyValue: Variant read GetKeyValue write SetKeyValue;
|
||||
|
@ -30,6 +30,11 @@ begin
|
||||
FLookup.UpdateData(ItemIndex, FScrollListDataset);
|
||||
end;
|
||||
|
||||
function TDBLookupListBox.IsUnbound: boolean;
|
||||
begin
|
||||
Result := (FDataLink.DataSource = nil) or (DataField = '');
|
||||
end;
|
||||
|
||||
procedure TDBLookupListBox.ActiveChange(Sender: TObject);
|
||||
begin
|
||||
if FDataLink.Active then
|
||||
@ -54,15 +59,18 @@ end;
|
||||
procedure TDBLookupListBox.DoSelectionChange(User: Boolean);
|
||||
begin
|
||||
if User then
|
||||
begin
|
||||
if FDataLink.CanModify then
|
||||
begin
|
||||
FDataLink.Modified;
|
||||
FDataLink.UpdateRecord;
|
||||
end
|
||||
if IsUnbound then
|
||||
UpdateData(Self)
|
||||
else
|
||||
DataChange(Self);
|
||||
end;
|
||||
begin
|
||||
if FDataLink.CanModify then
|
||||
begin
|
||||
FDataLink.Modified;
|
||||
FDataLink.UpdateRecord;
|
||||
end
|
||||
else
|
||||
DataChange(Self);
|
||||
end;
|
||||
inherited DoSelectionChange(User);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user