Reduce compiler warnings.

(cherry picked from commit c3891ad820)
This commit is contained in:
Juha 2023-07-02 12:45:55 +03:00 committed by Maxim Ganetsky
parent 7a3caa746f
commit 0bc8523ddf
52 changed files with 176 additions and 171 deletions

View File

@ -1262,11 +1262,11 @@ begin
// Move to visible area :
// window is out at left side of screen
if NewBounds.Right < Screen.DesktopLeft + 60 then
OffsetRect(NewBounds, Screen.DesktopLeft + 60 - NewBounds.Right, 0);
Types.OffsetRect(NewBounds, Screen.DesktopLeft + 60 - NewBounds.Right, 0);
// window is out above the screen
if NewBounds.Bottom < Screen.DesktopTop+60 then
OffsetRect(NewBounds, 0, Screen.DesktopTop + 60 - NewBounds.Bottom);
Types.OffsetRect(NewBounds, 0, Screen.DesktopTop + 60 - NewBounds.Bottom);
// window is out at right side of screen, i = right edge of screen - 60
i := Screen.DesktopWidth + Screen.DesktopLeft - 60;
@ -1739,32 +1739,32 @@ begin
if DockSibling.Parent<>nil then
begin
Offset:=DockSibling.ClientToScreen(Point(0,0));
OffsetRect(DockSiblingBounds,Offset.X,Offset.Y);
Types.OffsetRect(DockSiblingBounds,Offset.X,Offset.Y);
end;
case DockAlign of
alLeft:
begin
NewBounds.Top:=DockSiblingBounds.Top;
NewBounds.Bottom:=DockSiblingBounds.Bottom;
OffsetRect(NewBounds,DockSiblingBounds.Left-6-NewBounds.Right,0);
Types.OffsetRect(NewBounds,DockSiblingBounds.Left-6-NewBounds.Right,0);
end;
alRight:
begin
NewBounds.Top:=DockSiblingBounds.Top;
NewBounds.Bottom:=DockSiblingBounds.Bottom;
OffsetRect(NewBounds,DockSiblingBounds.Right+6-NewBounds.Left,0);
Types.OffsetRect(NewBounds,DockSiblingBounds.Right+6-NewBounds.Left,0);
end;
alTop:
begin
NewBounds.Left:=DockSiblingBounds.Left;
NewBounds.Right:=DockSiblingBounds.Right;
OffsetRect(NewBounds,0,DockSiblingBounds.Top-25-NewBounds.Bottom);
Types.OffsetRect(NewBounds,0,DockSiblingBounds.Top-25-NewBounds.Bottom);
end;
alBottom:
begin
NewBounds.Left:=DockSiblingBounds.Left;
NewBounds.Right:=DockSiblingBounds.Right;
OffsetRect(NewBounds,0,DockSiblingBounds.Bottom+25-NewBounds.Top);
Types.OffsetRect(NewBounds,0,DockSiblingBounds.Bottom+25-NewBounds.Top);
end;
alClient:
NewBounds:=DockSibling.BoundsRect;

View File

@ -5799,7 +5799,7 @@ begin
w1 := r.Right - r.Left;
h1 := r.Bottom - r.Top;
if (Flags and flPictCenter) <> 0 then
OffsetRect(r, (w - w1) div 2, (h - h1) div 2);
Types.OffsetRect(r, (w - w1) div 2, (h - h1) div 2);
end;
{$IFDEF LCLNOGUI}
bmp := TLazreportBitmap.create;
@ -5815,7 +5815,7 @@ begin
PictureWidth := Round(Picture.Width * ScaleX);
PictureHeight := Round(Picture.Height * ScaleY);
if (Flags and flPictCenter) <> 0 then
OffsetRect(r, (w - PictureWidth) div 2, (h - PictureHeight) div 2);
Types.OffsetRect(r, (w - PictureWidth) div 2, (h - PictureHeight) div 2);
{$IFDEF LCLNOGUI}
bmp := TLazreportBitmap.create;
bmp.LoadFromGraphic(Picture.Graphic);

View File

@ -2700,7 +2700,7 @@ begin
begin
NPEraseFocusRect;
RoundCoord(x, y);
OffsetRect(OldRect, x - OldRect.Left, y - OldRect.Top);
Types.OffsetRect(OldRect, x - OldRect.Left, y - OldRect.Top);
NPDrawFocusRect;
ShowSizes := True;
FDesigner.UpdateStatus;
@ -3288,7 +3288,7 @@ begin
if (Mode = mdInsert) and not Down then
begin
NPEraseFocusRect;
OffsetRect(OldRect, -10000, -10000);
Types.OffsetRect(OldRect, -10000, -10000);
end;
fGuides.HideGuides;
end;
@ -7192,10 +7192,10 @@ begin
begin
if not Selected then
begin
OffsetRect(Rect, 1, 1);
Types.OffsetRect(Rect, 1, 1);
Font.Color := clBtnHighlight;
DrawText(Handle, PChar(Caption), Length(Caption), Rect, Flags);
OffsetRect(Rect, -1, -1);
Types.OffsetRect(Rect, -1, -1);
end;
Font.Color := clBtnShadow;
end;
@ -7262,7 +7262,7 @@ begin
if AMenuItem.Caption <> '-' then
begin
OffsetRect(ARect, 0, 2);
Types.OffsetRect(ARect, 0, 2);
DoDrawText(ACanvas, AMenuItem.Caption, ARect, Selected, AMenuItem.Enabled, DT_LEFT);
if AMenuItem.ShortCut <> 0 then
begin

View File

@ -105,7 +105,7 @@ begin
r.Right := r.Left + 18;
r.Bottom := r.Top + 16;
OffsetRect(r, 2, (ARect.Bottom - ARect.Top) div 2 - 8);
Types.OffsetRect(r, 2, (ARect.Bottom - ARect.Top) div 2 - 8);
with CB1.Canvas do
begin

View File

