-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.h
117 lines (101 loc) · 4.04 KB
/
menu.h
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//******************************************************************************
//* Name: menu.h
//* Purpose: menu stuff
//* Author: Jan van den Borst
//* Copyright: (c) Jan van den Borst
//* License: GPL
//******************************************************************************
#ifndef MENU_H
#define MENU_H
#include <vector>
#include <wx/string.h>
#include "CBSvnPluginManager.h"
namespace CBTSVN
{
struct MenuEntry
{
enum MenuEntryKind
{
mekNormal=0,
mekCheck,
mekRadio
};
int menu_id;
int popup_id;
MenuEntryKind kind;
bool file_enabled;
bool project_enabled;
bool workspace_enabled;
bool required_main;
bool required_popup;
wxString name;
wxString text;
wxString help;
MenuEntry(int entry_menu_id,
int entry_popup_id,
MenuEntryKind entry_kind,
bool entry_file_enabled,
bool entry_project_enabled,
bool entry_workspace_enabled,
bool entry_required_main,
bool entry_required_popup,
wxString entry_name,
wxString entry_text,
wxString entry_help)
:
menu_id(entry_menu_id),
popup_id(entry_popup_id),
kind(entry_kind),
file_enabled(entry_file_enabled),
project_enabled(entry_project_enabled),
workspace_enabled(entry_workspace_enabled),
required_main(entry_required_main),
required_popup(entry_required_popup),
name(entry_name),
text(entry_text),
help(entry_help)
{}
};
bool GetIndex(const std::vector<CBTSVN::MenuEntry>& menu, const wxString& item, int& index);
std::vector<wxString> ConvertMenuItemsToStrings(const CBSvnPluginManager::SourceMenu source,
const std::vector<MenuEntry>& menu);
void ConvertMenuItemsToIndices(const std::vector<MenuEntry>& menu,
const std::vector<wxString>& items,
std::vector<int>& indices);
void ConvertIndicesToMenuItems(const std::vector<MenuEntry>& menu,
const std::vector<int>& indices,
std::vector<wxString>& items);
void MakeMenu(const CBSvnPluginManager::SourceMenu source,
const std::vector<MenuEntry>& menu,
const std::vector<int> indices,
bool file_based,
bool project_based,
bool workspace_based,
bool under_version_control,
wxMenu& out_menu);
void MakeMenu(const CBSvnPluginManager::SourceMenu source,
const std::vector<MenuEntry>& menu,
const std::vector<wxString>& items,
bool file_based,
bool project_based,
bool workspace_based,
bool under_version_control,
wxMenu& out_menu);
void UpdateMenu(const CBSvnPluginManager::SourceMenu source,
const std::vector<MenuEntry>& menu,
const std::vector<wxString>& items,
bool file_based,
bool project_based,
bool workspace_based,
bool under_version_control,
wxMenu* in_menu);
void UpdateMenu(const CBSvnPluginManager::SourceMenu source,
const std::vector<MenuEntry>& menu,
const std::vector<int> indices,
bool file_based,
bool project_based,
bool workspace_based,
bool under_version_control,
wxMenu* in_menu);
}
#endif // MENU_H