summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/optsmenu.h
blob: 2afe9b68a8963e87e8e29bfcc2542f34ba103662 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// license:BSD-3-Clause
// copyright-holders:Maurizio Petrarota
/***************************************************************************

    ui/optsmenu.h

    UI main options menu manager.

***************************************************************************/
#ifndef MAME_FRONTEND_UI_OPTSMENU_H
#define MAME_FRONTEND_UI_OPTSMENU_H

#pragma once

#include "ui/menu.h"
#include "ui/utils.h"


namespace ui {

class menu_simple_game_options : public menu
{
public:
	menu_simple_game_options(
			mame_ui_manager &mui,
			render_container &container,
			std::function<void ()> &&handler);
	virtual ~menu_simple_game_options() override;

protected:
	virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
	virtual void handle() override;
	virtual void populate(float &customtop, float &custombottom) override;

	void handle_item_event(event const &menu_event);

private:
	enum
	{
		DISPLAY_MENU = 1001,
		SOUND_MENU,
		CONTROLLER_MENU,
		MISC_MENU,
		ADVANCED_MENU,
		SAVE_OPTIONS,
		CGI_MENU,
		SAVE_CONFIG
	};

	std::function<void ()> const m_handler;
};


class menu_game_options : public menu_simple_game_options
{
public:
	menu_game_options(
			mame_ui_manager &mui,
			render_container &container,
			machine_filter_data &filter_data,
			std::function<void ()> &&handler);
	virtual ~menu_game_options() override;

protected:
	virtual void handle() override;
	virtual void populate(float &customtop, float &custombottom) override;

	void handle_item_event(event const &menu_event);

private:
	enum
	{
		FILTER_MENU = 2001,
		FILTER_ADJUST,
		CONF_DIR,
		CUSTOM_MENU
	};

	machine_filter_data &m_filter_data;
	machine_filter::type m_main_filter;
};

} // namespace ui

#endif // MAME_FRONTEND_UI_OPTSMENU_H