Commit dd3f611b authored by Michael W. Vogel's avatar Michael W. Vogel
Browse files

LCL: TTreeView: Win32 Fixed warning TResourceCacheItem.IncreaseRefCount 1000...

LCL: TTreeView: Win32 Fixed warning TResourceCacheItem.IncreaseRefCount 1000 TPenHandleCache. Issue #30661

git-svn-id: trunk@55118 -
parent 9ce286c9
......@@ -3315,6 +3315,7 @@ type
FTopItem: TTreeNode;
FTreeLineColor: TColor;
FTreeLinePenStyle: TPenStyle;
FTreeLinePenPattern: TPenPattern;
FExpandSignColor : TColor;
FTreeNodes: TTreeNodes;
FHintWnd: THintWindow;
......
......@@ -3264,6 +3264,9 @@ begin
FStates:=[tvsMaxLvlNeedsUpdate,tvsMaxRightNeedsUpdate,tvsScrollbarChanged];
FTreeLineColor := clWindowFrame;
FTreeLinePenStyle := psPattern;
SetLength(FTreeLinePenPattern, 2);
FTreeLinePenPattern[0] := 1;
FTreeLinePenPattern[1] := 1;
FExpandSignColor := clWindowFrame;
// Accessibility
AccessibleDescription := rsTTreeViewAccessibilityDescription;
......@@ -5220,6 +5223,8 @@ begin
// draw tree lines
Pen.Color := TreeLineColor;
Pen.Style := TreeLinePenStyle;
if Pen.Style = psPattern then
Pen.SetPattern(FTreeLinePenPattern);
x := DrawTreeLines(Node);
Pen.Style := psSolid;
......
......@@ -1352,6 +1352,11 @@ begin
LB.lbColor := ColorToRGB(TColor(lplb.lbColor));
LB.lbHatch := lplb.lbHatch;
Result := Windows.ExtCreatePen(dwPenStyle, dwWidth, LB, dwStyleCount, lpStyle);
// Note Michl: When style PS_USERSTYLE is used, lpStyle can't be nil, there
// must be dwSytleCount >= 1, see issue #30661
if Result = 0 then
DebugLn('TWin32WidgetSet.ExtCreatePen returns 0. Reason = ' + GetLastErrorText(Windows.GetLastError));
end;
{------------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment