Revert r58304, r58276, r58245 #862ceccf8c

git-svn-id: trunk@58366 -
This commit is contained in:
ondrej 2018-06-21 05:49:20 +00:00
parent 921d9eeecf
commit 7af0913345

View File

@ -1090,8 +1090,8 @@ type
procedure AdjustPosition(Column: TVirtualTreeColumn; Position: Cardinal); procedure AdjustPosition(Column: TVirtualTreeColumn; Position: Cardinal);
function CanSplitterResize(P: TPoint; Column: TColumnIndex): Boolean; function CanSplitterResize(P: TPoint; Column: TColumnIndex): Boolean;
procedure DoCanSplitterResize(P: TPoint; Column: TColumnIndex; var Allowed: Boolean); virtual; procedure DoCanSplitterResize(P: TPoint; Column: TColumnIndex; var Allowed: Boolean); virtual;
procedure DrawButtonText(Canvas: TCanvas; Caption: String; Bounds: TRect; Enabled, Hot: Boolean; DrawFormat: Cardinal; procedure DrawButtonText(DC: HDC; Caption: String; Bounds: TRect; Enabled, Hot: Boolean; DrawFormat: Cardinal;
WrapCaption: Boolean); virtual; WrapCaption: Boolean);
procedure FixPositions; procedure FixPositions;
function GetColumnAndBounds(const P: TPoint; var ColumnLeft, ColumnRight: Integer; Relative: Boolean = True): Integer; function GetColumnAndBounds(const P: TPoint; var ColumnLeft, ColumnRight: Integer; Relative: Boolean = True): Integer;
function GetOwner: TPersistent; override; function GetOwner: TPersistent; override;
@ -2544,7 +2544,6 @@ type
procedure Change(Node: PVirtualNode); virtual; procedure Change(Node: PVirtualNode); virtual;
procedure ChangeScale(M, D: Integer); override; procedure ChangeScale(M, D: Integer); override;
function CheckParentCheckState(Node: PVirtualNode; NewCheckState: TCheckState): Boolean; virtual; function CheckParentCheckState(Node: PVirtualNode; NewCheckState: TCheckState): Boolean; virtual;
procedure ClearSelection(pFireChangeEvent: Boolean); overload; virtual;
procedure ClearTempCache; virtual; procedure ClearTempCache; virtual;
function ColumnIsEmpty(Node: PVirtualNode; Column: TColumnIndex): Boolean; virtual; function ColumnIsEmpty(Node: PVirtualNode; Column: TColumnIndex): Boolean; virtual;
function ComputeRTLOffset(ExcludeScrollBar: Boolean = False): Integer; virtual; function ComputeRTLOffset(ExcludeScrollBar: Boolean = False): Integer; virtual;
@ -3006,7 +3005,7 @@ type
function CanEdit(Node: PVirtualNode; Column: TColumnIndex): Boolean; virtual; function CanEdit(Node: PVirtualNode; Column: TColumnIndex): Boolean; virtual;
procedure Clear; virtual; procedure Clear; virtual;
procedure ClearChecked; procedure ClearChecked;
procedure ClearSelection; overload; procedure ClearSelection;
function CopyTo(Source: PVirtualNode; Tree: TBaseVirtualTree; Mode: TVTNodeAttachMode; function CopyTo(Source: PVirtualNode; Tree: TBaseVirtualTree; Mode: TVTNodeAttachMode;
ChildrenOnly: Boolean): PVirtualNode; overload; ChildrenOnly: Boolean): PVirtualNode; overload;
function CopyTo(Source, Target: PVirtualNode; Mode: TVTNodeAttachMode; function CopyTo(Source, Target: PVirtualNode; Mode: TVTNodeAttachMode;
@ -8044,18 +8043,15 @@ end;
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
procedure TVirtualTreeColumns.DrawButtonText(Canvas: TCanvas; Caption: String; procedure TVirtualTreeColumns.DrawButtonText(DC: HDC; Caption: String; Bounds: TRect; Enabled, Hot: Boolean;
Bounds: TRect; Enabled, Hot: Boolean; DrawFormat: Cardinal; DrawFormat: Cardinal; WrapCaption: Boolean);
WrapCaption: Boolean);
var var
TextSpace: Integer; TextSpace: Integer;
TextColor: TColor; TextColor: TColor;
Size: TSize; Size: TSize;
DC: HDC;
begin begin
DC := Canvas.Handle;
if not WrapCaption then if not WrapCaption then
begin begin
// Do we need to shorten the caption due to limited space? // Do we need to shorten the caption due to limited space?
@ -9288,7 +9284,7 @@ var
else else
DrawHot := (IsHoverIndex and (hoHotTrack in FHeader.FOptions) and not(tsUseThemes in FHeader.Treeview.FStates)); DrawHot := (IsHoverIndex and (hoHotTrack in FHeader.FOptions) and not(tsUseThemes in FHeader.Treeview.FStates));
if not(hpeText in ActualElements) and (Length(Text) > 0) then if not(hpeText in ActualElements) and (Length(Text) > 0) then
DrawButtonText(TargetCanvas, String(ColCaptionText), TextRectangle, IsEnabled, DrawHot, DrawFormat, WrapCaption); DrawButtonText(TargetCanvas.Handle, String(ColCaptionText), TextRectangle, IsEnabled, DrawHot, DrawFormat, WrapCaption);
// sort glyph // sort glyph
if not (hpeSortGlyph in ActualElements) and ShowSortGlyph then if not (hpeSortGlyph in ActualElements) and ShowSortGlyph then
@ -16725,7 +16721,7 @@ begin
ForceSelection := False; ForceSelection := False;
if ClearPending and ((LastFocused <> FFocusedNode) or (FSelectionCount <> 1)) then if ClearPending and ((LastFocused <> FFocusedNode) or (FSelectionCount <> 1)) then
begin begin
ClearSelection(False); ClearSelection;
ForceSelection := True; ForceSelection := True;
end; end;
@ -22298,7 +22294,7 @@ begin
end; end;
end end
else if not ((hiNowhere in HitInfo.HitPositions) and (toAlwaysSelectNode in Self.TreeOptions.SelectionOptions)) then // When clicking in the free space we don't want the selection to be cleared in case toAlwaysSelectNode is set else if not ((hiNowhere in HitInfo.HitPositions) and (toAlwaysSelectNode in Self.TreeOptions.SelectionOptions)) then // When clicking in the free space we don't want the selection to be cleared in case toAlwaysSelectNode is set
ClearSelection(False); ClearSelection;
end; end;
// pending node edit // pending node edit
@ -22363,9 +22359,6 @@ begin
end; end;
end; end;
if SelectedCount = 0 then
Change(nil);
// Drag'n drop initiation // Drag'n drop initiation
// If we lost focus in the interim the button states would be cleared in WM_KILLFOCUS. // If we lost focus in the interim the button states would be cleared in WM_KILLFOCUS.
if AutoDrag and IsAnyHit and (FStates * [tsLeftButtonDown, tsRightButtonDown, tsMiddleButtonDown] <> []) then if AutoDrag and IsAnyHit and (FStates * [tsLeftButtonDown, tsRightButtonDown, tsMiddleButtonDown] <> []) then
@ -25604,7 +25597,7 @@ procedure TBaseVirtualTree.AutoScale();
var var
lTextHeight: Cardinal; lTextHeight: Cardinal;
begin begin
if (toAutoChangeScale in TreeOptions.AutoOptions) and HandleAllocated then if (toAutoChangeScale in TreeOptions.AutoOptions) then
begin begin
Canvas.Font.Assign(Self.Font); Canvas.Font.Assign(Self.Font);
lTextHeight := Canvas.TextHeight('Tg'); lTextHeight := Canvas.TextHeight('Tg');
@ -25814,7 +25807,7 @@ end;
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
procedure TBaseVirtualTree.ClearSelection(pFireChangeEvent: Boolean); procedure TBaseVirtualTree.ClearSelection;
var var
Node: PVirtualNode; Node: PVirtualNode;
@ -25851,21 +25844,12 @@ begin
end; end;
InternalClearSelection; InternalClearSelection;
if pFireChangeEvent then
Change(nil); Change(nil);
end; end;
end; end;
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
procedure TBaseVirtualTree.ClearSelection;
begin
ClearSelection(True);
end;
//----------------------------------------------------------------------------------------------------------------------
function TBaseVirtualTree.CopyTo(Source: PVirtualNode; Tree: TBaseVirtualTree; Mode: TVTNodeAttachMode; function TBaseVirtualTree.CopyTo(Source: PVirtualNode; Tree: TBaseVirtualTree; Mode: TVTNodeAttachMode;
ChildrenOnly: Boolean): PVirtualNode; ChildrenOnly: Boolean): PVirtualNode;