📄 main.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "main.h"
#include "biolife.h"
#include "ordform.h"
#include "inherit.h"
#include "bargraph.h"
#include "mast_dtl.h"
#include "custprev.h"
#include "acecan.h"
#include "newprev.h"
#include "statsamp.h"
#include "sampdest.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TFormMain *FormMain;
//---------------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button1Click(TObject *Sender)
{
TFormBioLife *bio = new TFormBioLife(Application);
bio->Show();
}
//---------------------------------------------------------------------
void __fastcall TFormMain::Button2Click(TObject *Sender)
{
TFormOrders *orders = new TFormOrders(Application);
orders->Show();
}
//---------------------------------------------------------------------
void __fastcall TFormMain::Button3Click(TObject *Sender)
{
TFormInheritance *inherit = new TFormInheritance(Application);
inherit->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button4Click(TObject *Sender)
{
TFormMasterDetail *masterdetail = new TFormMasterDetail(Application);
masterdetail->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button5Click(TObject *Sender)
{
TFormBarGraph *bargraph = new TFormBarGraph(Application);
bargraph->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button6Click(TObject *Sender)
{
TFormCustomPreview *custompreview = new TFormCustomPreview(Application);
custompreview->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Button7Click(TObject *Sender)
{
TFormCanvas *canvas = new TFormCanvas(Application);
canvas->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::CheckBox1Click(TObject *Sender)
{
if (CheckBox1->Checked) CustomPreview = Preview;
else CustomPreview = NULL;
}
//---------------------------------------------------------------------------
void __fastcall Preview(TSctPage *Page)
{
TNewPreview *np = new TNewPreview(Application);
np->SetAceFile(Page->PrintTo->AceFile);
np->OnAbort = Page->AbortGeneration;
Page->OnUpdate = np->UpdateStatus;
np->Show();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::CheckBox2Click(TObject *Sender)
{
if ((( TCheckBox *) Sender)->Checked) CustomStatus = MyStat;
else CustomStatus = NULL;
}
//---------------------------------------------------------------------------
void __fastcall MyStat(TSctPage *Page)
{
TSampleStatus *ss = new TSampleStatus(Application);
ss->Show();
ss->Report = Page->Report;
Page->OnUpdateStatus = ss->UpdateStatus;
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::CheckBox3Click(TObject *Sender)
{
if (((TCheckBox *) Sender)->Checked) CustomPrompt = MyPrompt;
else CustomPrompt = NULL;
}
//---------------------------------------------------------------------------
void __fastcall MyPrompt(TSctPage *Page, Boolean &Result)
{
TSampleDestination *OutForm = new TSampleDestination(Application);
OutForm->PageSetup = Page->PageSetup;
Result = (OutForm->ShowModal() == mrOk);
OutForm->Free();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::Exit2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -