54 |
|
FOwner: TIBLookupComboEditBox; |
55 |
|
protected |
56 |
|
procedure ActiveChanged; override; |
57 |
+ |
procedure DataEvent(Event: TDataEvent; Info: Ptrint); override; |
58 |
|
procedure RecordChanged(Field: TField); override; |
59 |
|
procedure UpdateData; override; |
60 |
|
public |
97 |
|
FInCheckAndInsert: boolean; |
98 |
|
FLastKeyValue: variant; |
99 |
|
FCurText: string; |
100 |
+ |
FModified: boolean; |
101 |
|
procedure DoActiveChanged(Data: PtrInt); |
102 |
|
function GetAutoCompleteText: TComboBoxAutoCompleteText; |
103 |
|
function GetListSource: TDataSource; |
124 |
|
procedure SetItemIndex(const Val: integer); override; |
125 |
|
function SQLSafe(aText: string): string; |
126 |
|
procedure UpdateShowing; override; |
127 |
< |
|
127 |
> |
procedure UpdateData(Sender: TObject); override; |
128 |
|
public |
129 |
|
{ Public declarations } |
130 |
|
constructor Create(TheComponent: TComponent); override; |
170 |
|
FOwner.ActiveChanged(self) |
171 |
|
end; |
172 |
|
|
173 |
+ |
procedure TIBLookupComboDataLink.DataEvent(Event: TDataEvent; Info: Ptrint); |
174 |
+ |
begin |
175 |
+ |
inherited DataEvent(Event, Info); |
176 |
+ |
if Event = deLayoutChange then |
177 |
+ |
FOwner.LookupCache := FOwner.LookupCache; {sneaky way of calling UpdateLookup} |
178 |
+ |
end; |
179 |
+ |
|
180 |
|
procedure TIBLookupComboDataLink.RecordChanged(Field: TField); |
181 |
|
begin |
182 |
|
FOwner.RecordChanged(self,Field); |
369 |
|
finally |
370 |
|
FUpdating := false |
371 |
|
end; |
372 |
+ |
FModified := true; |
373 |
|
end; |
374 |
|
end; |
375 |
|
|
561 |
|
ActiveChanged(nil); |
562 |
|
end; |
563 |
|
|
564 |
+ |
procedure TIBLookupComboEditBox.UpdateData(Sender: TObject); |
565 |
+ |
begin |
566 |
+ |
inherited UpdateData(Sender); |
567 |
+ |
FModified := false; |
568 |
+ |
end; |
569 |
+ |
|
570 |
|
constructor TIBLookupComboEditBox.Create(TheComponent: TComponent); |
571 |
|
begin |
572 |
|
inherited Create(TheComponent); |
585 |
|
if assigned(FDataLink) then FDataLink.Free; |
586 |
|
if assigned(FIBLookupControlLink) then FIBLookupControlLink.Free; |
587 |
|
if assigned(FTimer) then FTimer.Free; |
588 |
+ |
Application.RemoveAsyncCalls(self); |
589 |
|
inherited Destroy; |
590 |
|
end; |
591 |
|
|
599 |
|
FForceAutoComplete := false; |
600 |
|
end; |
601 |
|
CheckAndInsert; |
602 |
+ |
if FModified then |
603 |
+ |
Change; {ensure Update} |
604 |
|
inherited EditingDone; |
605 |
|
end; |
606 |
|
|