You've already forked lazarus-ccr
Started header implementation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@78 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2276,6 +2276,7 @@ TBaseVirtualTree = class(TCustomControl)
|
|||||||
function GetBorderDimensions: TSize; virtual;
|
function GetBorderDimensions: TSize; virtual;
|
||||||
function GetCheckImage(Node: PVirtualNode): Integer; virtual;
|
function GetCheckImage(Node: PVirtualNode): Integer; virtual;
|
||||||
class function GetCheckImageListFor(Kind: TCheckImageKind): TCustomImageList; virtual;
|
class function GetCheckImageListFor(Kind: TCheckImageKind): TCustomImageList; virtual;
|
||||||
|
function GetClientRect: TRect; override;
|
||||||
function GetColumnClass: TVirtualTreeColumnClass; virtual;
|
function GetColumnClass: TVirtualTreeColumnClass; virtual;
|
||||||
function GetHeaderClass: TVTHeaderClass; virtual;
|
function GetHeaderClass: TVTHeaderClass; virtual;
|
||||||
function GetHintWindowClass: THintWindowClass; virtual;
|
function GetHintWindowClass: THintWindowClass; virtual;
|
||||||
@ -15827,11 +15828,11 @@ procedure TBaseVirtualTree.WMEraseBkgnd(var Message: TLMEraseBkgnd);
|
|||||||
var
|
var
|
||||||
R: TRect;
|
R: TRect;
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod(lcPaint,'WMEraseBkgnd');
|
Logger.EnterMethod(lcEraseBkgnd,'WMEraseBkgnd');
|
||||||
Windows.GetUpdateRect(Handle,R,True);
|
//Windows.GetUpdateRect(Handle,R,True);
|
||||||
Logger.Send(lcPaint,'UpdateRect',R);
|
//Logger.Send(lcPaint,'UpdateRect',R);
|
||||||
Message.Result := 1;
|
Message.Result := 1;
|
||||||
Logger.ExitMethod(lcPaint,'WMEraseBkgnd');
|
Logger.ExitMethod(lcEraseBkgnd,'WMEraseBkgnd');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -16618,6 +16619,8 @@ begin
|
|||||||
|
|
||||||
// get information about the hit
|
// get information about the hit
|
||||||
GetHitTestInfoAt(Message.XPos, Message.YPos, True, HitInfo);
|
GetHitTestInfoAt(Message.XPos, Message.YPos, True, HitInfo);
|
||||||
|
if HitInfo.HitNode <> nil then
|
||||||
|
Logger.Send(lcPaintHeader,'HitNode',HitInfo.HitNode^.Index);
|
||||||
HandleMouseDown(Message, HitInfo);
|
HandleMouseDown(Message, HitInfo);
|
||||||
Logger.ExitMethod(lcMessages,'WMLButtonDown');
|
Logger.ExitMethod(lcMessages,'WMLButtonDown');
|
||||||
end;
|
end;
|
||||||
@ -16878,7 +16881,6 @@ begin
|
|||||||
FUpdateRect := ClientRect
|
FUpdateRect := ClientRect
|
||||||
else
|
else
|
||||||
FUpdateRect:=Message.PaintStruct^.rcPaint;
|
FUpdateRect:=Message.PaintStruct^.rcPaint;
|
||||||
//Windows.GetUpdateRect(Handle,FUpdateRect,True);
|
|
||||||
|
|
||||||
Logger.Send(lcPaint,'FUpdateRect', FUpdateRect);
|
Logger.Send(lcPaint,'FUpdateRect', FUpdateRect);
|
||||||
|
|
||||||
@ -20557,6 +20559,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBaseVirtualTree.GetClientRect: TRect;
|
||||||
|
begin
|
||||||
|
Result:=Inherited;
|
||||||
|
//lclheader
|
||||||
|
if HandleAllocated and (hoVisible in FHeader.FOptions) then
|
||||||
|
Dec(Result.Bottom,FHeader.Height);
|
||||||
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function TBaseVirtualTree.GetColumnClass: TVirtualTreeColumnClass;
|
function TBaseVirtualTree.GetColumnClass: TVirtualTreeColumnClass;
|
||||||
@ -22299,7 +22309,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
Window := FUpdateRect;
|
Window := FUpdateRect;
|
||||||
Target := Window.TopLeft;
|
Target := Window.TopLeft;
|
||||||
|
//lclheader
|
||||||
|
if hoVisible in FHeader.FOptions then
|
||||||
|
begin
|
||||||
|
Inc(Target.Y,FHeader.Height);
|
||||||
|
Dec(Window.Bottom,FHeader.Height);
|
||||||
|
if RectVisible(Canvas.Handle,FHeaderRect) then
|
||||||
|
begin
|
||||||
|
Logger.Send(lcPaintHeader,'RectVisible = True');
|
||||||
|
FHeader.FColumns.PaintHeader(Canvas.Handle, FHeaderRect, -FEffectiveOffsetX);
|
||||||
|
end;
|
||||||
|
with FHeaderRect do
|
||||||
|
ExcludeClipRect(Canvas.Handle,Left,Top,Right,Bottom);
|
||||||
|
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.
|
||||||
Logger.Send(lcPaintDetails,'FEffectiveOffsetX: %d, RTLOffset: %d, OffsetY: %d',[FEffectiveOffsetX,RTLOffset,FOffsetY]);
|
Logger.Send(lcPaintDetails,'FEffectiveOffsetX: %d, RTLOffset: %d, OffsetY: %d',[FEffectiveOffsetX,RTLOffset,FOffsetY]);
|
||||||
@ -22310,7 +22332,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Logger.Send(lcPaint,'FUpdateRect IS Empty');
|
Logger.Send(lcPaint,'VisibleFixedWidth > 0');
|
||||||
// First part, fixed columns
|
// First part, fixed columns
|
||||||
Window := ClientRect;
|
Window := ClientRect;
|
||||||
Window.Right := Temp;
|
Window.Right := Temp;
|
||||||
@ -23475,11 +23497,14 @@ var
|
|||||||
Size: TSize;
|
Size: TSize;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Logger.EnterMethod(lcPaintHeader,'UpdateHeaderRect');
|
||||||
FHeaderRect := Rect(0, 0, Width, Height);
|
FHeaderRect := Rect(0, 0, Width, Height);
|
||||||
|
|
||||||
// Consider borders...
|
// Consider borders...
|
||||||
Size := GetBorderDimensions;
|
Size := GetBorderDimensions;
|
||||||
InflateRect(FHeaderRect, Size.cx, Size.cy);
|
//lclheader
|
||||||
|
//Adjust rect size
|
||||||
|
Inc(FHeaderRect.Right,Size.cx*2);
|
||||||
|
|
||||||
// ... and bevels.
|
// ... and bevels.
|
||||||
OffsetX := BorderWidth;
|
OffsetX := BorderWidth;
|
||||||
@ -23510,6 +23535,8 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
FHeaderRect.Bottom := FHeaderRect.Top;
|
FHeaderRect.Bottom := FHeaderRect.Top;
|
||||||
|
Logger.Send(lcPaintHeader,'FHeaderRect',FHeaderRect);
|
||||||
|
Logger.ExitMethod(lcPaintHeader,'UpdateHeaderRect');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -25006,6 +25033,7 @@ var
|
|||||||
CurrentAlignment: TAlignment;
|
CurrentAlignment: TAlignment;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
//Logger.EnterMethod(lcPaintHeader,'GetDisplayRect');
|
||||||
Assert(Assigned(Node), 'Node must not be nil.');
|
Assert(Assigned(Node), 'Node must not be nil.');
|
||||||
Assert(Node <> FRoot, 'Node must not be the hidden root node.');
|
Assert(Node <> FRoot, 'Node must not be the hidden root node.');
|
||||||
|
|
||||||
@ -25151,6 +25179,9 @@ begin
|
|||||||
Result.Right := Result.Left + TextWidth;
|
Result.Right := Result.Left + TextWidth;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//Logger.Send(lcPaintHeader,'DisplayRect for Node '+IntToStr(Node^.Index),Result);
|
||||||
|
//Logger.ExitMethod(lcPaintHeader,'GetDisplayRect');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
@ -26145,8 +26176,14 @@ begin
|
|||||||
|
|
||||||
// CurrentPos tracks a running term of the current position to test for.
|
// CurrentPos tracks a running term of the current position to test for.
|
||||||
// It corresponds always to the top position of the currently considered node.
|
// It corresponds always to the top position of the currently considered node.
|
||||||
|
|
||||||
|
//lclheader: adjust position if Header is visible
|
||||||
|
if hoVisible in FHeader.FOptions then
|
||||||
|
CurrentPos:=FHeader.Height
|
||||||
|
else
|
||||||
CurrentPos := 0;
|
CurrentPos := 0;
|
||||||
|
|
||||||
|
|
||||||
// If the cache is available then use it.
|
// If the cache is available then use it.
|
||||||
if tsUseCache in FStates then
|
if tsUseCache in FStates then
|
||||||
Result := FindInPositionCache(AbsolutePos, CurrentPos)
|
Result := FindInPositionCache(AbsolutePos, CurrentPos)
|
||||||
@ -26207,9 +26244,13 @@ begin
|
|||||||
// of the found node this top position is returned.
|
// of the found node this top position is returned.
|
||||||
if Assigned(Result) then
|
if Assigned(Result) then
|
||||||
begin
|
begin
|
||||||
|
//lclheader
|
||||||
NodeTop := CurrentPos;
|
NodeTop := CurrentPos;
|
||||||
|
if hoVisible in FHeader.FOptions then
|
||||||
|
Dec(NodeTop,FHeader.Height);
|
||||||
if Relative then
|
if Relative then
|
||||||
Inc(NodeTop, FOffsetY);
|
Inc(NodeTop, FOffsetY);
|
||||||
|
//Logger.Send(lcPaintHeader,'GetNodeAt Result: ',Result^.Index);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -26855,6 +26896,12 @@ begin
|
|||||||
if (FUpdateCount = 0) and HandleAllocated then
|
if (FUpdateCount = 0) and HandleAllocated then
|
||||||
begin
|
begin
|
||||||
Result := GetDisplayRect(Node, NoColumn, False);
|
Result := GetDisplayRect(Node, NoColumn, False);
|
||||||
|
//lclheader
|
||||||
|
if hoVisible in FHeader.FOptions then
|
||||||
|
begin
|
||||||
|
inc(Result.Top,FHeader.Height);
|
||||||
|
inc(Result.Bottom,FHeader.Height);
|
||||||
|
end;
|
||||||
InvalidateRect(Handle, @Result, False);
|
InvalidateRect(Handle, @Result, False);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -27392,6 +27439,9 @@ begin
|
|||||||
Logger.EnterMethod(lcPaint,'PaintTree');
|
Logger.EnterMethod(lcPaint,'PaintTree');
|
||||||
Logger.Send(lcPaint,'Window',Window);
|
Logger.Send(lcPaint,'Window',Window);
|
||||||
Logger.Send(lcPaint,'Target',Target);
|
Logger.Send(lcPaint,'Target',Target);
|
||||||
|
Logger.Send(lcPaintHeader,'ClientRect',ClientRect);
|
||||||
|
Logger.Send(lcPaintHeader,'TreeRect',GetTreeRect);
|
||||||
|
Logger.Send(lcPaintHeader,'OffsetX: %d OffsetY: %d',[OffsetX,OffsetY]);
|
||||||
if not (tsPainting in FStates) then
|
if not (tsPainting in FStates) then
|
||||||
begin
|
begin
|
||||||
DoStateChange([tsPainting]);
|
DoStateChange([tsPainting]);
|
||||||
@ -27453,7 +27503,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.Watch(lcPaint,'BaseOffset',BaseOffset);
|
Logger.Send(lcPaint,'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);
|
||||||
@ -27462,10 +27512,13 @@ begin
|
|||||||
// It is usually smaller than an entire node and wanders while the paint loop advances.
|
// It is usually smaller than an entire node and wanders while the paint loop advances.
|
||||||
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);
|
||||||
|
//lclheader
|
||||||
|
//if hoVisible in FHeader.FOptions then
|
||||||
|
// Dec(MaximumBottom,FHeader.Height);
|
||||||
|
Logger.Send(lcPaintHeader,'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;
|
||||||
Logger.Send(lcPaint,'TargetRect',TargetRect);
|
|
||||||
// This marker gets the index of the first column which is visible in the given window.
|
// This marker gets the index of the first column which is visible in the given window.
|
||||||
// This is needed for column based background colors.
|
// This is needed for column based background colors.
|
||||||
FirstColumn := InvalidColumn;
|
FirstColumn := InvalidColumn;
|
||||||
@ -27754,6 +27807,8 @@ begin
|
|||||||
NodeBitmap.Height));
|
NodeBitmap.Height));
|
||||||
end;
|
end;
|
||||||
Logger.SendBitmap(lcPaintBitmap,'NodeBitmap',NodeBitmap);
|
Logger.SendBitmap(lcPaintBitmap,'NodeBitmap',NodeBitmap);
|
||||||
|
Logger.SendIf(lcPaint,'TargetRect.Top < Target.Y '+ Logger.RectToStr(TargetRect)
|
||||||
|
+' '+Logger.PointToStr(Target),TargetRect.Top < Target.Y);
|
||||||
// Put the constructed node image onto the target canvas.
|
// Put the constructed node image onto the target canvas.
|
||||||
with TargetRect, NodeBitmap do
|
with TargetRect, NodeBitmap do
|
||||||
BitBlt(TargetCanvas.Handle, Left, Top, Width, Height, Canvas.Handle, Window.Left, 0, SRCCOPY);
|
BitBlt(TargetCanvas.Handle, Left, Top, Width, Height, Canvas.Handle, Window.Left, 0, SRCCOPY);
|
||||||
@ -27761,6 +27816,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Inc(TargetRect.Top, PaintInfo.Node.NodeHeight);
|
Inc(TargetRect.Top, PaintInfo.Node.NodeHeight);
|
||||||
|
Logger.SendIf(lcPaintHeader,'Last Node to be painted: '+ IntToStr(PaintInfo.Node^.Index)
|
||||||
|
+' (TargetRect.Top >= MaximumBottom)',TargetRect.Top >= MaximumBottom);
|
||||||
if TargetRect.Top >= MaximumBottom then
|
if TargetRect.Top >= MaximumBottom then
|
||||||
Break;
|
Break;
|
||||||
|
|
||||||
@ -29273,7 +29330,9 @@ begin
|
|||||||
if FRoot.TotalHeight < FDefaultNodeHeight then
|
if FRoot.TotalHeight < FDefaultNodeHeight then
|
||||||
FRoot.TotalHeight := FDefaultNodeHeight;
|
FRoot.TotalHeight := FDefaultNodeHeight;
|
||||||
FRangeY := FRoot.TotalHeight - FRoot.NodeHeight + FBottomSpace;
|
FRangeY := FRoot.TotalHeight - FRoot.NodeHeight + FBottomSpace;
|
||||||
|
//lclheader
|
||||||
|
//if hoVisible in FHeader.FOptions then
|
||||||
|
// Inc(FRangeY,FHeader.Height);
|
||||||
if FScrollBarOptions.ScrollBars in [ssVertical, ssBoth] then
|
if FScrollBarOptions.ScrollBars in [ssVertical, ssBoth] then
|
||||||
begin
|
begin
|
||||||
ScrollInfo.cbSize := SizeOf(ScrollInfo);
|
ScrollInfo.cbSize := SizeOf(ScrollInfo);
|
||||||
@ -30517,7 +30576,6 @@ begin
|
|||||||
Result := nil
|
Result := nil
|
||||||
else
|
else
|
||||||
Result := PChar(Node) + FInternalDataOffset;
|
Result := PChar(Node) + FInternalDataOffset;
|
||||||
Logger.SendPointer('InternalData',Result);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -90,11 +90,11 @@ end;
|
|||||||
|
|
||||||
function InvalidateRect(aHandle : HWND; ARect : pRect; bErase : Boolean) : Boolean;
|
function InvalidateRect(aHandle : HWND; ARect : pRect; bErase : Boolean) : Boolean;
|
||||||
begin
|
begin
|
||||||
Logger.EnterMethod(lcPaint,'InvalidateRect');
|
//Logger.EnterMethod(lcPaint,'InvalidateRect');
|
||||||
Logger.Send(lcPaint,'Rect',ARect^);
|
//Logger.Send(lcPaint,'Rect',ARect^);
|
||||||
Logger.SendCallStack(lcPaint,'CallStack');
|
//Logger.SendCallStack(lcPaint,'CallStack');
|
||||||
Result:=Windows.InvalidateRect(aHandle,ARect,bErase);
|
Result:=Windows.InvalidateRect(aHandle,ARect,bErase);
|
||||||
Logger.ExitMethod(lcPaint,'InvalidateRect');
|
//Logger.ExitMethod(lcPaint,'InvalidateRect');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifndef NeedWindows}
|
{$ifndef NeedWindows}
|
||||||
|
@ -90,10 +90,12 @@ Port started in 26/01/07
|
|||||||
* Fixed MouseWheel
|
* Fixed MouseWheel
|
||||||
* Fixed drawing problem when using ScrollBar or MouseWheel
|
* Fixed drawing problem when using ScrollBar or MouseWheel
|
||||||
* Implemented Support for check images
|
* Implemented Support for check images
|
||||||
|
* Fixed position of editors while scrolling
|
||||||
|
* Started header implementation
|
||||||
|
|
||||||
#Major Tasks#
|
#Major Tasks#
|
||||||
< > General Painting
|
< > General Painting
|
||||||
[ ] The NodeBitmap width/Height is not reseted when erasing the background
|
[*] The NodeBitmap width/Height is not reseted when erasing the background > LCL bug
|
||||||
< > Define the UNICODE support schema. Probably change from widestring to ansistring and let LCL do the rest
|
< > Define the UNICODE support schema. Probably change from widestring to ansistring and let LCL do the rest
|
||||||
[ ] Use GetTextExtentPoint instead of GetTextExtentPoint32 since the later is a wrapper to the former in LCL
|
[ ] Use GetTextExtentPoint instead of GetTextExtentPoint32 since the later is a wrapper to the former in LCL
|
||||||
[ ] For now all rendering will be done with DrawTextW wrapper > Windows.DrawTextW
|
[ ] For now all rendering will be done with DrawTextW wrapper > Windows.DrawTextW
|
||||||
|
@ -28,6 +28,7 @@ const
|
|||||||
lcPaintDetails = 13;
|
lcPaintDetails = 13;
|
||||||
lcCheck = 14;
|
lcCheck = 14;
|
||||||
lcEditLink = 15;
|
lcEditLink = 15;
|
||||||
|
lcEraseBkgnd = 16;
|
||||||
|
|
||||||
var
|
var
|
||||||
Logger: TLCLLogger;
|
Logger: TLCLLogger;
|
||||||
|
Reference in New Issue
Block a user