implemented TCustomComboBox.AutoComplete (issue #1706)

git-svn-id: trunk@8752 -
This commit is contained in:
vincents 2006-02-17 13:32:58 +00:00
parent fb25475cdc
commit be77c68da7
2 changed files with 17 additions and 0 deletions

View File

@ -542,6 +542,11 @@ begin
Result:=FDroppedDown;
end;
function TCustomComboBox.GetAutoComplete: boolean;
begin
Result := cbactEnabled in AutoCompleteText;
end;
{------------------------------------------------------------------------------
function TCustomComboBox.GetItemWidth: Integer;
@ -553,6 +558,15 @@ begin
Result:=FItemWidth;
end;
procedure TCustomComboBox.SetAutoComplete(const AValue: boolean);
begin
if (cbactEnabled in FAutoCompleteText)=AValue then exit;
if AValue then
AutoCompleteText := AutoCompleteText + [cbactEnabled]
else
AutoCompleteText := AutoCompleteText - [cbactEnabled]
end;
{------------------------------------------------------------------------------
function TCustomComboBox.GetDroppedDown: Boolean;

View File

@ -256,8 +256,10 @@ type
FStyle: TComboBoxStyle;
FArrowKeysTraverseList: Boolean;
FReturnArrowState: Boolean; //used to return the state of arrow keys from termporary change
function GetAutoComplete: boolean;
function GetDroppedDown: Boolean;
function GetItemWidth: Integer;
procedure SetAutoComplete(const AValue: boolean);
procedure SetItemWidth(const AValue: Integer);
procedure SetItems(Value: TStrings);
procedure LMDrawListItem(var TheMessage: TLMDrawListItem); message LM_DrawListItem;
@ -329,6 +331,7 @@ type
property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
procedure SelectAll;
property AutoComplete: boolean read GetAutoComplete write SetAutoComplete;
property AutoCompleteText: TComboBoxAutoCompleteText
read FAutoCompleteText write FAutoCompleteText;
property AutoDropDown: Boolean