diff --git a/lcl/grids.pas b/lcl/grids.pas index c8aff4bc36..694134c6a3 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -5387,8 +5387,8 @@ begin then exit; aSize := TitleImageList.SizeForPPI[TitleImageListWidth, Font.PixelsPerInch]; - aWidth := aSize.Width; - aHeight := aSize.Height; + aWidth := aSize.cx; + aHeight := aSize.cy; imgLayout := c.Title.ImageLayout; result := c.Title.ImageIndex; end; diff --git a/lcl/include/comboex.inc b/lcl/include/comboex.inc index 4d7497211e..f6d8e16d35 100644 --- a/lcl/include/comboex.inc +++ b/lcl/include/comboex.inc @@ -394,11 +394,11 @@ begin { do not call inherited ! } begin if not FRightToLeft then aImgPoint.X:=ARect.Left+aIndent - else aImgPoint.X:=ARect.Right-aIndent-ImagesSize.Width; - aImgPoint.Y:=(ARect.Bottom+ARect.Top-ImagesSize.Height) div 2; + else aImgPoint.X:=ARect.Right-aIndent-ImagesSize.cx; + aImgPoint.Y:=(ARect.Bottom+ARect.Top-ImagesSize.cy) div 2; ThemeServices.DrawIcon(Canvas, aDetail, aImgPoint, Images, aItemIndex); end; - inc(aIndent, ImagesSize.Width+2*cItemIndent); + inc(aIndent, ImagesSize.cx+2*cItemIndent); end; Canvas.Brush.Style:=bsClear; if (not (odSelected in State) or not aDropped) and not aFocusedEditableMainItemNoDD diff --git a/lcl/include/coolbar.inc b/lcl/include/coolbar.inc index f1de4489ed..6bdfdea915 100644 --- a/lcl/include/coolbar.inc +++ b/lcl/include/coolbar.inc @@ -1308,17 +1308,17 @@ begin x := x-HorizontalSpacing; //paint Image if Assigned(FImages) and (FVisiBands[i].ImageIndex >= 0) then begin - if FRightToLeft and not Vertical then dec(x, aImageSize.Width); + if FRightToLeft and not Vertical then dec(x, aImageSize.cx); if not Vertical then ThemeServices.DrawIcon(Canvas, aDetails, - Point(x, aTop+(FVisiBands[i].FHeight-aImageSize.Height) div 2), + Point(x, aTop+(FVisiBands[i].FHeight-aImageSize.cy) div 2), FImages, FVisiBands[i].ImageIndex) else ThemeServices.DrawIcon(Canvas, aDetails, - Point(aTop+(FVisiBands[i].FHeight-aImageSize.Width) div 2, x), + Point(aTop+(FVisiBands[i].FHeight-aImageSize.cx) div 2, x), FImages, FVisiBands[i].ImageIndex); if not FRightToLeft or Vertical then - inc(x, aImageSize.Width+HorizontalSpacing) + inc(x, aImageSize.cx+HorizontalSpacing) else dec(x, HorizontalSpacing); end; diff --git a/lcl/include/headercontrol.inc b/lcl/include/headercontrol.inc index ff9f868113..68758ac343 100644 --- a/lcl/include/headercontrol.inc +++ b/lcl/include/headercontrol.inc @@ -416,9 +416,9 @@ begin inc(ContentRect.Left); ImagesSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; ThemeServices.DrawIcon(Canvas, Details, - Point(ContentRect.Left, (ContentRect.Top + ContentRect.Bottom - ImagesSize.Height) div 2), + Point(ContentRect.Left, (ContentRect.Top + ContentRect.Bottom - ImagesSize.cy) div 2), Images, Section.ImageIndex); - inc(ContentRect.Left, ImagesSize.Width + 2); + inc(ContentRect.Left, ImagesSize.cx + 2); end; if Section.Text <> '' then diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index ccf5ce8614..865624c72b 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -1604,8 +1604,8 @@ var Res: TCustomImageListResolution; begin Res := GetResolutionForPPI(AImageWidth, APPI); - Result.Width := Res.Width; - Result.Height := Res.Height; + Result.cx := Res.Width; + Result.cy := Res.Height; end; function TCustomImageList.GetWidthForPPI(AImageWidth, diff --git a/lcl/include/toolbutton.inc b/lcl/include/toolbutton.inc index 2089758b45..bc87e3dc27 100644 --- a/lcl/include/toolbutton.inc +++ b/lcl/include/toolbutton.inc @@ -357,8 +357,8 @@ begin if (ImgList<>nil) then begin IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, Font.PixelsPerInch]; - if IconSize.Height <= 0 then - IconSize.Width := 0; + if IconSize.cy <= 0 then + IconSize.cx := 0; end; // calculate text and icon position @@ -366,22 +366,22 @@ begin IconPos:=Point(0,0); if TextSize.cx > 0 then begin - if IconSize.Width > 0 then + if IconSize.cx > 0 then begin if FToolBar.List then begin // icon left of text - IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width-TextSize.cx-2) div 2; - IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height) div 2; - TextPos.X:=IconPos.X+IconSize.Width+2; + IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx-TextSize.cx-2) div 2; + IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy) div 2; + TextPos.X:=IconPos.X+IconSize.cx+2; TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2; end else begin // icon above text - IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width) div 2; - IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height-TextSize.cy-2) div 2; + IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx) div 2; + IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy-TextSize.cy-2) div 2; TextPos.X:=(MainBtnRect.Left+MainBtnRect.Right-TextSize.cx) div 2; - TextPos.Y:=IconPos.Y+IconSize.Height+2; + TextPos.Y:=IconPos.Y+IconSize.cy+2; end; end else begin @@ -390,11 +390,11 @@ begin TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2; end; end else - if IconSize.Width>0 then + if IconSize.cx>0 then begin // only icon - IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width) div 2; - IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height) div 2; + IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx) div 2; + IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy) div 2; end; // draw button @@ -1157,7 +1157,7 @@ begin if Assigned(ImgList) then begin IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, FToolBar.Font.PixelsPerInch]; - if IconSize.Height <= 0 then IconSize.Width := 0; + if IconSize.cy <= 0 then IconSize.cx := 0; end; end; // calculate text and icon position @@ -1165,17 +1165,17 @@ begin IconPos := Point(0, 0); if TextSize.cx > 0 then begin - if IconSize.Width > 0 then + if IconSize.cx > 0 then begin if FToolBar.List then begin // icon left of text - TextPos.X := IconPos.X + IconSize.Width + 2; + TextPos.X := IconPos.X + IconSize.cx + 2; end else begin // icon above text - TextPos.Y := IconPos.Y + IconSize.Height + 2; + TextPos.Y := IconPos.Y + IconSize.cy + 2; end; end else @@ -1184,13 +1184,13 @@ begin end; end else - if IconSize.Width > 0 then + if IconSize.cx > 0 then begin // only icon end; - PreferredWidth := Max(IconPos.X + IconSize.Width, TextPos.X + TextSize.cx); - PreferredHeight := Max(IconPos.Y + IconSize.Height, TextPos.Y + TextSize.cy); + PreferredWidth := Max(IconPos.X + IconSize.cx, TextPos.X + TextSize.cx); + PreferredHeight := Max(IconPos.Y + IconSize.cy, TextPos.Y + TextSize.cy); //DebugLn(['TToolButton.CalculatePreferredSize Preferred=',PreferredWidth,',',PreferredHeight,' Icon=',IconPos.X,'+',IconSize.Width,' Text=',TextPos.X,'+',TextSize.cx]); //DebugLn(['TToolButton.CalculatePreferredSize Preferred=',PreferredWidth,',',PreferredHeight,' Icon=',IconPos.Y,'+',IconSize.Height,' Text=',TextPos.Y,'+',TextSize.cy]); diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc index 0f0357f90a..8b7130f497 100644 --- a/lcl/include/treeview.inc +++ b/lcl/include/treeview.inc @@ -3617,10 +3617,10 @@ begin if Assigned(FStateImages) then StateImageSize := StateImages.SizeForPPI[StateImagesWidth, Font.PixelsPerInch]; if NewDefItemHeightnil) and (ImageSize.Height+FDefItemSpace>NewDefItemHeight) then - NewDefItemHeight:=ImageSize.Height+FDefItemSpace; - if (StateImages<>nil) and (StateImageSize.Height+FDefItemSpace>NewDefItemHeight) then - NewDefItemHeight:=StateImageSize.Height+FDefItemSpace; + if (Images<>nil) and (ImageSize.cy+FDefItemSpace>NewDefItemHeight) then + NewDefItemHeight:=ImageSize.cy+FDefItemSpace; + if (StateImages<>nil) and (StateImageSize.cy+FDefItemSpace>NewDefItemHeight) then + NewDefItemHeight:=StateImageSize.cy+FDefItemSpace; if Odd(NewDefItemHeight) then Inc(NewDefItemHeight); if NewDefItemHeight<>FDefItemHeight then begin FDefItemHeight:=NewDefItemHeight;