Changeset 505 for trunk/Packages/CevoComponents
- Timestamp:
- Dec 24, 2023, 11:24:57 PM (12 months ago)
- Location:
- trunk/Packages/CevoComponents
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ButtonN.pas
r471 r505 36 36 37 37 procedure Register; 38 38 39 39 40 implementation -
trunk/Packages/CevoComponents/ScreenTools.pas
r502 r505 32 32 function LoadGraphicFile(Bmp: TBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): Boolean; 33 33 function LoadGraphicSet(const Name: string; Transparency: Boolean = True): TGraphicSet; 34 procedure Dump( dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);34 procedure Dump(Dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 35 35 procedure BitmapReplaceColor(Dst: TBitmap; X, Y, Width, Height: Integer; OldColor, NewColor: TColor); 36 36 procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 37 37 overload; 38 procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 38 procedure Sprite(Canvas: TCanvas; xDst, yDst: Integer; GraphicSetItem: TGraphicSetItem); 39 overload; 40 procedure Sprite(Dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 39 41 overload; 40 42 procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer); … … 85 87 procedure VDarkGradient(Canvas: TCanvas; X, Y, Height, Kind: Integer); 86 88 procedure UnderlinedTitleValue(Canvas: TCanvas; Title, Value: string; X, Y, Width: Integer); 87 procedure NumberBar( dst: TBitmap; X, Y: Integer; Cap: string; val: Integer;89 procedure NumberBar(Dst: TBitmap; X, Y: Integer; Cap: string; val: Integer; 88 90 T: TTexture); 89 procedure CountBar( dst: TBitmap; X, Y, W: Integer; Kind: Integer;91 procedure CountBar(Dst: TBitmap; X, Y, W: Integer; Kind: Integer; 90 92 Cap: string; val: Integer; T: TTexture); 91 93 procedure PaintProgressBar(Canvas: TCanvas; Kind, X, Y, Pos, Growth, Max: Integer; … … 562 564 end; 563 565 564 procedure Dump( dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);565 begin 566 BitBltCanvas( dst.Canvas, xDst, yDst, Width, Height,566 procedure Dump(Dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 567 begin 568 BitBltCanvas(Dst.Canvas, xDst, yDst, Width, Height, 567 569 HGr.Data.Canvas, xGr, yGr); 568 570 end; … … 863 865 procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 864 866 begin 865 BitBltCanvas(Canvas, xDst, yDst, Width, Height, 866 HGr.Mask.Canvas, xGr, yGr, SRCAND); 867 BitBltCanvas(Canvas, xDst, yDst, Width, Height, 868 HGr.Data.Canvas, xGr, yGr, SRCPAINT); 869 end; 870 871 procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 872 begin 873 BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height, 874 HGr.Mask.Canvas, xGr, yGr, SRCAND); 875 BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height, 876 HGr.Data.Canvas, xGr, yGr, SRCPAINT); 867 BitBltCanvas(Canvas, xDst, yDst, Width, Height, HGr.Mask.Canvas, xGr, yGr, SRCAND); 868 BitBltCanvas(Canvas, xDst, yDst, Width, Height, HGr.Data.Canvas, xGr, yGr, SRCPAINT); 869 end; 870 871 procedure Sprite(Canvas: TCanvas; xDst, yDst: Integer; GraphicSetItem: TGraphicSetItem); 872 begin 873 Sprite(Canvas, GraphicSetItem.GraphicSet, xDst, yDst, GraphicSetItem.Width, 874 GraphicSetItem.Height, GraphicSetItem.Left, GraphicSetItem.Top); 875 end; 876 877 procedure Sprite(Dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer); 878 begin 879 Sprite(Dst.Canvas, HGr, xDst, yDst, Width, Height, xGr, yGr); 877 880 end; 878 881 … … 1211 1214 procedure PaintIcon(X, Y, Kind: Integer); 1212 1215 begin 1213 BitBltCanvas(Canvas, X, Y + 6, 10, 10, HGrSystem.Mask.Canvas, 1214 66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCAND); 1215 BitBltCanvas(Canvas, X, Y + 6, 10, 10, HGrSystem.Data.Canvas, 1216 66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCPAINT); 1216 Sprite(Canvas, HGrSystem, X, Y + 6, 10, 10, 1217 66 + Kind mod 11 * 11, 115 + Kind div 11 * 11); 1217 1218 end; 1218 1219 … … 1383 1384 end; 1384 1385 1385 procedure NumberBar( dst: TBitmap; X, Y: Integer; Cap: string;1386 procedure NumberBar(Dst: TBitmap; X, Y: Integer; Cap: string; 1386 1387 val: Integer; T: TTexture); 1387 1388 var … … 1390 1391 if val > 0 then 1391 1392 begin 1392 DLine( dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade,1393 DLine(Dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade, 1393 1394 T.ColorBevelLight); 1394 LoweredTextOut( dst.Canvas, -1, T, X - 2, Y, Cap);1395 LoweredTextOut(Dst.Canvas, -1, T, X - 2, Y, Cap); 1395 1396 S := IntToStr(val); 1396 RisedTextOut( dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas,1397 RisedTextOut(Dst.Canvas, X + 170 - BiColorTextWidth(Dst.Canvas, 1397 1398 S), Y, S); 1398 1399 end; 1399 1400 end; 1400 1401 1401 procedure CountBar( dst: TBitmap; X, Y, W: Integer; Kind: Integer;1402 procedure CountBar(Dst: TBitmap; X, Y, W: Integer; Kind: Integer; 1402 1403 Cap: string; val: Integer; T: TTexture); 1403 1404 var … … 1409 1410 Exit; 1410 1411 Assert(Kind >= 0); 1411 with dst.Canvas do1412 with Dst.Canvas do 1412 1413 begin 1413 1414 // xIcon:=x+100; 1414 1415 // yIcon:=y; 1415 // DLine( dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight);1416 // DLine(Dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight); 1416 1417 1417 1418 xIcon := X - 5; 1418 1419 yIcon := Y + 15; 1419 DLine( dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, T.ColorBevelShade,1420 DLine(Dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, T.ColorBevelShade, 1420 1421 T.ColorBevelLight); 1421 1422 … … 1425 1426 else 1426 1427 cl := -1; 1427 LoweredTextOut( dst.Canvas, cl, T, X - 2, Y, Cap);1428 LoweredTextOut( dst.Canvas, cl, T,1429 xIcon + W + 2 - BiColorTextWidth( dst.Canvas, S), yIcon, S);1428 LoweredTextOut(Dst.Canvas, cl, T, X - 2, Y, Cap); 1429 LoweredTextOut(Dst.Canvas, cl, T, 1430 xIcon + W + 2 - BiColorTextWidth(Dst.Canvas, S), yIcon, S); 1430 1431 1431 1432 if (Kind = 12) and (val >= 100) then … … 1441 1442 for I := 0 to val mod 10 - 1 do 1442 1443 begin 1443 BitBltCanvas( dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 2 + 1, 14,1444 BitBltCanvas(Dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 2 + 1, 14, 1444 1445 14, HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15, 1445 1446 70 + Kind div 8 * 15, SRCAND); 1446 Sprite( dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,1447 Sprite(Dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2, 1447 1448 14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15); 1448 1449 end; 1449 1450 for I := 0 to val div 10 - 1 do 1450 1451 begin 1451 BitBltCanvas( dst.Canvas, xIcon + 4 + (val mod 10) *1452 BitBltCanvas(Dst.Canvas, xIcon + 4 + (val mod 10) * 1452 1453 (14 * ld div sd) + I * (14 * ld div sd), yIcon + 3, 14, 14, 1453 1454 HGrSystem.Mask.Canvas, 67 + 7 mod 8 * 15, 1454 1455 70 + 7 div 8 * 15, SRCAND); 1455 Sprite( dst, HGrSystem, xIcon + 3 + (val mod 10) *1456 Sprite(Dst, HGrSystem, xIcon + 3 + (val mod 10) * 1456 1457 (14 * ld div sd) + I * (14 * ld div sd), yIcon + 2, 14, 1457 1458 14, 67 + 7 mod 8 * 15, … … 1474 1475 for I := 0 to val div 10 - 1 do 1475 1476 begin 1476 BitBltCanvas( dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 3, 14, 14,1477 BitBltCanvas(Dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 3, 14, 14, 1477 1478 HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15, 1478 1479 70 + Kind div 8 * 15, SRCAND); 1479 Sprite( dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,1480 Sprite(Dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2, 1480 1481 14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15); 1481 1482 end; 1482 1483 for I := 0 to val mod 10 - 1 do 1483 1484 begin 1484 BitBltCanvas( dst.Canvas, xIcon + 4 + (val div 10) *1485 BitBltCanvas(Dst.Canvas, xIcon + 4 + (val div 10) * 1485 1486 (14 * ld div sd) + I * (10 * ld div sd), yIcon + 7, 10, 10, 1486 1487 HGrSystem.Mask.Canvas, 66 + Kind mod 11 * 11, 1487 1488 115 + Kind div 11 * 11, SRCAND); 1488 Sprite( dst, HGrSystem, xIcon + 3 + (val div 10) *1489 Sprite(Dst, HGrSystem, xIcon + 3 + (val div 10) * 1489 1490 (14 * ld div sd) + I * (10 * ld div sd), yIcon + 6, 10, 1490 1491 10, 66 + Kind mod 11 * 11,
Note:
See TracChangeset
for help on using the changeset viewer.