⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 screen.h

📁 关于书籍《Borland c++Builder工程实践》的源代码
💻 H
字号:
//---------------------------------------------------------------------------
#ifndef ScreenH
#define ScreenH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <registry.hpp>
#include <MPlayer.hpp>
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
const int BmpW=600;
const int BmpH=450;
const int MouseMoveDistance = 10;
class TScreenForm : public TForm
{
__published:	// IDE-managed Components
     TTimer *Timer1;
     TMediaPlayer *MediaPlayer1;
     void __fastcall FormDestroy(TObject *Sender);
     void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
     void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
     void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift,
          int X, int Y);
     void __fastcall FormPaint(TObject *Sender);
     void __fastcall Timer1Timer(TObject *Sender);
     void __fastcall MediaPlayer1Notify(TObject *Sender);
     void __fastcall FormCreate(TObject *Sender);
private:
     void __fastcall WMEraseBkgnd(TWMEraseBkgnd & Msg);
     void __fastcall WMActivate(TWMActivate & Msg);	// User declarations
     void __fastcall WMSysCommand(TWMSysCommand & Msg);
     TRegistry *Reg;
     TPoint aPoint;
     Graphics::TBitmap *Bit1;
     Graphics::TBitmap *Bit2;
     Graphics::TBitmap *tmp;
     TStringList *PicList;
     TStringList *SndList;
     bool Effect[16];
     int Mode;
     TPoint nLocation;  //new location point
     TPoint oLocation;  //old location point
     int xSpeed,ySpeed,xDir,yDir;
     TRect oRect,nRect;
     void DrawObject(void);
     void ShowObject(void);
     void MoveObject(void);
     void PatchBkgnd(void);

public:		// User declarations
     int x,y,s;
     int flag;  //效果标记
     int Lft,Tp;
     int Pic,Snd;
     bool ChangePic;
     bool b[15][20];
     int RunTime;  //记录动画运行时间,到600X50ms=0.5min则换图片
     __fastcall TScreenForm(TComponent* Owner);
     void __fastcall PlayPic();
     void __fastcall LoadPic(AnsiString FName);
     void ReadReg();

BEGIN_MESSAGE_MAP
     MESSAGE_HANDLER(WM_ERASEBKGND,TWMEraseBkgnd,WMEraseBkgnd)
     MESSAGE_HANDLER(WM_ACTIVATE,TWMActivate,WMActivate)
     MESSAGE_HANDLER(WM_SYSCOMMAND,TWMSysCommand,WMSysCommand)
END_MESSAGE_MAP(TForm)
};


//---------------------------------------------------------------------------
extern PACKAGE TScreenForm *ScreenForm;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -