lcl: treeview: added DefaultTreeNodeHeight, patch #30884, from AlexeyT

git-svn-id: trunk@53321 -
This commit is contained in:
mattias 2016-11-08 16:00:03 +00:00
parent 144135bfcc
commit 5b945f55ec
2 changed files with 6 additions and 4 deletions

View File

@ -3198,6 +3198,7 @@ const
tvoHideSelection, tvoToolTips,
tvoKeepCollapsedNodes, tvoAutoItemHeight, tvoThemedDraw];
DefaultMultiSelectStyle = [msControlSelect];
DefaultTreeNodeHeight = 20;
type
TTreeViewExpandSignType = (
@ -3541,7 +3542,7 @@ type
property BorderWidth default 0;
property Color default clWindow;
property BottomItem: TTreeNode read GetBottomItem write SetBottomItem;
property DefaultItemHeight: integer read FDefItemHeight write SetDefaultItemHeight default 20;
property DefaultItemHeight: integer read FDefItemHeight write SetDefaultItemHeight default DefaultTreeNodeHeight;
property DropTarget: TTreeNode read GetDropTarget write SetDropTarget;
property ExpandSignType: TTreeViewExpandSignType
read FExpandSignType write SetExpandSignType default tvestTheme;
@ -3564,6 +3565,7 @@ type
property TreeLineColor: TColor read FTreeLineColor write FTreeLineColor default clWindowFrame;
property TreeLinePenStyle: TPenStyle read FTreeLinePenStyle write FTreeLinePenStyle default psPattern;
property ExpandSignColor: TColor read FExpandSignColor write FExpandSignColor default clWindowFrame;
property ExpandSignSize: integer read FExpandSignSize write FExpandSignSize;
published
property TabStop default true;
end;

View File

@ -1127,7 +1127,7 @@ begin
if TreeView <> nil then
Result := TreeView.FDefItemHeight
else
Result := 20;
Result := DefaultTreeNodeHeight;
end
else
Result := FHeight;
@ -3162,7 +3162,7 @@ begin
TabStop := True;
ParentColor := False;
// FBackgroundColor := clWindow;
FDefItemHeight := 20;
FDefItemHeight := DefaultTreeNodeHeight;
FExpandSignType := tvestTheme;
UpdateExpandSignSize;
FTreeNodes := TTreeNodes.Create(Self);
@ -4392,7 +4392,7 @@ procedure TCustomTreeView.SetDefaultItemHeight(Value: integer);
begin
if (tvoAutoItemHeight in FOptions) and (not (csLoading in ComponentState))
then exit;
if Value<=0 then Value:=20;
if Value<=0 then Value:=DefaultTreeNodeHeight;
if Value=FDefItemHeight then exit;
FDefItemHeight:=Value;
Include(FStates,tvsTopsNeedsUpdate);