Курсовая работа: Работа со списками
l1.color=clbSecond->Selected;
LineBufer.change(i,l1);
}//end if
}//next i
LoadLines(chkSecondary->Checked);
}
//---------------------------------------------------------------------------
int WhichObject (int number) {
int object=0;
int i=0;
while (i<number){object++;i+=Objects.getvalue(object);}
if (object==0) object=1;
return (object);
}//end function
//---------------------------------------------------------------------------
void __fastcall TfrmMain::ListBox1Click(TObject *Sender)
{
Tline l1;
l1=LineBufer.getvalue(ListBox1->ItemIndex+1);
frmMain->lblPicture->Refresh();
LoadLines(chkSecondary->Checked);
for (int i=2;i>0;i--){
frmMain->lblPicture->Canvas->Pen->Color=clbSelect->Selected;
frmMain->lblPicture->Canvas->Ellipse(l1.p1.x-i,l1.p1.y-i,l1.p1.x+i,l1.p1.y+i);
frmMain->lblPicture->Canvas->Ellipse(l1.p2.x-i,l1.p2.y-i,l1.p2.x+i,l1.p2.y+i);
frmMain->lblPicture->Canvas->MoveTo(l1.p1.x,l1.p1.y);
frmMain->lblPicture->Canvas->LineTo(l1.p2.x,l1.p2.y);
}//next
}