lcl: set some defaults for TCombobox properties (by Alexander S. Klenin, issue #0013772)

git-svn-id: trunk@20103 -
This commit is contained in:
paul 2009-05-21 12:20:11 +00:00
parent b74111c319
commit f8c5dc7b12
2 changed files with 17 additions and 15 deletions

View File

@ -758,13 +758,14 @@ begin
SetInitialBounds(0,0,GetControlClassDefaultSize.X,GetControlClassDefaultSize.Y); SetInitialBounds(0,0,GetControlClassDefaultSize.X,GetControlClassDefaultSize.Y);
FItems := TStringlist.Create; FItems := TStringlist.Create;
FItemIndex := -1; FItemIndex := -1;
FItemWidth := 0;
FMaxLength := 0; FMaxLength := 0;
FDropDownCount := 8; FDropDownCount := 8;
FCanvas := TControlCanvas.Create; FCanvas := TControlCanvas.Create;
TControlCanvas(FCanvas).Control := Self; TControlCanvas(FCanvas).Control := Self;
ArrowKeysTraverseList := True; ArrowKeysTraverseList := True;
TabStop := true; TabStop := True;
ParentColor := false; ParentColor := False;
FAutoCompleteText := DefaultComboBoxAutoCompleteText; FAutoCompleteText := DefaultComboBoxAutoCompleteText;
FAutoSelect := False; FAutoSelect := False;
FAutoSelected := False; FAutoSelected := False;

View File

@ -227,24 +227,24 @@ type
{ TCustomComboBox } { TCustomComboBox }
TComboBoxAutoCompleteTextOption = ( TComboBoxAutoCompleteTextOption = (
cbactEnabled,//Enable Auto-Completion Feature cbactEnabled, //Enable Auto-Completion Feature
cbactEndOfLineComplete,//Perform Auto-Complete only when cursor is at end of line cbactEndOfLineComplete, //Perform Auto-Complete only when cursor is at end of line
cbactRetainPrefixCase,//Retains the case of characters user has typed if is cbactEndOfLineComplete cbactRetainPrefixCase, //Retains the case of characters user has typed if is cbactEndOfLineComplete
cbactSearchCaseSensitive,//Search Text with CaseSensitivity cbactSearchCaseSensitive, //Search Text with CaseSensitivity
cbactSearchAscending//Search Text from top of the list cbactSearchAscending //Search Text from top of the list
); );
TComboBoxAutoCompleteText = set of TComboBoxAutoCompleteTextOption; TComboBoxAutoCompleteText = set of TComboBoxAutoCompleteTextOption;
const const
DefaultComboBoxAutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]; DefaultComboBoxAutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending];
type type
TComboBoxStyle = ( TComboBoxStyle = (
csDropDown, // like an TEdit plus a button to drop down the list, default csDropDown, // like an TEdit plus a button to drop down the list, default
csSimple, // like an TEdit plus a TListBox csSimple, // like an TEdit plus a TListBox
csDropDownList, // like TLabel plus a button to drop down the list csDropDownList, // like TLabel plus a button to drop down the list
csOwnerDrawFixed, // like csDropDownList, but custom drawn csOwnerDrawFixed, // like csDropDownList, but custom drawn
csOwnerDrawVariable // like csDropDownList, but custom drawn and with each item can have another height csOwnerDrawVariable // like csDropDownList, but custom drawn and with each item can have another height
); );
TOwnerDrawState = TBaseOwnerDrawState; TOwnerDrawState = TBaseOwnerDrawState;
@ -343,7 +343,7 @@ type
function SelectItem(const AnItem: String): Boolean; function SelectItem(const AnItem: String): Boolean;
property ItemHeight: Integer read GetItemHeight write SetItemHeight; property ItemHeight: Integer read GetItemHeight write SetItemHeight;
property ItemWidth: Integer read GetItemWidth write SetItemWidth; property ItemWidth: Integer read GetItemWidth write SetItemWidth default 0;
property MaxLength: integer read GetMaxLength write SetMaxLength default 0; property MaxLength: integer read GetMaxLength write SetMaxLength default 0;
property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp;
@ -370,7 +370,8 @@ type
property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown; property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual; procedure MeasureItem(Index: Integer; var TheHeight: Integer); virtual;
procedure SelectAll; procedure SelectAll;
property AutoComplete: boolean read GetAutoComplete write SetAutoComplete; property AutoComplete: boolean
read GetAutoComplete write SetAutoComplete default False;
property AutoCompleteText: TComboBoxAutoCompleteText property AutoCompleteText: TComboBoxAutoCompleteText
read FAutoCompleteText write FAutoCompleteText read FAutoCompleteText write FAutoCompleteText
default DefaultComboBoxAutoCompleteText; default DefaultComboBoxAutoCompleteText;