diff --git a/components/rx/dbutils.pas b/components/rx/dbutils.pas index 3990872ab..f78bca018 100644 --- a/components/rx/dbutils.pas +++ b/components/rx/dbutils.pas @@ -43,8 +43,9 @@ const NumericDataTypes = IntegerDataTypes + [ftFloat, ftCurrency, ftBCD]; -const - TimeDataTypes = [ftTime, ftDateTime, ftTimeStamp]; + DataTimeTypes = [ftTime, ftDateTime, ftTimeStamp]; + + StringTypes = [ftString, {ftMemo,} ftFixedChar, ftWideString, ftFixedWideChar, ftWideMemo]; type diff --git a/components/rx/rxdbtimeedit.pas b/components/rx/rxdbtimeedit.pas index 11b4bf4f9..8db776262 100644 --- a/components/rx/rxdbtimeedit.pas +++ b/components/rx/rxdbtimeedit.pas @@ -146,7 +146,7 @@ type procedure TCustomRxDBTimeEdit.DataChange(Sender: TObject); begin - if Assigned(FDataLink.Field) and (FDataLink.Field.DataType in TimeDataTypes) then + if Assigned(FDataLink.Field) and (FDataLink.Field.DataType in DataTimeTypes) then Self.Time:=FDatalink.Field.AsDateTime else Text := ''; @@ -190,7 +190,7 @@ end; procedure TCustomRxDBTimeEdit.UpdateData(Sender: TObject); begin - if Assigned(FDataLink.Field) and (FDataLink.Field.DataType in TimeDataTypes) then + if Assigned(FDataLink.Field) and (FDataLink.Field.DataType in DataTimeTypes) then begin FDataLink.Field.AsDateTime := Self.Time; end; diff --git a/components/rx/rxpopupunit.pas b/components/rx/rxpopupunit.pas index 3c291d9b2..68dce3c50 100644 --- a/components/rx/rxpopupunit.pas +++ b/components/rx/rxpopupunit.pas @@ -823,11 +823,30 @@ begin end; procedure TPopUpGrid.FindNextChar(var UTF8Key: TUTF8Char); +var + F:TField; + V:boolean; begin if DatalinkActive then begin - if DataSetLocateThrough(DataSource.DataSet, FLookupDisplayField, FFindLine + UTF8Key, [loCaseInsensitive, loPartialKey]) then + F:=Columns[FLookupDisplayIndex].Field; + if F.DataType in StringTypes then + V:=true + else begin + if Length(UTF8Key) = 1 then + V:=F.IsValidChar(UTF8Key[1]) + else + V:=false; + end; + if V then + begin + if DataSetLocateThrough(DataSource.DataSet, FLookupDisplayField, FFindLine + UTF8Key, [loCaseInsensitive, loPartialKey]) then + begin +// TPopUpForm(Owner).WControl.Caption:=FFindLine; +// TPopUpForm(Owner).WControl.Repaint; + end; + FFindLine:=FFindLine + UTF8Key; TPopUpForm(Owner).WControl.Caption:=FFindLine; TPopUpForm(Owner).WControl.Repaint; @@ -847,11 +866,16 @@ begin begin if DataSetLocateThrough(DataSource.DataSet, FLookupDisplayField, FFindLine, [loCaseInsensitive, loPartialKey]) then begin - TPopUpForm(Owner).WControl.Caption:=FFindLine; - TPopUpForm(Owner).WControl.Repaint; - end - else - FFindLine:=F; +// TPopUpForm(Owner).WControl.Caption:=FFindLine; +// TPopUpForm(Owner).WControl.Repaint; + end; +// else +// FFindLine:=F; + + //FFindLine:=FFindLine + UTF8Key; + TPopUpForm(Owner).WControl.Caption:=FFindLine; + TPopUpForm(Owner).WControl.Repaint; + end else begin