LCL: fix compilation with FPC 3.0.0

git-svn-id: trunk@57167 -
This commit is contained in:
ondrej 2018-01-27 18:55:34 +00:00
parent df35dca526
commit 4a5dab2d4b
7 changed files with 36 additions and 36 deletions

View File

@ -5387,8 +5387,8 @@ begin
then then
exit; exit;
aSize := TitleImageList.SizeForPPI[TitleImageListWidth, Font.PixelsPerInch]; aSize := TitleImageList.SizeForPPI[TitleImageListWidth, Font.PixelsPerInch];
aWidth := aSize.Width; aWidth := aSize.cx;
aHeight := aSize.Height; aHeight := aSize.cy;
imgLayout := c.Title.ImageLayout; imgLayout := c.Title.ImageLayout;
result := c.Title.ImageIndex; result := c.Title.ImageIndex;
end; end;

View File

@ -394,11 +394,11 @@ begin { do not call inherited ! }
begin begin
if not FRightToLeft if not FRightToLeft
then aImgPoint.X:=ARect.Left+aIndent then aImgPoint.X:=ARect.Left+aIndent
else aImgPoint.X:=ARect.Right-aIndent-ImagesSize.Width; else aImgPoint.X:=ARect.Right-aIndent-ImagesSize.cx;
aImgPoint.Y:=(ARect.Bottom+ARect.Top-ImagesSize.Height) div 2; aImgPoint.Y:=(ARect.Bottom+ARect.Top-ImagesSize.cy) div 2;
ThemeServices.DrawIcon(Canvas, aDetail, aImgPoint, Images, aItemIndex); ThemeServices.DrawIcon(Canvas, aDetail, aImgPoint, Images, aItemIndex);
end; end;
inc(aIndent, ImagesSize.Width+2*cItemIndent); inc(aIndent, ImagesSize.cx+2*cItemIndent);
end; end;
Canvas.Brush.Style:=bsClear; Canvas.Brush.Style:=bsClear;
if (not (odSelected in State) or not aDropped) and not aFocusedEditableMainItemNoDD if (not (odSelected in State) or not aDropped) and not aFocusedEditableMainItemNoDD

View File

@ -1308,17 +1308,17 @@ begin
x := x-HorizontalSpacing; x := x-HorizontalSpacing;
//paint Image //paint Image
if Assigned(FImages) and (FVisiBands[i].ImageIndex >= 0) then begin 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 if not Vertical then
ThemeServices.DrawIcon(Canvas, aDetails, 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) FImages, FVisiBands[i].ImageIndex)
else else
ThemeServices.DrawIcon(Canvas, aDetails, 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); FImages, FVisiBands[i].ImageIndex);
if not FRightToLeft or Vertical then if not FRightToLeft or Vertical then
inc(x, aImageSize.Width+HorizontalSpacing) inc(x, aImageSize.cx+HorizontalSpacing)
else else
dec(x, HorizontalSpacing); dec(x, HorizontalSpacing);
end; end;

View File

@ -416,9 +416,9 @@ begin
inc(ContentRect.Left); inc(ContentRect.Left);
ImagesSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch]; ImagesSize := Images.SizeForPPI[ImagesWidth, Font.PixelsPerInch];
ThemeServices.DrawIcon(Canvas, Details, 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); Images, Section.ImageIndex);
inc(ContentRect.Left, ImagesSize.Width + 2); inc(ContentRect.Left, ImagesSize.cx + 2);
end; end;
if Section.Text <> '' then if Section.Text <> '' then

View File

