You've already forked lazarus-ccr
* fix header height resize
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2425 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9697,7 +9697,8 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
with Message do
|
with Message do
|
||||||
begin
|
begin
|
||||||
P := Point(XPos, YPos);
|
//lclheader
|
||||||
|
P := Point(XPos, YPos - Treeview.FHeader.Height);
|
||||||
if hsColumnWidthTrackPending in FStates then
|
if hsColumnWidthTrackPending in FStates then
|
||||||
begin
|
begin
|
||||||
KillTimer(Treeview.Handle, HeaderTimer);
|
KillTimer(Treeview.Handle, HeaderTimer);
|
||||||
@ -10106,42 +10107,36 @@ begin
|
|||||||
|
|
||||||
P := Point(XPos,YPos);
|
P := Point(XPos,YPos);
|
||||||
//P := Treeview.ScreenToClient(Point(XPos, YPos));
|
//P := Treeview.ScreenToClient(Point(XPos, YPos));
|
||||||
if not InHeader(P) then
|
IsInHeader := InHeader(P);
|
||||||
Exit;
|
if IsInHeader then
|
||||||
Treeview.DoHeaderMouseMove(GetShiftState, P.X, P.Y);
|
|
||||||
if ((AdjustHoverColumn(P)) or ((FDownIndex >= 0) and (FHoverIndex <> FDownIndex))) then
|
|
||||||
begin
|
begin
|
||||||
// We need a mouse leave detection from here for the non client area. The best solution available would be the
|
Treeview.DoHeaderMouseMove(GetShiftState, P.X, P.Y);
|
||||||
// TrackMouseEvent API. Unfortunately, it leaves Win95 totally and WinNT4 for non-client stuff out and
|
if ((AdjustHoverColumn(P)) or ((FDownIndex >= 0) and (FHoverIndex <> FDownIndex))) then
|
||||||
// currently I cannot ignore these systems. Hence I go the only other reliable way and use a timer
|
|
||||||
// (although, I don't like it...).
|
|
||||||
KillTimer(Treeview.Handle, HeaderTimer);
|
|
||||||
SetTimer(Treeview.Handle, HeaderTimer, 50, nil);
|
|
||||||
// todo: under lcl, the hint is show even if HintMouseMessage is not implemented
|
|
||||||
// Is it necessary here?
|
|
||||||
// use Delphi's internal hint handling for header hints too
|
|
||||||
if hoShowHint in FOptions then
|
|
||||||
begin
|
begin
|
||||||
// client coordinates!
|
// We need a mouse leave detection from here for the non client area. The best solution available would be the
|
||||||
XPos := P.x;
|
// TrackMouseEvent API. Unfortunately, it leaves Win95 totally and WinNT4 for non-client stuff out and
|
||||||
YPos := P.y;
|
// currently I cannot ignore these systems. Hence I go the only other reliable way and use a timer
|
||||||
Application.HintMouseMessage(Treeview, Message);
|
// (although, I don't like it...).
|
||||||
|
KillTimer(Treeview.Handle, HeaderTimer);
|
||||||
|
SetTimer(Treeview.Handle, HeaderTimer, 50, nil);
|
||||||
|
// todo: under lcl, the hint is show even if HintMouseMessage is not implemented
|
||||||
|
// Is it necessary here?
|
||||||
|
// use Delphi's internal hint handling for header hints too
|
||||||
|
if hoShowHint in FOptions then
|
||||||
|
begin
|
||||||
|
// client coordinates!
|
||||||
|
XPos := P.x;
|
||||||
|
YPos := P.y;
|
||||||
|
Application.HintMouseMessage(Treeview, Message);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//Adjust Cursor
|
//Adjust Cursor
|
||||||
if not (csDesigning in FOwner.ComponentState) and (FStates = []) then
|
if not (csDesigning in FOwner.ComponentState) and (FStates = []) then
|
||||||
begin
|
begin
|
||||||
//lcl: The code above already did these checks
|
//todo: see a way to store the user defined cursor.
|
||||||
{
|
IsHSplitterHit := IsInHeader and HSplitterHit;
|
||||||
// Retrieve last cursor position (GetMessagePos does not work here, I don't know why).
|
IsVSplitterHit := (hoHeightResize in FOptions) and InHeaderSplitterArea(P);
|
||||||
GetCursorPos(P);
|
|
||||||
// Is the mouse in the header rectangle?
|
|
||||||
P := Treeview.ScreenToClient(P);
|
|
||||||
if InHeader(P) then
|
|
||||||
}
|
|
||||||
//todo: see a way to store the user defined cursor.
|
|
||||||
IsHSplitterHit := HSplitterHit;
|
|
||||||
IsVSplitterHit := InHeaderSplitterArea(P) and (hoHeightResize in FOptions);
|
|
||||||
|
|
||||||
if IsVSplitterHit or IsHSplitterHit then
|
if IsVSplitterHit or IsHSplitterHit then
|
||||||
begin
|
begin
|
||||||
@ -10582,26 +10577,15 @@ function TVTHeader.InHeaderSplitterArea(P: TPoint): Boolean;
|
|||||||
// Determines whether the given point (client coordinates!) hits the horizontal splitter area of the header.
|
// Determines whether the given point (client coordinates!) hits the horizontal splitter area of the header.
|
||||||
|
|
||||||
var
|
var
|
||||||
R, RW: TRect;
|
R: TRect;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//todo: see if is necessary MapWindowPoints
|
Result := (hoVisible in FOptions);
|
||||||
if (P.Y > 2) or (P.Y < -2) or not (hoVisible in FOptions) then
|
if Result then
|
||||||
Result := False
|
|
||||||
else
|
|
||||||
begin
|
begin
|
||||||
R := Treeview.FHeaderRect;
|
R := Treeview.FHeaderRect;
|
||||||
|
R.Top := R.Bottom - 2;
|
||||||
Inc(R.Bottom, 2);
|
Inc(R.Bottom, 2);
|
||||||
|
|
||||||
// Current position of the owner in screen coordinates.
|
|
||||||
GetWindowRect(Treeview.Handle, RW);
|
|
||||||
|
|
||||||
{$ifndef INCOMPLETE_WINAPI}
|
|
||||||
// Convert to client coordinates.
|
|
||||||
MapWindowPoints(0, Treeview.Handle, RW, 2);
|
|
||||||
{$endif}
|
|
||||||
// Consider the header within this rectangle.
|
|
||||||
OffsetRect(R, RW.Left, RW.Top);
|
|
||||||
Result := PtInRect(R, P);
|
Result := PtInRect(R, P);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user