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

Comparing ibx/trunk/ibcontrols/IBLookupComboEditBox.pas (file contents):
Revision 271 by tony, Fri Dec 28 11:36:35 2018 UTC vs.
Revision 272 by tony, Mon Feb 4 13:34:37 2019 UTC

# Line 54 | Line 54 | type
54      FOwner: TIBLookupComboEditBox;
55    protected
56      procedure ActiveChanged; override;
57 +    {$if lcl_fullversion < 2000003}
58      procedure DataEvent(Event: TDataEvent; Info: Ptrint); override;
59 +    {$endif}
60      procedure RecordChanged(Field: TField); override;
61      procedure UpdateData; override;
62    public
# Line 129 | Line 131 | type
131      procedure Loaded; override;
132      procedure Notification(AComponent: TComponent; Operation: TOperation); override;
133      procedure SetItemIndex(const Val: integer); override;
132    function SQLSafe(aText: string): string;
134      procedure UpdateShowing; override;
135      procedure UpdateData(Sender: TObject); override;
136    public
# Line 155 | Line 156 | type
156  
157   implementation
158  
159 < uses Variants, LCLProc, LazUTF8;
159 > uses Variants, LCLProc, LazUTF8, IBUtils;
160  
161   { TIBLookupControlLink }
162  
# Line 177 | Line 178 | begin
178    FOwner.ActiveChanged(self)
179   end;
180  
181 + {$if lcl_fullversion < 2000003}
182   procedure TIBLookupComboDataLink.DataEvent(Event: TDataEvent; Info: Ptrint);
183   begin
184    inherited DataEvent(Event, Info);
185    if Event = deLayoutChange then
186     FOwner.LookupCache := FOwner.LookupCache; {sneaky way of calling UpdateLookup}
187   end;
188 + {$endif}
189  
190   procedure TIBLookupComboDataLink.RecordChanged(Field: TField);
191   begin
# Line 392 | Line 395 | begin
395        FilterText := Text;
396      if cbactSearchCaseSensitive in AutoCompleteText then
397        Parser.Add2WhereClause(GetRelationNameQualifier + '"' + ListField + '" Like ''' +
398 <                                  SQLSafe(FilterText) + '%''')
398 >                                  SQLSafeString(FilterText) + '%''')
399      else
400        Parser.Add2WhereClause('Upper(' + GetRelationNameQualifier + '"' +  ListField + '") Like Upper(''' +
401 <                                  SQLSafe(FilterText) + '%'')');
401 >                                  SQLSafeString(FilterText) + '%'')');
402  
403      if cbactSearchAscending in AutoCompleteText then
404      begin
# Line 560 | Line 563 | begin
563    FLastKeyValue := KeyValue;
564   end;
565  
563 function TIBLookupComboEditBox.SQLSafe(aText: string): string;
564 var I: integer;
565 begin
566  Result := '';
567  for I := 1 to length(aText) do
568    if aText[I] = '''' then
569      Result := Result + ''''''
570    else
571      Result := Result + aText[I];
572 end;
573
566   procedure TIBLookupComboEditBox.UpdateShowing;
567   begin
568    inherited UpdateShowing;
# Line 605 | Line 597 | end;
597  
598   procedure TIBLookupComboEditBox.Change;
599   begin
600 <  THackedCustomComboBox(self).CallChange;
600 >  if IsUnbound then
601 >    THackedCustomComboBox(self).CallChange
602 >  else
603 >    inherited Change;
604   end;
605  
606   procedure TIBLookupComboEditBox.CloseUp;
607   begin
613  inherited CloseUp;
608    inherited DoEdit;
609 +  inherited CloseUp;
610 +  EditingDone;
611   end;
612  
613   procedure TIBLookupComboEditBox.Select;
614   begin
615    inherited Select;
616 <  inherited DoEdit;
616 >  if IsUnbound then
617 >    inherited DoEdit;
618   end;
619  
620   function TIBLookupComboEditBox.DoEdit: boolean;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines