mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 13:19:16 +02:00
ObjectInspector: Reduce Painting in OI-Grid for smother scrolling. (ShowScrollBar in UpdateScrollBar let to a full Invalidate on each Paint). Unnecessary moving of FCurrentEdit (TWinControl), while outside visible area also increases InvalidationRect after ScrollWindowEx.
git-svn-id: trunk@59624 -
This commit is contained in:
parent
075d701aad
commit
8d45fef409
@ -1221,7 +1221,6 @@ begin
|
|||||||
if TopY > ATopMax then
|
if TopY > ATopMax then
|
||||||
TopY := ATopMax;
|
TopY := ATopMax;
|
||||||
ScrollInfo.nPos := TopY;
|
ScrollInfo.nPos := TopY;
|
||||||
ShowScrollBar(Handle, SB_VERT, True);
|
|
||||||
SetScrollInfo(Handle, SB_VERT, ScrollInfo, True);
|
SetScrollInfo(Handle, SB_VERT, ScrollInfo, True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1280,6 +1279,7 @@ procedure TOICustomPropertyGrid.CreateWnd;
|
|||||||
begin
|
begin
|
||||||
inherited CreateWnd;
|
inherited CreateWnd;
|
||||||
// handle just created, set scrollbar
|
// handle just created, set scrollbar
|
||||||
|
ShowScrollBar(Handle, SB_VERT, True);
|
||||||
UpdateScrollBar;
|
UpdateScrollBar;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2754,7 +2754,6 @@ end;
|
|||||||
procedure TOICustomPropertyGrid.SetTopY(const NewValue:integer);
|
procedure TOICustomPropertyGrid.SetTopY(const NewValue:integer);
|
||||||
var
|
var
|
||||||
NewTopY, d: integer;
|
NewTopY, d: integer;
|
||||||
r: TRect;
|
|
||||||
f: UINT;
|
f: UINT;
|
||||||
begin
|
begin
|
||||||
NewTopY := TopMax;
|
NewTopY := TopMax;
|
||||||
@ -2763,7 +2762,6 @@ begin
|
|||||||
if NewTopY < 0 then
|
if NewTopY < 0 then
|
||||||
NewTopY := 0;
|
NewTopY := 0;
|
||||||
if FTopY<>NewTopY then begin
|
if FTopY<>NewTopY then begin
|
||||||
r := ClientRect;
|
|
||||||
f := SW_INVALIDATE;
|
f := SW_INVALIDATE;
|
||||||
d := FTopY-NewTopY;
|
d := FTopY-NewTopY;
|
||||||
// SW_SCROLLCHILDREN can only be used, if the active editor is not
|
// SW_SCROLLCHILDREN can only be used, if the active editor is not
|
||||||
@ -2773,7 +2771,7 @@ begin
|
|||||||
( (d < 0) and (FCurrentEdit.Top < Height - FCurrentEdit.Height) )
|
( (d < 0) and (FCurrentEdit.Top < Height - FCurrentEdit.Height) )
|
||||||
then
|
then
|
||||||
f := f + SW_SCROLLCHILDREN;
|
f := f + SW_SCROLLCHILDREN;
|
||||||
if not ScrollWindowEx(Handle,0,d,@r,@r,0,nil, f) then
|
if not ScrollWindowEx(Handle,0,d,nil,nil,0,nil, f) then
|
||||||
Invalidate;
|
Invalidate;
|
||||||
FTopY:=NewTopY;
|
FTopY:=NewTopY;
|
||||||
UpdateScrollBar;
|
UpdateScrollBar;
|
||||||
@ -2905,8 +2903,12 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
//debugln('TOICustomPropertyGrid.AlignEditComponents A ',dbgsName(FCurrentEdit),' ',dbgs(EditCompRect));
|
//debugln('TOICustomPropertyGrid.AlignEditComponents A ',dbgsName(FCurrentEdit),' ',dbgs(EditCompRect));
|
||||||
if FCurrentEdit.BoundsRect <> EditCompRect then
|
if ( ( (FCurrentEdit.BoundsRect.Bottom >= 0) and (FCurrentEdit.BoundsRect.Top <= Height) ) or
|
||||||
|
( (EditCompRect.Bottom >= 0) and (EditCompRect.Top <= Height) ) ) and
|
||||||
|
( FCurrentEdit.BoundsRect <> EditCompRect )
|
||||||
|
then begin
|
||||||
FCurrentEdit.BoundsRect := EditCompRect;
|
FCurrentEdit.BoundsRect := EditCompRect;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user