Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Архив3 / OOP_kursach / ООП_курсач.doc
Скачиваний:
96
Добавлен:
07.08.2013
Размер:
393.73 Кб
Скачать

Исходный текст программы Project1.Cpp

//---------------------------------------------------------------------------

#include <vcl.h>

#pragma hdrstop

//---------------------------------------------------------------------------

USEFORM("Unit1.cpp", Form1);

USEFORM("Unit3.cpp", AboutBox);

USEFORM("Unit4.cpp", AboutBox1);

//---------------------------------------------------------------------------

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)

{

try

{

Application->Initialize();

Application->CreateForm(__classid(TForm1), &Form1);

Application->CreateForm(__classid(TAboutBox), &AboutBox);

Application->CreateForm(__classid(TAboutBox1), &AboutBox1);

Application->Run();

}

catch (Exception &exception)

{

Application->ShowException(&exception);

}

catch (...)

{

try

{

throw Exception("");

}

catch (Exception &exception)

{

Application->ShowException(&exception);

}

}

return 0;

}

//---------------------------------------------------------------------------

Unit1.H

//---------------------------------------------------------------------------

#ifndef Unit1H

#define Unit1H

#ifndef File1H

#define File1H

//---------------------------------------------------------------------------

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include "CSPIN.h"

#include <ExtCtrls.hpp>

#include <Grids.hpp>

#include "Unit2.h"

class TMatrix;

//---------------------------------------------------------------------------

class NSquare {};

class InsideError {};

class NRightSize {};

//---------------------------------------------------------------------------

class TForm1 : public TForm

{

__published: // IDE-managed Components

TPanel *Panel1;

TStringGrid *StringGrid1;

TPanel *Panel2;

TStringGrid *StringGrid2;

TPanel *Panel3;

TStringGrid *StringGrid3;

TPanel *Panel11;

TButton *Button0;

TGroupBox *GroupBox12;

TEdit *Edit1;

TPanel *Panel13;

TButton *ButtonC;

TGroupBox *GroupBox14;

TButton *Button2;

TButton *Button3;

TLabel *Label3;

TPanel *Panel15;

TButton *Button7;

TButton *Button6;

TButton *Button5;

TPanel *Panel16;

TButton *Button17;

TButton *Button15;

TButton *Button16;

TButton *Button11;

TButton *Button12;

TEdit *Edit1_1;

TButton *Button1_1P;

TButton *Button1_1M;

TButton *Button1_2P;

TButton *Button1_2M;

TEdit *Edit1_2;

TButton *Button2_1P;

TButton *Button2_1M;

TEdit *Edit2_1;

TButton *Button2_2P;

TButton *Button2_2M;

TEdit *Edit2_2;

TButton *Button3_2;

TButton *Button3_1;

TLabel *Label3_1;

TLabel *Label3_2;

TButton *Button10;

TButton *Button18;

TLabel *Label1;

TLabel *Label2;

TButton *Button8;

TButton *Button1;

TLabel *Label4;

TLabel *Label5;

TLabel *Label6;

TLabel *Label7;

TLabel *Label8;

TLabel *Label9;

void __fastcall Button6Click(TObject *Sender);

void __fastcall Button5Click(TObject *Sender);

void __fastcall Button7Click(TObject *Sender);

void __fastcall Button3_1Click(TObject *Sender);

void __fastcall Button3_2Click(TObject *Sender);

void __fastcall ButtonCClick(TObject *Sender);

void __fastcall Button15Click(TObject *Sender);

void __fastcall Button1_1PClick(TObject *Sender);

void __fastcall Button1_1MClick(TObject *Sender);

void __fastcall Button1_2PClick(TObject *Sender);

void __fastcall Button1_2MClick(TObject *Sender);

void __fastcall Button2_1PClick(TObject *Sender);

void __fastcall Button2_1MClick(TObject *Sender);

void __fastcall Button2_2PClick(TObject *Sender);

void __fastcall Button2_2MClick(TObject *Sender);

void __fastcall StringGrid1Click(TObject *Sender);

void __fastcall StringGrid2Click(TObject *Sender);

void __fastcall Button16Click(TObject *Sender);

void __fastcall Button12Click(TObject *Sender);

void __fastcall Button11Click(TObject *Sender);

void __fastcall StringGrid1Exit(TObject *Sender);

void __fastcall StringGrid2Exit(TObject *Sender);

void __fastcall Button10Click(TObject *Sender);

void __fastcall Button17Click(TObject *Sender);

void __fastcall Button3Click(TObject *Sender);

void __fastcall Button8Click(TObject *Sender);

void __fastcall Button2Click(TObject *Sender);

void __fastcall Button1Click(TObject *Sender);

void __fastcall Button0Click(TObject *Sender);

private:

// User declaration

TMatrix _Mat1,

_Mat2,

_Res,

_Mem;

int _Memory;

int _SG1_R,

_SG1_C,

_SG2_R,

_SG2_C;

int _Edit1Num;

int _SGFocusInt;

TStringGrid *_SGFocus;

TMatrix *_MatFocus;

public:

// User declarations

__fastcall TForm1(TComponent* Owner);

TForm1 :: ReadMemory();

TForm1 :: WriteMemory();

TForm1 :: ReadForm();

TForm1 :: ReadMatrix();

TForm1 :: WriteForm();

TForm1 :: WriteMatrix();

TForm1 :: StringRight(AnsiString *String);

TForm1 :: Print(int Index);

TForm1 :: SGRight(int SGNUM);

TForm1 :: ExceptCatch(int ErrCode);

};

//---------------------------------------------------------------------------

extern PACKAGE TForm1 *Form1;

//---------------------------------------------------------------------------

#endif

#endif