LCL: listbox: fix default value for Options

git-svn-id: trunk@55126 -
This commit is contained in:
ondrej 2017-05-30 14:54:05 +00:00
parent 9311861669
commit 48dbf5c56d
2 changed files with 4 additions and 8 deletions

View File

@ -128,11 +128,6 @@ begin
UnlockSelectionChange; UnlockSelectionChange;
end; end;
function TCustomListBox.IsOptionsStored: Boolean;
begin
Result := (FOptions = [lboDrawFocusRect]);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
procedure TCustomListBox.FinalizeWnd procedure TCustomListBox.FinalizeWnd
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
@ -562,7 +557,7 @@ begin
FItemIndex:=-1; FItemIndex:=-1;
FExtendedSelect := true; FExtendedSelect := true;
//FScrollWidth := 0; //FScrollWidth := 0;
FOptions := [lboDrawFocusRect]; FOptions := DefOptions;
FCanvas := TControlCanvas.Create; FCanvas := TControlCanvas.Create;
TControlCanvas(FCanvas).Control := Self; TControlCanvas(FCanvas).Control := Self;
ParentColor := false; ParentColor := false;

View File

@ -495,6 +495,8 @@ type
{ TCustomListBox } { TCustomListBox }
TCustomListBox = class(TWinControl) TCustomListBox = class(TWinControl)
private const
DefOptions = [lboDrawFocusRect];
private private
FCacheValid: Boolean; FCacheValid: Boolean;
FCanvas: TCanvas; FCanvas: TCanvas;
@ -519,7 +521,6 @@ type
function GetCount: Integer; function GetCount: Integer;
function GetScrollWidth: Integer; function GetScrollWidth: Integer;
function GetTopIndex: Integer; function GetTopIndex: Integer;
function IsOptionsStored: Boolean;
procedure RaiseIndexOutOfBounds(AIndex: integer); procedure RaiseIndexOutOfBounds(AIndex: integer);
procedure SetColumns(const AValue: Integer); procedure SetColumns(const AValue: Integer);
procedure SetScrollWidth(const AValue: Integer); procedure SetScrollWidth(const AValue: Integer);
@ -622,7 +623,7 @@ type
property OnSelectionChange: TSelectionChangeEvent read FOnSelectionChange property OnSelectionChange: TSelectionChangeEvent read FOnSelectionChange
write FOnSelectionChange; write FOnSelectionChange;
property OnUTF8KeyPress; property OnUTF8KeyPress;
property Options: TListBoxOptions read FOptions write FOptions stored IsOptionsStored; property Options: TListBoxOptions read FOptions write FOptions default DefOptions;
property ParentColor default False; property ParentColor default False;
property ParentFont; property ParentFont;
property ParentShowHint; property ParentShowHint;