Курсовая работа: Работа со списками
Lines.add(l1,"Rectangle");
l1.p1.x=x1;l1.p1.y=y2;l1.p2.x=x1;l1.p2.y=y1;l1.color=col;l1.secondary=false;
Lines.add(l1,"Rectangle");
return (Lines);
}//end function
//=========
//Переменные
queue <Tline> LineBufer;
int n=0;
Tline l1,l2;
queue <int> Objects;
//=========
//---------------------------------------------------------------------------
__fastcall TfrmMain::TfrmMain(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void LoadLines(bool sec){
Tline l1;
int checkedItem=frmMain->ListBox1->ItemIndex;
frmMain->ListBox1->Clear();
frmMain->lstObjects->Clear();
for (int i=1;i<=LineBufer.count();i++){
l1=LineBufer.getvalue(i);
frmMain->lblPicture->Canvas->Pen->Color=l1.color;
if ((sec && l1.secondary)||!l1.secondary){
if (l1.secondary) frmMain->lblPicture->Canvas->Pen->Style=2; else frmMain->lblPicture->Canvas->Pen->Style=0;
frmMain->lblPicture->Canvas->MoveTo(l1.p1.x,l1.p1.y);