2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
2015-03-04 09:36:08 +00:00
|
|
|
enum Menu_ID
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
//ControlID
|
|
|
|
SPLITER, SUB_MENU, NO_ID, ID_PLUGIN_MENU,
|
|
|
|
};
|
|
|
|
|
2015-03-04 09:36:08 +00:00
|
|
|
const std::wstring EMPTY_STDSTR = L"";
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-03-04 09:36:08 +00:00
|
|
|
class MENU_ITEM
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
public:
|
2015-03-04 09:36:08 +00:00
|
|
|
MENU_ITEM (void)
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
Reset(NO_ID);
|
|
|
|
}
|
2015-03-04 09:36:08 +00:00
|
|
|
MENU_ITEM ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut = EMPTY_STDSTR,
|
|
|
|
void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
|
|
|
Reset(ID,Title,ShotCut,SubMenu,ManualString);
|
|
|
|
}
|
2015-03-04 09:36:08 +00:00
|
|
|
void Reset ( int ID, LanguageStringID Title = EMPTY_STRING, const std::wstring & ShotCut2 = EMPTY_STDSTR,
|
|
|
|
void * SubMenu = NULL, const std::wstring & ManualString = EMPTY_STDSTR)
|
2008-09-18 03:15:49 +00:00
|
|
|
{
|
2015-03-04 09:36:08 +00:00
|
|
|
this->m_ID = ID;
|
|
|
|
this->m_Title = Title;
|
|
|
|
this->m_ShotCut = ShotCut2;
|
|
|
|
this->m_SubMenu = SubMenu;
|
|
|
|
this->m_ManualString = ManualString;
|
|
|
|
this->m_ItemTicked = false;
|
|
|
|
this->m_ItemEnabled = true;
|
2008-09-18 03:15:49 +00:00
|
|
|
}
|
2015-03-04 09:36:08 +00:00
|
|
|
|
|
|
|
int ID() const { return m_ID; }
|
|
|
|
LanguageStringID Title() const { return m_Title; }
|
|
|
|
const std::wstring & ShotCut() const { return m_ShotCut; }
|
|
|
|
void * SubMenu() const { return m_SubMenu; }
|
|
|
|
const std::wstring & ManualString() const { return m_ManualString; }
|
|
|
|
bool ItemTicked() const { return m_ItemTicked; }
|
|
|
|
bool ItemEnabled() const { return m_ItemEnabled; }
|
|
|
|
|
|
|
|
void SetItemTicked(bool ItemTicked) { m_ItemTicked = ItemTicked; }
|
|
|
|
void SetItemEnabled(bool ItemEnabled) { m_ItemEnabled = ItemEnabled; }
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
int m_ID;
|
|
|
|
LanguageStringID m_Title;
|
|
|
|
std::wstring m_ShotCut;
|
|
|
|
void * m_SubMenu;
|
|
|
|
std::wstring m_ManualString;
|
|
|
|
bool m_ItemTicked;
|
|
|
|
bool m_ItemEnabled;
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::list<MENU_ITEM> MenuItemList;
|
|
|
|
|
|
|
|
class CBaseMenu {
|
|
|
|
protected:
|
2015-01-27 05:07:44 +00:00
|
|
|
HMENU m_MenuHandle;
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2015-01-27 05:07:44 +00:00
|
|
|
bool AddMenu ( HMENU hMenu, MenuItemList Items );
|
2008-09-18 03:15:49 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CBaseMenu ();
|
|
|
|
|
|
|
|
|
2015-01-27 05:07:44 +00:00
|
|
|
virtual int ProcessAccelerator(HWND hWnd, void * lpMsg ) = 0; // pure virtual draw() function
|
|
|
|
virtual bool ProcessMessage(HWND hWnd, DWORD wNotifyCode, DWORD wID) = 0; // pure virtual draw() function
|
2008-09-18 03:15:49 +00:00
|
|
|
virtual void ResetMenu(void) = 0; // pure virtual draw() function
|
2015-01-27 05:07:44 +00:00
|
|
|
HMENU GetHandle (void) { return m_MenuHandle; }
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|