You've already forked lazarus-ccr
* Synchronize with main VTV repository up to svn rev 220
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2914 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -27,6 +27,14 @@ unit VirtualTrees;
|
|||||||
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
|
// (C) 1999-2001 digital publishing AG. All Rights Reserved.
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
// September 2009
|
||||||
|
// - Bug fix: TCustomVirtualStringTree.DoTextMeasuring now makes use of the parameter Width of the
|
||||||
|
// OnMeasureTextWidth event
|
||||||
|
// - Bug fix: TBaseVirtualTree.DetermineLineImageAndSelectLevel will no longer access LineImage[-1]
|
||||||
|
// - Bug fix: clearing the columns now correctly reset TBaseVirtualTree.FFocusedColumn
|
||||||
|
// - Improvement: explorer style painting is now more close to the real explorer
|
||||||
|
// - Bug fix: TCustomVirtualStringTree.TContentToHTML.WriteStyle will no longer produce invalid CSS
|
||||||
|
// - Bug fix: the parameter DragEffect of TBaseVirtualTree.DragAndDrop is now var as it should be
|
||||||
// August 2009
|
// August 2009
|
||||||
// - Bug fix: TBaseVirtualTree.MoveTo now initializes the target node using the target tree
|
// - Bug fix: TBaseVirtualTree.MoveTo now initializes the target node using the target tree
|
||||||
// - Bug fix: TBaseVirtualTree.FVisibleCount is now calculated correctly when using filtered nodes
|
// - Bug fix: TBaseVirtualTree.FVisibleCount is now calculated correctly when using filtered nodes
|
||||||
@@ -1230,7 +1238,7 @@ type
|
|||||||
procedure SetWidth(Value: Integer);
|
procedure SetWidth(Value: Integer);
|
||||||
protected
|
protected
|
||||||
procedure ComputeHeaderLayout(DC: HDC; const Client: TRect; UseHeaderGlyph, UseSortGlyph: Boolean;
|
procedure ComputeHeaderLayout(DC: HDC; const Client: TRect; UseHeaderGlyph, UseSortGlyph: Boolean;
|
||||||
var HeaderGlyphPos, SortGlyphPos: TPoint; var TextBounds: TRect; DrawFormat: Cardinal;
|
var HeaderGlyphPos, SortGlyphPos: TPoint; var SortGlyphSize: TSize; var TextBounds: TRect; DrawFormat: Cardinal;
|
||||||
CalculateTextRect: Boolean = False);
|
CalculateTextRect: Boolean = False);
|
||||||
procedure GetAbsoluteBounds(var Left, Right: Integer);
|
procedure GetAbsoluteBounds(var Left, Right: Integer);
|
||||||
function GetDisplayName: string; override;
|
function GetDisplayName: string; override;
|
||||||
@@ -1695,7 +1703,8 @@ type
|
|||||||
tsVCLDragPending, // One-shot flag to avoid clearing the current selection on implicit mouse up for VCL drag.
|
tsVCLDragPending, // One-shot flag to avoid clearing the current selection on implicit mouse up for VCL drag.
|
||||||
tsWheelPanning, // Wheel mouse panning is active or soon will be.
|
tsWheelPanning, // Wheel mouse panning is active or soon will be.
|
||||||
tsWheelScrolling, // Wheel mouse scrolling is active or soon will be.
|
tsWheelScrolling, // Wheel mouse scrolling is active or soon will be.
|
||||||
tsWindowCreating // Set during window handle creation to avoid frequent unnecessary updates.
|
tsWindowCreating, // Set during window handle creation to avoid frequent unnecessary updates.
|
||||||
|
tsUseExplorerTheme // The tree runs under WinVista+ and is using the explorer theme
|
||||||
);
|
);
|
||||||
|
|
||||||
TChangeStates = set of (
|
TChangeStates = set of (
|
||||||
@@ -2694,7 +2703,7 @@ type
|
|||||||
procedure DoUpdating(State: TVTUpdateState); virtual;
|
procedure DoUpdating(State: TVTUpdateState); virtual;
|
||||||
function DoValidateCache: Boolean; virtual;
|
function DoValidateCache: Boolean; virtual;
|
||||||
procedure DragAndDrop(AllowedEffects: LongWord; DataObject: IDataObject;
|
procedure DragAndDrop(AllowedEffects: LongWord; DataObject: IDataObject;
|
||||||
DragEffect: LongWord); virtual;
|
var DragEffect: LongWord); virtual;
|
||||||
procedure DragCanceled; override;
|
procedure DragCanceled; override;
|
||||||
function DragDrop(const DataObject: IDataObject; KeyState: LongWord; Pt: TPoint;
|
function DragDrop(const DataObject: IDataObject; KeyState: LongWord; Pt: TPoint;
|
||||||
var Effect: LongWord): HResult; reintroduce; virtual;
|
var Effect: LongWord): HResult; reintroduce; virtual;
|
||||||
@@ -4060,6 +4069,11 @@ const
|
|||||||
);
|
);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$ifndef COMPILER_11_UP}
|
||||||
|
const
|
||||||
|
TVP_HOTGLYPH = 4;
|
||||||
|
{$endif COMPILER_11_UP}
|
||||||
|
|
||||||
RTLFlag: array[Boolean] of Integer = (0, ETO_RTLREADING);
|
RTLFlag: array[Boolean] of Integer = (0, ETO_RTLREADING);
|
||||||
AlignmentToDrawFlag: array[TAlignment] of Cardinal = (DT_LEFT, DT_RIGHT, DT_CENTER);
|
AlignmentToDrawFlag: array[TAlignment] of Cardinal = (DT_LEFT, DT_RIGHT, DT_CENTER);
|
||||||
|
|
||||||
@@ -6742,7 +6756,7 @@ end;
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TVirtualTreeColumn.ComputeHeaderLayout(DC: HDC; const Client: TRect; UseHeaderGlyph, UseSortGlyph: Boolean;
|
procedure TVirtualTreeColumn.ComputeHeaderLayout(DC: HDC; const Client: TRect; UseHeaderGlyph, UseSortGlyph: Boolean;
|
||||||
var HeaderGlyphPos, SortGlyphPos: TPoint; var TextBounds: TRect; DrawFormat: Cardinal;
|
var HeaderGlyphPos, SortGlyphPos: TPoint; var SortGlyphSize: TSize; var TextBounds: TRect; DrawFormat: Cardinal;
|
||||||
CalculateTextRect: Boolean = False);
|
CalculateTextRect: Boolean = False);
|
||||||
|
|
||||||
// The layout of a column header is determined by a lot of factors. This method takes them all into account and
|
// The layout of a column header is determined by a lot of factors. This method takes them all into account and
|
||||||
@@ -6755,14 +6769,15 @@ var
|
|||||||
TextSize: TSize;
|
TextSize: TSize;
|
||||||
TextPos,
|
TextPos,
|
||||||
ClientSize,
|
ClientSize,
|
||||||
HeaderGlyphSize,
|
HeaderGlyphSize: TPoint;
|
||||||
SortGlyphSize: TPoint;
|
|
||||||
CurrentAlignment: TAlignment;
|
CurrentAlignment: TAlignment;
|
||||||
MinLeft,
|
MinLeft,
|
||||||
MaxRight,
|
MaxRight,
|
||||||
TextSpacing: Integer;
|
TextSpacing: Integer;
|
||||||
UseText: Boolean;
|
UseText: Boolean;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
//todo
|
||||||
|
//Theme: HTHEME;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
UseText := Length(FText) > 0;
|
UseText := Length(FText) > 0;
|
||||||
@@ -6787,12 +6802,27 @@ begin
|
|||||||
HeaderGlyphSize := Point(0, 0);
|
HeaderGlyphSize := Point(0, 0);
|
||||||
if UseSortGlyph then
|
if UseSortGlyph then
|
||||||
begin
|
begin
|
||||||
SortGlyphSize := Point(UtilityImages.Height, UtilityImages.Height);
|
if tsUseExplorerTheme in FHeader.Treeview.FStates then
|
||||||
|
begin
|
||||||
|
R := Rect(0, 0, 100, 100);
|
||||||
|
//Theme := OpenThemeData(FHeader.Treeview.Handle, 'HEADER');
|
||||||
|
//GetThemePartSize(Theme, DC, HP_HEADERSORTARROW, HSAS_SORTEDUP, @R, TS_TRUE, SortGlyphSize);
|
||||||
|
//CloseThemeData(Theme);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
SortGlyphSize.cx := UtilityImages.Width;
|
||||||
|
SortGlyphSize.cy := UtilityImages.Height;
|
||||||
|
end;
|
||||||
|
|
||||||
// In any case, the sort glyph is vertically centered.
|
// In any case, the sort glyph is vertically centered.
|
||||||
SortGlyphPos.Y := (ClientSize.Y - SortGlyphSize.Y) div 2;
|
SortGlyphPos.Y := (ClientSize.Y - SortGlyphSize.cy) div 2;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
SortGlyphSize := Point(0, 0);
|
begin
|
||||||
|
SortGlyphSize.cx := 0;
|
||||||
|
SortGlyphSize.cy := 0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if UseText then
|
if UseText then
|
||||||
@@ -6828,7 +6858,7 @@ begin
|
|||||||
if UseSortGlyph and not (UseText or UseHeaderGlyph) then
|
if UseSortGlyph and not (UseText or UseHeaderGlyph) then
|
||||||
begin
|
begin
|
||||||
// Center the sort glyph in the available area if nothing else is there.
|
// Center the sort glyph in the available area if nothing else is there.
|
||||||
SortGlyphPos := Point((ClientSize.X - SortGlyphSize.X) div 2, (ClientSize.Y - SortGlyphSize.Y) div 2);
|
SortGlyphPos := Point((ClientSize.X - SortGlyphSize.cx) div 2, (ClientSize.Y - SortGlyphSize.cy) div 2);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -6866,7 +6896,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// In RTL context is the sort glyph placed on the left hand side.
|
// In RTL context is the sort glyph placed on the left hand side.
|
||||||
SortGlyphPos.X := MinLeft;
|
SortGlyphPos.X := MinLeft;
|
||||||
Inc(MinLeft, SortGlyphSize.X + FSpacing);
|
Inc(MinLeft, SortGlyphSize.cx + FSpacing);
|
||||||
end;
|
end;
|
||||||
if Layout in [blGlyphTop, blGlyphBottom] then
|
if Layout in [blGlyphTop, blGlyphBottom] then
|
||||||
begin
|
begin
|
||||||
@@ -6910,7 +6940,7 @@ begin
|
|||||||
HeaderGlyphPos.X := (ClientSize.X - HeaderGlyphSize.X) div 2;
|
HeaderGlyphPos.X := (ClientSize.X - HeaderGlyphSize.X) div 2;
|
||||||
TextPos.X := (ClientSize.X - TextSize.cx) div 2;
|
TextPos.X := (ClientSize.X - TextSize.cx) div 2;
|
||||||
if UseSortGlyph then
|
if UseSortGlyph then
|
||||||
Dec(TextPos.X, SortGlyphSize.X div 2);
|
Dec(TextPos.X, SortGlyphSize.cx div 2);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -6945,7 +6975,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Sort glyph on the left hand side.
|
// Sort glyph on the left hand side.
|
||||||
SortGlyphPos.X := MinLeft - FSpacing - SortGlyphSize.X;
|
SortGlyphPos.X := MinLeft - FSpacing - SortGlyphSize.cx;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
@@ -6954,7 +6984,7 @@ begin
|
|||||||
if UseSortGlyph and (FBidiMode = bdLeftToRight) then
|
if UseSortGlyph and (FBidiMode = bdLeftToRight) then
|
||||||
begin
|
begin
|
||||||
// In LTR context is the sort glyph placed on the right hand side.
|
// In LTR context is the sort glyph placed on the right hand side.
|
||||||
Dec(MaxRight, SortGlyphSize.X);
|
Dec(MaxRight, SortGlyphSize.cx);
|
||||||
SortGlyphPos.X := MaxRight;
|
SortGlyphPos.X := MaxRight;
|
||||||
Dec(MaxRight, FSpacing);
|
Dec(MaxRight, FSpacing);
|
||||||
end;
|
end;
|
||||||
@@ -6989,7 +7019,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if UseSortGlyph and (FBidiMode <> bdLeftToRight) then
|
if UseSortGlyph and (FBidiMode <> bdLeftToRight) then
|
||||||
SortGlyphPos.X := MaxRight - SortGlyphSize.X;
|
SortGlyphPos.X := MaxRight - SortGlyphSize.cx;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -7005,8 +7035,8 @@ begin
|
|||||||
if FBidiMode = bdLeftToRight then
|
if FBidiMode = bdLeftToRight then
|
||||||
begin
|
begin
|
||||||
// Sort glyph on the right hand side.
|
// Sort glyph on the right hand side.
|
||||||
if SortGlyphPos.X + SortGlyphSize.X > MaxRight then
|
if SortGlyphPos.X + SortGlyphSize.cx > MaxRight then
|
||||||
SortGlyphPos.X := MaxRight - SortGlyphSize.X;
|
SortGlyphPos.X := MaxRight - SortGlyphSize.cx;
|
||||||
MaxRight := SortGlyphPos.X - FSpacing;
|
MaxRight := SortGlyphPos.X - FSpacing;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -7015,7 +7045,7 @@ begin
|
|||||||
SortGlyphPos.X := MinLeft;
|
SortGlyphPos.X := MinLeft;
|
||||||
// Left border needs only adjustment if the sort glyph marks the left border.
|
// Left border needs only adjustment if the sort glyph marks the left border.
|
||||||
if FBidiMode <> bdLeftToRight then
|
if FBidiMode <> bdLeftToRight then
|
||||||
MinLeft := SortGlyphPos.X + SortGlyphSize.X + FSpacing;
|
MinLeft := SortGlyphPos.X + SortGlyphSize.cx + FSpacing;
|
||||||
|
|
||||||
// Finally transform sort glyph to its actual position.
|
// Finally transform sort glyph to its actual position.
|
||||||
with SortGlyphPos do
|
with SortGlyphPos do
|
||||||
@@ -8202,6 +8232,10 @@ begin
|
|||||||
FSortColumn := NoColumn;
|
FSortColumn := NoColumn;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
with Header.Treeview do
|
||||||
|
if not (csLoading in ComponentState) then
|
||||||
|
FFocusedColumn := NoColumn;
|
||||||
|
|
||||||
inherited Clear;
|
inherited Clear;
|
||||||
finally
|
finally
|
||||||
FClearing := False;
|
FClearing := False;
|
||||||
@@ -8593,8 +8627,11 @@ var
|
|||||||
WrapCaption,
|
WrapCaption,
|
||||||
AdvancedOwnerDraw: Boolean;
|
AdvancedOwnerDraw: Boolean;
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
Details: TThemedElementDetails;
|
Details: TThemedElementDetails;
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
SortGlyphSize: TSize;
|
||||||
|
Glyph: TThemedHeader;
|
||||||
|
Pos: TRect;
|
||||||
|
|
||||||
PaintInfo: THeaderPaintInfo;
|
PaintInfo: THeaderPaintInfo;
|
||||||
RequestedElements,
|
RequestedElements,
|
||||||
@@ -8826,7 +8863,7 @@ begin
|
|||||||
if UseRightToLeftReading then
|
if UseRightToLeftReading then
|
||||||
DrawFormat := DrawFormat + DT_RTLREADING;
|
DrawFormat := DrawFormat + DT_RTLREADING;
|
||||||
ComputeHeaderLayout(Handle, PaintRectangle, ShowHeaderGlyph, ShowSortGlyph, GlyphPos, SortGlyphPos,
|
ComputeHeaderLayout(Handle, PaintRectangle, ShowHeaderGlyph, ShowSortGlyph, GlyphPos, SortGlyphPos,
|
||||||
TextRectangle, DrawFormat);
|
SortGlyphSize, TextRectangle, DrawFormat);
|
||||||
|
|
||||||
// Move glyph and text one pixel to the right and down to simulate a pressed button.
|
// Move glyph and text one pixel to the right and down to simulate a pressed button.
|
||||||
if IsDownIndex then
|
if IsDownIndex then
|
||||||
@@ -8889,20 +8926,36 @@ begin
|
|||||||
ColCaptionText := Text;
|
ColCaptionText := Text;
|
||||||
|
|
||||||
if not (hpeText in ActualElements) and (Length(Text) > 0) then
|
if not (hpeText in ActualElements) and (Length(Text) > 0) then
|
||||||
DrawButtonText(Handle, ColCaptionText, TextRectangle, IsEnabled, IsHoverIndex and (hoHotTrack in FHeader.FOptions) and
|
DrawButtonText(Handle, ColCaptionText, TextRectangle, IsEnabled,
|
||||||
not (tsUseThemes in FHeader.Treeview.FStates), DrawFormat, WrapCaption );
|
IsHoverIndex and (hoHotTrack in FHeader.FOptions) and not (tsUseThemes in FHeader.Treeview.FStates),
|
||||||
|
DrawFormat, WrapCaption );
|
||||||
|
|
||||||
// sort glyph
|
// sort glyph
|
||||||
if not (hpeSortGlyph in ActualElements) and ShowSortGlyph then
|
if not (hpeSortGlyph in ActualElements) and ShowSortGlyph then
|
||||||
begin
|
begin
|
||||||
SortIndex := SortGlyphs[FHeader.FSortDirection, tsUseThemes in FHeader.Treeview.FStates];
|
if tsUseExplorerTheme in FHeader.Treeview.FStates then
|
||||||
{$ifdef USE_DELPHICOMPAT}
|
begin
|
||||||
DirectMaskBlt(FHeaderBitmap.Canvas.Handle, SortGlyphPos.X, SortGlyphPos.Y, UtilityImageSize, UtilityImageSize, UtilityImages.Canvas.Handle,
|
Pos.TopLeft := SortGlyphPos;
|
||||||
SortIndex * UtilityImageSize, 0, UtilityImages.MaskHandle);
|
Pos.Right := Pos.Left + SortGlyphSize.cx;
|
||||||
{$else}
|
Pos.Bottom := Pos.Top + SortGlyphSize.cy;
|
||||||
StretchMaskBlt(FHeaderBitmap.Canvas.Handle, SortGlyphPos.X, SortGlyphPos.Y, UtilityImageSize, UtilityImageSize, UtilityImages.Canvas.Handle,
|
if FHeader.FSortDirection = sdAscending then
|
||||||
SortIndex * UtilityImageSize, 0, UtilityImageSize, UtilityImageSize, UtilityImages.MaskHandle,SortIndex * UtilityImageSize, 0, SRCCOPY);
|
Glyph := thHeaderSortArrowSortedUp
|
||||||
{$endif}
|
else
|
||||||
|
Glyph := thHeaderSortArrowSortedDown;
|
||||||
|
Details := ThemeServices.GetElementDetails(Glyph);
|
||||||
|
ThemeServices.DrawElement(Handle, Details, Pos, @Pos);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
SortIndex := SortGlyphs[FHeader.FSortDirection, tsUseThemes in FHeader.Treeview.FStates];
|
||||||
|
{$ifdef USE_DELPHICOMPAT}
|
||||||
|
DirectMaskBlt(FHeaderBitmap.Canvas.Handle, SortGlyphPos.X, SortGlyphPos.Y, UtilityImageSize, UtilityImageSize, UtilityImages.Canvas.Handle,
|
||||||
|
SortIndex * UtilityImageSize, 0, UtilityImages.MaskHandle);
|
||||||
|
{$else}
|
||||||
|
StretchMaskBlt(FHeaderBitmap.Canvas.Handle, SortGlyphPos.X, SortGlyphPos.Y, UtilityImageSize, UtilityImageSize, UtilityImages.Canvas.Handle,
|
||||||
|
SortIndex * UtilityImageSize, 0, UtilityImageSize, UtilityImageSize, UtilityImages.MaskHandle,SortIndex * UtilityImageSize, 0, SRCCOPY);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Show an indication if this column is the current drop target in a header drag operation.
|
// Show an indication if this column is the current drop target in a header drag operation.
|
||||||
@@ -9878,6 +9931,7 @@ begin
|
|||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -12217,7 +12271,7 @@ begin
|
|||||||
|
|
||||||
if (poDrawSelection in PaintOptions) and (toFullRowSelect in FOptions.FSelectionOptions) and
|
if (poDrawSelection in PaintOptions) and (toFullRowSelect in FOptions.FSelectionOptions) and
|
||||||
(vsSelected in Node.States) and not (toUseBlendedSelection in FOptions.PaintOptions) and not
|
(vsSelected in Node.States) and not (toUseBlendedSelection in FOptions.PaintOptions) and not
|
||||||
((tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) and IsWinVistaOrAbove) then
|
(tsUseExplorerTheme in FStates) then
|
||||||
begin
|
begin
|
||||||
{$ifdef DEBUG_VTV}Logger.Send([lcPaintDetails, lcDrag], 'Draw the background of a selected node');{$endif}
|
{$ifdef DEBUG_VTV}Logger.Send([lcPaintDetails, lcDrag], 'Draw the background of a selected node');{$endif}
|
||||||
if toShowHorzGridLines in FOptions.PaintOptions then
|
if toShowHorzGridLines in FOptions.PaintOptions then
|
||||||
@@ -12315,6 +12369,7 @@ function TBaseVirtualTree.DetermineLineImageAndSelectLevel(Node: PVirtualNode; o
|
|||||||
|
|
||||||
var
|
var
|
||||||
X: Integer;
|
X: Integer;
|
||||||
|
Indent: Integer;
|
||||||
Run: PVirtualNode;
|
Run: PVirtualNode;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@@ -12336,6 +12391,7 @@ begin
|
|||||||
|
|
||||||
// Set initial size of line index array, this will automatically initialized all entries to ltNone.
|
// Set initial size of line index array, this will automatically initialized all entries to ltNone.
|
||||||
SetLength(LineImage, X);
|
SetLength(LineImage, X);
|
||||||
|
Indent := X - 1;
|
||||||
|
|
||||||
// Only use lines if requested.
|
// Only use lines if requested.
|
||||||
if toShowTreeLines in FOptions.FPaintOptions then
|
if toShowTreeLines in FOptions.FPaintOptions then
|
||||||
@@ -12424,6 +12480,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (tsUseExplorerTheme in FStates) and HasChildren[Node] and (Indent >= 0) then
|
||||||
|
LineImage[Indent] := ltNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -13372,13 +13431,9 @@ var
|
|||||||
Size: TSize;
|
Size: TSize;
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
//Theme: HTHEME;
|
//Theme: HTHEME;
|
||||||
|
{$EndIf ThemeSupport}
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
|
||||||
const
|
|
||||||
TVP_HOTGLYPH = 4;
|
|
||||||
|
|
||||||
{$endif ThemeSupport}
|
|
||||||
|
|
||||||
//--------------- local function --------------------------------------------
|
//--------------- local function --------------------------------------------
|
||||||
|
|
||||||
procedure FillBitmap (ABitmap: TBitmap);
|
procedure FillBitmap (ABitmap: TBitmap);
|
||||||
@@ -13442,7 +13497,7 @@ begin
|
|||||||
// box is always of odd size
|
// box is always of odd size
|
||||||
FillBitmap(FMinusBM);
|
FillBitmap(FMinusBM);
|
||||||
FillBitmap(FHotMinusBM);
|
FillBitmap(FHotMinusBM);
|
||||||
if not (IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions)) then
|
if not (tsUseExplorerTheme in FStates) then
|
||||||
begin
|
begin
|
||||||
if FButtonStyle = bsTriangle then
|
if FButtonStyle = bsTriangle then
|
||||||
begin
|
begin
|
||||||
@@ -13478,7 +13533,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
FillBitmap(FPlusBM);
|
FillBitmap(FPlusBM);
|
||||||
FillBitmap(FHotPlusBM);
|
FillBitmap(FHotPlusBM);
|
||||||
if not (IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions)) then
|
if not (tsUseExplorerTheme in FStates) then
|
||||||
begin
|
begin
|
||||||
if FButtonStyle = bsTriangle then
|
if FButtonStyle = bsTriangle then
|
||||||
begin
|
begin
|
||||||
@@ -13522,7 +13577,7 @@ begin
|
|||||||
R := Rect(0, 0, Size.cx, Size.cy);
|
R := Rect(0, 0, Size.cx, Size.cy);
|
||||||
DrawThemeBackground(Theme, FPlusBM.Canvas.Handle, TVP_GLYPH, GLPS_CLOSED, R, nil);
|
DrawThemeBackground(Theme, FPlusBM.Canvas.Handle, TVP_GLYPH, GLPS_CLOSED, R, nil);
|
||||||
DrawThemeBackground(Theme, FMinusBM.Canvas.Handle, TVP_GLYPH, GLPS_OPENED, R, nil);
|
DrawThemeBackground(Theme, FMinusBM.Canvas.Handle, TVP_GLYPH, GLPS_OPENED, R, nil);
|
||||||
if IsWinVistaOrAbove and (toUseExplorerTheme in FOptions.FPaintOptions) then
|
if tsUseExplorerTheme in FStates then
|
||||||
begin
|
begin
|
||||||
DrawThemeBackground(Theme, FHotPlusBM.Canvas.Handle, TVP_HOTGLYPH, GLPS_CLOSED, R, nil);
|
DrawThemeBackground(Theme, FHotPlusBM.Canvas.Handle, TVP_HOTGLYPH, GLPS_CLOSED, R, nil);
|
||||||
DrawThemeBackground(Theme, FHotMinusBM.Canvas.Handle, TVP_HOTGLYPH, GLPS_OPENED, R, nil);
|
DrawThemeBackground(Theme, FHotMinusBM.Canvas.Handle, TVP_HOTGLYPH, GLPS_OPENED, R, nil);
|
||||||
@@ -19833,7 +19888,7 @@ end;
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TBaseVirtualTree.DragAndDrop(AllowedEffects: LongWord;
|
procedure TBaseVirtualTree.DragAndDrop(AllowedEffects: LongWord;
|
||||||
DataObject: IDataObject; DragEffect: LongWord);
|
DataObject: IDataObject; var DragEffect: LongWord);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef Windows}
|
{$ifdef Windows}
|
||||||
@@ -20673,7 +20728,7 @@ begin
|
|||||||
CheckPositions := [hiOnItemLabel, hiOnItemCheckbox];
|
CheckPositions := [hiOnItemLabel, hiOnItemCheckbox];
|
||||||
|
|
||||||
// If running under Windows Vista using the explorer theme hitting the buttons makes the node hot, too.
|
// If running under Windows Vista using the explorer theme hitting the buttons makes the node hot, too.
|
||||||
if (IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions)) then
|
if tsUseExplorerTheme in FStates then
|
||||||
Include(CheckPositions, hiOnItemButtonExact);
|
Include(CheckPositions, hiOnItemButtonExact);
|
||||||
|
|
||||||
if (CheckPositions * HitInfo.HitPositions = []) and not (toFullRowSelect in FOptions.FSelectionOptions) then
|
if (CheckPositions * HitInfo.HitPositions = []) and not (toFullRowSelect in FOptions.FSelectionOptions) then
|
||||||
@@ -22768,6 +22823,10 @@ var
|
|||||||
Bitmap: TBitmap;
|
Bitmap: TBitmap;
|
||||||
XPos: Integer;
|
XPos: Integer;
|
||||||
IsHot: Boolean;
|
IsHot: Boolean;
|
||||||
|
//Theme: HTHEME;
|
||||||
|
Glyph: Integer;
|
||||||
|
State: Integer;
|
||||||
|
Pos: TRect;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
IsHot := (toHotTrack in FOptions.FPaintOptions) and (FCurrentHotNode = Node) and FHotNodeButtonHit;
|
IsHot := (toHotTrack in FOptions.FPaintOptions) and (FCurrentHotNode = Node) and FHotNodeButtonHit;
|
||||||
@@ -22793,6 +22852,18 @@ begin
|
|||||||
else
|
else
|
||||||
XPos := R.Right - ButtonX - Bitmap.Width;
|
XPos := R.Right - ButtonX - Bitmap.Width;
|
||||||
|
|
||||||
|
if tsUseExplorerTheme in FStates then
|
||||||
|
begin
|
||||||
|
Glyph := IfThen(IsHot, TVP_HOTGLYPH, TVP_GLYPH);
|
||||||
|
State := IfThen(vsExpanded in Node.States, GLPS_OPENED, GLPS_CLOSED);
|
||||||
|
Pos := Rect(XPos, R.Top + ButtonY, XPos + Bitmap.Width, R.Top + ButtonY + Bitmap.Height);
|
||||||
|
{
|
||||||
|
Theme := OpenThemeData(Handle, 'TREEVIEW');
|
||||||
|
DrawThemeBackground(Theme, Canvas.Handle, Glyph, State, Pos, nil);
|
||||||
|
CloseThemeData(Theme);
|
||||||
|
}
|
||||||
|
end
|
||||||
|
else
|
||||||
// Need to draw this masked.
|
// Need to draw this masked.
|
||||||
Canvas.Draw(XPos, R.Top + ButtonY, Bitmap);
|
Canvas.Draw(XPos, R.Top + ButtonY, Bitmap);
|
||||||
end;
|
end;
|
||||||
@@ -31218,8 +31289,7 @@ begin
|
|||||||
|
|
||||||
if (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) then
|
if (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) then
|
||||||
begin
|
begin
|
||||||
if not IsWinVistaOrAbove or not (tsUseThemes in FStates) or
|
if not (tsUseExplorerTheme in FStates) then
|
||||||
not (toUseExplorerTheme in FOptions.FPaintOptions) then
|
|
||||||
Canvas.Font.Style := Canvas.Font.Style + [fsUnderline];
|
Canvas.Font.Style := Canvas.Font.Style + [fsUnderline];
|
||||||
Canvas.Font.Color := FColors.HotColor;
|
Canvas.Font.Color := FColors.HotColor;
|
||||||
end;
|
end;
|
||||||
@@ -31231,17 +31301,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
if Node = FDropTargetNode then
|
if Node = FDropTargetNode then
|
||||||
begin
|
begin
|
||||||
if (FLastDropMode = dmOnNode) or (vsSelected in Node.States) and
|
if (FLastDropMode = dmOnNode) or (vsSelected in Node.States) and not
|
||||||
(not IsWinVistaOrAbove or not (tsUseThemes in FStates) or
|
(tsUseExplorerTheme in FStates) then
|
||||||
not (toUseExplorerTheme in FOptions.FPaintOptions)) then
|
|
||||||
Canvas.Font.Color := clHighlightText;
|
Canvas.Font.Color := clHighlightText;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if vsSelected in Node.States then
|
if vsSelected in Node.States then
|
||||||
begin
|
begin
|
||||||
if (Focused or (toPopupMode in FOptions.FPaintOptions)) and
|
if (Focused or (toPopupMode in FOptions.FPaintOptions)) and not
|
||||||
(not IsWinVistaOrAbove or not (tsUseThemes in FStates) or
|
(tsUseExplorerTheme in FStates) then
|
||||||
not (toUseExplorerTheme in FOptions.FPaintOptions)) then
|
|
||||||
Canvas.Font.Color := clHighlightText;
|
Canvas.Font.Color := clHighlightText;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -32028,23 +32096,24 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if Length(Name) = 0 then
|
if Length(Name) = 0 then
|
||||||
Buffer.Add(' style="{font:')
|
Buffer.Add(' style="{')
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Buffer.Add('.');
|
Buffer.Add('.');
|
||||||
Buffer.Add(Name);
|
Buffer.Add(Name);
|
||||||
Buffer.Add('{font:');
|
Buffer.Add('{');
|
||||||
end;
|
end;
|
||||||
if fsUnderline in Font.Style then
|
|
||||||
Buffer.Add(' underline');
|
Buffer.Add(Format('font-family: ''%s''; ', [Font.Name]));
|
||||||
if fsItalic in Font.Style then
|
|
||||||
Buffer.Add(' italic');
|
|
||||||
if fsBold in Font.Style then
|
|
||||||
Buffer.Add(' bold');
|
|
||||||
if Font.Size < 0 then
|
if Font.Size < 0 then
|
||||||
Buffer.Add(Format(' %dpx "%s";', [Font.Height, Font.Name]))
|
Buffer.Add(Format('font-size: %dpx; ', [Font.Height]))
|
||||||
else
|
else
|
||||||
Buffer.Add(Format(' %dpt "%s";', [Font.Size, Font.Name]));
|
Buffer.Add(Format('font-size: %dpt; ', [Font.Size]));
|
||||||
|
|
||||||
|
Buffer.Add(Format('font-style: %s; ', [IfThen(fsItalic in Font.Style, 'italic', 'normal')]));
|
||||||
|
Buffer.Add(Format('font-weight: %s; ', [IfThen(fsBold in Font.Style, 'bold', 'normal')]));
|
||||||
|
Buffer.Add(Format('text-decoration: %s; ', [IfThen(fsUnderline in Font.Style, 'underline', 'none')]));
|
||||||
|
|
||||||
Buffer.Add('color:');
|
Buffer.Add('color:');
|
||||||
WriteColorAsHex(Font.Color);
|
WriteColorAsHex(Font.Color);
|
||||||
Buffer.Add(';}');
|
Buffer.Add(';}');
|
||||||
|
Reference in New Issue
Block a user