mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 02:33:38 +02:00
MG: fixed TTreeView collapse and update scrollbar bug
git-svn-id: trunk@1470 -
This commit is contained in:
parent
b04c9a1244
commit
83aa6eb997
@ -2472,8 +2472,7 @@ begin
|
|||||||
dec(FUpdateCount);
|
dec(FUpdateCount);
|
||||||
if FUpdateCount=0 then begin
|
if FUpdateCount=0 then begin
|
||||||
// ToDo: only refresh if something changed
|
// ToDo: only refresh if something changed
|
||||||
if tvsScrollbarChanged in FStates then
|
UpdateScrollBars;
|
||||||
UpdateScrollBars;
|
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2560,6 +2559,7 @@ begin
|
|||||||
if (FScrollBars <> Value) then begin
|
if (FScrollBars <> Value) then begin
|
||||||
FScrollBars := Value;
|
FScrollBars := Value;
|
||||||
RecreateWnd;
|
RecreateWnd;
|
||||||
|
Include(FStates,tvsScrollbarChanged);
|
||||||
UpdateScrollBars;
|
UpdateScrollBars;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3059,9 +3059,12 @@ procedure TCustomTreeView.UpdateScrollbars;
|
|||||||
var
|
var
|
||||||
ScrollInfo: TScrollInfo;
|
ScrollInfo: TScrollInfo;
|
||||||
begin
|
begin
|
||||||
|
if not (tvsScrollbarChanged in FStates) then exit;
|
||||||
if not HandleAllocated or (FUpdateCount>0) then begin
|
if not HandleAllocated or (FUpdateCount>0) then begin
|
||||||
Include(FStates,tvsScrollbarChanged);
|
//Include(FStates,tvsScrollbarChanged);
|
||||||
end else begin
|
end else begin
|
||||||
|
if ScrolledLeft>GetMaxScrollLeft then ScrolledLeft:=GetMaxScrollLeft;
|
||||||
|
if ScrolledTop>GetMaxScrollTop then ScrolledTop:=GetMaxScrollTop;
|
||||||
Exclude(FStates,tvsScrollbarChanged);
|
Exclude(FStates,tvsScrollbarChanged);
|
||||||
if fScrollBars <> ssNone then begin
|
if fScrollBars <> ssNone then begin
|
||||||
ScrollInfo.cbSize := SizeOf(ScrollInfo);
|
ScrollInfo.cbSize := SizeOf(ScrollInfo);
|
||||||
@ -3588,8 +3591,7 @@ var a,HalfBorderWidth:integer;
|
|||||||
Node: TTreeNode;
|
Node: TTreeNode;
|
||||||
begin
|
begin
|
||||||
if tvsUpdating in FStates then exit;
|
if tvsUpdating in FStates then exit;
|
||||||
if (tvsScrollbarChanged in FStates) then
|
UpdateScrollbars;
|
||||||
UpdateScrollbars;
|
|
||||||
with Canvas do begin
|
with Canvas do begin
|
||||||
// draw nodes
|
// draw nodes
|
||||||
Node:=TopItem;
|
Node:=TopItem;
|
||||||
@ -3951,7 +3953,7 @@ begin
|
|||||||
if CursorNode.HasChildren
|
if CursorNode.HasChildren
|
||||||
and (x>=CursorNode.DisplayExpandSignLeft)
|
and (x>=CursorNode.DisplayExpandSignLeft)
|
||||||
and (x<CursorNode.DisplayExpandSignRight) then begin
|
and (x<CursorNode.DisplayExpandSignRight) then begin
|
||||||
// mousedown occured on expand sign -> exapnd/collapse
|
// mousedown occured on expand sign -> expand/collapse
|
||||||
CursorNode.Expanded:=not CursorNode.Expanded;
|
CursorNode.Expanded:=not CursorNode.Expanded;
|
||||||
end else if x>=CursorNode.DisplayTextLeft then begin
|
end else if x>=CursorNode.DisplayTextLeft then begin
|
||||||
// mousedown occured in text -> select node and begin drag operation
|
// mousedown occured in text -> select node and begin drag operation
|
||||||
|
Loading…
Reference in New Issue
Block a user