Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FbMenu.h « MyRuLib « sources - github.com/lintest/myrulib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 53ea6025dbd8ca96edd687251939df29bc012c7d (plain)
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
#ifndef __FBMENU_H__
#define __FBMENU_H__

#include <wx/wx.h>
#include <wx/artprov.h>
#include <wx/hashmap.h>

class FbMenu: public wxMenu
{
	public:
		enum Type {
			AUTH,
			SEQN,
			FLDR,
			CLSS,
		};

		wxMenuItem * AppendImg(int itemid, const wxString& text, const wxArtID& art, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL)
		{
			wxMenuItem * item = new wxMenuItem(this, itemid, text, help, kind);
			item->SetBitmap( wxArtProvider::GetBitmap(art) );
			return Append(item);
		}

		wxMenuItem * AppendSub(Type type, int code, const wxString& name, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL);
};

class FbMenuSort: public FbMenu
{
	public:
		FbMenuSort();
};

class FbMenuRating: public FbMenu
{
	public:
		FbMenuRating();
};

class FbMenuRefs: public FbMenu
{
	public:
		static wxMenuItem * Create(wxMenu * menu);
		FbMenuRefs() {}
};

class FbMenuData {
	public:
		FbMenu::Type type;
		int code;
};

WX_DECLARE_HASH_MAP(int, FbMenuData, wxIntegerHash, wxIntegerEqual, FbMenuHash);

class FbMenuItem: public wxMenuItem
{
	public:
		static bool Get(wxWindowID id, FbMenu::Type & type, int & code);

		FbMenuItem(wxMenu * menu, FbMenu::Type type, int code, 
			const wxString& name = wxEmptyString, 
			const wxString& help = wxEmptyString, 
			wxItemKind kind = wxITEM_NORMAL, 
			wxMenu * submenu = NULL 
		);

		virtual ~FbMenuItem();

	private:
		static wxWindowID NewId(FbMenu::Type type, int code);
		static FbMenuHash m_hash;
};

#endif // __FBMENU_H__