Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Domi ( 12 years ago )
void __fastcall TForm1::StringGrid1SelectCell(TObject *Sender, int ACol,
int ARow, bool &CanSelect;) {
if (StringGrid1->Row == 0)
if (!TryStrToFloat(StringGrid1->Cells[StringGrid1->Col]
[StringGrid1->Row], mas.dtp[StringGrid1->Col])) {
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row]=Buf;
if (Application->MessageBox(L"Ячейка должна быть заполнена!",
L"Ошибка", MB_OK) != IDOK) {
return;
}
}
if (StringGrid1->Row == 1)
if (!TryStrToFloat(StringGrid1->Cells[StringGrid1->Col]
[StringGrid1->Row], mas.dtpp[StringGrid1->Col])) {
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row]=Buf;
if (Application->MessageBox(L"Ячейка должна быть заполнена!",
L"Ошибка", MB_OK) != IDOK) {
return;
}
}
if (StringGrid1->Row == 2)
if (!TryStrToFloat(StringGrid1->Cells[StringGrid1->Col]
[StringGrid1->Row], mas.tem[StringGrid1->Col])) {
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row]=Buf;
if (Application->MessageBox(L"Ячейка должна быть заполнена!",
L"Ошибка", MB_OK) != IDOK) {
return;
}
}
if (StringGrid1->Row == 3)
if (!TryStrToFloat(StringGrid1->Cells[StringGrid1->Col]
[StringGrid1->Row], mas.dav[StringGrid1->Col])) {
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row]=Buf;
if (Application->MessageBox(L"Ячейка должна быть заполнена!",
L"Ошибка", MB_OK) != IDOK) {
return;
}
}
if (StringGrid1->Row == 4)
if (!TryStrToFloat(StringGrid1->Cells[StringGrid1->Col]
[StringGrid1->Row], mas.osd[StringGrid1->Col])) {
StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row]=Buf;
if (Application->MessageBox(L"Ячейка должна быть заполнена!",
L"Ошибка", MB_OK) != IDOK) {
return;
}
}
}
// ---------------------------------------------------------------------------
void __fastcall TForm1::StringGrid1GetEditText(TObject *Sender, int ACol,
int ARow, UnicodeString &Value;) {
Buf = StringGrid1->Cells[StringGrid1->Col][StringGrid1->Row];
}
Revise this Paste