mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 00:30:25 +02:00
lcl: override Select in TCustomDBComboBox instead of TDBComboBox to affect also TDBLookupComboBox (avoid crash when ListDataset enters in Edit state inside TDBLookup.UpdateData)
git-svn-id: trunk@33467 -
This commit is contained in:
parent
f54588640d
commit
190136efbb
@ -654,6 +654,7 @@ Type
|
|||||||
procedure Notification(AComponent: TComponent;
|
procedure Notification(AComponent: TComponent;
|
||||||
Operation: TOperation); override;
|
Operation: TOperation); override;
|
||||||
procedure Change; override;
|
procedure Change; override;
|
||||||
|
procedure Select; override;
|
||||||
procedure UpdateData(Sender: TObject); virtual; abstract;
|
procedure UpdateData(Sender: TObject); virtual; abstract;
|
||||||
procedure WndProc(var Message: TLMessage); override;
|
procedure WndProc(var Message: TLMessage); override;
|
||||||
public
|
public
|
||||||
@ -676,7 +677,6 @@ Type
|
|||||||
procedure DataChange(Sender: TObject); override;
|
procedure DataChange(Sender: TObject); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure KeyPress(var Key: char); override;
|
procedure KeyPress(var Key: char); override;
|
||||||
procedure Select; override;
|
|
||||||
procedure UpdateData(Sender: TObject); override;
|
procedure UpdateData(Sender: TObject); override;
|
||||||
published
|
published
|
||||||
property Anchors;
|
property Anchors;
|
||||||
|
@ -44,6 +44,16 @@ begin
|
|||||||
inherited Change;
|
inherited Change;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomDBComboBox.Select;
|
||||||
|
begin
|
||||||
|
//avoid reseting text when calling select
|
||||||
|
FDataLink.OnDataChange := nil;
|
||||||
|
FDataLink.Edit;
|
||||||
|
FDataLink.Modified;
|
||||||
|
FDataLink.OnDataChange := @DataChange;
|
||||||
|
inherited Select;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TCustomDBComboBox.GetReadOnly: Boolean;
|
function TCustomDBComboBox.GetReadOnly: Boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -18,16 +18,6 @@
|
|||||||
|
|
||||||
{ TDBComboBox }
|
{ TDBComboBox }
|
||||||
|
|
||||||
procedure TDBComboBox.Select;
|
|
||||||
begin
|
|
||||||
//avoid reseting text when calling select
|
|
||||||
FDataLink.OnDataChange := nil;
|
|
||||||
FDataLink.Edit;
|
|
||||||
FDataLink.Modified;
|
|
||||||
FDataLink.OnDataChange := @DataChange;
|
|
||||||
inherited Select;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TDBComboBox.UpdateData(Sender: TObject);
|
procedure TDBComboBox.UpdateData(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FDataLink.Field.Text := Text;
|
FDataLink.Field.Text := Text;
|
||||||
|
Loading…
Reference in New Issue
Block a user