mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 00:37:11 +01:00
workaround for gtk1 invalidate bug
git-svn-id: trunk@4783 -
This commit is contained in:
parent
477baf5d1a
commit
711c426a9c
@ -510,7 +510,7 @@ var
|
||||
ARect: TRect;
|
||||
begin
|
||||
GetRect(ARect);
|
||||
InvalidateRect(AForm.Handle,@ARect,false);
|
||||
InvalidateDesignerRect(AForm.Handle,@ARect);
|
||||
end;
|
||||
|
||||
|
||||
@ -612,7 +612,8 @@ begin
|
||||
CompRect.Top:=LongRec(FComponent.DesignInfo).Hi;
|
||||
CompRect.Right:=CompRect.Left+NonVisualCompWidth;
|
||||
CompRect.Bottom:=CompRect.Top+NonVisualCompWidth;
|
||||
InvalidateRect(AForm.Handle,@CompRect,false);
|
||||
//writeln('TSelectedControl.InvalidateNonVisualComponent A ',CompRect.Left,',',CompRect.Top,',',CompRect.Right,',',CompRect.Bottom);
|
||||
InvalidateDesignerRect(AForm.Handle,@CompRect);
|
||||
end;
|
||||
|
||||
function TSelectedControl.GetLeft: integer;
|
||||
@ -817,8 +818,14 @@ procedure TControlSelection.GrabberMove(Grabber: TGrabber; const OldRect,
|
||||
NewRect: TRect);
|
||||
begin
|
||||
if FForm=nil then exit;
|
||||
InvalidateRect(FForm.Handle,@OldRect,false);
|
||||
InvalidateRect(FForm.Handle,@NewRect,false);
|
||||
{if Grabber.Positions=[gpTop,gpLeft] then begin
|
||||
writeln('TControlSelection.GrabberMove ',
|
||||
' OldRect=',OldRect.Left,',',OldRect.Top,',',OldRect.Right,',',OldRect.Bottom,
|
||||
' NewRect=',NewRect.Left,',',NewRect.Top,',',NewRect.Right,',',NewRect.Bottom,
|
||||
' ');
|
||||
end;}
|
||||
InvalidateDesignerRect(FForm.Handle,@OldRect);
|
||||
InvalidateDesignerRect(FForm.Handle,@NewRect);
|
||||
end;
|
||||
|
||||
function TControlSelection.GetCacheGuideLines: boolean;
|
||||
@ -935,7 +942,7 @@ begin
|
||||
LineRect:=FGuideLinesCache[g].PaintedLine;
|
||||
if LineRect.Top=LineRect.Bottom then inc(LineRect.Bottom);
|
||||
if LineRect.Left=LineRect.Right then inc(LineRect.Right);
|
||||
InvalidateRect(FForm.Handle,@LineRect,false);
|
||||
InvalidateDesignerRect(FForm.Handle,@LineRect);
|
||||
end;
|
||||
end;
|
||||
Exclude(FStates,cssGuideLinesPainted);
|
||||
|
||||
@ -2018,6 +2018,7 @@ begin
|
||||
IconRect:=Rect(ItemLeft+NonVisualCompBorder,ItemTop+NonVisualCompBorder,
|
||||
ItemRight-NonVisualCompBorder,ItemBottom-NonVisualCompBorder);
|
||||
Brush.Color:=clBtnFace;
|
||||
//writeln('TDesigner.DrawNonVisualComponents A ',IconRect.Left,',',IconRect.Top,',',IconRect.Right,',',IconRect.Bottom);
|
||||
FillRect(Rect(IconRect.Left,IconRect.Top,
|
||||
IconRect.Right+1,IconRect.Bottom+1));
|
||||
end;
|
||||
|
||||
@ -99,6 +99,7 @@ function GetComponentTop(AComponent: TComponent): integer;
|
||||
function GetComponentWidth(AComponent: TComponent): integer;
|
||||
function GetComponentHeight(AComponent: TComponent): integer;
|
||||
|
||||
procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect);
|
||||
|
||||
implementation
|
||||
|
||||
@ -243,6 +244,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect);
|
||||
const
|
||||
ExtraInvalidateFrame = 3;
|
||||
var
|
||||
InvRect: TRect;
|
||||
begin
|
||||
InvRect:=ARect^;
|
||||
dec(InvRect.Left,ExtraInvalidateFrame);
|
||||
dec(InvRect.Top,ExtraInvalidateFrame);
|
||||
inc(InvRect.Right,ExtraInvalidateFrame);
|
||||
inc(InvRect.Bottom,ExtraInvalidateFrame);
|
||||
InvalidateRect(aHandle,@InvRect,false);
|
||||
end;
|
||||
|
||||
function GetParentLevel(AControl: TControl): integer;
|
||||
begin
|
||||
Result:=0;
|
||||
|
||||
@ -5743,7 +5743,7 @@ begin
|
||||
|
||||
if bErase then
|
||||
gtk_widget_queue_clear_area(PaintWidget,
|
||||
gdkRect.X,gdkRect.Y,gdkRect.Width,gdkRect.Height);
|
||||
gdkRect.X,gdkRect.Y,gdkRect.Width,gdkRect.Height);
|
||||
|
||||
gtk_widget_queue_draw_area(PaintWidget,
|
||||
gdkRect.X,gdkRect.Y,gdkRect.Width,gdkRect.Height);
|
||||
@ -9057,6 +9057,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.298 2003/11/08 22:53:11 mattias
|
||||
workaround for gtk1 invalidate bug
|
||||
|
||||
Revision 1.297 2003/11/03 22:37:41 mattias
|
||||
fixed vert scrollbar, implemented GetDesignerDC
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user