LabelSize->Caption = "Матрица M:";
}
ButtonStart->Enabled = false;
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::ShowMatrix(matrix *matr)
{
int row, col;
for (col = 1; col <= iSize; ++col)
for (row = 1; row <= iSize; ++row)
{
if ( matr->elem(row-1,col-1) )
MatrixGrid->Cells[col][row] = "1";
else
MatrixGrid->Cells[col][row] = "";
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::MatrixGridClick(TObject *Sender)
{
if ( iStage > 1 )
return;
/*
AnsiString asMess = "Row = " + AnsiString(MatrixGrid->Row) + "; Col = " +
AnsiString(MatrixGrid->Col);
Application->MessageBoxA(asMess.c_str(),"Cell",MB_OK);
*/
if ( MatrixGrid->Row > MatrixGrid->Col )
LinkPopup->Popup(Mouse->CursorPos.x, Mouse->CursorPos.y);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::miInformClick(TObject *Sender)
{
MatrixGrid->Cells[MatrixGrid->Col][MatrixGrid->Row] = "1";
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::miControlClick(TObject *Sender)
{
MatrixGrid->Cells[MatrixGrid->Col][MatrixGrid->Row] = "*";
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::miDeleteClick(TObject *Sender)
{
MatrixGrid->Cells[MatrixGrid->Col][MatrixGrid->Row] = "";
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::ShowMatrixGrid()
{
MatrixGrid->RowCount = iSize + 1;
MatrixGrid->ColCount = iSize + 1;
MatrixGrid->Top = LabelSize->Height + 16;