mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 12:29:24 +02:00
GTK2 ScrollWindowEx / flag and prcUpdate
git-svn-id: trunk@34889 -
This commit is contained in:
parent
61e36cdd59
commit
53db968eab
@ -7409,6 +7409,9 @@ begin
|
|||||||
if Widget = nil then exit;
|
if Widget = nil then exit;
|
||||||
Window:=GetControlWindow(Widget);
|
Window:=GetControlWindow(Widget);
|
||||||
if Window = nil then exit;
|
if Window = nil then exit;
|
||||||
|
|
||||||
|
Result := true;
|
||||||
|
|
||||||
{$ifdef GTK_2_8}
|
{$ifdef GTK_2_8}
|
||||||
RClient.Left := 0;//Widget^.Allocation.Left;
|
RClient.Left := 0;//Widget^.Allocation.Left;
|
||||||
RClient.Top := 0; //Widget^.Allocation.Top;
|
RClient.Top := 0; //Widget^.Allocation.Top;
|
||||||
@ -7488,12 +7491,14 @@ begin
|
|||||||
Region := gdk_region_rectangle(@Rect1);
|
Region := gdk_region_rectangle(@Rect1);
|
||||||
gdk_window_move_region(Window, Region, dx, dy);
|
gdk_window_move_region(Window, Region, dx, dy);
|
||||||
|
|
||||||
|
if (flags and SW_INVALIDATE) <> 0 then begin
|
||||||
//invalidate
|
//invalidate
|
||||||
If RUsableTarget.Left > RFullSource.Left then begin
|
If RUsableTarget.Left > RFullSource.Left then begin
|
||||||
Rect2 := RFullSource;
|
Rect2 := RFullSource;
|
||||||
Rect2.Right:= RUsableTarget.Left;
|
Rect2.Right:= RUsableTarget.Left;
|
||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Left', dbgs(Rect2)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Left', dbgs(Rect2)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @Rect2, false);
|
InvalidateRect(hWnd, @Rect2, false);
|
||||||
|
if (prcUpdate <> nil) and (dx > 0) then prcUpdate^ := Rect2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If RUsableTarget.Right < RFullSource.Right then begin
|
If RUsableTarget.Right < RFullSource.Right then begin
|
||||||
@ -7501,6 +7506,7 @@ begin
|
|||||||
Rect2.Left:= RUsableTarget.Right;
|
Rect2.Left:= RUsableTarget.Right;
|
||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Right', dbgs(Rect2)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Right', dbgs(Rect2)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @Rect2, false);
|
InvalidateRect(hWnd, @Rect2, false);
|
||||||
|
if (prcUpdate <> nil) and (dx < 0) then prcUpdate^ := Rect2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If RUsableTarget.Top > RFullSource.Top then begin
|
If RUsableTarget.Top > RFullSource.Top then begin
|
||||||
@ -7508,6 +7514,7 @@ begin
|
|||||||
Rect2.Bottom:= RUsableTarget.Top;
|
Rect2.Bottom:= RUsableTarget.Top;
|
||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Top', dbgs(Rect2)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Top', dbgs(Rect2)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @Rect2, false);
|
InvalidateRect(hWnd, @Rect2, false);
|
||||||
|
if (prcUpdate <> nil) and (dy > 0) then prcUpdate^ := Rect2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If RUsableTarget.Bottom < RFullSource.Bottom then begin
|
If RUsableTarget.Bottom < RFullSource.Bottom then begin
|
||||||
@ -7515,6 +7522,7 @@ begin
|
|||||||
Rect2.Top:= RUsableTarget.Bottom;
|
Rect2.Top:= RUsableTarget.Bottom;
|
||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Bottom', dbgs(Rect2)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate Src Bottom', dbgs(Rect2)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @Rect2, false);
|
InvalidateRect(hWnd, @Rect2, false);
|
||||||
|
if (prcUpdate <> nil) and (dy < 0) then prcUpdate^ := Rect2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -7545,17 +7553,22 @@ begin
|
|||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate TARGET Bottom', dbgs(Rect2)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate TARGET Bottom', dbgs(Rect2)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @Rect2, false);
|
InvalidateRect(hWnd, @Rect2, false);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
if (flags and SW_INVALIDATE) <> 0 then begin
|
||||||
// invalidate, nothing to scroll
|
// invalidate, nothing to scroll
|
||||||
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate all', dbgs(RUsableSource)]);{$ENDIF}
|
{$ifdef VerboseScrollWindowEx}DebugLn(['ScrollWindowEx Invalidate all', dbgs(RUsableSource)]);{$ENDIF}
|
||||||
InvalidateRect(hWnd, @RFullSource, false);
|
InvalidateRect(hWnd, @RFullSource, false);
|
||||||
InvalidateRect(hWnd, @RTarget, false);
|
InvalidateRect(hWnd, @RTarget, false);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := False;
|
||||||
end;
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
gdk_window_scroll(Window, dx, dy);
|
gdk_window_scroll(Window, dx, dy);
|
||||||
{$ENDIF}
|
|
||||||
Result := true;
|
Result := true;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user