@ -1604,8 +1604,8 @@ var
Res: TCustomImageListResolution; Res: TCustomImageListResolution;
begin begin
Res := GetResolutionForPPI(AImageWidth, APPI); Res := GetResolutionForPPI(AImageWidth, APPI);
Result.Width := Res.Width; Result.cx := Res.Width;
Result.Height := Res.Height; Result.cy := Res.Height;
end; end;
function TCustomImageList.GetWidthForPPI(AImageWidth, function TCustomImageList.GetWidthForPPI(AImageWidth,

View File

@ -357,8 +357,8 @@ begin
if (ImgList<>nil) then if (ImgList<>nil) then
begin begin
IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, Font.PixelsPerInch]; IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, Font.PixelsPerInch];
if IconSize.Height <= 0 then if IconSize.cy <= 0 then
IconSize.Width := 0; IconSize.cx := 0;
end; end;
// calculate text and icon position // calculate text and icon position
@ -366,22 +366,22 @@ begin
IconPos:=Point(0,0); IconPos:=Point(0,0);
if TextSize.cx > 0 then if TextSize.cx > 0 then
begin begin
if IconSize.Width > 0 then if IconSize.cx > 0 then
begin begin
if FToolBar.List then if FToolBar.List then
begin begin
// icon left of text // icon left of text
IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width-TextSize.cx-2) div 2; IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx-TextSize.cx-2) div 2;
IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height) div 2; IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy) div 2;
TextPos.X:=IconPos.X+IconSize.Width+2; TextPos.X:=IconPos.X+IconSize.cx+2;
TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2; TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2;
end else end else
begin begin
// icon above text // icon above text
IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width) div 2; IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx) div 2;
IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height-TextSize.cy-2) 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.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;
end else end else
begin begin
@ -390,11 +390,11 @@ begin
TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2; TextPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-TextSize.cy) div 2;
end; end;
end else end else
if IconSize.Width>0 then if IconSize.cx>0 then
begin begin
// only icon // only icon
IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.Width) div 2; IconPos.X:=(MainBtnRect.Left+MainBtnRect.Right-IconSize.cx) div 2;
IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.Height) div 2; IconPos.Y:=(MainBtnRect.Top+MainBtnRect.Bottom-IconSize.cy) div 2;
end; end;
// draw button // draw button
@ -1157,7 +1157,7 @@ begin
if Assigned(ImgList) then if Assigned(ImgList) then
begin begin
IconSize := ImgList.SizeForPPI[FToolBar.ImagesWidth, FToolBar.Font.PixelsPerInch]; 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;
end; end;
// calculate text and icon position // calculate text and icon position
@ -1165,17 +1165,17 @@ begin
IconPos := Point(0, 0); IconPos := Point(0, 0);
if TextSize.cx > 0 then if TextSize.cx > 0 then
begin begin
if IconSize.Width > 0 then if IconSize.cx > 0 then
begin begin
if FToolBar.List then if FToolBar.List then
begin begin
// icon left of text // icon left of text
TextPos.X := IconPos.X + IconSize.Width + 2; TextPos.X := IconPos.X + IconSize.cx + 2;
end end
else else
begin begin
// icon above text // icon above text
TextPos.Y := IconPos.Y + IconSize.Height + 2; TextPos.Y := IconPos.Y + IconSize.cy + 2;
end; end;
end end
else else
@ -1184,13 +1184,13 @@ begin
end; end;
end end
else else
if IconSize.Width > 0 then if IconSize.cx > 0 then
begin begin
// only icon // only icon
end; end;
PreferredWidth := Max(IconPos.X + IconSize.Width, TextPos.X + TextSize.cx); PreferredWidth := Max(IconPos.X + IconSize.cx, TextPos.X + TextSize.cx);
PreferredHeight := Max(IconPos.Y + IconSize.Height, TextPos.Y + TextSize.cy); 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.X,'+',IconSize.Width,' Text=',TextPos.X,'+',TextSize.cx]);
//DebugLn(['TToolButton.CalculatePreferredSize Preferred=',PreferredWidth,',',PreferredHeight,' Icon=',IconPos.Y,'+',IconSize.Height,' Text=',TextPos.Y,'+',TextSize.cy]); //DebugLn(['TToolButton.CalculatePreferredSize Preferred=',PreferredWidth,',',PreferredHeight,' Icon=',IconPos.Y,'+',IconSize.Height,' Text=',TextPos.Y,'+',TextSize.cy]);

View File

@ -3617,10 +3617,10 @@ begin
if Assigned(FStateImages) then if Assigned(FStateImages) then
StateImageSize := StateImages.SizeForPPI[StateImagesWidth, Font.PixelsPerInch]; StateImageSize := StateImages.SizeForPPI[StateImagesWidth, Font.PixelsPerInch];
if NewDefItemHeight<FDefItemSpace then NewDefItemHeight:=FDefItemSpace; if NewDefItemHeight<FDefItemSpace then NewDefItemHeight:=FDefItemSpace;
if (Images<>nil) and (ImageSize.Height+FDefItemSpace>NewDefItemHeight) then if (Images<>nil) and (ImageSize.cy+FDefItemSpace>NewDefItemHeight) then
NewDefItemHeight:=ImageSize.Height+FDefItemSpace; NewDefItemHeight:=ImageSize.cy+FDefItemSpace;
if (StateImages<>nil) and (StateImageSize.Height+FDefItemSpace>NewDefItemHeight) then if (StateImages<>nil) and (StateImageSize.cy+FDefItemSpace>NewDefItemHeight) then
NewDefItemHeight:=StateImageSize.Height+FDefItemSpace; NewDefItemHeight:=StateImageSize.cy+FDefItemSpace;
if Odd(NewDefItemHeight) then Inc(NewDefItemHeight); if Odd(NewDefItemHeight) then Inc(NewDefItemHeight);
if NewDefItemHeight<>FDefItemHeight then begin if NewDefItemHeight<>FDefItemHeight then begin
FDefItemHeight:=NewDefItemHeight; FDefItemHeight:=NewDefItemHeight;