LCL: set combobox maxlength when the control is created (bug #9439)

git-svn-id: trunk@11817 -
This commit is contained in:
vincents 2007-08-14 18:30:00 +00:00
parent cede6cfe89
commit 78ef0135a5
2 changed files with 5 additions and 3 deletions

View File

@ -49,6 +49,7 @@ begin
TWSCustomComboBoxClass(WidgetSetClass).SetStyle(Self, FStyle);
TWSCustomComboBoxClass(WidgetSetClass).SetArrowKeysTraverseList(Self, FArrowKeysTraverseList);
TWSCustomComboBoxClass(WidgetSetClass).SetReadOnly(Self, FReadOnly);
TWSCustomComboBoxClass(WidgetSetClass).SetMaxLength(Self, FMaxLength);
if FSelStart <> FSelLength then begin
ASelStart:= FSelStart;
@ -162,8 +163,8 @@ end;
function TCustomComboBox.GetMaxLength : integer;
begin
if HandleAllocated then
fMaxLength := TWSCustomComboBoxClass(WidgetSetClass).GetMaxLength(Self);
Result:=fMaxLength;
FMaxLength := TWSCustomComboBoxClass(WidgetSetClass).GetMaxLength(Self);
Result:=FMaxLength;
end;
{------------------------------------------------------------------------------
@ -711,6 +712,7 @@ begin
SetInitialBounds(0,0,100,25);
FItems := TStringlist.Create;
FItemIndex:=-1;
FMaxLength := -1;
FDropDownCount:=8;
FCanvas := TControlCanvas.Create;
TControlCanvas(FCanvas).Control := Self;

View File

@ -257,7 +257,7 @@ type
FItemIndex: integer;
FItemWidth: integer;
FItems: TStrings;
fMaxLength: integer;
FMaxLength: integer;
FOnChange: TNotifyEvent;
FOnCloseUp: TNotifyEvent;
FOnDrawItem: TDrawItemEvent;