File: NS_MenuGeneric.h

package info (click to toggle)
clanlib 1.0~svn3827-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,632 kB
  • ctags: 16,580
  • sloc: cpp: 101,591; xml: 6,410; makefile: 1,743; ansic: 463; perl: 424; php: 247; sh: 53
file content (58 lines) | stat: -rw-r--r-- 1,756 bytes parent folder | download | duplicates (7)
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
// NS_MenuGeneric.h: interface for the NS_MenuGeneric class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NS_MENUGENERIC_H__15FC6E14_CE64_4603_96A7_7A10E4350EE4__INCLUDED_)
#define AFX_NS_MENUGENERIC_H__15FC6E14_CE64_4603_96A7_7A10E4350EE4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <ClanLib/gui.h>
#include <ClanLib/gui.h>
#include <ClanLib/signals.h>
#include <ClanLib/signals.h>

#include <string>

class NS_MenuManager;
class CL_StyleManager;
class CL_ComponentManager;

// Generic menu class, serves as base of all other menus in
// the game. Derive from it and overload virtual methods if
// you want to add a new menu.

class NS_MenuGeneric : public CL_GUIManager
{
public:
    NS_MenuGeneric(NS_MenuManager & menu_manager,
        CL_StyleManager & style_manager,
        std::string const & path_to_resource);
    virtual ~NS_MenuGeneric();
public:
    NS_MenuManager & get_menu_manager() const;
public:
    virtual void on_begin_paint();
    // Exit from app
    void on_exit();
    virtual void switch_to(std::string const & menu) = 0;
    virtual void on_focus_changed(CL_Component * new_comp_focus);
    void run();
    void show();
    // Menu manager loops a current menu, and so here should be
    // a things which usualy doing in main loop in games
    // Do a whatever calculations you need in this method.
    // Standard implementation just clears the screen
    virtual void run_task();
    void quit();
private:
    NS_MenuManager & menu_manager;
    volatile bool quit_run;
protected:
    CL_SlotContainer slots;
    CL_ComponentManager * comp_manager;
};

#endif // !defined(AFX_NS_MENUGENERIC_H__15FC6E14_CE64_4603_96A7_7A10E4350EE4__INCLUDED_)