procedure TodvKoGame.Resize;
var
W: Integer;
KOG: TodKoGame;
dt: TDatetime;
procedure d(i: Integer);
procedure Swap(
var i, j: tda);
var
H: tda;
begin
H := i;
i := j;
j := H;
end;
procedure Sort;
var
i, j: Integer;
begin
for i := Low(da)
to High(da) - 1
do
for j := i + 1
to High(da)
do
begin
if da[j].dt > da[i].dt
then
Swap(da[i], da[j]);
end;
end;
begin
dt := now - dt;
da[i].nr := i;
da[i].dt := da[i].dt + dt;
if i = high(da)
then
begin
inc(
dc);
if dc = 240
then
begin
Sort;
for i := Low(da)
to High(da)
do
codesite.send(pchar(FormatDateTime('
ss.zzz', da[i].dt) + '
: ' + inttostr(da[i].nr)));
dc := 0;
end;
end;
dt := now;
end;
begin
PaintBackground;
KOG := KoGame;
if KOG <>
nil then
begin
// inc(xxxr);
// outputdebugstring(pchar('Resize: ' + inttostr(xxxr)));
dt := now;
if odvLinkIn1.BevelOuter <> bvNone
then
odvLinkIn1.BevelOuter := bvNone;
d(1);
if odPanelGameParty1.BevelOuter <> bvNone
then
odPanelGameParty1.BevelOuter := bvNone;
d(2);
if odvLinkIn2.BevelOuter <> bvNone
then
odvLinkIn2.BevelOuter := bvNone;
d(3);
if odPanelGameParty2.BevelOuter <> bvNone
then
odPanelGameParty2.BevelOuter := bvNone;
d(4);
if odvLinkOutWin.BevelOuter <> bvNone
then
odvLinkOutWin.BevelOuter := bvNone;
d(5);
if odvLinkOutLose.BevelOuter <> bvNone
then
odvLinkOutLose.BevelOuter := bvNone;
d(6);
W := Pred(Width);
d(7);
odvLinkIn1.Visible := True;
d(8);
odPanelGameParty1.Visible := True;
d(9);
if KOG.ToLeft
then
odvLinkIn1.SetBounds(W - 24, Succ(LineTop), 24, Pred(LineTop))
// <---
else
odvLinkIn1.SetBounds(0, Succ(LineTop), 24, Pred(LineTop));
// <---
d(10);
if KOG.ToLeft
then
odPanelGameParty1.SetBounds(1, Succ(LineTop), W - 24, Pred(LineTop))
else
odPanelGameParty1.SetBounds(24, Succ(LineTop), W - 24, Pred(LineTop));
d(11);
odvLinkIn2.Visible := True;
d(12);
odPanelGameParty2.Visible := True;
d(13);
if KOG.ToLeft
then
odvLinkIn2.SetBounds(W - 24, LineBottom - LineTop, 24, Pred(LineTop))
else
odvLinkIn2.SetBounds(0, LineBottom - LineTop, 24, Pred(LineTop));
d(14);
if KOG.ToLeft
then
odPanelGameParty2.SetBounds(2, LineBottom - LineTop, W - 24, Pred(LineTop))
else
odPanelGameParty2.SetBounds(24, LineBottom - LineTop, W - 24, Pred(LineTop));
d(15);
odvLinkOutWin.Visible := True;
d(16);
if KOG.ToLeft
then
odvLinkOutWin.SetBounds(1, (Height
div 2) - (Pred(LineTop)
div 2) - 1, 24, Pred(LineTop))
else
odvLinkOutWin.SetBounds(Width - odvLinkOutWin.Width - 1, (Height
div 2) - (Pred(LineTop)
div 2) - 1, 24, Pred(LineTop));
d(17);
odvLinkOutLose.Visible := True;
d(18);
if KOG.ToLeft
then
odvLinkOutLose.SetBounds(Width - odvLinkOutLose.Width - 1, (Height
div 2) - (Pred(LineTop)
div 2) - 1, 24, Pred(LineTop))
else
odvLinkOutLose.SetBounds(0, (Height
div 2) - (Pred(LineTop)
div 2) - 1, 24, Pred(LineTop));
d(19);
// outputdebugstring(pchar('Resize: ' + inttostr(xxxr) + ' ready'));
end
else
begin
// outputdebugstring(pchar('Resize: ' + '---------------------------'));
// odvLinkIn1.Visible := False;
// odPanelGameParty1.Visible := False;
// odvLinkIn2.Visible := False;
// odPanelGameParty2.Visible := False;
// odvLinkOutWin.Visible := False;
// odvLinkOutLose.Visible := False;
end;
end;