📄 brewmainmenu.h
字号:
// BrewMainMenu.h: interface for the CBrewMainMenu class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BREWMAINMENU_H__8973E3D6_CA40_426F_944B_F201A7A74663__INCLUDED_)
#define AFX_BREWMAINMENU_H__8973E3D6_CA40_426F_944B_F201A7A74663__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "BrewLoginCanvasBase.h"
#include "BrewLogin.h"
#include "GameSetting.h"
#include "brewhelpandintro.h"
#include "gameabout.h"
#define MAINMENU_BEGIN 0
#define MAINMENU_HELP 1
#define MAINMENU_LOGIN 2
#define MAINMENU_ABOUT 3
#define MAINMENU_SETTING 4
#define MAINMENU_QUIT 5
class CPosition
//菜单项目个数必须大于等于2
{
public:
AEERect m_rt;
int16 m_ItemCounts,m_nPos;
CPosition(){m_nPos = 0;}
CPosition(AEERect rt, int16 nItemCounts) : m_rt(rt),m_ItemCounts(nItemCounts)
{
m_nPos = 0;
}
void Up()
{
if(m_nPos < 2)
{
if(m_nPos % 2)
m_nPos = m_ItemCounts - 1;
else
m_nPos = m_ItemCounts - 2;
}
else
m_nPos -= 2;
}
void Down()
{
if(m_nPos + 2 > m_ItemCounts - 1)
{
if(m_nPos % 2)
m_nPos = 1;
else
m_nPos = 0;
}
else
m_nPos += 2;
}
void Left()
{
if(m_nPos % 2)
m_nPos -= 1;
else
m_nPos += 1;
}
void Right()
{
Left();
}
int16 GetX()
{
if(m_nPos % 2)
return (m_rt.dx) / 2 + m_rt.x;
else
return m_rt.x;
}
int16 GetY()
{
int16 ht = (m_rt.dy)/(m_ItemCounts/2);
return (m_nPos/2) * ht + m_rt.y;
}
void Key(uint16 code)
{
switch(code)
{
case AVK_LEFT:
Left();
break;
case AVK_RIGHT:
Right();
break;
case AVK_UP:
Up();
break;
case AVK_DOWN:
Down();
break;
}
}
};
class CBrewMainMenu : public CBrewLoginCanvasBase
{
public:
CGameSetting* m_pGs;
CBrewHelpAndIntro* m_pHelp;
CGameAbout* m_pAbout;
CPosition m_pos;
IBitmap* m_pTheme,*m_pCorpLogo,*m_pMenu,*m_pArrowWt,
*m_pArrowBl,*m_pBitmap;
int16 m_nx,m_ny;
AEERect m_rtarrow;
CBrewLogin* frame;
CBrewMainMenu();
virtual ~CBrewMainMenu();
public:
void setFrame(void *f);
void paint(IDisplay *d, IGraphics *g);
boolean key(UINT16 code, UINT32 param);
CBrewLoginCanvasBase* GetSomeCanvas();
void SetNull(CBrewLoginCanvasBase* p);
virtual void SetDisplayInfo(IDisplay* d);
};
IBrewCanvas *CreateBrewMainMenu();
#endif // !defined(AFX_BREWMAINMENU_H__8973E3D6_CA40_426F_944B_F201A7A74663__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -