1 //---------------------------------------------------------------------------
8 #include "IdGlobal.hpp"
9 #include <inifiles.hpp>
12 #include "thOpenSource.h"
13 #include "SearchFrm.h"
14 //#include "SysUtils.hpp"
17 //---------------------------------------------------------------------------
18 #pragma package(smart_init)
19 #pragma resource "*.dfm"
21 //---------------------------------------------------------------------------
22 __fastcall
TFrmMain::TFrmMain(TComponent
* Owner
)
28 //---------------------------------------------------------------------------
30 void __fastcall
TFrmMain::btOpenClick(TObject
*Sender
)
32 if(OpenDialog1
->Execute()){
33 if (FileExists(OpenDialog1
->FileName
)){
38 thOpen
= new thOpenFile(false);
39 //thOpen->Priority = tpTimeCritical;
40 pnFileName
->Caption
= OpenDialog1
->FileName
;
43 pnFileName
->Caption
= "";
47 //---------------------------------------------------------------------------
48 void __fastcall
TFrmMain::btSaveClick(TObject
*Sender
)
52 SaveToFile(CurrentOpenFile
.c_str());
54 ShowMessage("Îļþδ´ò¿ªÍê³É£¡");
57 //---------------------------------------------------------------------------
59 void TFrmMain::SaveToFile(const char * pszFileName
)
67 fnsplit(pszFileName
, 0, 0, szFileName
, 0);
68 strcat(szFileName
, "_new.dbc");
71 AnsiString NewFileName
=ExtractFilePath(Application
->ExeName
)+szFileName
;//=pszFileName;
72 int iFileHandle
; //Îļþ¾ä±ú
73 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
74 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
78 CopyFileTo(pszFileName
,NewFileName
);
80 iFileHandle
= FileOpen(NewFileName
, fmOpenRead
|fmOpenWrite
);//´ò¿ªÎļþ
82 if ((stream
= fopen(CurrentOpenFile
.c_str(), "r+"))
85 ShowMessage("´ò¿ªÎļþ³ö´í");
95 FileSeek(iFileHandle
,0x14,0);
97 ini
= new TIniFile( iniSetFile
);
99 for(int i
=1; i
<sgEdit
->RowCount
; i
++)
101 for(int j
=1; j
<sgEdit
->ColCount
; j
++)
104 iVal
=StrToInt(sgEdit
->Cells
[j
][i
]);
105 FileWrite(iFileHandle
, &iVal
, 4);
108 //ColType= ini->ReadInteger(SectionName,"ColType"+IntToStr(j-1),0);
109 //thOpen->ColType[10000];
111 switch (thOpen
->ColType
[j
])
114 iVal
=StrToFloat(sgEdit
->Cells
[j
][i
]);
115 FileWrite(iFileHandle
, &iVal
, 4);
118 fVal
=StrToFloat(sgEdit
->Cells
[j
][i
]);
119 FileWrite(iFileHandle
, &fVal
, 4);
122 fseek(stream
, 0x14+(i
*(sgEdit
->ColCount
-1)+(j
-1))*4, 0);
123 fread(&iVal
, 4, 1, stream
);
124 FileWrite(iFileHandle
, &iVal
, 4);
127 iVal
=StrToFloat(sgEdit
->Cells
[j
][i
]);
128 FileWrite(iFileHandle
, &iVal
, 4);
133 FileClose(iFileHandle
);
137 ShowMessage("Save To File:"+NewFileName
);
139 void __fastcall
TFrmMain::btIntTypeClick(TObject
*Sender
)
142 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
143 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
145 ini
= new TIniFile( iniSetFile
);
146 ini
->WriteInteger(SectionName
,"ColType"+IntToStr(sgEdit
->Col
),0);
148 thOpen
->ColType
[sgEdit
->Col
]=0;
150 //OpenFileCol(AnsiString FileName,int ColType);
151 OpenFileCol(CurrentOpenFile
,sgEdit
->Col
,0);
154 //---------------------------------------------------------------------------
157 void __fastcall
TFrmMain::btFloatTypeClick(TObject
*Sender
)
160 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
161 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
163 ini
= new TIniFile( iniSetFile
);
164 ini
->WriteInteger(SectionName
,"ColType"+IntToStr(sgEdit
->Col
),1);
166 thOpen
->ColType
[sgEdit
->Col
]=1;
167 OpenFileCol(CurrentOpenFile
,sgEdit
->Col
,1);
170 //---------------------------------------------------------------------------
172 void __fastcall
TFrmMain::PopupMenu1Popup(TObject
*Sender
)
175 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
176 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
179 ini
= new TIniFile( iniSetFile
);
180 ColType
=ini
->ReadInteger(SectionName
,"ColType"+IntToStr(sgEdit
->Col
),0);
185 btIntType
->Checked
=true;
186 btFloatType
->Checked
=false;
187 btTxtType
->Checked
=false;
190 btIntType
->Checked
=false;
191 btFloatType
->Checked
=true;
192 btTxtType
->Checked
=false;
195 btIntType
->Checked
=false;
196 btFloatType
->Checked
=false;
197 btTxtType
->Checked
=true;
200 btIntType
->Checked
=true;
201 btFloatType
->Checked
=false;
205 //---------------------------------------------------------------------------
207 void __fastcall
TFrmMain::N1Click(TObject
*Sender
)
209 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
210 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
212 FrmTitle
->edTitle
->Text
=sgEdit
->Cells
[sgEdit
->Col
][0];
213 if(FrmTitle
->ShowModal()==mrOk
){
215 ini
= new TIniFile( iniSetFile
);
216 ini
->WriteString(SectionName
,"ColTitle"+IntToStr(sgEdit
->Col
),FrmTitle
->edTitle
->Text
);
218 sgEdit
->Cells
[sgEdit
->Col
][0]=FrmTitle
->edTitle
->Text
;
221 //---------------------------------------------------------------------------
225 void __fastcall
TFrmMain::FormDestroy(TObject
*Sender
)
232 //---------------------------------------------------------------------------
234 void __fastcall
TFrmMain::ToolButton1Click(TObject
*Sender
)
237 if(FrmSearch
->ShowModal()==mrOk
){
238 switch (FrmSearch
->rgSI
->ItemIndex
)
241 for(int i
=sgEdit
->ColCount
*sgEdit
->Row
+sgEdit
->Col
-1;i
>sgEdit
->ColCount
;i
--){
242 if(i
%sgEdit
->ColCount
!=0){
243 if( 0==CompareStr(sgEdit
->Cells
[i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
)][i
/sgEdit
->ColCount
],
244 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
245 sgEdit
->Col
=i
-sgEdit
->ColCount
*i
/sgEdit
->ColCount
;
246 sgEdit
->Row
=i
/sgEdit
->ColCount
;
252 if(SeFlag
) ShowMessage("Seach Top£¬Find Nothing.");
255 for(int i
=sgEdit
->ColCount
*sgEdit
->Row
+sgEdit
->Col
+1;i
<sgEdit
->ColCount
*sgEdit
->RowCount
;i
++){
256 if(i
%sgEdit
->ColCount
!=0){
257 if( 0==CompareStr(sgEdit
->Cells
[i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
)][i
/sgEdit
->ColCount
],
258 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
259 sgEdit
->Col
=i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
);
260 sgEdit
->Row
=i
/sgEdit
->ColCount
;
266 if(SeFlag
) ShowMessage("Seach End£¬Find Nothing");
268 case 2: //µ±Ç°ÁÐÏòÉÏÕÒ;
269 for(int i
=sgEdit
->Row
;i
>1;i
--){
270 if( 0==CompareStr(sgEdit
->Cells
[sgEdit
->Col
][i
],
271 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
277 if(SeFlag
) ShowMessage("Seach col top£¬Find Nothing");
279 case 3: //µ±Ç°ÁÐÏòÏÂÕÒ;
280 for(int i
=sgEdit
->Row
;i
<sgEdit
->RowCount
;i
++){
281 if( 0==CompareStr(sgEdit
->Cells
[sgEdit
->Col
][i
],
282 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
288 if(SeFlag
) ShowMessage("Seach col end£¬Find Nothing.");
293 //---------------------------------------------------------------------------
295 void __fastcall
TFrmMain::sgEditKeyDown(TObject
*Sender
, WORD
&Key
,
301 switch (FrmSearch
->rgSI
->ItemIndex
)
304 for(int i
=sgEdit
->ColCount
*sgEdit
->Row
+sgEdit
->Col
-1;i
>sgEdit
->ColCount
;i
--){
305 if(i
%sgEdit
->ColCount
!=0){
306 if( 0==CompareStr(sgEdit
->Cells
[i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
)][i
/sgEdit
->ColCount
],
307 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
308 sgEdit
->Col
=i
-sgEdit
->ColCount
*i
/sgEdit
->ColCount
;
309 sgEdit
->Row
=i
/sgEdit
->ColCount
;
315 if(SeFlag
) ShowMessage("Seach Top£¬Find Nothing.");
318 for(int i
=sgEdit
->ColCount
*sgEdit
->Row
+sgEdit
->Col
+1;i
<sgEdit
->ColCount
*sgEdit
->RowCount
;i
++){
319 if(i
%sgEdit
->ColCount
!=0){
320 if( 0==CompareStr(sgEdit
->Cells
[i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
)][i
/sgEdit
->ColCount
],
321 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
322 sgEdit
->Col
=i
-sgEdit
->ColCount
*(i
/sgEdit
->ColCount
);
323 sgEdit
->Row
=i
/sgEdit
->ColCount
;
329 if(SeFlag
) ShowMessage("Seach End£¬Find Nothing.");
331 case 2: //µ±Ç°ÁÐÏòÉÏÕÒ;
332 for(int i
=sgEdit
->Row
;i
>1;i
--){
333 if( 0==CompareStr(sgEdit
->Cells
[sgEdit
->Col
][i
],
334 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
340 if(SeFlag
) ShowMessage("Seach col Top£¬Find Nothing.");
342 case 3: //µ±Ç°ÁÐÏòÏÂÕÒ;
343 for(int i
=sgEdit
->Row
;i
<sgEdit
->RowCount
;i
++){
344 if( 0==CompareStr(sgEdit
->Cells
[sgEdit
->Col
][i
],
345 FrmSearch
->edSeach
->Text
)){ //ÕÒµ½ÁË
351 if(SeFlag
) ShowMessage("Seach col end£¬Find Nothing.");
356 //---------------------------------------------------------------------------
358 void __fastcall
TFrmMain::sgEditSelectCell(TObject
*Sender
, int ACol
,
359 int ARow
, bool &CanSelect
)
363 //---------------------------------------------------------------------------
364 void __fastcall
TFrmMain::OpenFileCol(AnsiString FileName
,int ColIndex
,int ColType
)
366 int iFileHandle
; //Îļþ¾ä±ú
372 DWORD dwRows
, dwCols
, dwRowLen
, dwTextLen
;
374 DWORD dwTextStartPos
;
378 if ((stream
= fopen(FileName
.c_str(), "r+"))
381 ShowMessage("Open File Error");
385 curpos
= ftell(stream
);
386 fseek(stream
, 0L, SEEK_END
);
387 length
= ftell(stream
);
393 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
394 fseek(stream
, 0x14+(i
*(sgEdit
->ColCount
-1)+(ColIndex
-1))*4, 0);
395 fread(&iVal
, 4, 1, stream
);
396 sgEdit
->Cells
[ColIndex
][i
+1]=IntToStr(iVal
);
399 case 1: //¸¡µãÖµ Float
400 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
401 fseek(stream
, 0x14+(i
*(sgEdit
->ColCount
-1)+(ColIndex
-1))*4, 0);
402 fread(&fVal
, 4, 1, stream
);
403 sgEdit
->Cells
[ColIndex
][i
+1]=FloatToStr(fVal
);
408 fread(&iVal
, 4, 1, stream
);
410 fread(&iVal
, 4, 1, stream
);
412 fread(&iVal
, 4, 1, stream
);
414 fread(&iVal
, 4, 1, stream
);
417 dwTextStartPos
= dwRows
*dwRowLen
+20;
418 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
419 fseek(stream
, 0x14+(i
*(sgEdit
->ColCount
-1)+(ColIndex
-1))*4, 0);
420 fread(&iVal
, 4, 1, stream
);
421 sgEdit
->Cells
[ColIndex
][i
+1]=IntToStr(iVal
);
422 if(dwTextStartPos
+ iVal
< length
){
423 fseek(stream
,dwTextStartPos
+ iVal
,0);
424 fread(Txtbuf
, 1, 255, stream
);
425 //pTextPtr = pBuff + dwTextStartPos + lTemp;
426 sgEdit
->Cells
[ColIndex
][i
+1]=Txtbuf
;
428 sgEdit
->Cells
[ColIndex
][i
+1]="This Col Not Text!";
435 void __fastcall
TFrmMain::Timer1Timer(TObject
*Sender
)
438 lbOpState
->Caption
= "Open File Ok.";
440 lbOpState
->Caption
= "Open Now.....";
443 //---------------------------------------------------------------------------
444 //µ±Ç°¸ñ×ÓдÈëÐÞ¸ÄÎļþÖÐ
445 void __fastcall
TFrmMain::N4Click(TObject
*Sender
)
449 int iFileHandle
; //Îļþ¾ä±ú
455 if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
458 ShowMessage("´ò¿ªÎļþ³ö´í");
462 iFileHandle
= FileOpen(CurrentOpenFile
, fmOpenRead
|fmOpenWrite
);//´ò¿ªÎļþ
464 switch (thOpen
->ColType
[sgEdit
->Col
])
467 //for(int i=0;i<sgEdit->RowCount-1;i++){
469 fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
470 iVal=StrToInt(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
471 memcpy(buf, &iVal, 4);
473 fwrite(buf+i, 1, 1, stream);
475 iVal
=StrToInt(sgEdit
->Cells
[sgEdit
->Col
][sgEdit
->Row
]);
476 memcpy(buf
, &iVal
, 4);
477 FileSeek(iFileHandle
,0x14+((sgEdit
->Row
-1)*(sgEdit
->ColCount
-1)+(sgEdit
->Col
-1))*4,0);
478 FileWrite(iFileHandle
,buf
,4);
482 //fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
483 //fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][sgEdit->Row]);
484 //fwrite(&fVal, 4, 1, stream);
485 fVal
=StrToFloat(sgEdit
->Cells
[sgEdit
->Col
][sgEdit
->Row
]);
486 memcpy(buf
, &fVal
, 4);
487 FileSeek(iFileHandle
,0x14+((sgEdit
->Row
-1)*(sgEdit
->ColCount
-1)+(sgEdit
->Col
-1))*4,0);
488 FileWrite(iFileHandle
,buf
,4);
495 FileClose(iFileHandle
);
497 //---------------------------------------------------------------------------
499 void __fastcall
TFrmMain::btTxtTypeClick(TObject
*Sender
)
502 AnsiString iniSetFile
=ExtractFilePath(Application
->ExeName
)+"BcdEditer.ini";
503 AnsiString SectionName
=ExtractFileName(CurrentOpenFile
);
505 ini
= new TIniFile( iniSetFile
);
506 ini
->WriteInteger(SectionName
,"ColType"+IntToStr(sgEdit
->Col
),2);
508 thOpen
->ColType
[sgEdit
->Col
]=2;
509 OpenFileCol(CurrentOpenFile
,sgEdit
->Col
,2);
512 //---------------------------------------------------------------------------
514 void __fastcall
TFrmMain::ToolButton3Click(TObject
*Sender
)
520 if(sgEdit
->FixedCols
==1){
521 sgEdit
->FixedCols
=2;
526 sgEdit
->FixedCols
=1;
532 //---------------------------------------------------------------------------
534 void __fastcall
TFrmMain::btRowSaveClick(TObject
*Sender
)
536 if(OpenOk
==false) return;
538 int iFileHandle
; //Îļþ¾ä±ú
545 DWORD dwRows
, dwCols
, dwRowLen
, dwTextLen
;
547 DWORD dwTextStartPos
;
551 //if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
554 // ShowMessage("´ò¿ªÎļþ³ö´í");
558 //curpos = ftell(stream);
559 //fseek(stream, 0L, SEEK_END);
560 //length = ftell(stream);
561 iFileHandle
= FileOpen(CurrentOpenFile
, fmOpenRead
|fmOpenWrite
);//´ò¿ªÎļþ
563 for(int i
=0;i
<sgEdit
->ColCount
-1;i
++){
564 switch (thOpen
->ColType
[i
])
566 case 0: //ÕûÐÍÖµ sgEdit->Row
567 //fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4, 0);
568 //iVal=StrToInt(sgEdit->Cells[i+1][sgEdit->Row]);
569 //fwrite(&iVal, 4, 1, stream);
570 iVal
=StrToInt(sgEdit
->Cells
[i
+1][sgEdit
->Row
]);
571 memcpy(buf
, &iVal
, 4);
572 FileSeek(iFileHandle
,0x14+((sgEdit
->Row
-1)*(sgEdit
->ColCount
-1)+i
)*4,0);
573 FileWrite(iFileHandle
,buf
,4);
576 //fseek(stream, 0x14+((sgEdit->Row-1)*(sgEdit->ColCount-1)+i)*4, 0);
577 //fVal=StrToFloat(sgEdit->Cells[i+1][sgEdit->Row]);
578 //fwrite(&fVal, 4, 1, stream);
579 fVal
=StrToFloat(sgEdit
->Cells
[i
+1][sgEdit
->Row
]);
580 memcpy(buf
, &fVal
, 4);
581 FileSeek(iFileHandle
,0x14+((sgEdit
->Row
-1)*(sgEdit
->ColCount
-1)+i
)*4,0);
582 FileWrite(iFileHandle
,buf
,4);
589 FileClose(iFileHandle
);
590 ShowMessage("The "+IntToStr(sgEdit
->Row
)+" Row Write Ok!");
592 //---------------------------------------------------------------------------
594 void __fastcall
TFrmMain::btColSaveClick(TObject
*Sender
)
596 if(OpenOk
==false) return;
598 int iFileHandle
; //Îļþ¾ä±ú
605 DWORD dwRows
, dwCols
, dwRowLen
, dwTextLen
;
607 DWORD dwTextStartPos
;
610 iFileHandle
= FileOpen(CurrentOpenFile
, fmOpenRead
|fmOpenWrite
);//´ò¿ªÎļþ
612 //if ((stream = fopen(CurrentOpenFile.c_str(), "r+"))
615 // ShowMessage("´ò¿ªÎļþ³ö´í");
619 //curpos = ftell(stream);
620 //fseek(stream, 0L, SEEK_END);
621 //length = ftell(stream);
624 switch (thOpen
->ColType
[sgEdit
->Col
])
627 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
628 //fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
629 //iVal=StrToInt(sgEdit->Cells[sgEdit->Col][i+1]);
630 //fwrite(&iVal, 4, 1, stream);
631 iVal
=StrToInt(sgEdit
->Cells
[sgEdit
->Col
][i
+1]);
632 memcpy(buf
, &iVal
, 4);
633 FileSeek(iFileHandle
,0x14+(i
*(sgEdit
->ColCount
-1)+(sgEdit
->Col
-1))*4,0);
634 FileWrite(iFileHandle
,buf
,4);
638 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
639 //fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
640 //fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][i+1]);
641 //fwrite(&fVal, 4, 1, stream);
642 fVal
=StrToFloat(sgEdit
->Cells
[sgEdit
->Col
][i
+1]);
643 memcpy(buf
, &fVal
, 4);
644 FileSeek(iFileHandle
,0x14+(i
*(sgEdit
->ColCount
-1)+(sgEdit
->Col
-1))*4,0);
645 FileWrite(iFileHandle
,buf
,4);
653 FileClose(iFileHandle
);
654 ShowMessage("The "+IntToStr(sgEdit
->Col
)+"Col Write Ok!");
656 //---------------------------------------------------------------------------
658 void __fastcall
TFrmMain::btRowClearClick(TObject
*Sender
)
660 if(OpenOk
==false) return;
662 int iFileHandle
; //Îļþ¾ä±ú
668 DWORD dwRows
, dwCols
, dwRowLen
, dwTextLen
;
670 DWORD dwTextStartPos
;
674 if ((stream
= fopen(CurrentOpenFile
.c_str(), "r+"))
677 ShowMessage("Open File Error!");
681 curpos
= ftell(stream
);
682 fseek(stream
, 0L, SEEK_END
);
683 length
= ftell(stream
);
685 for(int i
=1;i
<sgEdit
->ColCount
-1;i
++){
686 switch (thOpen
->ColType
[i
])
688 case 0: //ÕûÐÍÖµ sgEdit->Row
689 //fseek(stream, 0x14+(sgEdit->Row*(sgEdit->ColCount-1)+i)*4, 0);
690 //iVal=StrToInt(sgEdit->Cells[i+1][sgEdit->Row]);
691 //fwrite(&iVal, 4, 1, stream);
692 sgEdit
->Cells
[i
+1][sgEdit
->Row
]="0";
695 //fseek(stream, 0x14+(sgEdit->Row*(sgEdit->ColCount-1)+i)*4, 0);
696 //fVal=StrToFloat(sgEdit->Cells[i+1][sgEdit->Row]);
697 //fwrite(&fVal, 4, 1, stream);
698 sgEdit
->Cells
[i
+1][sgEdit
->Row
]="0";
706 //---------------------------------------------------------------------------
708 void __fastcall
TFrmMain::btColClearClick(TObject
*Sender
)
710 if(OpenOk
==false) return;
712 int iFileHandle
; //Îļþ¾ä±ú
718 DWORD dwRows
, dwCols
, dwRowLen
, dwTextLen
;
720 DWORD dwTextStartPos
;
724 if ((stream
= fopen(CurrentOpenFile
.c_str(), "r+"))
727 ShowMessage("Open File Error!");
731 curpos
= ftell(stream
);
732 fseek(stream
, 0L, SEEK_END
);
733 length
= ftell(stream
);
736 switch (thOpen
->ColType
[sgEdit
->Col
])
739 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
740 //fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
741 //iVal=StrToInt(sgEdit->Cells[ColIndex][i+1]);
742 //fwrite(&iVal, 4, 1, stream);
743 sgEdit
->Cells
[sgEdit
->Col
][i
+1]="0";
747 for(int i
=0;i
<sgEdit
->RowCount
-1;i
++){
748 //fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
749 //fVal=StrToFloat(sgEdit->Cells[ColIndex][i+1]);
750 //fwrite(&fVal, 4, 1, stream);
751 sgEdit
->Cells
[sgEdit
->Col
][i
+1]="0";
759 //---------------------------------------------------------------------------
761 void __fastcall
TFrmMain::ToolButton4Click(TObject
*Sender
)
765 WinExec(Cmd
.c_str(), SW_SHOWNORMAL
);
767 //---------------------------------------------------------------------------