Registriert seit: 26. Nov 2003
Ort: Halle/Saale
4.343 Beiträge
Delphi 11 Alexandria
|
AW: Vpe
10. Mai 2013, 13:46
Wenn ich Dich richtig verstehe könnte Dir nBottom in Verbindung mit RenderWrite weiter helfen.
Das ist halt nicht sehr komfortabel.
Ich hatte dem Hersteller mal einen SoftPageBreak vorgeschlagen. Man könnte dann einen solchen setzen und falls die nächste(n) Aktion(en) einen Seitenwechsel benötigen würden, sollte das Framework diesen hart einfügen. Sie wollten das aufnehmen, aber so häufig tut sich da scheinbar nichts...
Mal ein Beispiel anbei. Ich brauche da zwar keinen Seitenwechsel aber vielleicht findest Du eine Anregung.
Delphi-Quellcode:
procedure TodGame.ExportVPE;
var
T: Double;
S: String;
TW, TH, XC, Y1, Y2, YGP: Double;
I, C: Integer;
H, W: Double;
SP: TodSetPoints;
procedure WriteGameParty(L, T, W, H: Double; GameParty: TodGameParty; RightFlag: Boolean);
var
S: String;
SL, PL, PW: Double;
I, C: Integer;
Player: TodPlayer;
PlayerName: String;
begin
StahliSportOptions.GamePaperPictures := gppLarge;
with VPEStahliSport do
begin
if IsDoubleGame then
C := 2
else
C := 1;
if odExist(GameParty.Team) then
begin
BKGMode := VBKG_SOLID;
BKGColor := ColorLightness(clBlue, 235);
WriteBox(L, T, W, VFREE, '[N CE]' + GameParty.Team.LongName);
if C = 2 then
begin
T := T + 1;
// H := H - 1;
end
else
begin
T := T + 0.75;
// H := H - 0.75;
end;
BKGColor := clWhite;
BKGMode := VBKG_TRANSPARENT;
end;
for I := 1 to C do
begin
case I of
1:
begin
Player := GameParty.Player1;
PlayerName := VPEPlayerName(Player, True, True);
end;
2:
begin
Player := GameParty.Player2;
PlayerName := VPEPlayerName(Player, True, True);
end
else
begin
Player := nil;
PlayerName := '';
end;
end;
Write(L, T, W, VFREE, PlayerName);
if not odExist(GameParty.Team) then
begin
if Player <> nil then
S := Player.GetClubName
else
S := '';;
if S = '' then
S := ' ';
TextColor := clGray;
Write(L, nBottom, W, VFREE, '[N CE]' + S);
end;
TextColor := clBlack;
WriteBox(L, T, W, nBottom, '');
T := nBottom;
if StahliSportOptions.GamePaperPictures <> gppNone then
begin
S := '';
if Player <> nil then
begin
if Player <> PlayerBye then
begin
S := PathTmp + 'PersonPicture' + Player.Person.odId + '.bmp';
Player.Person.PictureStream.SaveToFile(S);
if C > 1 then
begin
PW := (W / C) - (W / 10);
if not RightFlag then
PL := L + Abs(W) - Abs(PW)
else
PL := L;
Picture(PL, T, PW, PW, S);
end
else
begin
case StahliSportOptions.GamePaperPictures of
gppLarge:
begin
PW := W;
PL := L;
Picture(PL, T, PW, PW, S);
end;
gppSmall:
begin
PW := W / 2;
if not RightFlag then
PL := L + Abs(W) - Abs(PW)
else
PL := L;
Picture(PL, T, PW, PW, S);
end;
end;
end;
end;
end;
end;
T := nBottom;
if not RightFlag then
SL := nRightMargin - 4
else
SL := nLeftMargin;
WriteBox(SL, nBottomMargin - 1.5, -4, -1.5, '[N CE S 10 I C Gray]Zeichen');
end;
end;
end;
begin
with VPEStahliSport do
begin
// Margin := 1.3;
XC := nLeftMargin + ((nRightMargin - nLeftMargin) / 2);
T := nBottom + 0.25;
S := 'Spielzettel';
S := ' ' + S + ' ';
RenderWrite(0, 0, VFREE, VFREE, '[N S 12 CE I C White BC Gray U TO AO]' + S);
TW := nRenderWidth;
// TH := nRenderHeight;
WriteBox(nLeftMargin, nTopMargin, nRightMargin, nBottomMargin, '');
Write(XC - (TW / 2), T, -TW, VFREE, '[N S 12 CE I C White BC Gray U TO AO]' + S);
Write(XC - (TW / 2) + 0.01, T, -TW, VFREE, '[N S 12 CE I C Blue U T AO]' + S);
Y1 := T; // nBottom + 0.5;
PenSize := 0.01;
S := te.Sport.SportPlaceName;
if S = '' then
S := 'Feld';
Write(nLeftMargin + 1, Y1, VFREE, VFREE, S + '-Nr.');
Y2 := nBottom;
WriteBox(nLeftMargin + 1, Y2, -1.5, -0.75, '');
S := CourtName;
RenderWrite(0, 0, VFREE, VFREE, S);
// TW := nRenderWidth;
TH := nRenderHeight;
Write(nLeftMargin + 1, Y2 + (0.75 / 2) - (TH / 2), -1.5, VFREE, '[N CE]' + S);
PenSize := 0.03;
{
PenSize := 0.01;
Write(nLeftMargin + 5, Y1, VFREE, VFREE, 'Beginn');
WriteBox(nLeftMargin + 5, nBottom, -4, -0.75, '');
if StartTime > 0 then
S := FormatDateTime('dd.mm.yyyy, hh:nn', StartTime) + ' Uhr'
else
S := '';
RenderWrite(0, 0, VFREE, VFREE, S);
TW := nRenderWidth;
TH := nRenderHeight;
Write(nLeftMargin + 5, Y2 + (0.75 / 2) - (TH / 2), -4, VFREE, '[N CE]' + S);
PenSize := 0.03;
}
Y1 := nBottom + 0.5;
PenSize := 0.01;
S := 'Spiel';
RenderWrite(0, 0, VFREE, VFREE, S);
TW := nRenderWidth;
// TH := nRenderHeight;
Write(XC - (TW / 2), Y1, VFREE, VFREE, S);
Y2 := nBottom;
S := Self.GameName(False);
RenderWrite(0, 0, VFREE, VFREE, S);
// TW := nRenderWidth;
TH := nRenderHeight;
Write(XC - 1, Y2 + (0.75 / 2) - (TH / 2), -2, VFREE, '[N CE]' + S);
WriteBox(XC - 1, Y2, -2, -0.75, '');
PenSize := 0.03;
YGP := Y2;
S := ':';
RenderWrite(0, 0, VFREE, VFREE, S);
TW := nRenderWidth;
TH := nRenderHeight;
C := GetMaxSetCount(Numerator);
H := 5 / C;
W := 2.25;
if H > 2 then
H := 2;
for I := 0 to C - 1 do
begin
SP := GamePoints.SetPointsList.SetPoints(I);
Y1 := nBottom + 0.2;
S := ':';
Write(XC - (TW / 2), Y1 + (H / 2) - (TH / 2), VFREE, VFREE, S);
if Assigned(SP) then
S := SP.SetPoint1.Text
else
S := '';
Write(XC - W - 0.25, Y1 + (H / 2) - (TH / 2), -W, -H, '[N CE]' + S);
WriteBox(XC - W - 0.25, Y1, -W, -H, '');
if Assigned(SP) then
S := SP.SetPoint2.Text
else
S := '';
Write(XC + 0.25, Y1 + (H / 2) - (TH / 2), -W, -H, '[N CE]' + S);
WriteBox(XC + 0.25, Y1, -W, -H, '');
end;
W := 6;
PenSize := 0.01;
WriteGameParty(nLeftMargin + 0.5, YGP, -W, -7, GamePartyContainer1.GameParty, False);
WriteGameParty(nRightMargin - W - 0.5, YGP, -W, -7, GamePartyContainer2.GameParty, True);
PenSize := 0.03;
end;
end;
|