@ -475,7 +475,7 @@ begin
for i := 0 to Pages.Count - 1 do // drawing window background
begin
r := Pages[i]^.r;
OffsetRect(r, Preview.ofx, Preview.ofy);
Types.OffsetRect(r, Preview.ofx, Preview.ofy);
if (r.Top > 2000) or (r.Bottom < 0) then
Pages[i]^.Visible := False else
Pages[i]^.Visible := RectVisible(Canvas.Handle, r);
@ -499,7 +499,7 @@ begin
if Pages[i]^.Visible then
begin
r := Pages[i]^.r;
OffsetRect(r, Preview.ofx, Preview.ofy);
Types.OffsetRect(r, Preview.ofx, Preview.ofy);
Canvas.Rectangle(r.Left, r.Top, r.Right, r.Bottom);
Canvas.Polyline([Point(r.Left + 1, r.Bottom),
Point(r.Right, r.Bottom),
@ -511,7 +511,7 @@ begin
if Pages[i]^.Visible then
begin
r := Pages[i]^.r;
OffsetRect(r, Preview.ofx, Preview.ofy);
Types.OffsetRect(r, Preview.ofx, Preview.ofy);
if Pages[i]^.pgMargins then
Pages.Draw(i, Canvas, r)
else

View File

@ -432,15 +432,13 @@ function ExecBasicHandler({%H-}Caller: TPSExec; p: TPSExternalProcRec;
ASyn := TSynEdit(o);
end;
var
res: PPSVariant;
data: PPoint;
temp: TPSVariantIFC;
s: String;
typerec: TPSTypeRec;
Obj: TSynEdit;
begin
Result := True;
case Longint(p.Ext1) of
case PtrUInt(p.Ext1) of
FunctionId_POINT: begin // POINT()
CheckMinParamCount(3, 'Point');
data := GetVarPointFromStack(Stack, -1);

View File

@ -240,7 +240,7 @@ var
s: TbtString;
begin
Result := True;
case Longint(p.Ext1) of
case PtrUInt(p.Ext1) of
Id_test_ord_mb: begin // test_ord_mb(ABtn: TMsgDlgBtn): Integer;
if Stack.Count < 2 then raise TEMScriptBadParamException.Create('Invalid param count for "test_ord_mb"');
Stack.SetInt(-1, test_ord_mb(TMsgDlgBtn(Stack.GetUInt(-2))) );

View File

@ -193,7 +193,7 @@ type
procedure RebuildGridLayout; virtual;
procedure AddHeaderPropertyEditor(Prop: TPropertyEditor);
procedure BeforeMoveSelection(const DCol,DRow: Integer); override;
procedure CalcCellExtent(aCol, aRow: Integer; var aRect: TRect); virtual;
procedure CalcCellExtent(aCol, aRow: Integer; var aRect: TRect); override;
procedure DoEditorHide; override;
procedure DoEditorShow; override;
procedure DrawCell(aCol, aRow: Integer; aRect: TRect;

View File

@ -5406,7 +5406,7 @@ begin
pt := ClientToScreen(Point(ClientWidth-ScrollBarWidth - rc.Right - 4, 10));
if eoScrollHintFollows in fOptions then
pt.y := Mouse.CursorPos.y - (rc.Bottom div 2);
OffsetRect(rc, pt.x, pt.y);
Types.OffsetRect(rc, pt.x, pt.y);
ScrollHint.ActivateWithBounds(rc, s);
ScrollHint.Invalidate;
ScrollHint.Update;

View File

@ -2064,7 +2064,7 @@ end;
function TSynCssSyn.GetRange: Pointer;
begin
Result := {%H-}Pointer(Integer(fRange));
Result := Pointer(PtrUInt(Cardinal(fRange)));
end;
function TSynCssSyn.GetToken: string;
@ -2122,7 +2122,7 @@ end;
procedure TSynCssSyn.SetRange(Value: Pointer);
begin
FRange := TRangeStates({%H-}Cardinal(Value));
FRange := TRangeStates(Cardinal(PtrUInt(Value)));
end;
function TSynCssSyn.GetIdentChars: TSynIdentChars;

View File

@ -277,7 +277,7 @@ begin
if cloShowCheckboxes in Options then begin
ACheckBoxRect := Rect(0, 0, FCheckboxSize.CX, FCheckboxSize.CY);
if isRTL then dec(x, FCheckboxSize.CX);
OffsetRect(ACheckboxRect, x, (AItemRect.Top + AItemRect.Bottom - FCheckboxSize.CY) div 2);
Types.OffsetRect(ACheckboxRect, x, (AItemRect.Top + AItemRect.Bottom - FCheckboxSize.CY) div 2);
if cloShowIcons in Options then
x := IfThen(isRTL, ACheckboxRect.Left - MARGIN, ACheckboxRect.Right + MARGIN);
end;

View File

@ -681,7 +681,7 @@ begin
end;
rDrop:=rBar;
szB:=Size(rBar);
OffsetRect(rDrop, szB.cx + 1, 2);
Types.OffsetRect(rDrop, szB.cx + 1, 2);
rDrop.Right:=r.Right-1;
rDrop.Bottom:=r.Bottom-1;
Canvas.Frame(rDrop);

View File

@ -851,7 +851,7 @@ var
// token fits into line
// => draw token
OffsetRect(TokenRect,TokenPos.x,TokenPos.y);
Types.OffsetRect(TokenRect,TokenPos.x,TokenPos.y);
if Draw then begin
Canvas.FillRect(Rect(TokenRect.Left,TokenRect.Top-VerticalSpace,
TokenRect.Right,TokenRect.Bottom+VerticalSpace));

View File

@ -3950,7 +3950,7 @@ begin
// Save all SynEditKeyStrokes into a tree map for fast lookup, sorted by command.
for i:=ASynEditKeyStrokes.Count-1 downto 0 do begin
Key:=ASynEditKeyStrokes[i];
Node:=KeyStrokesByCmds.FindKey({%H-}Pointer(Key.Command), @CompareKeyCmd);
Node:=KeyStrokesByCmds.FindKey({%H-}Pointer(PtrUInt(Key.Command)), @CompareKeyCmd);
if Assigned(Node) then begin // Another key is already defined for this command
KeyList:=TKeyStrokeList(Node.Data);
if KeyList.FCount < 3 then
@ -3987,7 +3987,7 @@ begin
if (ccid >= ecFirstPlugin) and (ccid < ecLastPlugin) then
ccid:=ccid+ACommandOffsetOffset;
// Get SynEditKeyStrokes from the lookup tree
Node:=KeyStrokesByCmds.FindKey({%H-}Pointer(ccid), @CompareKeyCmd);
Node:=KeyStrokesByCmds.FindKey({%H-}Pointer(PtrUInt(ccid)), @CompareKeyCmd);
// First and second shortcuts for this command
UpdateOrAddKeyStroke(0, @CurRelation.ShortcutA);
UpdateOrAddKeyStroke(1, @CurRelation.ShortcutB);

View File

@ -7101,6 +7101,7 @@ end;
{$IfOpt C+}
function TIdeWatches.Add: TCollectionItem;
begin
Result := Nil; // Prevent compiler warning.
assert(False, 'TIdeWatches.Add: False');
end;
{$EndIf}

View File

@ -35,7 +35,7 @@ interface
{$ENDIF}
{$MACRO ON}
{$IF FPC_FULLVERSION >= 30300}
{$IF FPC_FULLVERSION >= 30200}
{$DEFINE SysUITypes:=System.UITypes}
{$ELSE}
{$DEFINE SysUITypes:=UITypes}

View File

@ -815,7 +815,7 @@ begin
ParentOrigin.Y := 0;
if FHintControl.Parent <> nil then
ParentOrigin := FHintControl.Parent.ClientOrigin;
OffsetRect(HintInfo.CursorRect, ParentOrigin.X - ClientOrigin.X,
Types.OffsetRect(HintInfo.CursorRect, ParentOrigin.X - ClientOrigin.X,
ParentOrigin.Y - ClientOrigin.Y);
HintInfo.CursorPos := FHintControl.ScreenToClient(Info.MousePos);
HintInfo.HintStr := GetControlShortHint(Info.Control);
@ -866,7 +866,7 @@ begin
WidthAdjust := HintWinRect.Right - HintWinRect.Left
else
WidthAdjust := 0;
OffsetRect(HintWinRect, HintInfo.HintPos.X - WidthAdjust, HintInfo.HintPos.Y);
Types.OffsetRect(HintWinRect, HintInfo.HintPos.X - WidthAdjust, HintInfo.HintPos.Y);
//DebugLn(['TApplication.ShowHintWindow HintStr="',HintInfo.HintStr,'" HintWinRect=',dbgs(HintWinRect)]);
FHintWindow.Color := HintInfo.HintColor;

View File

@ -1313,13 +1313,13 @@ begin
begin
DrawText(DC, pChar(Text), Length(Text), fRect, DT_CALCRECT or Options);
case Style.Alignment of
taRightJustify : OffsetRect(fRect, ARect.Right - fRect.Right, 0);
taCenter : OffsetRect(fRect, (ARect.Right - fRect.Right) div 2, 0);
taRightJustify : Types.OffsetRect(fRect, ARect.Right - fRect.Right, 0);
taCenter : Types.OffsetRect(fRect, (ARect.Right - fRect.Right) div 2, 0);
end;
case Style.Layout of
tlCenter : OffsetRect(fRect, 0,
tlCenter : Types.OffsetRect(fRect, 0,
((ARect.Bottom - ARect.Top) - (fRect.Bottom - fRect.Top)) div 2);
tlBottom : OffsetRect(fRect, 0, ARect.Bottom - fRect.Bottom);
tlBottom : Types.OffsetRect(fRect, 0, ARect.Bottom - fRect.Bottom);
end;
end;

View File

@ -472,10 +472,10 @@ begin
MoveRectToFit(ARect, NewDockSite.GetLogicalClientRect);
// consider Align to increase chance the width/height is kept
case Align of
alLeft: OffsetRect(ARect,-ARect.Left,0);
alTop: OffsetRect(ARect,0,-ARect.Top);
alRight: OffsetRect(ARect,NewDockSite.ClientWidth-ARect.Right,0);
alBottom: OffsetRect(ARect,0,NewDockSite.ClientHeight-ARect.Bottom);
alLeft: Types.OffsetRect(ARect,-ARect.Left,0);
alTop: Types.OffsetRect(ARect,0,-ARect.Top);
alRight: Types.OffsetRect(ARect,NewDockSite.ClientWidth-ARect.Right,0);
alBottom: Types.OffsetRect(ARect,0,NewDockSite.ClientHeight-ARect.Bottom);
end;
end;
//DebugLn('TControl.DoDock AFTER Adjusting ',DbgSName(Self),' ',dbgs(ARect),' Align=',DbgS(Align),' NewDockSite.ClientRect=',dbgs(NewDockSite.ClientRect));

View File

@ -233,7 +233,7 @@ begin
ChangeY := (ImgHeight-PicHeight) div 2;
if FKeepOriginXWhenClipped and (ChangeX<0) then ChangeX := 0;
if FKeepOriginYWhenClipped and (ChangeY<0) then ChangeY := 0;
OffsetRect(Result, ChangeX, ChangeY);
Types.OffsetRect(Result, ChangeX, ChangeY);
end;
end;

View File

@ -134,7 +134,7 @@ begin
begin
Canvas.Font.Color := clBtnHighlight;
Rect2 := Rect;
OffsetRect(Rect2, 1, 1);
Types.OffsetRect(Rect2, 1, 1);
DrawText(Canvas.Handle, PChar(LabelText), Length(LabelText), Rect2, Flags);
Canvas.Font.Color := clBtnShadow;
end;
@ -449,8 +449,8 @@ begin
begin
case FLayout of
tlTop: ; // nothing
tlCenter: OffsetRect(R, 0, (R.Height-CalcRect.Height) div 2);
tlBottom: OffsetRect(R, 0, R.Height-CalcRect.Height)
tlCenter: Types.OffsetRect(R, 0, (R.Height-CalcRect.Height) div 2);
tlBottom: Types.OffsetRect(R, 0, R.Height-CalcRect.Height)
end;
R.Height := CalcRect.Height;
end;
@ -463,16 +463,16 @@ begin
CalcRect := RotateRect(CalcRect.Width, CalcRect.Height, angle);
R := CalcRect;
case FAlignment of
taLeftJustify: OffsetRect(R, -CalcRect.Left, 0);
taCenter: OffsetRect(R, (Width - CalcRect.Width) div 2 - CalcRect.Left, 0);
taRightJustify: OffsetRect(r, Width - CalcRect.Right, 0);
taLeftJustify: Types.OffsetRect(R, -CalcRect.Left, 0);
taCenter: Types.OffsetRect(R, (Width - CalcRect.Width) div 2 - CalcRect.Left, 0);
taRightJustify: Types.OffsetRect(r, Width - CalcRect.Right, 0);
end;
case FLayout of
tlTop: OffsetRect(R, 0, -CalcRect.Top);
tlCenter: OffsetRect(R, 0, (Height - CalcRect.Height) div 2 - CalcRect.Top);
tlBottom: OffsetRect(R, 0, Height - CalcRect.Bottom);
tlTop: Types.OffsetRect(R, 0, -CalcRect.Top);
tlCenter: Types.OffsetRect(R, 0, (Height - CalcRect.Height) div 2 - CalcRect.Top);
tlBottom: Types.OffsetRect(R, 0, Height - CalcRect.Bottom);
end;
OffsetRect(R, -CalcRect.Left-1, -CalcRect.Top-1);
Types.OffsetRect(R, -CalcRect.Left-1, -CalcRect.Top-1);
end;
//debugln('TCustomLabel.Paint ',dbgs(Alignment=tacenter),' ',dbgs(Layout=tlCenter),' ',dbgs(TextLeft),' TextTop=',dbgs(TextTop),' ',dbgs(R));
DoDrawText(R, Flags);

View File

@ -839,7 +839,7 @@ begin
if (Index=Items.Count) and (Index>0) then
begin
TWSCustomListBoxClass(WidgetSetClass).GetItemRect(Self, Index - 1, Result);
OffsetRect(Result, 0, Result.Bottom - Result.Top);
Types.OffsetRect(Result, 0, Result.Bottom - Result.Top);
end;
end;

View File

@ -174,10 +174,10 @@ begin
else
begin
Canvas.Font.Color := clBtnHighlight;
OffsetRect(ARect, 1, 1);
Types.OffsetRect(ARect, 1, 1);
Canvas.TextRect(ARect, ARect.Left, ARect.Top, Caption, TS);
Canvas.Font.Color := clBtnShadow;
OffsetRect(ARect, -1, -1);
Types.OffsetRect(ARect, -1, -1);
end
else
Canvas.Font.Color := Font.Color;

View File

@ -229,13 +229,13 @@ var
OldSize := GetControlSize(CurResizeControl);
case ResizeAnchor of
akLeft:
OffsetRect(NewRect, NewSize - OldSize, 0);
Types.OffsetRect(NewRect, NewSize - OldSize, 0);
akRight:
OffsetRect(NewRect, OldSize - NewSize, 0);
Types.OffsetRect(NewRect, OldSize - NewSize, 0);
akTop:
OffsetRect(NewRect, 0, NewSize - OldSize);
Types.OffsetRect(NewRect, 0, NewSize - OldSize);
akBottom:
OffsetRect(NewRect, 0, OldSize - NewSize);
Types.OffsetRect(NewRect, 0, OldSize - NewSize);
end;
SetRubberBandRect(FSplitterWindow, NewRect);
end;
@ -476,9 +476,9 @@ begin
NewRect.BottomRight := Parent.ClientToScreen(NewRect.BottomRight);
if ResizeAnchor in [akLeft, akRight] then
OffsetRect(NewRect, Offset, 0)
Types.OffsetRect(NewRect, Offset, 0)
else
OffsetRect(NewRect, 0, Offset);
Types.OffsetRect(NewRect, 0, Offset);
SetRubberBandRect(FSplitterWindow, NewRect);
end;
end;

View File

@ -127,7 +127,7 @@ end;
procedure TDragDockObject.AdjustDockRect(ARect: TRect);
begin
with DockOffset do
OffsetRect(FDockRect, -X, -Y);
Types.OffsetRect(FDockRect, -X, -Y);
end;
function TDragDockObject.GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor;

View File

@ -351,7 +351,7 @@ end;
function THintWindow.OffsetHintRect(AOffset: TPoint; dy: Integer;
KeepWidth: Boolean; KeepHeight: Boolean): Boolean;
begin
Result:=OffsetRect(FHintRect, AOffset.X, AOffset.Y + dy);
Result:=Types.OffsetRect(FHintRect, AOffset.X, AOffset.Y + dy);
AdjustBoundsForMonitor(KeepWidth, KeepHeight);
end;

View File

@ -1431,7 +1431,7 @@ var
ImageRect: TRect;
begin
ImageRect := Rect(0, 0, Width, Height);
OffsetRect(ImageRect, (Image.Width-Width) div 2, (Image.Height-Height) div 2);
Types.OffsetRect(ImageRect, (Image.Width-Width) div 2, (Image.Height-Height) div 2);
Result := AddSlice(Image, ImageRect);
end;
@ -2619,7 +2619,7 @@ var
begin
if not FindResolution(AImageWidth, R) then Exit;
ImageRect := Rect(0, 0, R.Width, R.Height);
OffsetRect(ImageRect, (Image.Width-R.Width) div 2, (Image.Height-R.Height) div 2);
Types.OffsetRect(ImageRect, (Image.Width-R.Width) div 2, (Image.Height-R.Height) div 2);
ReplaceSlice(AIndex, Image, ImageRect, AllResolutions);
end;
@ -2794,7 +2794,7 @@ function TLCLGlyphs.GetImageIndex(const AResourceName: string): Integer;
Exit(-1);
try
ImageRect := Rect(0, 0, Resolution.Width, GetHeightForWidth(Resolution.Width));
OffsetRect(ImageRect, (G.Width-ImageRect.Right) div 2, (G.Height-ImageRect.Bottom) div 2);
Types.OffsetRect(ImageRect, (G.Width-ImageRect.Right) div 2, (G.Height-ImageRect.Bottom) div 2);
Result := AddSlice(G, ImageRect);
finally
G.Free;

View File

@ -612,9 +612,9 @@ var
If not CalcRect then
Case LeftOffset of
DT_CENTER :
OffsetRect(theRect, (Rect.Right - theRect.Right) div 2, 0);
Types.OffsetRect(theRect, (Rect.Right - theRect.Right) div 2, 0);
DT_Right :
OffsetRect(theRect, Rect.Right - theRect.Right, 0);
Types.OffsetRect(theRect, Rect.Right - theRect.Right, 0);
end;
theRect.Bottom := theRect.Top + hT;
@ -624,9 +624,9 @@ var
If SingleLine then
Case TopOffset of
DT_VCENTER :
OffsetRect(theRect, 0, (Rect.Bottom - theRect.Bottom) div 2);
Types.OffsetRect(theRect, 0, (Rect.Bottom - theRect.Bottom) div 2);
DT_Bottom :
OffsetRect(theRect, 0, Rect.Bottom - theRect.Bottom);
Types.OffsetRect(theRect, 0, Rect.Bottom - theRect.Bottom);
end;
end;
var

View File

@ -328,7 +328,7 @@ begin
TextLeft := (cMinLeft + reqWidth - TextBox.Right) div 2;
// position the text
OffsetRect(TextBox, TextLeft, Scale96ToFont(cLabelSpacing));
Types.OffsetRect(TextBox, TextLeft, Scale96ToFont(cLabelSpacing));
// set size of form
ClientWidth := reqWidth + 2 * Scale96ToFont(cLabelSpacing);
@ -722,7 +722,7 @@ begin
end;
// calculate the text position
OffsetRect(TextBox,
Types.OffsetRect(TextBox,
((reqWidth-cMinLeft-TextBox.Right-cLabelSpacing) div 2) + cMinLeft,
cLabelSpacing);

View File

@ -284,7 +284,7 @@ begin
if not LHorzVisible and not LVertVisible then Exit;
LRect := Rect(0, 0, AControl.Width, AControl.Height);
LPoint := AControl.ClientToParent(Point(0, 0), Self);
OffsetRect(LRect, LPoint.x, LPoint.y);
Types.OffsetRect(LRect, LPoint.x, LPoint.y);
if LHorzVisible then
if LRect.Left < 0 then
HorzScrollBar.Position := HorzScrollBar.Position + LRect.Left

View File

@ -266,7 +266,7 @@ procedure TToolButton.Paint;
ARect.Top := (ARect.Top + ARect.Bottom) div 2 - 5;
ARect.Bottom := ARect.Top + 5;
DrawDivider(Details, ARect);
OffsetRect(ARect, 0, 5);
Types.OffsetRect(ARect, 0, 5);
DrawDivider(Details, ARect);
end
else
@ -279,7 +279,7 @@ procedure TToolButton.Paint;
ARect.Left := (ARect.Left + ARect.Right) div 2 - 5;
ARect.Right := ARect.Left + 5;
DrawDivider(Details, ARect);
OffsetRect(ARect, 5, 0);
Types.OffsetRect(ARect, 5, 0);
DrawDivider(Details, ARect);
end
else

View File

@ -2069,7 +2069,7 @@ begin
Info^.SelectedIndex := SelectedIndex;
Info^.OverlayIndex := OverlayIndex;
Info^.StateIndex := StateIndex;
Info^.Data := {%H-}Cardinal(Data);
Info^.Data := {%H-}Cardinal(PtrUInt(Data));
ItemCount := Count;
Info^.Count := ItemCount;
Stream.WriteBuffer(Size, SizeOf(Size));
@ -4598,7 +4598,7 @@ begin
end;
TextRect := Rect(Node.DisplayTextLeft, Node.Top, Node.DisplayTextRight, Node.Top + Node.Height);
OffsetRect(TextRect, 0, -ScrolledTop);
Types.OffsetRect(TextRect, 0, -ScrolledTop);
if not PtInRect(TextRect, Point(X, Y))
or (IntersectRect(IntRect, TextRect, ClientRect) and EqualRect(IntRect, TextRect)) then
begin
@ -4632,7 +4632,7 @@ begin
PHint.X := PLeft.X - R.Right;
end;
end;
OffsetRect(R, PHint.X, PHint.Y);
Types.OffsetRect(R, PHint.X, PHint.Y);
FHintWnd.ActivateHint(R, Node.Text)
end;

View File

@ -749,7 +749,7 @@ begin
{$ENDIF}
R := ARect;
LPtoDP(ADC, R, 2);
OffSetRect(R, DCOrigin.x, DCOrigin.y);
Types.OffSetRect(R, DCOrigin.x, DCOrigin.y);
Drawable := DevCtx.Drawable;
if Drawable = nil then

View File

@ -542,7 +542,7 @@ begin
begin
OffsetPage := RectFromGdkRect(PageWidget^.allocation);
Result := RectFromGdkRect(TabWidget^.allocation);
OffsetRect(Result, -OffsetPage.Left, -OffsetPage.Top);
Types.OffsetRect(Result, -OffsetPage.Left, -OffsetPage.Top);
end;
end;
end;

View File

@ -6222,7 +6222,7 @@ begin
Widget^.allocation.width + Widget^.allocation.x,
Widget^.allocation.height + Widget^.allocation.y);
OffsetRect(ItemStruct^.rcItem, -ItemStruct^.rcItem.Left, -ItemStruct^.rcItem.Top);
Types.OffsetRect(ItemStruct^.rcItem, -ItemStruct^.rcItem.Left, -ItemStruct^.rcItem.Top);
// take frame borders into account
with ItemStruct^.rcItem do

View File

@ -2347,7 +2347,7 @@ begin
LPtoDP(DC, R, 2);
DCOrigin := Offset;
OffsetRect(R, DCOrigin.X, DCOrigin.Y);
Types.OffsetRect(R, DCOrigin.X, DCOrigin.Y);
// try to use the gdk functions, so that the current theme is used
BInner := False;
@ -2415,7 +2415,7 @@ begin
if (grfFlags and BF_ADJUST) = BF_ADJUST then
begin
ARect := R;
OffsetRect(ARect, -DCOrigin.X, -DCOrigin.Y);
Types.OffsetRect(ARect, -DCOrigin.X, -DCOrigin.Y);
DPtoLP(DC, ARect, 2);
end;
Result := True;
@ -2515,12 +2515,12 @@ var
theRect.Bottom := theRect.Top + AP.cY;
if (Flags and DT_VCENTER) > 0 then
begin
OffsetRect(theRect, 0, ((Rect.Bottom - Rect.Top) - (theRect.Bottom - theRect.Top)) div 2);
Types.OffsetRect(theRect, 0, ((Rect.Bottom - Rect.Top) - (theRect.Bottom - theRect.Top)) div 2);
end
else
if (Flags and DT_BOTTOM) > 0 then
begin
OffsetRect(theRect, 0, (Rect.Bottom - Rect.Top) - (theRect.Bottom - theRect.Top));
Types.OffsetRect(theRect, 0, (Rect.Bottom - Rect.Top) - (theRect.Bottom - theRect.Top));
end;
end;
@ -2567,9 +2567,9 @@ var
if not CalcRect then
case LeftOffset of
DT_CENTER:
OffsetRect(theRect, (Rect.Right - theRect.Right) div 2, 0);
Types.OffsetRect(theRect, (Rect.Right - theRect.Right) div 2, 0);
DT_RIGHT:
OffsetRect(theRect, Rect.Right - theRect.Right, 0);
Types.OffsetRect(theRect, Rect.Right - theRect.Right, 0);
end;
end;
@ -2625,7 +2625,7 @@ var
begin
{see issue #27547}
AClipRect := RectFromGdkRect(TGtkDeviceContext(DC).ClipRect);
OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
Types.OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
Result := (TGtkDeviceContext(DC).CurrentFont^.LogFont.lfOrientation <> 0) and
(Flags and DT_SINGLELINE <> 0) and
(Flags and DT_VCENTER = 0) and (Flags and DT_CENTER = 0) and
@ -3883,8 +3883,8 @@ begin
if ((Options and (ETO_OPAQUE + ETO_CLIPPED)) <> 0) and (Rect = nil) then
begin
R := RectFromGdkRect(DevCtx.ClipRect);
OffsetRect(R, -R.Left, -R.Top);
OffsetRect(R, X, Y);
Types.OffsetRect(R, -R.Left, -R.Top);
Types.OffsetRect(R, X, Y);
DrawText(DC, Str, Count, R, DT_SINGLELINE or DT_CALCRECT);
Rect := @R;
end;
@ -4505,7 +4505,7 @@ begin
lpRect^.Bottom := lpRect^.Top + CRect.Height;
end;
DPtoLP(DC, lpRect^, 2);
OffsetRect(lpRect^, -DCOrigin.X, -DCOrigin.Y);
Types.OffsetRect(lpRect^, -DCOrigin.X, -DCOrigin.Y);
end;
{------------------------------------------------------------------------------
@ -6522,7 +6522,7 @@ begin
Pt.X := Round(Adjustment^.value);
dec(gdkRect.x, Pt.X);
dec(gdkRect.y, Pt.Y);
OffsetRect(Rect^, -Pt.X, -Pt.Y);
Types.OffsetRect(Rect^, -Pt.X, -Pt.Y);
end;
WidgetInfo := GetWidgetInfo(Widget); // GetOrCreateWidgetInfo() ??
if WidgetInfo <> nil then

View File

@ -452,10 +452,10 @@ begin
Offs := TabWidget.getGeometry;
Result := TabWidget.TabBar.GetTabRect(AIndex);
case ATabControl.TabPosition of
tpTop: OffsetRect(Result, 0, -Result.Bottom);
tpLeft: OffsetRect(Result, -Result.Right, 0);
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
tpTop: Types.OffsetRect(Result, 0, -Result.Bottom);
tpLeft: Types.OffsetRect(Result, -Result.Right, 0);
tpRight: Types.OffsetRect(Result, Offs.Width - Result.Right, 0);
tpBottom: Types.OffsetRect(Result, 0, Offs.Height - Result.Bottom);
end;
end;

View File

@ -11,8 +11,10 @@ uses
Types, Classes, SysUtils,
// qt bindings
qt5,
// LazUtils
LazLoggerBase,
// lcl
LCLType, LCLProc, LCLIntf, Graphics, Themes, TmSchema,
LCLType, LCLIntf, Graphics, Themes, TmSchema,
// widgetset
InterfaceBase, QtObjects
;
@ -333,7 +335,7 @@ begin
dx := ARect.Left;
dy := ARect.Top;
Context.translate(dx, dy);
OffsetRect(ARect, -dx, -dy);
Types.OffsetRect(ARect, -dx, -dy);
QStyleOption_setRect(opt, @ARect);
// issue #27182 qt5 does not implement splitter grabber in some themes.
@ -354,7 +356,7 @@ begin
begin
opt := QStyleOptionGroupBox_create();
Context.translate(ARect.Left, ARect.Top);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
end;
QStyleCC_ToolButton:
begin
@ -395,7 +397,7 @@ begin
// workaround: qt has own minds about position of requested part -
// but we need a way to draw it at our position
Context.translate(ARect.Left, ARect.Top);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
end;
QStyleCC_Slider, QStyleCC_ScrollBar:
begin
@ -495,7 +497,7 @@ begin
and (ARect.Top > 0) then
begin
ClipR.Left := (ARect.Right - ARect.Left + 1) div 3;
OffsetRect(ARect, -ClipR.Left, -1);
Types.OffsetRect(ARect, -ClipR.Left, -1);
end;
end;
{$ENDIF}
@ -736,7 +738,7 @@ begin
begin
Context.Translate(R.Left, R.Top);
Context.Rotate(-0.1 * Context.Font.Angle);
OffsetRect(R, -R.Left, -R.Top);
Types.OffsetRect(R, -R.Left, -R.Top);
end;
if (Details.Element = teEdit) then

View File

@ -27,6 +27,8 @@ uses
qtobjects, qtint,
// Free Pascal
Classes, SysUtils, Types,
// LazUtils
LazLoggerBase,
// LCL
LCLType, LCLProc, LazUTF8, LazStringUtils, LCLIntf, LMessages, Graphics, Forms, Controls,
ComCtrls, ExtCtrls, StdCtrls, Menus, Dialogs, ImgList;
@ -7381,7 +7383,7 @@ begin
begin
R1 := ARect^;
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
QWidget_update(MDIAreaHandle.viewportWidget, @R1);
end;
end else
@ -7401,7 +7403,7 @@ begin
begin
QRegion_boundingRect(ARgn, @R1);
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
ANewRgn := QRegion_create(PRect(@R1));
QWidget_update(MDIAreaHandle.viewportWidget, ANewRgn);
QRegion_destroy(ANewRgn);
@ -7422,7 +7424,7 @@ begin
begin
R1 := ARect^;
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
QWidget_repaint(MDIAreaHandle.viewportWidget, @R1);
end;
end else
@ -8524,7 +8526,7 @@ begin
else
R1 := Rect(0, 0, 0, 0);
Result := R;
OffsetRect(Result, -Result.Left, -Result.Top);
Types.OffsetRect(Result, -Result.Left, -Result.Top);
{$IFNDEF HASX11}
if testAttribute(QtWA_Mapped) and QWidget_testAttribute(FCentralWidget, QtWA_Mapped) then
QWidget_rect(FCentralWidget, @Result)
@ -8614,7 +8616,7 @@ begin
begin
P := getClientOffset;
R := ARect^;
OffsetRect(R, -P.X, -P.Y);
Types.OffsetRect(R, -P.X, -P.Y);
QWidget_update(FCentralWidget, @R);
end else
QWidget_update(FCentralWidget);
@ -8650,7 +8652,7 @@ begin
begin
P := getClientOffset;
R := ARect^;
OffsetRect(R, -P.X, -P.Y);
Types.OffsetRect(R, -P.X, -P.Y);
QWidget_repaint(FCentralWidget, @R);
end else
QWidget_repaint(FCentralWidget);
@ -10361,7 +10363,7 @@ begin
if Assigned(FOwner) then
begin
Pt := TabBarOffset;
OffsetRect(Result, Pt.X, Pt.Y);
Types.OffsetRect(Result, Pt.X, Pt.Y);
end;
end;
@ -11656,7 +11658,7 @@ begin
end else
begin
ButtonRect := R;
OffsetRect(ButtonRect, -R.Left, -R.Top);
Types.OffsetRect(ButtonRect, -R.Left, -R.Top);
end;
if PtInRect(ButtonRect, Pt) then
@ -17355,7 +17357,7 @@ begin
if HaveBar and (horizontalScrollBar.getVisibleTo(Widget)) then
dec(Result.Bottom, horizontalScrollBar.getHeight);
end;
OffsetRect(Result, -Result.Left, -Result.Top);
Types.OffsetRect(Result, -Result.Left, -Result.Top);
{$IF DEFINED(VerboseQtResize) OR DEFINED(VerboseQScrollBarShowHide)}
DebugLn('TQtAbstractScrollArea.GetClientBounds(not mapped): ',dbgsName(LCLObject),':',dbgsName(Self),' ',dbgs(Result),' ChildComplex=',dbgs(Ord(ChildOfComplexWidget)));
{$ENDIF}
@ -17581,7 +17583,7 @@ begin
if ARect <> nil then
begin
P := getClientOffset;
OffsetRect(ARect^, -P.X , -P.Y);
Types.OffsetRect(ARect^, -P.X , -P.Y);
QWidget_update(viewportWidget, ARect);
end else
QWidget_update(viewportWidget);
@ -17602,7 +17604,7 @@ begin
if ARect <> nil then
begin
P := getClientOffset;
OffsetRect(ARect^, -P.X , -P.Y);
Types.OffsetRect(ARect^, -P.X , -P.Y);
QWidget_repaint(viewportWidget, ARect);
end else
QWidget_repaint(viewportWidget);
@ -18486,13 +18488,13 @@ begin
if R.Bottom-R.Top > D.Bottom-D.Top then // check height
R.Bottom := R.Top + D.Bottom-D.Top;
if R.Left < D.Left then
OffsetRect(R, D.Left-R.Left, 0);
Types.OffsetRect(R, D.Left-R.Left, 0);
if R.Top < D.Top then
OffsetRect(R, 0, D.Top-R.Top);
Types.OffsetRect(R, 0, D.Top-R.Top);
if (R.Right > D.Right) then
OffsetRect(R, D.Right-R.Right, 0);
Types.OffsetRect(R, D.Right-R.Right, 0);
if (R.Bottom > D.Bottom) then
OffsetRect(R, 0, D.Bottom-R.Bottom);
Types.OffsetRect(R, 0, D.Bottom-R.Bottom);
move(R.Left, R.Top);
end;

View File

@ -2611,7 +2611,7 @@ begin
if Handle = 0 then
Exit(False);
GetClientBounds(Handle, ARect);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
Result := True;
end;
@ -4966,19 +4966,19 @@ begin
if Rect <> nil then
begin
with TQtWidget(aHandle).getClientOffset do
OffsetRect(Rect^, x, y);
Types.OffsetRect(Rect^, x, y);
{$IFDEF QTSCROLLABLEFORMS}
if (TQtWidget(AHandle) is TQtMainWindow) and Assigned(TQtMainWindow(AHandle).ScrollArea) then
begin
Pt := TQtMainWindow(AHandle).ScrollArea.ScrolledOffset;
OffsetRect(Rect^, -Pt.X, -Pt.Y);
Types.OffsetRect(Rect^, -Pt.X, -Pt.Y);
end else
{$ENDIF}
if TQtWidget(AHandle).ChildOfComplexWidget = ccwScrollingWinControl then
begin
Pt := TQtCustomControl(AHandle).viewport.ScrolledOffset;
OffsetRect(Rect^, -Pt.X, -Pt.Y);
Types.OffsetRect(Rect^, -Pt.X, -Pt.Y);
end;
// no need to handle bErase. Qt automatically erase rect on paint event according to docs
@ -7119,7 +7119,7 @@ begin
DstQDC.getClipping and DstQDC.getClipRegion.containsRect(SrcRect) then
begin
AClipRect := DstQDC.getClipRegion.getBoundingRect;
OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
Types.OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
if (DstRect.Right - DstRect.Left <= AClipRect.Right) and
(DstRect.Bottom - DstRect.Top <= AClipRect.Bottom) and

View File

@ -29,7 +29,7 @@ uses
SysUtils, Classes, Types,
// LCL
ComCtrls, Controls, LCLType, Graphics, StdCtrls,
LCLProc, LCLIntf, Forms, ImgList,
LCLIntf, Forms, ImgList,
// Widgetset
WSProc, WSComCtrls, WSLCLClasses;
@ -1791,7 +1791,7 @@ begin
(QtTreeWidget.OwnerData or QtTreeWidget.OwnerDrawn) then
begin
IconRect := Rect(0, 0, ImgListRes.Width, ImgListRes.Height);
OffsetRect(IconRect, Result.Left, Result.Top + APixelMetric);
Types.OffsetRect(IconRect, Result.Left, Result.Top + APixelMetric);
end;
IconRect.Left += APixelMetric + (ChkBoxRect.Right - ChkBoxRect.Left);
IconRect.Right += APixelMetric;

View File

@ -311,7 +311,7 @@ begin
Exit;
ARect := TQtWidget(AWinControl.Handle).getClientBounds;
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
Result := True;
end;

View File

@ -1041,7 +1041,7 @@ begin
ASize.cy := 0;
// we must use real geometry, and then exclude menubar height.
aClientRect := AWin.getGeometry;
OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
Types.OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
dec(AClientRect.Bottom, ASize.cy);
{$IFDEF VerboseQtResize}
DebugLn('TQtWSCustomForm.getDefaultClientRect ',dbgsName(AWinControl),' ',dbgs(AWin.getClientBounds),' mnuBarHeight ',dbgs(AWin.MenuBar.getHeight),' ASize=',dbgs(ASize),' FINAL=',dbgs(AClientRect));

View File

@ -452,10 +452,10 @@ begin
Offs := TabWidget.getGeometry;
Result := TabWidget.TabBar.GetTabRect(AIndex);
case ATabControl.TabPosition of
tpTop: OffsetRect(Result, 0, -Result.Bottom);
tpLeft: OffsetRect(Result, -Result.Right, 0);
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
tpTop: Types.OffsetRect(Result, 0, -Result.Bottom);
tpLeft: Types.OffsetRect(Result, -Result.Right, 0);
tpRight: Types.OffsetRect(Result, Offs.Width - Result.Right, 0);
tpBottom: Types.OffsetRect(Result, 0, Offs.Height - Result.Bottom);
end;
end;

View File

@ -11,8 +11,10 @@ uses
Types, Classes, SysUtils,
// qt bindings
qt6,
// LazUtils
LazLoggerBase,
// lcl
LCLType, LCLProc, LCLIntf, Graphics, Themes, TmSchema,
LCLType, LCLIntf, Graphics, Themes, TmSchema,
// widgetset
InterfaceBase, QtObjects
;
@ -336,7 +338,7 @@ begin
dx := ARect.Left;
dy := ARect.Top;
Context.translate(dx, dy);
OffsetRect(ARect, -dx, -dy);
Types.OffsetRect(ARect, -dx, -dy);
QStyleOption_setRect(opt, @ARect);
// issue #27182 qt5 does not implement splitter grabber in some themes.
@ -357,7 +359,7 @@ begin
begin
opt := QStyleOptionGroupBox_create();
Context.translate(ARect.Left, ARect.Top);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
end;
QStyleCC_ToolButton:
begin
@ -398,7 +400,7 @@ begin
// workaround: qt has own minds about position of requested part -
// but we need a way to draw it at our position
Context.translate(ARect.Left, ARect.Top);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
end;
QStyleCC_Slider, QStyleCC_ScrollBar:
begin
@ -498,7 +500,7 @@ begin
and (ARect.Top > 0) then
begin
ClipR.Left := (ARect.Right - ARect.Left + 1) div 3;
OffsetRect(ARect, -ClipR.Left, -1);
Types.OffsetRect(ARect, -ClipR.Left, -1);
end;
end;
{$ENDIF}
@ -739,7 +741,7 @@ begin
begin
Context.Translate(R.Left, R.Top);
Context.Rotate(-0.1 * Context.Font.Angle);
OffsetRect(R, -R.Left, -R.Top);
Types.OffsetRect(R, -R.Left, -R.Top);
end;
if (Details.Element = teEdit) then

View File

@ -7408,7 +7408,7 @@ begin
begin
R1 := ARect^;
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
QWidget_update(MDIAreaHandle.viewportWidget, @R1);
end;
end else
@ -7428,7 +7428,7 @@ begin
begin
QRegion_boundingRect(ARgn, @R1);
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
ANewRgn := QRegion_create(PRect(@R1));
QWidget_update(MDIAreaHandle.viewportWidget, ANewRgn);
QRegion_destroy(ANewRgn);
@ -7449,7 +7449,7 @@ begin
begin
R1 := ARect^;
QWidget_geometry(MDIAreaHandle.Widget, @R);
OffsetRect(R1, -R.Left, -R.Top);
Types.OffsetRect(R1, -R.Left, -R.Top);
QWidget_repaint(MDIAreaHandle.viewportWidget, @R1);
end;
end else
@ -8552,7 +8552,7 @@ begin
else
R1 := Rect(0, 0, 0, 0);
Result := R;
OffsetRect(Result, -Result.Left, -Result.Top);
Types.OffsetRect(Result, -Result.Left, -Result.Top);
{$IFNDEF HASX11}
if testAttribute(QtWA_Mapped) and QWidget_testAttribute(FCentralWidget, QtWA_Mapped) then
QWidget_rect(FCentralWidget, @Result)
@ -8646,7 +8646,7 @@ begin
begin
P := getClientOffset;
R := ARect^;
OffsetRect(R, -P.X, -P.Y);
Types.OffsetRect(R, -P.X, -P.Y);
QWidget_update(FCentralWidget, @R);
end else
QWidget_update(FCentralWidget);
@ -8682,7 +8682,7 @@ begin
begin
P := getClientOffset;
R := ARect^;
OffsetRect(R, -P.X, -P.Y);
Types.OffsetRect(R, -P.X, -P.Y);
QWidget_repaint(FCentralWidget, @R);
end else
QWidget_repaint(FCentralWidget);
@ -10396,7 +10396,7 @@ begin
if Assigned(FOwner) then
begin
Pt := TabBarOffset;
OffsetRect(Result, Pt.X, Pt.Y);
Types.OffsetRect(Result, Pt.X, Pt.Y);
end;
end;
@ -11691,7 +11691,7 @@ begin
end else
begin
ButtonRect := R;
OffsetRect(ButtonRect, -R.Left, -R.Top);
Types.OffsetRect(ButtonRect, -R.Left, -R.Top);
end;
if PtInRect(ButtonRect, Pt) then
@ -17389,7 +17389,7 @@ begin
if HaveBar and (horizontalScrollBar.getVisibleTo(Widget)) then
dec(Result.Bottom, horizontalScrollBar.getHeight);
end;
OffsetRect(Result, -Result.Left, -Result.Top);
Types.OffsetRect(Result, -Result.Left, -Result.Top);
{$IF DEFINED(VerboseQtResize) OR DEFINED(VerboseQScrollBarShowHide)}
DebugLn('TQtAbstractScrollArea.GetClientBounds(not mapped): ',dbgsName(LCLObject),':',dbgsName(Self),' ',dbgs(Result),' ChildComplex=',dbgs(Ord(ChildOfComplexWidget)));
{$ENDIF}
@ -17615,7 +17615,7 @@ begin
if ARect <> nil then
begin
P := getClientOffset;
OffsetRect(ARect^, -P.X , -P.Y);
Types.OffsetRect(ARect^, -P.X , -P.Y);
QWidget_update(viewportWidget, ARect);
end else
QWidget_update(viewportWidget);
@ -17636,7 +17636,7 @@ begin
if ARect <> nil then
begin
P := getClientOffset;
OffsetRect(ARect^, -P.X , -P.Y);
Types.OffsetRect(ARect^, -P.X , -P.Y);
QWidget_repaint(viewportWidget, ARect);
end else
QWidget_repaint(viewportWidget);
@ -18530,13 +18530,13 @@ begin
if R.Bottom-R.Top > D.Bottom-D.Top then // check height
R.Bottom := R.Top + D.Bottom-D.Top;
if R.Left < D.Left then
OffsetRect(R, D.Left-R.Left, 0);
Types.OffsetRect(R, D.Left-R.Left, 0);
if R.Top < D.Top then
OffsetRect(R, 0, D.Top-R.Top);
Types.OffsetRect(R, 0, D.Top-R.Top);
if (R.Right > D.Right) then
OffsetRect(R, D.Right-R.Right, 0);
Types.OffsetRect(R, D.Right-R.Right, 0);
if (R.Bottom > D.Bottom) then
OffsetRect(R, 0, D.Bottom-R.Bottom);
Types.OffsetRect(R, 0, D.Bottom-R.Bottom);
move(R.Left, R.Top);
end;

View File

@ -2608,7 +2608,7 @@ begin
if Handle = 0 then
Exit(False);
GetClientBounds(Handle, ARect);
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
Result := True;
end;
@ -4977,19 +4977,19 @@ begin
if Rect <> nil then
begin
with TQtWidget(aHandle).getClientOffset do
OffsetRect(Rect^, x, y);
Types.OffsetRect(Rect^, x, y);
{$IFDEF QTSCROLLABLEFORMS}
if (TQtWidget(AHandle) is TQtMainWindow) and Assigned(TQtMainWindow(AHandle).ScrollArea) then
begin
Pt := TQtMainWindow(AHandle).ScrollArea.ScrolledOffset;
OffsetRect(Rect^, -Pt.X, -Pt.Y);
Types.OffsetRect(Rect^, -Pt.X, -Pt.Y);
end else
{$ENDIF}
if TQtWidget(AHandle).ChildOfComplexWidget = ccwScrollingWinControl then
begin
Pt := TQtCustomControl(AHandle).viewport.ScrolledOffset;
OffsetRect(Rect^, -Pt.X, -Pt.Y);
Types.OffsetRect(Rect^, -Pt.X, -Pt.Y);
end;
// no need to handle bErase. Qt automatically erase rect on paint event according to docs
@ -7159,7 +7159,7 @@ begin
DstQDC.getClipping and DstQDC.getClipRegion.containsRect(SrcRect) then
begin
AClipRect := DstQDC.getClipRegion.getBoundingRect;
OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
Types.OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
if (DstRect.Right - DstRect.Left <= AClipRect.Right) and
(DstRect.Bottom - DstRect.Top <= AClipRect.Bottom) and

View File

@ -27,7 +27,7 @@ uses
qtwidgets, qtobjects, qtproc,
// LCL
SysUtils, Classes, Types, ComCtrls, Controls, LCLType, Graphics, StdCtrls,
LCLProc, LCLIntf, Forms, ImgList,
LCLIntf, Forms, ImgList,
// Widgetset
WSProc, WSComCtrls, WSLCLClasses;
@ -1789,7 +1789,7 @@ begin
(QtTreeWidget.OwnerData or QtTreeWidget.OwnerDrawn) then
begin
IconRect := Rect(0, 0, ImgListRes.Width, ImgListRes.Height);
OffsetRect(IconRect, Result.Left, Result.Top + APixelMetric);
Types.OffsetRect(IconRect, Result.Left, Result.Top + APixelMetric);
end;
IconRect.Left += APixelMetric + (ChkBoxRect.Right - ChkBoxRect.Left);
IconRect.Right += APixelMetric;

View File

@ -309,7 +309,7 @@ begin
Exit;
ARect := TQtWidget(AWinControl.Handle).getClientBounds;
OffsetRect(ARect, -ARect.Left, -ARect.Top);
Types.OffsetRect(ARect, -ARect.Left, -ARect.Top);
Result := True;
end;

View File

@ -1041,7 +1041,7 @@ begin
ASize.cy := 0;
// we must use real geometry, and then exclude menubar height.
aClientRect := AWin.getGeometry;
OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
Types.OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
dec(AClientRect.Bottom, ASize.cy);
{$IFDEF VerboseQtResize}
DebugLn('TQtWSCustomForm.getDefaultClientRect ',dbgsName(AWinControl),' ',dbgs(AWin.getClientBounds),' mnuBarHeight ',dbgs(AWin.MenuBar.getHeight),' ASize=',dbgs(ASize),' FINAL=',dbgs(AClientRect));

View File

@ -2543,13 +2543,13 @@ var
theRect.Right := theRect.Left + Min(MaxWidth, AP.cX);
if (Flags and DT_VCENTER) > 0 then
begin
OffsetRect(theRect, 0, ((Rect.Bottom - Rect.Top) -
Types.OffsetRect(theRect, 0, ((Rect.Bottom - Rect.Top) -
(theRect.Bottom - theRect.Top)) div 2);
end
else
if (Flags and DT_BOTTOM) > 0 then
begin
OffsetRect(theRect, 0, (Rect.Bottom - Rect.Top) -
Types.OffsetRect(theRect, 0, (Rect.Bottom - Rect.Top) -
(theRect.Bottom - theRect.Top));
end;
end;
@ -2592,12 +2592,12 @@ var
DT_CENTER:
begin
Offset := (Rect.Right - theRect.Right) div 2;
OffsetRect(theRect, offset, 0);
Types.OffsetRect(theRect, offset, 0);
end;
DT_RIGHT:
begin
Offset := Rect.Right - theRect.Right;
OffsetRect(theRect, offset, 0);
Types.OffsetRect(theRect, offset, 0);
end;
end;
end;
@ -2909,24 +2909,24 @@ begin
taRightJustify:
begin
Offset := ARect.Right - fRect.Right;
OffsetRect(fRect, Offset, 0);
Types.OffsetRect(fRect, Offset, 0);
end;
taCenter:
begin
Offset := (ARect.Right - fRect.Right) div 2;
OffsetRect(fRect, offset, 0);
Types.OffsetRect(fRect, offset, 0);
end;
end;
case Style.Layout of
tlCenter:
begin
Offset := ((ARect.Bottom - ARect.Top) - (fRect.Bottom - fRect.Top)) div 2;
OffsetRect(fRect, 0, offset);
Types.OffsetRect(fRect, 0, offset);
end;
tlBottom:
begin
Offset := ARect.Bottom - fRect.Bottom;
OffsetRect(fRect, 0, offset);
Types.OffsetRect(fRect, 0, offset);
end;
end;
end;

View File

@ -2456,10 +2456,10 @@ begin
else
begin
Canvas.Font.Color := clBtnHighlight;
OffsetRect(R, 1, 1);
Types.OffsetRect(R, 1, 1);
Canvas.TextRect(R, R.Left, R.Top, S, TXTStyle);
Canvas.Font.Color := clBtnShadow;
OffsetRect(R, -1, -1);
Types.OffsetRect(R, -1, -1);
end;
if (Details.Element = teTreeview) and (Details.Part = TVP_TREEITEM) then
begin