Hirdetés
- Lassacskán fenyőfát állítanak a hardverek
- Tudjuk, de nem tesszük: a magyarok többsége nem törődik adatai védelmével
- Mesébe illő csodakábelt tervezett a GeForce-ok leégése ellen a Segotep?
- Irodát kért, de gyárat kapott Elon Musk a Samsungtól
- Nyílt forráskódú lett a legegyszerűbben használható AI tartalomgeneráló
- Mesébe illő csodakábelt tervezett a GeForce-ok leégése ellen a Segotep?
- 5.1, 7.1 és gamer fejhallgatók
- ZIDOO médialejátszók
- Milyen videókártyát?
- Apple asztali gépek
- Notebook / laptop alkatrészek cseréje (processzor, RAM, HDD)
- Milyen házat vegyek?
- Szünetmentes tápegységek (UPS)
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Több száz játékban kezdi meg karrierjét az FSR Redstone
Új hozzászólás Aktív témák
-
tusi74
őstag
Eddig én is eljutottam, csak nem jövök, rá, melyik kódot hová kell
copy-paste-zni, hogy működjön.
Eddig, ha így szereztem kódot, akkor egyértelmű volt, hogy melyik eseményhez
melyik eljárást kell írni. De most pl. Van külön type stb, és nem tudom beilleszteni
az én programomba.
type
TrecPrintStrGrid = Record
PrCanvas : TCanvas; //Printer or PaintBox Canvas
sGrid: TStringGrid; //StringGrid containing data
sTitle: String; //Title of document
bPrintFlag : Boolean; //Print if True
ptXYOffset : TPoint; //Left and Top margins
ftTitleFont : TFont; //Font for Title
ftHeadingFont : TFont; //Font for Heading row
ftDataFont : TFont; //Font for Data
bBorderFlag : Boolean //Print border if True
end;
var
recPrintStrGrid : TrecPrintStrGrid;
procedure PrintGrid(ArecPrintStrGrid : TrecPrintStrGrid);
var
iX1, iX2, iY1, iY2, iY3, iTmp , iLoop, iWd : Integer;
trTextRect : TRect;
begin
iWd := 0;
with ArecPrintStrGrid, PrCanvas do
begin
//Calculate Total Width of String Grid
Font := ftHeadingFont;
for iLoop := 0 to sGrid.ColCount-1 do
begin
if (TextWidth(sGrid.Cells[iLoop, 0])+5) < sGrid.ColWidths[iLoop] then
iWd := iWd + sGrid.ColWidths[iLoop]
else
iWd := iWd + TextWidth(sGrid.Cells[iLoop, 0])+5;
end; // for sGrid.ColCount
//Initialize Printer
if bPrintFlag then
begin
Printer.Title := sTitle;
Printer.BeginDoc;
end;
//Output Title
Pen.Color := clBlack;
Font := ftTitleFont;
TextOut(((iWd Div 2) - (TextWidth(sTitle) Div 2)), ptXYOffset.Y, sTitle);
//Output Column Data
for iLoop := 0 to sGrid.ColCount-1 do
begin
Font := ftHeadingFont;
iX1 := ptXYOffset.X;
for iTmp := 0 to (iLoop-1) do
if (TextWidth(sGrid.Cells[iTmp, 0])+5) < (sGrid.ColWidths[iTmp]) then
iX1 := iX1 + (sGrid.ColWidths[iTmp])
else
iX1 := iX1 + TextWidth(sGrid.Cells[iTmp, 0])+5;
iY1 := ptXYOffset.Y + ((TextHeight('Ag')+5) * 2);
iX2 := ptXYOffset.X;
for iTmp := 0 to iLoop do
if (TextWidth(sGrid.Cells[iTmp, 0])+5) < (sGrid.ColWidths[iTmp]) then
iX2 := iX2 + (sGrid.ColWidths[iTmp])
else
iX2 := iX2 + TextWidth(sGrid.Cells[iTmp, 0])+5;
iY2 := iY1 + TextHeight('Ag');
trTextRect := Rect(iX1, iY1, iX2, iY2);
TextRect(trTextRect, trTextRect.Left+5, trTextRect.Top+3, sGrid.Cells[iLoop, 0]);
Brush.Color := clWhite;
if bBorderFlag then FrameRect(trTextRect);
Brush.Style := bsClear;
//Output Row Data
Font := ftDataFont;
iY1 := iY2;
iY3 := TextHeight('Ag')+5;
for iTmp := 1 to sGrid.RowCount-1 do
begin
iY2 := iY1 + iY3;
trTextRect := Rect(iX1, iY1, iX2, iY2);
TextRect(trTextRect, trTextRect.Left+5, trTextRect.Top+3, sGrid.Cells[iLoop, iTmp]);
Brush.Color := clBlack;
if bBorderFlag then FrameRect(trTextRect);
Brush.Style := bsClear;
iY1 := iY1 + iY3;
end; // for sGrid.RowCount-1 do
end; // for sGrid.ColCount-1
if bPrintFlag then Printer.EndDoc;
end; // with ArecPrintStrGrid, prCanvas
end; { PrintGrid }
procedure TfrmSamp.buPrintClick(Sender: TObject);
begin
with recPrintStrGrid do
begin
PrCanvas := pbPreview.Canvas;
sGrid := stgData;
sTitle := 'Print of String Grid';
bPrintFlag := False;
ptXYOffset.X := 10;
ptXYOffset.Y := 100;
ftTitleFont := TFont.Create;
with ftTitleFont do
begin
Name := 'Arial';
Style := [fsBold, fsItalic, fsUnderLine];
Size := 14;
end;
ftHeadingFont := TFont.Create;
with ftHeadingFont do
begin
Name := 'Arial';
Style := [fsBold];
Size := 12;
end;
ftDataFont := TFont.Create;
with ftDataFont do
begin
Name := 'Arial';
Style := [];
Size := 10;
end;
bBorderFlag := True;
end; //with recPrintStrGrid do
PrintGrid(recPrintStrGrid);
end;
Új hozzászólás Aktív témák
- Építő/felújító topik
- Samsung Galaxy A56 - megbízható középszerűség
- Vivo X300 Pro – messzebbre lát, mint ameddig bírja
- ASZTALI GÉP / ALKATRÉSZ beárazás
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Magisk
- One otthoni szolgáltatások (TV, internet, telefon)
- Háztartási gépek
- Villanyszerelés
- Lexus, Toyota topik
- További aktív témák...
- Samsung S20 Ultra 5G + Galaxy Watch 5 Pro egyben, tokokkal, dobozokkal
- Eladó macbook pro 16 M1 Max 10 CPU/32 GPU 64GB 1TB
- Nálam már kapható a jelenlegi leggyorsabb brutál notebook: Samsung Galaxy Book 5 Edge 5G!
- Sony WF-G700 White- INZONE Buds vezeték nélküli zajszűrős(ANC) fülhallgató - Fekete, 2 év gari
- High-End AMD Ryzen 9 9950X3D, ASRock X870E Taichi + Dell AlienWare AW2725DF + ajándékok
- LG 27GR95QE - 27" OLED / QHD 2K / 240Hz & 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- Dell Latitude 7250 12" FHD IPS touch, i5 5300U, 8GB RAM, SSD, jó akku, számla, 6 hó gar
- Telefon felvásárlás!! iPhone 16/iPhone 16 Plus/iPhone 16 Pro/iPhone 16 Pro Max
- Vállalom Xiaomi Okoskamerák szoftveres javíttását
- Keresünk iPhone 13/13 Mini/13 Pro/13 Pro Max
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: BroadBit Hungary Kft.
Város: Budakeszi


