You've already forked lazarus-ccr
* Fixed drawing when header height is bigger than node height.
* Fix drawing with fixed columns git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@411 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -77,13 +77,13 @@ unit VirtualTrees;
|
|||||||
// For full document history see help file.
|
// For full document history see help file.
|
||||||
//
|
//
|
||||||
// Credits for their valuable assistance and code donations go to:
|
// Credits for their valuable assistance and code donations go to:
|
||||||
// Freddy Ertl, Marian Aldenhövel, Thomas Bogenrieder, Jim Kuenemann, Werner Lehmann, Jens Treichler,
|
// Freddy Ertl, Marian Aldenh�vel, Thomas Bogenrieder, Jim Kuenemann, Werner Lehmann, Jens Treichler,
|
||||||
// Paul Gallagher (IBO tree), Ondrej Kelle, Ronaldo Melo Ferraz, Heri Bender, Roland Bedürftig (BCB)
|
// Paul Gallagher (IBO tree), Ondrej Kelle, Ronaldo Melo Ferraz, Heri Bender, Roland Bed�rftig (BCB)
|
||||||
// Anthony Mills, Alexander Egorushkin (BCB), Mathias Torell (BCB), Frank van den Bergh, Vadim Sedulin, Peter Evans,
|
// Anthony Mills, Alexander Egorushkin (BCB), Mathias Torell (BCB), Frank van den Bergh, Vadim Sedulin, Peter Evans,
|
||||||
// Milan Vandrovec (BCB), Steve Moss, Joe White, David Clark, Anders Thomsen, Igor Afanasyev, Eugene Programmer,
|
// Milan Vandrovec (BCB), Steve Moss, Joe White, David Clark, Anders Thomsen, Igor Afanasyev, Eugene Programmer,
|
||||||
// Corbin Dunn, Richard Pringle, Uli Gerhardt, Azza, Igor Savkic
|
// Corbin Dunn, Richard Pringle, Uli Gerhardt, Azza, Igor Savkic
|
||||||
// Beta testers:
|
// Beta testers:
|
||||||
// Freddy Ertl, Hans-Jürgen Schnorrenberg, Werner Lehmann, Jim Kueneman, Vadim Sedulin, Moritz Franckenstein,
|
// Freddy Ertl, Hans-J�rgen Schnorrenberg, Werner Lehmann, Jim Kueneman, Vadim Sedulin, Moritz Franckenstein,
|
||||||
// Wim van der Vegt, Franc v/d Westelaken
|
// Wim van der Vegt, Franc v/d Westelaken
|
||||||
// Indirect contribution (via publicly accessible work of those persons):
|
// Indirect contribution (via publicly accessible work of those persons):
|
||||||
// Alex Denissov, Hiroyuki Hori (MMXAsm expert)
|
// Alex Denissov, Hiroyuki Hori (MMXAsm expert)
|
||||||
@ -97,7 +97,7 @@ unit VirtualTrees;
|
|||||||
// Accessability implementation:
|
// Accessability implementation:
|
||||||
// Marco Zehe (with help from Sebastian Modersohn)
|
// Marco Zehe (with help from Sebastian Modersohn)
|
||||||
// LCL Port (version 4.5.1):
|
// LCL Port (version 4.5.1):
|
||||||
// Luiz Américo Pereira Câmara
|
// Luiz Am�rico Pereira C�mara
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -3367,7 +3367,7 @@ const
|
|||||||
|
|
||||||
// Do not modify the copyright in any way! Usage of this unit is prohibited without the copyright notice
|
// Do not modify the copyright in any way! Usage of this unit is prohibited without the copyright notice
|
||||||
// in the compiled binary file.
|
// in the compiled binary file.
|
||||||
Copyright: string = 'Virtual Treeview © 1999, 2003 Mike Lischke';
|
Copyright: string = 'Virtual Treeview � 1999, 2003 Mike Lischke';
|
||||||
|
|
||||||
var
|
var
|
||||||
//Workaround to LCL bug 8553
|
//Workaround to LCL bug 8553
|
||||||
@ -21370,19 +21370,29 @@ begin
|
|||||||
if Temp = 0 then
|
if Temp = 0 then
|
||||||
begin
|
begin
|
||||||
Window := FUpdateRect;
|
Window := FUpdateRect;
|
||||||
|
Logger.Send([lcHeaderOffset], 'FUpdateRect', FUpdateRect);
|
||||||
Target := Window.TopLeft;
|
Target := Window.TopLeft;
|
||||||
//lclheader
|
//lclheader
|
||||||
if hoVisible in FHeader.FOptions then
|
if hoVisible in FHeader.FOptions then
|
||||||
begin
|
begin
|
||||||
Inc(Target.Y,FHeader.Height);
|
if Target.Y < FHeader.Height then
|
||||||
Dec(Window.Bottom,FHeader.Height);
|
begin
|
||||||
if RectVisible(Canvas.Handle,FHeaderRect) then
|
Window.Top := 0;
|
||||||
|
Target.Y := FHeader.Height;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Dec(Window.Top, FHeader.Height);
|
||||||
|
end;
|
||||||
|
Dec(Window.Bottom, FHeader.Height);
|
||||||
|
|
||||||
|
if RectVisible(Canvas.Handle, FHeaderRect) then
|
||||||
begin
|
begin
|
||||||
Logger.Send([lcPaintHeader],'RectVisible = True');
|
Logger.Send([lcPaintHeader],'RectVisible = True');
|
||||||
FHeader.FColumns.PaintHeader(Canvas.Handle, FHeaderRect, -FEffectiveOffsetX);
|
FHeader.FColumns.PaintHeader(Canvas.Handle, FHeaderRect, -FEffectiveOffsetX);
|
||||||
end;
|
end;
|
||||||
with FHeaderRect do
|
with FHeaderRect do
|
||||||
ExcludeClipRect(Canvas.Handle,Left,Top,Right,Bottom);
|
ExcludeClipRect(Canvas.Handle, Left, Top, Right, Bottom);
|
||||||
end;
|
end;
|
||||||
// The clipping rectangle is given in client coordinates of the window. We have to convert it into
|
// The clipping rectangle is given in client coordinates of the window. We have to convert it into
|
||||||
// a sliding window of the tree image.
|
// a sliding window of the tree image.
|
||||||
@ -21403,11 +21413,12 @@ begin
|
|||||||
//lclheader
|
//lclheader
|
||||||
if hoVisible in FHeader.FOptions then
|
if hoVisible in FHeader.FOptions then
|
||||||
begin
|
begin
|
||||||
Inc(Target.Y,FHeader.Height);
|
//Target is always (0,0) due to call to ClientRect, so no need set Top to 0
|
||||||
Dec(Window.Bottom,FHeader.Height);
|
//also no need to decrease bottom because ClientRect already computes header
|
||||||
if RectVisible(Canvas.Handle,FHeaderRect) then
|
Inc(Target.Y, FHeader.Height);
|
||||||
|
if RectVisible(Canvas.Handle, FHeaderRect) then
|
||||||
begin
|
begin
|
||||||
Logger.Send([lcPaintHeader],'RectVisible = True');
|
Logger.Send([lcPaintHeader], 'RectVisible = True');
|
||||||
FHeader.FColumns.PaintHeader(Canvas.Handle, FHeaderRect, -FEffectiveOffsetX);
|
FHeader.FColumns.PaintHeader(Canvas.Handle, FHeaderRect, -FEffectiveOffsetX);
|
||||||
end;
|
end;
|
||||||
with FHeaderRect do
|
with FHeaderRect do
|
||||||
@ -21431,10 +21442,7 @@ begin
|
|||||||
|
|
||||||
//lclheader
|
//lclheader
|
||||||
if hoVisible in FHeader.FOptions then
|
if hoVisible in FHeader.FOptions then
|
||||||
begin
|
Inc(Target.Y, FHeader.Height);
|
||||||
Inc(Target.Y,FHeader.Height);
|
|
||||||
Dec(Window.Bottom,FHeader.Height);
|
|
||||||
end;
|
|
||||||
|
|
||||||
OffsetRect(Window, FEffectiveOffsetX - RTLOffset, -FOffsetY);
|
OffsetRect(Window, FEffectiveOffsetX - RTLOffset, -FOffsetY);
|
||||||
PaintTree(Canvas, Window, Target, Options);
|
PaintTree(Canvas, Window, Target, Options);
|
||||||
@ -26557,8 +26565,8 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod([lcPaint],'PaintTree');
|
Logger.EnterMethod([lcPaint],'PaintTree');
|
||||||
Logger.Send([lcPaint],'Window',Window);
|
Logger.Send([lcPaint, lcHeaderOffset],'Window',Window);
|
||||||
Logger.Send([lcPaint],'Target',Target);
|
Logger.Send([lcPaint, lcHeaderOffset],'Target',Target);
|
||||||
Logger.Send([lcPaintHeader],'ClientRect',ClientRect);
|
Logger.Send([lcPaintHeader],'ClientRect',ClientRect);
|
||||||
Logger.Send([lcPaintHeader],'TreeRect',GetTreeRect);
|
Logger.Send([lcPaintHeader],'TreeRect',GetTreeRect);
|
||||||
Logger.Send([lcPaintHeader],'OffsetX: %d OffsetY: %d',[OffsetX,OffsetY]);
|
Logger.Send([lcPaintHeader],'OffsetX: %d OffsetY: %d',[OffsetX,OffsetY]);
|
||||||
@ -26629,7 +26637,7 @@ begin
|
|||||||
PaintInfo.Node := GetNodeAt(0, Window.Top, False, BaseOffset);
|
PaintInfo.Node := GetNodeAt(0, Window.Top, False, BaseOffset);
|
||||||
if PaintInfo.Node = nil then
|
if PaintInfo.Node = nil then
|
||||||
BaseOffset := Window.Top;
|
BaseOffset := Window.Top;
|
||||||
Logger.Send([lcPaint],'BaseOffset',BaseOffset);
|
Logger.Send([lcPaint, lcHeaderOffset],'BaseOffset',BaseOffset);
|
||||||
// Transform selection rectangle into node bitmap coordinates.
|
// Transform selection rectangle into node bitmap coordinates.
|
||||||
if DrawSelectionRect then
|
if DrawSelectionRect then
|
||||||
OffsetRect(SelectionRect, 0, -BaseOffset);
|
OffsetRect(SelectionRect, 0, -BaseOffset);
|
||||||
@ -26639,7 +26647,7 @@ begin
|
|||||||
MaximumRight := Target.X + (Window.Right - Window.Left);
|
MaximumRight := Target.X + (Window.Right - Window.Left);
|
||||||
MaximumBottom := Target.Y + (Window.Bottom - Window.Top);
|
MaximumBottom := Target.Y + (Window.Bottom - Window.Top);
|
||||||
|
|
||||||
Logger.Send([lcPaintHeader],'MaximumRight: %d MaximumBottom: %d',[MaximumRight,MaximumBottom]);
|
Logger.Send([lcPaintHeader, lcHeaderOffset],'MaximumRight: %d MaximumBottom: %d',[MaximumRight,MaximumBottom]);
|
||||||
TargetRect := Rect(Target.X, Target.Y - (Window.Top - BaseOffset), MaximumRight, 0);
|
TargetRect := Rect(Target.X, Target.Y - (Window.Top - BaseOffset), MaximumRight, 0);
|
||||||
TargetRect.Bottom := TargetRect.Top;
|
TargetRect.Bottom := TargetRect.Top;
|
||||||
|
|
||||||
@ -26678,6 +26686,8 @@ begin
|
|||||||
|
|
||||||
TargetRect.Bottom := TargetRect.Top + PaintInfo.Node.NodeHeight;
|
TargetRect.Bottom := TargetRect.Top + PaintInfo.Node.NodeHeight;
|
||||||
|
|
||||||
|
Logger.Send([lcHeaderOffset], 'TargetRect for Node ' + IntToStr(PaintInfo.Node.Index), TargetRect);
|
||||||
|
|
||||||
// If poSelectedOnly is active then do the following stuff only for selected nodes or nodes
|
// If poSelectedOnly is active then do the following stuff only for selected nodes or nodes
|
||||||
// which are children of selected nodes.
|
// which are children of selected nodes.
|
||||||
if (SelectLevel > 0) or not (poSelectedOnly in PaintOptions) then
|
if (SelectLevel > 0) or not (poSelectedOnly in PaintOptions) then
|
||||||
@ -26936,7 +26946,7 @@ begin
|
|||||||
NodeBitmap.Height));
|
NodeBitmap.Height));
|
||||||
end;
|
end;
|
||||||
Logger.SendBitmap([lcPaintBitmap],'NodeBitmap',NodeBitmap);
|
Logger.SendBitmap([lcPaintBitmap],'NodeBitmap',NodeBitmap);
|
||||||
Logger.SendIf([lcPaintDetails],'TargetRect.Top < Target.Y '+ Logger.RectToStr(TargetRect)
|
Logger.SendIf([lcPaintDetails, lcHeaderOffset],'TargetRect.Top < Target.Y '+ Logger.RectToStr(TargetRect)
|
||||||
+' '+Logger.PointToStr(Target),TargetRect.Top < Target.Y);
|
+' '+Logger.PointToStr(Target),TargetRect.Top < Target.Y);
|
||||||
{$ifdef Gtk}
|
{$ifdef Gtk}
|
||||||
//lclheader
|
//lclheader
|
||||||
@ -29763,7 +29773,7 @@ function TCustomVirtualStringTree.ContentToHTML(Source: TVSTTextSourceType; cons
|
|||||||
|
|
||||||
// Renders the current tree content (depending on Source) as HTML text encoded in UTF-8.
|
// Renders the current tree content (depending on Source) as HTML text encoded in UTF-8.
|
||||||
// If Caption is not empty then it is used to create and fill the header for the table built here.
|
// If Caption is not empty then it is used to create and fill the header for the table built here.
|
||||||
// Based on ideas and code from Frank van den Bergh and Andreas Hörstemeier.
|
// Based on ideas and code from Frank van den Bergh and Andreas H�rstemeier.
|
||||||
|
|
||||||
type
|
type
|
||||||
UCS2 = Word;
|
UCS2 = Word;
|
||||||
@ -30240,7 +30250,7 @@ end;
|
|||||||
function TCustomVirtualStringTree.ContentToRTF(Source: TVSTTextSourceType): string;
|
function TCustomVirtualStringTree.ContentToRTF(Source: TVSTTextSourceType): string;
|
||||||
|
|
||||||
// Renders the current tree content (depending on Source) as RTF (rich text).
|
// Renders the current tree content (depending on Source) as RTF (rich text).
|
||||||
// Based on ideas and code from Frank van den Bergh and Andreas Hörstemeier.
|
// Based on ideas and code from Frank van den Bergh and Andreas H�rstemeier.
|
||||||
|
|
||||||
var
|
var
|
||||||
Fonts: TStringList;
|
Fonts: TStringList;
|
||||||
|
@ -34,6 +34,7 @@ const
|
|||||||
lcDrag = 19;
|
lcDrag = 19;
|
||||||
lcOle = 20;
|
lcOle = 20;
|
||||||
lcPanning = 21;
|
lcPanning = 21;
|
||||||
|
lcHeaderOffset = 22;
|
||||||
|
|
||||||
var
|
var
|
||||||
Logger: TLCLLogger;
|
Logger: TLCLLogger;
|
||||||
|
Reference in New Issue
Block a user