?? menu.h
字號(hào):
// ████████████
// ██╭------------╮██
// █╭╯ Menu.h ╰╮█
// █| 菜單類頭文件 |█
// █╰----------------╯█
// ████████████
#if !defined(AFX_MENU_H__85F73C78_057F_4EE3_8A0A_474170DD6A53__INCLUDED_)
#define AFX_MENU_H__85F73C78_057F_4EE3_8A0A_474170DD6A53__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <ddraw.h>
//------ 清除與重載的宏 -------//
#define SafeRelease(x) if (x) { x->Release(); x=NULL;}
#define SafeDelete(x) if (x) {delete x;x=NULL;}
#define ButtonMax 604
class CMenu
{
public:
CMenu();
virtual ~CMenu();
void CreateButton(const LPCTSTR name,int x,int y);//創(chuàng)建按鈕
void Show();//顯示圖片
void MouseDown();//鼠標(biāo)按下判斷
void MouseMove();//鼠標(biāo)移到判斷
bool IsEmpty() const {return MenuNum==0;}//菜單列棧中是否為空
CMenu& CreateMenu(const LPCTSTR MenuName,int x,int y,bool havebutton);//創(chuàng)建菜單
CMenu& DelMenu();//刪除頂棧的窗體
// void Alphi(int x,int y,int ALPHA);
void ButtonOn(int buttonid,LPCTSTR buttonbmpname);//改變按鈕
void CreateTile(LPDIRECTDRAWSURFACE7 face);//創(chuàng)建Tile
struct MenuNode
{
LPDIRECTDRAWSURFACE7 MenuSurface; //窗體頁面
LPCTSTR MenuName; //窗體名
int MenuX,MenuY; //窗體坐標(biāo)
int MenuWidth,MenuHeight;
LPDIRECTDRAWSURFACE7 ButtonSurface[ButtonMax]; //按鈕頁面
int ButtonID; //按鈕ID
int ButtonX[ButtonMax],ButtonY[ButtonMax]; //按鈕坐標(biāo)
int ButtonWidth[ButtonMax],ButtonHeight[ButtonMax];
LPCTSTR ButtonName[ButtonMax]; //按鈕名
bool HaveButton;//是否是有按鈕的菜單
MenuNode* link; //下一個(gè)菜單
};
MenuNode* top;//指向棧頂節(jié)點(diǎn)和后節(jié)點(diǎn)
RECT destRect;
private:
typedef struct
{
RGBQUAD depth; // How many bits of precision per channel
RGBQUAD Position; // At what bit position does the color start
UINT bpp;
} RGBFORMAT;
RGBFORMAT g_pixelFormat;
LPDIRECTDRAWSURFACE7 BMPToSurface(LPCTSTR bmpname,int& width,int& height);
// bool GetRGBFormat(LPDIRECTDRAWSURFACE7 surf, RGBFORMAT* rgb);
int MenuNum;
};
void ButtonClick(LPCTSTR name);
void NotButtonClick(LPCTSTR name);
#endif // !defined(AFX_MENU_H__85F73C78_057F_4EE3_8A0A_474170DD6A53__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -