📄 hero.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Hero.h"
#include "Mainform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
extern struct _hero hero[4];
THeroForm *HeroForm;
//---------------------------------------------------------------------------
__fastcall THeroForm::THeroForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall THeroForm::Button_ClearKeyDown(TObject *, WORD &Key,
TShiftState )
{
if (Key == 27)
{
Close();
}
}
//---------------------------------------------------------------------------
void __fastcall THeroForm::Button_CancelKeyDown(TObject *, WORD &Key,
TShiftState )
{
if (Key == 27)
{
Close();
}
}
//---------------------------------------------------------------------------
void __fastcall THeroForm::Button_CancelClick(TObject *)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall THeroForm::Button_ClearClick(TObject *)
{
for (int i=0; i<4; ++i)
{
hero[i].time = 999;
hero[i].name = "匿名";
}
HeroForm->Label_Easy_Name->Caption = hero[0].name;
HeroForm->Label_Easy_Seconds->Caption = IntToStr(hero[0].time);
HeroForm->Label_Middle_Name->Caption = hero[1].name;
HeroForm->Label_Middle_Seconds->Caption = IntToStr(hero[1].time);
HeroForm->Label_Expert_Name->Caption = hero[2].name;
HeroForm->Label_Expert_Seconds->Caption = IntToStr(hero[2].time);
HeroForm->Label_Professional_Name->Caption = hero[3].name;
HeroForm->Label_Professional_Seconds->Caption = IntToStr(hero[3].time);
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -