П.3.3. Текст модуля lsimgsize.h

 

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

#ifndef lsImgSizeH

#define lsImgSizeH

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

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

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

class TfrmImgSize: public TForm

{

__published:   // IDE-managed Components

TButton *btnOK;

TButton *btnCancel;

TEdit *edtWidth;

TEdit *edtHeight;

TLabel *Label1;

TLabel *Label2;

void __fastcall btnCancelClick(TObject *Sender);

private:// User declarations

public:// User declarations

__fastcall TfrmImgSize(TComponent* Owner);

};

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

extern PACKAGE TfrmImgSize *frmImgSize;

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

#endif

 

П.3.4. Текст модуля lsimgsize.cpp

 

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

#include <vcl.h>

#pragma hdrstop

#include "LineSeg.h"

#include "lsImgSize.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TfrmImgSize *frmImgSize;

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

__fastcall TfrmImgSize::TfrmImgSize(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TfrmImgSize::btnCancelClick(TObject *Sender)

{

Close();

}

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

 

П.3.5. Текст модуля lsoptions.h

 

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

#ifndef lsOptionsH

#define lsOptionsH

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

#include <Classes.hpp>

#include <Controls.hpp>

#include <StdCtrls.hpp>

#include <Forms.hpp>

#include <Dialogs.hpp>

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

class TfrmOptions: public TForm

{

__published:// IDE-managed Components

TButton *btnOk;

TButton *btnCancel;

TColorDialog *ColorDialog1;

TFontDialog *FontDialog1;

TCheckBox *cbLogs;

TGroupBox *gbColors;

TLabel *Label1;

TLabel *Label2;

TLabel *Label3;

TGroupBox *gbFonts;

TLabel *Label4;

TLabel *Label5;

void __fastcall btnCancelClick(TObject *Sender);

void __fastcall Label1MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y);

void __fastcall Label2MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y);

void __fastcall Label3MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y);

void __fastcall Label4MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y);

void __fastcall Label5MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y);

private:// User declarations

public:// User declarations

__fastcall TfrmOptions(TComponent* Owner);

};

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

extern PACKAGE TfrmOptions *frmOptions;

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

#endif

 

П.3.6. Текст модуля lsoptions.cpp

 

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

#include <vcl.h>

#pragma hdrstop

#include "lsOptions.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TfrmOptions *frmOptions;

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

__fastcall TfrmOptions::TfrmOptions(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TfrmOptions::btnCancelClick(TObject *Sender)

{

Close();

}

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

void __fastcall TfrmOptions::Label1MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y)

{

ColorDialog1->Color=Label1->Font->Color;

if(ColorDialog1->Execute())

Label1->Font->Color=ColorDialog1->Color;

}

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

void __fastcall TfrmOptions::Label2MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y)

{

ColorDialog1->Color=Label2->Font->Color;

if(ColorDialog1->Execute())

Label2->Font->Color=ColorDialog1->Color;

}

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

void __fastcall TfrmOptions::Label3MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y)

{

ColorDialog1->Color=Label3->Font->Color;

if(ColorDialog1->Execute())

Label3->Font->Color=ColorDialog1->Color;

}

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

void __fastcall TfrmOptions::Label4MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y)

{

FontDialog1->Font=Label4->Font;

if(FontDialog1->Execute())

Label4->Font=FontDialog1->Font;

}

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

void __fastcall TfrmOptions::Label5MouseDown(TObject *Sender,

TMouseButton Button, TShiftState Shift, int X, int Y)

{

FontDialog1->Font=Label5->Font;

if(FontDialog1->Execute())

Label5->Font=FontDialog1->Font;

}

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

 

П.3.7. Текст модуля prjlineseg.cpp

 

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

#include <vcl.h>

#pragma hdrstop

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

USEFORM("LineSeg.cpp", frmLineSeg);

USEFORM("lsImgSize.cpp", frmImgSize);

USEFORM("lsOptions.cpp", frmOptions);

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

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)

{

try

{

Application->Initialize();

Application->Title = "Линейная сегментация";

Application->CreateForm(__classid(TfrmLineSeg), &frmLineSeg);

Application->CreateForm(__classid(TfrmImgSize), &frmImgSize);

Application->CreateForm(__classid(TfrmOptions), &frmOptions);

Application->Run();

}

catch (Exception &exception)

{

Application->ShowException(&exception);

}

catch (...)

{

try

{

throw Exception("");

}

catch (Exception &exception)

{

Application->ShowException(&exception);

}

}

return 0;

}

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


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: