* Readd the fixes to the header position that were lost after rev 619

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@621 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2008-12-08 01:36:47 +00:00
parent bc82d7544b
commit 754079f0e2

View File

@@ -10569,46 +10569,49 @@ var
begin begin
if (hoVisible in FOptions) and Treeview.HandleAllocated then if (hoVisible in FOptions) and Treeview.HandleAllocated then
with Treeview do with Treeview do
begin
if Column = nil then
R := FHeaderRect
else
begin begin
if Column = nil then R := Column.GetRect;
R := FHeaderRect if not (coFixed in Column.Options) then
else OffsetRect(R, -FEffectiveOffsetX, 0);
if UseRightToLeftAlignment then
OffsetRect(R, ComputeRTLOffset, 0);
if ExpandToBorder then
begin begin
R := Column.GetRect; if (hoFullRepaintOnResize in FHeader.FOptions) then
if not (coFixed in Column.Options) then begin
OffsetRect(R, -FEffectiveOffsetX, 0); R.Left := FHeaderRect.Left;
if UseRightToLeftAlignment then R.Right := FHeaderRect.Right;
OffsetRect(R, ComputeRTLOffset, 0); end else
if ExpandToBorder then
begin begin
if (hoFullRepaintOnResize in FHeader.FOptions) then
begin
R.Left := FHeaderRect.Left;
R.Right := FHeaderRect.Right;
end else
begin
if UseRightToLeftAlignment then if UseRightToLeftAlignment then
R.Left := FHeaderRect.Left R.Left := FHeaderRect.Left
else else
R.Right := FHeaderRect.Right; R.Right := FHeaderRect.Right;
end;
end; end;
end; end;
{
// Current position of the owner in screen coordinates.
GetWindowRect(Handle, RW);
// Consider the header within this rectangle.
OffsetRect(R, RW.Left, RW.Top);
// Expressed in client coordinates (because RedrawWindow wants them so, they will actually become negative).
MapWindowPoints(0, Handle, R, 2);
RedrawWindow(Handle, @R, 0, RDW_FRAME or RDW_INVALIDATE or RDW_VALIDATE or RDW_NOINTERNALPAINT or
RDW_NOERASE or RDW_NOCHILDREN);
}
end; end;
//lclheader
RedrawWindow(Handle, @R, 0, RDW_FRAME or RDW_INVALIDATE or RDW_VALIDATE or RDW_NOINTERNALPAINT or
RDW_NOERASE or RDW_NOCHILDREN);
{
// Current position of the owner in screen coordinates.
GetWindowRect(Handle, RW);
// Consider the header within this rectangle.
OffsetRect(R, RW.Left, RW.Top);
// Expressed in client coordinates (because RedrawWindow wants them so, they will actually become negative).
MapWindowPoints(0, Handle, R, 2);
RedrawWindow(Handle, @R, 0, RDW_FRAME or RDW_INVALIDATE or RDW_VALIDATE or RDW_NOINTERNALPAINT or
RDW_NOERASE or RDW_NOCHILDREN);
}
end;
end; end;
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
@@ -29223,7 +29226,8 @@ begin
if toChildrenAbove in FOptions.FPaintOptions then if toChildrenAbove in FOptions.FPaintOptions then
begin begin
PosHoldable := (FOffsetY + (Integer(Node.TotalHeight - NodeHeight[Node]))) <= 0; PosHoldable := (FOffsetY + (Integer(Node.TotalHeight - NodeHeight[Node]))) <= 0;
NodeInView := Up.Top < ClientHeight; //lclheader
NodeInView := Up.Top < inherited GetClientRect.Bottom;
Steps := 0; Steps := 0;
if NodeInView then if NodeInView then
begin begin
@@ -29240,7 +29244,8 @@ begin
FOffsetY + (Up.Bottom - Integer(Node.TotalHeight))); FOffsetY + (Up.Bottom - Integer(Node.TotalHeight)));
Up.Top := Max(Up.Bottom - Integer(Node.TotalHeight), Up.Top := Max(Up.Bottom - Integer(Node.TotalHeight),
FOffsetY + (Up.Bottom - Integer(Node.TotalHeight))); FOffsetY + (Up.Bottom - Integer(Node.TotalHeight)));
Up.Bottom := ClientHeight; //lclheader
Up.Bottom := inherited GetClientRect.Bottom;
end; end;
end; end;
end end
@@ -29248,12 +29253,15 @@ begin
begin begin
Mode := tamScrollUp; Mode := tamScrollUp;
Inc(Up.Top, NodeHeight[Node]); Inc(Up.Top, NodeHeight[Node]);
Up.Bottom := ClientHeight; //lclheader
Up.Bottom := inherited GetClientRect.Bottom;
Steps := Min(Up.Bottom - Up.Top + 1, Node.TotalHeight - NodeHeight[Node]); Steps := Min(Up.Bottom - Up.Top + 1, Node.TotalHeight - NodeHeight[Node]);
end;; end;
// No animation necessary if the node is below the current client height. // No animation necessary if the node is below the current client height.
if Up.Top < ClientHeight then //lclheader
if Up.Top < inherited GetClientRect.Bottom then
begin begin
Window := Handle; Window := Handle;
DC := GetDC(Handle); DC := GetDC(Handle);
@@ -29269,7 +29277,7 @@ begin
end; end;
// Remind old height to keep the nodes position if toChildrenAbove is set. // Remind old height to keep the nodes position if toChildrenAbove is set.
OldHeight := Node.TotalHeight; OldHeight := Node.TotalHeight;
// collapse the node // collapse the node
AdjustTotalHeight(Node, NodeHeight[Node]); AdjustTotalHeight(Node, NodeHeight[Node]);
@@ -29327,12 +29335,14 @@ begin
// is to keep the nodes visual position so the user does not get confused. As a result we need to // is to keep the nodes visual position so the user does not get confused. As a result we need to
// scroll the view when the expanding is done. To determine what to do after expanding we need to check // scroll the view when the expanding is done. To determine what to do after expanding we need to check
// the cases below. // the cases below.
TotalFit := NewHeight + Integer(NodeHeight[Node]) <= ClientHeight; //lclheader
PosHoldable := TotalFit and ((FOffsetY - NewHeight) >= -(Integer(FRangeY) - ClientHeight)); //todo: add a variable to hold the actual clientheight
TotalFit := NewHeight + Integer(NodeHeight[Node]) <= inherited GetClientRect.Bottom;
PosHoldable := TotalFit and ((FOffsetY - NewHeight) >= -(Integer(FRangeY) - inherited GetClientRect.Bottom));
ChildrenInView := (Down.Top - NewHeight) >= 0; ChildrenInView := (Down.Top - NewHeight) >= 0;
NodeInView := (PosHoldable or ((Down.Bottom + NewHeight) <= ClientHeight)) NodeInView := (PosHoldable or ((Down.Bottom + NewHeight) <= inherited GetClientRect.Bottom))
and (Down.Bottom < ClientHeight - 1); and (Down.Bottom < inherited GetClientRect.Bottom - 1);
Down.Bottom := ClientHeight; Down.Bottom := inherited GetClientRect.Bottom;
end; end;
end; end;