LCL: TTreeView: replace wrong property default for DefaultItemHeight with stored function

git-svn-id: trunk@55111 -
This commit is contained in:
ondrej 2017-05-28 07:50:19 +00:00
parent 73e1e2caee
commit d8490f1c3c
2 changed files with 8 additions and 2 deletions

View File

@ -3409,6 +3409,7 @@ type
Stage: TCustomDrawStage): Boolean; virtual;
function CustomDrawItem(Node: TTreeNode; State: TCustomDrawState;
Stage: TCustomDrawStage; var PaintImages: Boolean): Boolean; virtual;
function DefaultItemHeightIsStored: Boolean;
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
const AXProportion, AYProportion: Double); override;
function ExpandSignSizeIsStored: Boolean;
@ -3575,7 +3576,7 @@ type
property BorderWidth default 0;
property BottomItem: TTreeNode read GetBottomItem write SetBottomItem;
property Color default clWindow;
property DefaultItemHeight: integer read FDefItemHeight write SetDefaultItemHeight default DefaultTreeNodeHeight;
property DefaultItemHeight: integer read FDefItemHeight write SetDefaultItemHeight stored DefaultItemHeightIsStored;
property DropTarget: TTreeNode read GetDropTarget write SetDropTarget;
property ExpandSignColor: TColor read FExpandSignColor write FExpandSignColor default clWindowFrame;
property ExpandSignSize: integer read GetExpandSignSize write SetExpandSignSize stored ExpandSignSizeIsStored;

View File

@ -3329,7 +3329,7 @@ begin
begin
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomTreeView.DoAutoAdjustLayout'){$ENDIF};
try
if not (tvoAutoItemHeight in Options) then
if DefaultItemHeightIsStored then
DefaultItemHeight := Round(DefaultItemHeight*AYProportion);
if IndentIsStored then
FIndent := Round(FIndent*AXProportion);
@ -3428,6 +3428,11 @@ begin
end;
end;
function TCustomTreeView.DefaultItemHeightIsStored: Boolean;
begin
Result := not(tvoAutoItemHeight in Options);
end;
function TCustomTreeView.DefaultTreeViewSort(Node1, Node2: TTreeNode): Integer;
begin
if Assigned(OnCompare) then begin