mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 17:52:59 +02:00
rtticontrols: published TTIComboBox AutoComplete and AutoCompleteText
git-svn-id: trunk@19276 -
This commit is contained in:
parent
bee2f4497e
commit
ca7c8700f0
@ -486,6 +486,8 @@ Type
|
|||||||
property Align;
|
property Align;
|
||||||
property Anchors;
|
property Anchors;
|
||||||
property ArrowKeysTraverseList;
|
property ArrowKeysTraverseList;
|
||||||
|
property AutoComplete;
|
||||||
|
property AutoCompleteText;
|
||||||
property AutoDropDown;
|
property AutoDropDown;
|
||||||
property BorderSpacing;
|
property BorderSpacing;
|
||||||
property DropDownCount;
|
property DropDownCount;
|
||||||
@ -2405,6 +2407,7 @@ function TTICustomComboBox.LinkTestEditing(Sender: TObject): boolean;
|
|||||||
begin
|
begin
|
||||||
if Sender=nil then ;
|
if Sender=nil then ;
|
||||||
Result:=Focused or DroppedDown;
|
Result:=Focused or DroppedDown;
|
||||||
|
//DebugLn(['TTICustomComboBox.LinkTestEditing ',dbgsName(Self),' Result=',Result,' CanTab=',CanTab,' Handle=',HandleAllocated,' ',dbgsname(FindOwnerControl(GetFocus))]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTICustomComboBox.SetLink(const AValue: TPropertyLink);
|
procedure TTICustomComboBox.SetLink(const AValue: TPropertyLink);
|
||||||
@ -2431,19 +2434,21 @@ end;
|
|||||||
procedure TTICustomComboBox.LinkSaveToProperty(Sender: TObject);
|
procedure TTICustomComboBox.LinkSaveToProperty(Sender: TObject);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
s: String;
|
||||||
begin
|
begin
|
||||||
if Sender=nil then ;
|
if Sender=nil then ;
|
||||||
//debugln('TTICustomComboBox.LinkSaveToProperty ',dbgsName(Self),' FLink.GetAsText=',FLink.GetAsText,' Text=',Text);
|
//debugln('TTICustomComboBox.LinkSaveToProperty ',dbgsName(Self),' FLink.GetAsText=',FLink.GetAsText,' Text=',Text);
|
||||||
if (FLink.Editor=nil) then exit;
|
if (FLink.Editor=nil) then exit;
|
||||||
FLink.SetAsText(Text);
|
s:=Text;
|
||||||
|
FLink.SetAsText(s);
|
||||||
|
|
||||||
// update history
|
// update history
|
||||||
if (MaxHistoryCount>0) and ((Items.Count=0) or (Items[0]<>Text)) then begin
|
if (MaxHistoryCount>0) and ((Items.Count=0) or (Items[0]<>s)) then begin
|
||||||
Items.BeginUpdate;
|
Items.BeginUpdate;
|
||||||
Items.Insert(0,Text);
|
Items.Insert(0,s);
|
||||||
for i:=Items.Count-1 downto 1 do
|
for i:=Items.Count-1 downto 1 do
|
||||||
if (i>=MaxHistoryCount) or (Items[i]=Text)
|
if (i>=MaxHistoryCount) or (Items[i]=s)
|
||||||
or ((not HistoryCaseSensitive) and (AnsiCompareText(Items[i],Text)=0))
|
or ((not HistoryCaseSensitive) and (AnsiCompareText(Items[i],s)=0))
|
||||||
then
|
then
|
||||||
Items.Delete(i);
|
Items.Delete(i);
|
||||||
Items.EndUpdate;
|
Items.EndUpdate;
|
||||||
|
Loading…
Reference in New Issue
Block a user