Ignore:
Timestamp:
Jan 12, 2026, 4:03:17 PM (8 hours ago)
Author:
chronos
Message:
  • Fixed: Limit maximum width of negative growth progress bar.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r719 r721  
    9191  T: TTexture);
    9292procedure CountBar(Dst: TBitmap; X, Y, W: Integer; Kind: Integer;
    93   Cap: string; Val: Integer; T: TTexture);
     93  Cap: string; Val: Integer; Texture: TTexture);
    9494procedure PaintProgressBar(Canvas: TCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    95   T: TTexture);
     95  Texture: TTexture);
    9696procedure PaintRelativeProgressBar(Canvas: TCanvas;
    9797  Kind, X, Y, Size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    98   T: TTexture);
     98  Texture: TTexture);
    9999procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer);
    100100procedure DrawBufferEnsureSize(Width, Height: Integer);
     
    14351435
    14361436procedure CountBar(Dst: TBitmap; X, Y, W: Integer; Kind: Integer;
    1437   Cap: string; Val: Integer; T: TTexture);
     1437  Cap: string; Val: Integer; Texture: TTexture);
    14381438var
    14391439  I, sd, ld, cl, xIcon, yIcon: Integer;
     
    14481448    // xIcon:=x+100;
    14491449    // yIcon:=y;
    1450     // DLine(Dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight);
     1450    // DLine(Dst.Canvas,x-2,x+170+32,y+16,Texture.ColorBevelShade,Texture.ColorBevelLight);
    14511451
    14521452    xIcon := X - 5;
    14531453    yIcon := Y + 15;
    1454     DLine(Dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, T.ColorBevelShade,
    1455       T.ColorBevelLight);
     1454    DLine(Dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, Texture.ColorBevelShade,
     1455      Texture.ColorBevelLight);
    14561456
    14571457    S := IntToStr(Val);
     
    14601460    else
    14611461      cl := -1;
    1462     LoweredTextOut(Dst.Canvas, cl, T, X - 2, Y, Cap);
    1463     LoweredTextOut(Dst.Canvas, cl, T,
     1462    LoweredTextOut(Dst.Canvas, cl, Texture, X - 2, Y, Cap);
     1463    LoweredTextOut(Dst.Canvas, cl, Texture,
    14641464      xIcon + W + 2 - BiColorTextWidth(Dst.Canvas, S), yIcon, S);
    14651465
     
    15311531
    15321532procedure PaintProgressBar(Canvas: TCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    1533   T: TTexture);
     1533  Texture: TTexture);
    15341534var
    15351535  I: Integer;
     
    15431543    begin
    15441544      Growth := Growth - Pos;
     1545      if Growth > Max then Growth := Max;
    15451546      Pos := 0;
    15461547    end;
     
    15491550    Growth := Max - Pos;
    15501551  Frame(Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000);
    1551   RFrame(Canvas, X - 2, Y - 2, X + Max + 1, Y + 8, T.ColorBevelShade,
    1552     T.ColorBevelLight);
     1552  RFrame(Canvas, X - 2, Y - 2, X + Max + 1, Y + 8, Texture.ColorBevelShade,
     1553    Texture.ColorBevelLight);
    15531554  with Canvas do
    15541555  begin
     
    15851586procedure PaintRelativeProgressBar(Canvas: TCanvas;
    15861587  Kind, X, Y, Size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    1587   T: TTexture);
     1588  Texture: TTexture);
    15881589begin
    15891590  if Growth > 0 then
    15901591    PaintProgressBar(Canvas, Kind, X, Y, Pos * Size div Max,
    1591       (Growth * Size + Max div 2) div Max, Size, T)
     1592      (Growth * Size + Max div 2) div Max, Size, Texture)
    15921593  else
    15931594    PaintProgressBar(Canvas, Kind, X, Y, Pos * Size div Max,
    1594       (Growth * Size - Max div 2) div Max, Size, T);
     1595      (Growth * Size - Max div 2) div Max, Size, Texture);
    15951596  if IndicateComplete and (Pos + Growth >= Max) then
    15961597    Sprite(Canvas, HGrSystem, X + Size - 10, Y - 7, 23, 16, 1, 129);
Note: See TracChangeset for help on using the changeset viewer.