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

📄 unit1.~h

📁 自编的华容道小游戏
💻 ~H
字号:
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Buttons.hpp>
//---------------------------------------------------------------------------
enum Dragward
{
 Drag_Upward,     //向上移动
 Drag_Downward,   //向下移动
 Drag_Rightward,  //向右移动
 Drag_Leftward    //向左移动
};

class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TPanel *Panel1;
        TLabel *Label1;
        TLabel *Label2;
        TLabel *Label3;
        TLabel *Label4;
        TLabel *Label5;
        TLabel *Label6;
        TLabel *Label7;
        TLabel *Label8;
        TLabel *Label9;
        TLabel *Label10;
        TLabel *Label11;
        TLabel *Label12;
        TButton *Button1;
        TButton *Button2;
        TTimer *Timer1;
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall Timer1Timer(TObject *Sender);
        void __fastcall Button2Click(TObject *Sender);
private:	// User declarations
        int Position[10][2]; //用于保存或设置每个BitBtn组件的Left和Top属性
        int WidthHeight[10][2]; //用于保存每个BitBtn组件的宽度和高度
        BOOL PrepareMove;  //用于显示是否准备移动
        Dragward Moveward;  //移动方向
        TPoint BeginPosition; //用户拖动BitBtn组件时的起始位置
        bool InvalidMove(int X, int Y,int ButtonNumber);//判断是否允许用户的拖动

        TBitBtn* BitBtn[10];
        void __fastcall BitBtnMouseDown(TObject *Sender,
                TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall BitBtnMouseUp(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);

        int SpendTime;
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

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