ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/ibcontrols/IBLookupComboEditBox.pas
(Generate patch)

Comparing ibx/trunk/ibcontrols/IBLookupComboEditBox.pas (file contents):
Revision 64 by tony, Thu Jun 29 11:11:22 2017 UTC vs.
Revision 143 by tony, Fri Feb 23 12:11:21 2018 UTC

# Line 96 | Line 96 | type
96      FInCheckAndInsert: boolean;
97      FLastKeyValue: variant;
98      FCurText: string;
99 +    FModified: boolean;
100      procedure DoActiveChanged(Data: PtrInt);
101      function GetAutoCompleteText: TComboBoxAutoCompleteText;
102      function GetListSource: TDataSource;
# Line 122 | Line 123 | type
123      procedure SetItemIndex(const Val: integer); override;
124      function SQLSafe(aText: string): string;
125      procedure UpdateShowing; override;
126 <
126 >    procedure UpdateData(Sender: TObject); override;
127    public
128      { Public declarations }
129      constructor Create(TheComponent: TComponent); override;
# Line 350 | Line 351 | begin
351                 SelLength := UTF8Length(Text);
352               end;
353               KeyValue := ListSource.DataSet.FieldByName(KeyField).AsVariant;
354 +           end
355 +           else
356 +           begin
357 +             SelStart := iSelStart;
358 +             SelLength := 0;
359             end;
360           end;
361      finally
362        FUpdating := false
363      end;
364 +    FModified := true;
365    end;
366   end;
367  
# Line 546 | Line 553 | begin
553      ActiveChanged(nil);
554   end;
555  
556 + procedure TIBLookupComboEditBox.UpdateData(Sender: TObject);
557 + begin
558 +  inherited UpdateData(Sender);
559 +  FModified := false;
560 + end;
561 +
562   constructor TIBLookupComboEditBox.Create(TheComponent: TComponent);
563   begin
564    inherited Create(TheComponent);
# Line 564 | Line 577 | begin
577    if assigned(FDataLink) then FDataLink.Free;
578    if assigned(FIBLookupControlLink) then FIBLookupControlLink.Free;
579    if assigned(FTimer) then FTimer.Free;
580 +  Application.RemoveAsyncCalls(self);
581    inherited Destroy;
582   end;
583  
# Line 577 | Line 591 | begin
591      FForceAutoComplete := false;
592    end;
593    CheckAndInsert;
594 +  if FModified then
595 +    Change; {ensure Update}
596    inherited EditingDone;
597   end;
598  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines