Borland C++ Builder. Windows. , , .
: , , , , , .
. Borland C++ Builder , , , .
, . , . .
2
12 | 21.09.2011 | ||||
22.09.2015 | |||||
01.01.2016 | |||||
11.02.2016 | |||||
01.02.2016 | |||||
01.03.2013 | 11;:% |
1: .
2: , , .
3: , , .
4: , , .
5: , , .
6: , , .
7: , , .
.
. , .
Borland C++ Builder.
.
.
|
|
.
Project1.exe Windows, .
.
(. 7). :
;
;
;
;
;
.
. 7
Form1 (. 8).
. 8
.
.
.
.
.
.
.
.
Form3 (. 9).
. 9
.
( ) .
.
.
.
Form4 (. 10).
. 10
.
.
Form5 (. 11).
. 11
Form6 (. 12).
. 12
.
.
:
1. . .txt;
2. Web . .html.
:
1. ;
2. .
3.
3
txt | ||
JPEG png | ||
html | Web- |
|
|
, , .
, . .
, .
, .
.
:
1. .. /++. , -, 2010,240.
2. ., ., . , 2011,310.
- :
1. : http\\www.edu.sety.ru
2. :http\\www.edu.BPwin -- Dr_dimdim.ru
3. : http\\www.edu.bd.ru
4. -:http://www.cyberforum.ru/cpp-builder/thread795260.html
Form2 - .
Form1 - .
Form3 -
Form4 -
Form5 -
Form6 -
Form1:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
int GetLine(int f, AnsiString *st);
struct TSklad{
AnsiString Kod,Kol,Ed,Cena,Data,Naimenovanie;};
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form1->Close();
Form2->Show();
}
//---------------------------------------------------------------------------
int i;
void __fastcall TForm1::FormCreate(TObject *Sender)
{ StringGrid1->Cells[0][0]= " ";
StringGrid1->Cells[1][0]= " ";
StringGrid1->Cells[2][0]= " ";
StringGrid1->Cells[3][0]= "";
StringGrid1->Cells[4][0]= " ";
StringGrid1->Cells[5][0]= " ";
StringGrid1->Options << goEditing;
StringGrid1->Options << goTabs;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
int i,j;int index,index0;int Kod;int Lstr;
AnsiString Lst; TSklad Sklad1;
Sklad1.Kod = InputBox(" "," ",Kod);
Sklad1.Kol = InputBox(" "," ","");
Sklad1.Ed = InputBox(" "," ","");
Sklad1.Cena = InputBox(" "," ","");
Sklad1.Data =InputBox(" "," ","");
Sklad1.Naimenovanie = InputBox(" "," ","");
|
|
index0 = StringGrid1->RowCount;
for (i=0; i <index0;i++)
{Lst= StringGrid1->Cells[1][i];
Lstr =Lst.Length();
if (Lstr==0) break; index = i; }
if(index <(index0 -1)) StringGrid1->RowCount=(index0+1);
Kod=index +1;
StringGrid1->Cells[0][Kod]=Sklad1.Kod;
StringGrid1->Cells[1][Kod]= Sklad1.Kol;
StringGrid1->Cells[2][Kod]= Sklad1.Ed;
StringGrid1->Cells[3][Kod]= Sklad1.Cena;
StringGrid1->Cells[4][Kod]=Sklad1.Data;
StringGrid1->Cells[5][Kod]=Sklad1.Naimenovanie; }
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
StringGrid1->RowCount++;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)
{
int count=StringGrid1->RowCount;
int row=StringGrid1->Row;
if(count-StringGrid1->FixedRows <= 1) return;
for(int i=row; i < count;i++)
{
StringGrid1->Rows[i]=StringGrid1->Rows[i+1];
}
StringGrid1->RowCount--;
StringGrid1->SetFocus();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button6Click(TObject *Sender)
{
int i,j;
for(i=1; i<StringGrid1->RowCount; i++)
for(j=0; j<StringGrid1->ColCount; j++)
StringGrid1->Cells[j][i]="";
StringGrid1->RowCount=2;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
int f;
if (FileExists("TOVARI.txt"))
f= FileOpen("TOVARI.txt",fmOpenWrite);
else
f = FileCreate("TOVARI.txt");
if (f!=-1)
{ for (int i =1; i<StringGrid1->RowCount; i++)
{
AnsiString st = StringGrid1->Rows[i]->DelimitedText+"\r\n";
FileWrite(f,st.c_str(), st.Length());}
FileClose(f); }
else
ShowMessage(" ");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn3Click(TObject *Sender)
{
int f; AnsiString st;
bool f1=true;
if((f = FileOpen("TOVARI.txt",fmOpenRead))==-1)
return;
while (GetLine(f,&st)!=0)
{ if (f1)
{ StringGrid1->Rows[StringGrid1->Row] -> DelimitedText= st;
f1= false; }
else
{ StringGrid1->RowCount++;
StringGrid1->Row = StringGrid1->RowCount -1;
StringGrid1->Rows[StringGrid1->Row]-> DelimitedText=st; } }
FileClose(f);}
int GetLine (int f, AnsiString *st)
{
unsigned char buf[256];
unsigned char *p = buf;
int n;
int len = 0;
n = FileRead(f,p,1);
while (n!= 0)
{if(*p =='\r')
{ n = FileRead(f,p,1);
break;}
len++;p++;
n = FileRead(f,p,1);}
*p = '\0';
if (len!=0)
st -> printf("%s",buf);return len;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn4Click(TObject *Sender)
{
int i,j,minind,colin=1;
AnsiString minval;
TStringList *TempList=new TStringList;
if(!TempList)throw Exception(" ");
for(i=1;i<this->StringGrid1->RowCount;i++)
{
minind=i;
minval=this->StringGrid1->Cells[colin][i];
for (j=i+1;j<this->StringGrid1->RowCount;j++)
{
if(minval>this->StringGrid1->Cells[colin][j])
{
minind=j;
minval=this->StringGrid1->Cells[colin][j];
};
};
TempList->Text=this->StringGrid1->Rows[minind]->Text;
this->StringGrid1->Rows[minind]->Text=this->StringGrid1->Rows[i]->Text;
|
|
this->StringGrid1->Rows[i]->Text=TempList->Text;
};
delete TempList;
}
//---------------------------------------------------------------------------
Form2:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#include "Unit3.h"
#include "Unit4.h"
#include "Unit5.h"
#include "Unit6.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
Form1->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button2Click(TObject *Sender)
{
Form2->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button3Click(TObject *Sender)
{
Form3->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button4Click(TObject *Sender)
{
Form4->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button5Click(TObject *Sender)
{
Form5->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button6Click(TObject *Sender)
{
Form6->Show();
}
//---------------------------------------------------------------------------
Form3:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
int GetLine(int f, AnsiString *st);
void __fastcall TForm3::Button2Click(TObject *Sender)
{
Form3->Close();
Form2->Show();
}
//---------------------------------------------------------------------------
int i;
void __fastcall TForm3::FormCreate(TObject *Sender)
{ StringGrid1->Cells[0][0]= " ";
StringGrid1->Cells[1][0]= " ";
StringGrid1->Cells[2][0]= " ";
StringGrid1->Cells[3][0]= "";
StringGrid1->Cells[4][0]= " ";
StringGrid1->Cells[5][0]= " ";
StringGrid1->Options << goEditing;
StringGrid1->Options << goTabs;
StringGrid2->Cells[0][0]= " ";
StringGrid2->Cells[1][0]= " ";
StringGrid2->Cells[2][0]= " ";
StringGrid2->Cells[3][0]= "";
StringGrid2->Cells[4][0]= " ";
StringGrid2->Cells[5][0]= " ";
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button1Click(TObject *Sender)
{
int f; AnsiString st;
bool f1=true;
if((f = FileOpen("TOVARI.txt",fmOpenRead))==-1)
return;
while (GetLine(f,&st)!=0)
{ if (f1)
{ StringGrid1->Rows[StringGrid1->Row] -> DelimitedText= st;
f1= false; }
else
{ StringGrid1->RowCount++;
StringGrid1->Row = StringGrid1->RowCount -1;
StringGrid1->Rows[StringGrid1->Row]-> DelimitedText=st; } }
FileClose(f);}
int GetLine (int f, AnsiString *st)
{
unsigned char buf[256];
unsigned char *p = buf;
int n;
int len = 0;
n = FileRead(f,p,1);
while (n!= 0)
{if(*p =='\r')
{ n = FileRead(f,p,1);
break;}
len++;p++;
n = FileRead(f,p,1);}
*p = '\0';
if (len!=0)
st -> printf("%s",buf);return len;
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button6Click(TObject *Sender)
{
int i,j;
float f;
for(i=1; i<StringGrid1->RowCount; i++)
|
|
for(j=0; j<StringGrid1->ColCount; j++)
StringGrid1->Cells[j][i]="";
StringGrid1->RowCount=2;
for(i=1; i<StringGrid2->RowCount; i++)
for(j=0; j<StringGrid2->ColCount; j++)
StringGrid2->Cells[j][i]="";
StringGrid2->RowCount=2;
if(f==1)
{ Form3->Edit1->Text = "0"; }
else { Form3->Edit1->Text= ""; return;}
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button3Click(TObject *Sender)
{
StringGrid2->Visible = true;
AnsiString s1,s2;
s1 = Edit1->Text;
for (i=1; i<=StringGrid1->RowCount; i++)
{s2= StringGrid1->Cells[4][i];
if(s1==s2) break;
else {ShowMessage(" ");
StringGrid2->Visible = false;}}
StringGrid2->Rows[1]=StringGrid1->Rows[i];
}
//---------------------------------------------------------------------------
void __fastcall TForm3::BitBtn1Click(TObject *Sender)
{float f;
int i,j;
for(i=1; i<StringGrid2->RowCount; i++)
for(j=0; j<StringGrid2->ColCount; j++)
StringGrid2->Cells[j][i]="";
StringGrid2->RowCount=2;
if(f==1)
{ Form3->Edit1->Text = "0"; }
else { Form3->Edit1->Text= ""; return;}
}
//---------------------------------------------------------------------------
Form 4:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DateUtils.hpp"
#include "Unit4.h"
#include "Unit3.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button1Click(TObject *Sender)
{
int i,j;
TDateTime i1,j1;
for(i=0;i<Form3->StringGrid1->RowCount;i++){
StringGrid1->Cells[0][i]=Form3->StringGrid1->Cells[1][i];
StringGrid1->Cells[1][i]=Form3->StringGrid1->Cells[2][i];
StringGrid1->Cells[2][i]=Form3->StringGrid1->Cells[3][i];
StringGrid1->Cells[3][i]=Form3->StringGrid1->Cells[4][i];
StringGrid1->Cells[4][i]=Form3->StringGrid1->Cells[5][i];
}
StringGrid1->RowCount=Form3->StringGrid1->RowCount;;
for(j=0;j<Form3->StringGrid1->RowCount-1;j++){
for(i=1;i<Form3->StringGrid1->RowCount-1;i++) {
i1=StringGrid1->Cells[3][i];
j1=StringGrid1->Cells[3][i+1];
if (i1.Val<j1.Val){
StringGrid1->Rows[StringGrid1->RowCount+1]=StringGrid1->Rows[i+1];
StringGrid1->Rows[i+1]= StringGrid1->Rows[i];
StringGrid1->Rows[i]=StringGrid1->Rows[StringGrid1->RowCount+1]; }
} }
}
//---------------------------------------------------------------------------
void __fastcall TForm4::FormCreate(TObject *Sender)
{
StringGrid1->Cells[0][0]= " ";
StringGrid1->Cells[1][0]= " ";
StringGrid1->Cells[2][0]= "";
StringGrid1->Cells[3][0]= " ";
StringGrid1->Cells[4][0]= " ";
StringGrid1->Options << goEditing;
StringGrid1->Options << goTabs;
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Button2Click(TObject *Sender)
{
Form4->Close();
Form2->Show();
}
//---------------------------------------------------------------------------
Form 5:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma resource "*.dfm"
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm5::Label1Click(TObject *Sender)
{
Form5->CppWebBrowser1->Navigate((WideString(ExtractFilePath(ParamStr(0)))+ L" .html").c_bstr());
}
//---------------------------------------------------------------------------
Form 6:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit6.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "SHDocVw_OCX"
#pragma resource "*.dfm"
TForm6 *Form6;
//---------------------------------------------------------------------------
__fastcall TForm6::TForm6(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm6::Label1Click(TObject *Sender)
{
Form6->CppWebBrowser1->Navigate((WideString(ExtractFilePath(ParamStr(0)))+ L".html").c_bstr());
}
//----------------------------------------------------------------------------