to the world

very mystery and interesting

C++博客 首页 新随笔 联系 聚合 管理
  11 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
//---------------------------------------------------------------------------

#ifndef UnitTetrisH
#define UnitTetrisH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include 
<Controls.hpp>
#include 
<StdCtrls.hpp>
#include 
<Forms.hpp>
#include 
"TetrisData.h"
#include 
<ExtCtrls.hpp>
#include 
<ActnList.hpp>
#include 
<Menus.hpp>
#include 
<AppEvnts.hpp>
//---------------------------------------------------------------------------
class TFormTetris : public TForm
{
__published:    
// IDE-managed Components
    TPaintBox *PaintBox1;
    TMainMenu 
*MainMenu1;
    TActionList 
*ActionList1;
    TAction 
*AnNew;
    TAction 
*AnPause;
    TAction 
*AnHScore;
    TAction 
*AnExit;
    TPaintBox 
*PaintBox2;
    TTimer 
*Timer1;
    TMenuItem 
*MmFile;
    TMenuItem 
*New1;
    TMenuItem 
*Pause1;
    TMenuItem 
*HighScore1;
    TMenuItem 
*Exit1;
    TMenuItem 
*N1;
    TLabel 
*LabelLines;
    TLabel 
*LabelScore;
    TScrollBox 
*ScrollBox1;
    TApplicationEvents 
*ApplicationEvents1;
    TLabel 
*LabelHome;
    TLabel 
*Label2;
    TLabel 
*Label3;
    TLabel 
*Label4;
    TLabel 
*LabelHighScore;
    TMenuItem 
*H1;
    TAction 
*AnHelp;
    TAction 
*AnAbout;
    TMenuItem 
*AnHelp1;
    TMenuItem 
*AnAbout1;
    TLabel 
*Label1;
    
void __fastcall PaintBox1Paint(TObject *Sender);
    
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
    
void __fastcall AnNewExecute(TObject *Sender);
    
void __fastcall AnPauseExecute(TObject *Sender);
    
void __fastcall AnHScoreExecute(TObject *Sender);
    
void __fastcall AnExitExecute(TObject *Sender);
    
void __fastcall PaintBox2Paint(TObject *Sender);
    
void __fastcall Timer1Timer(TObject *Sender);
    
void __fastcall ApplicationEvents1Deactivate(TObject *Sender);
    
void __fastcall LabelHomeMouseEnter(TObject *Sender);
    
void __fastcall LabelHomeMouseLeave(TObject *Sender);
    
void __fastcall LabelHomeClick(TObject *Sender);
    
void __fastcall AnHelpExecute(TObject *Sender);
    
void __fastcall AnAboutExecute(TObject *Sender);
public:
    
static const NumScores = 5;
    #pragma pack(push,
1)
    typedef 
struct
     
{
       
int Score;
       
char Name[32];
     }
 TScoreItem;
    typedef union
     
{
       TScoreItem Scores[NumScores];
       
char Buffer[512];
     }
 TTetrisParams;
    #pragma pack(pop)    
private:    // User declarations
    __property bool Paused = { read = _bPaused, write = SetPause };

    
bool _bPaused;
    TBaseTetris Tetris;
    TTetrisParams TetrisParams;
    Graphics::TBitmap 
*TtBmp, *PsBmp, *OvBmp;

    
void __fastcall SetPause(bool);
    
void __fastcall CheckGameStatus(void);
    
void __fastcall RefreshDisplay(void);

    
void LoadParams(void);
    
void SaveParams(void);
    
void GetPlayerName(char *lpName);
    
void ShowHighScores(void);
public:        // User declarations
    __fastcall TFormTetris(TComponent* Owner);
    __fastcall 
~TFormTetris();
}
;
//---------------------------------------------------------------------------
extern PACKAGE TFormTetris *FormTetris;
//---------------------------------------------------------------------------
#endif
posted on 2006-01-17 17:41 hacken 阅读(156) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理