From f8c5dc7b12030e7e781ca41edc2a66c1e6741db6 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 21 May 2009 12:20:11 +0000 Subject: [PATCH] lcl: set some defaults for TCombobox properties (by Alexander S. Klenin, issue #0013772) git-svn-id: trunk@20103 - --- lcl/include/customcombobox.inc | 5 +++-- lcl/stdctrls.pp | 27 ++++++++++++++------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lcl/include/customcombobox.inc b/lcl/include/customcombobox.inc index 20104964aa..59929907dd 100644 --- a/lcl/include/customcombobox.inc +++ b/lcl/include/customcombobox.inc @@ -758,13 +758,14 @@ begin SetInitialBounds(0,0,GetControlClassDefaultSize.X,GetControlClassDefaultSize.Y); FItems := TStringlist.Create; FItemIndex := -1; + FItemWidth := 0; FMaxLength := 0; FDropDownCount := 8; FCanvas := TControlCanvas.Create; TControlCanvas(FCanvas).Control := Self; ArrowKeysTraverseList := True; - TabStop := true; - ParentColor := false; + TabStop := True; + ParentColor := False; FAutoCompleteText := DefaultComboBoxAutoCompleteText; FAutoSelect := False; FAutoSelected := False; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index 7bc6ab4420..de3aa147b7 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -227,24 +227,24 @@ type { TCustomComboBox } TComboBoxAutoCompleteTextOption = ( - cbactEnabled,//Enable Auto-Completion Feature - cbactEndOfLineComplete,//Perform Auto-Complete only when cursor is at end of line - cbactRetainPrefixCase,//Retains the case of characters user has typed if is cbactEndOfLineComplete - cbactSearchCaseSensitive,//Search Text with CaseSensitivity - cbactSearchAscending//Search Text from top of the list - ); + cbactEnabled, //Enable Auto-Completion Feature + cbactEndOfLineComplete, //Perform Auto-Complete only when cursor is at end of line + cbactRetainPrefixCase, //Retains the case of characters user has typed if is cbactEndOfLineComplete + cbactSearchCaseSensitive, //Search Text with CaseSensitivity + cbactSearchAscending //Search Text from top of the list + ); TComboBoxAutoCompleteText = set of TComboBoxAutoCompleteTextOption; const DefaultComboBoxAutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]; type TComboBoxStyle = ( - csDropDown, // like an TEdit plus a button to drop down the list, default - csSimple, // like an TEdit plus a TListBox - csDropDownList, // like TLabel plus a button to drop down the list - csOwnerDrawFixed, // like csDropDownList, but custom drawn + csDropDown, // like an TEdit plus a button to drop down the list, default + csSimple, // like an TEdit plus a TListBox + csDropDownList, // like TLabel plus a button to drop down the list + csOwnerDrawFixed, // like csDropDownList, but custom drawn csOwnerDrawVariable // like csDropDownList, but custom drawn and with each item can have another height - ); + ); TOwnerDrawState = TBaseOwnerDrawState; @@ -343,7 +343,7 @@ type function SelectItem(const AnItem: String): Boolean; 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 OnChange: TNotifyEvent read FOnChange write FOnChange; property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp; @@ -370,7 +370,8 @@ 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 AutoComplete: boolean + read GetAutoComplete write SetAutoComplete default False; property AutoCompleteText: TComboBoxAutoCompleteText read FAutoCompleteText write FAutoCompleteText default DefaultComboBoxAutoCompleteText;