Skip to content

Commit 4963220

Browse files
- Bug fix: Removed active column changing from TBaseVirtualTree.WMKeyDown to re-gain standard conforming behaviour for VK_NEXT and VK_PRIOR
- Bug fix: Paint option toUseExplorerTheme works properly without defining columns - Bug fix: TBaseVirtualTree.PrepareBitmaps now correctly closes the theme handle
1 parent a34341a commit 4963220

File tree

1 file changed

+16
-53
lines changed

1 file changed

+16
-53
lines changed

Source/VirtualTrees.pas

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
unit VirtualTrees;
22

3-
// Version 4.8.6
3+
// Version 4.8.7
44
//
55
// The contents of this file are subject to the Mozilla Public License
66
// Version 1.1 (the "License"); you may not use this file except in compliance
@@ -24,6 +24,11 @@
2424
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
2525
//----------------------------------------------------------------------------------------------------------------------
2626
//
27+
// April 2010
28+
// - Bug fix: Removed active column changing from TBaseVirtualTree.WMKeyDown to re-gain standard conforming
29+
// behaviour for VK_NEXT and VK_PRIOR
30+
// - Bug fix: Paint option toUseExplorerTheme works properly without defining columns
31+
// - Bug fix: TBaseVirtualTree.PrepareBitmaps now correctly closes the theme handle
2732
// January 2010
2833
// - Bug fix: TBaseVirtualTree.AdjustTotalHeight now longer calculates wrong total heights if nodes have been
2934
// made invisible
@@ -354,7 +359,7 @@ interface
354359
{$endif COMPILER_12_UP}
355360

356361
const
357-
VTVersion = '4.8.6';
362+
VTVersion = '4.8.7';
358363
VTTreeStreamVersion = 2;
359364
VTHeaderStreamVersion = 6; // The header needs an own stream version to indicate changes only relevant to the header.
360365

@@ -15550,7 +15555,8 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
1555015555
{$Ifdef ThemeSupport}
1555115556
if IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) then
1555215557
begin
15553-
if not (coParentColor in FHeader.FColumns[FHeader.FMainColumn].FOptions) then
15558+
if (FHeader.FMainColumn > NoColumn) and not
15559+
(coParentColor in FHeader.FColumns[FHeader.FMainColumn].FOptions) then
1555415560
Brush.Color := FHeader.FColumns[FHeader.FMainColumn].Color
1555515561
else
1555615562
Brush.Color := Self.Color;
@@ -15706,6 +15712,11 @@ procedure TBaseVirtualTree.PrepareBitmaps(NeedButtons, NeedLines: Boolean);
1570615712
FDottedBrush := CreatePatternBrush(PatternBitmap);
1570715713
DeleteObject(PatternBitmap);
1570815714
end;
15715+
15716+
{$ifdef ThemeSupport}
15717+
if Theme <> 0 then
15718+
CloseThemeData(Theme);
15719+
{$endif}
1570915720
end;
1571015721

1571115722
//----------------------------------------------------------------------------------------------------------------------
@@ -17999,31 +18010,7 @@ procedure TBaseVirtualTree.WMKeyDown(var Message: TWMKeyDown);
1799918010
end;
1800018011
end;
1800118012
VK_PRIOR:
18002-
if Shift = [ssCtrl, ssShift] then
18003-
SetOffsetX(FOffsetX + ClientWidth)
18004-
else if [ssShift] = Shift then
18005-
begin
18006-
if FFocusedColumn = InvalidColumn then
18007-
NewColumn := FHeader.FColumns.GetFirstVisibleColumn
18008-
else
18009-
begin
18010-
Offset := FHeader.FColumns.GetVisibleFixedWidth;
18011-
NewColumn := FFocusedColumn;
18012-
while True do
18013-
begin
18014-
TempColumn := FHeader.FColumns.GetPreviousVisibleColumn(NewColumn);
18015-
NewWidth := FHeader.FColumns[NewColumn].Width;
18016-
if (TempColumn <= NoColumn) or
18017-
(Offset + NewWidth >= ClientWidth) or
18018-
(coFixed in FHeader.FColumns[TempColumn].FOptions) then
18019-
Break;
18020-
NewColumn := TempColumn;
18021-
Inc(Offset, NewWidth);
18022-
end;
18023-
end;
18024-
SetFocusedColumn(NewColumn);
18025-
end
18026-
else if ssCtrl in Shift then
18013+
if ssCtrl in Shift then
1802718014
SetOffsetY(FOffsetY + ClientHeight)
1802818015
else
1802918016
begin
@@ -18048,31 +18035,7 @@ procedure TBaseVirtualTree.WMKeyDown(var Message: TWMKeyDown);
1804818035
FocusedNode := Node;
1804918036
end;
1805018037
VK_NEXT:
18051-
if Shift = [ssCtrl, ssShift] then
18052-
SetOffsetX(FOffsetX - ClientWidth)
18053-
else if [ssShift] = Shift then
18054-
begin
18055-
if FFocusedColumn = InvalidColumn then
18056-
NewColumn := FHeader.FColumns.GetFirstVisibleColumn
18057-
else
18058-
begin
18059-
Offset := FHeader.FColumns.GetVisibleFixedWidth;
18060-
NewColumn := FFocusedColumn;
18061-
while True do
18062-
begin
18063-
TempColumn := FHeader.FColumns.GetNextVisibleColumn(NewColumn);
18064-
NewWidth := FHeader.FColumns[NewColumn].Width;
18065-
if (TempColumn <= NoColumn) or
18066-
(Offset + NewWidth >= ClientWidth) or
18067-
(coFixed in FHeader.FColumns[TempColumn].FOptions) then
18068-
Break;
18069-
NewColumn := TempColumn;
18070-
Inc(Offset, NewWidth);
18071-
end;
18072-
end;
18073-
SetFocusedColumn(NewColumn);
18074-
end
18075-
else if ssCtrl in Shift then
18038+
if ssCtrl in Shift then
1807618039
SetOffsetY(FOffsetY - ClientHeight)
1807718040
else
1807818041
begin

0 commit comments

Comments
 (0)