ARB
Main Page
Namespaces
Classes
Files
File List
File Members
SL
MASKS
hotkeys.hxx
Go to the documentation of this file.
1
// ==================================================================== //
2
// //
3
// File : hotkeys.hxx //
4
// Purpose : auto-generated mnemonics for user masks //
5
// //
6
// Coded by Ralf Westram (coder@reallysoft.de) in August 2001 //
7
// Copyright Department of Microbiology (Technical University Munich) //
8
// //
9
// Visit our web site at: http://www.arb-home.de/ //
10
// //
11
// ==================================================================== //
12
13
#ifndef HOTKEYS_HXX
14
#define HOTKEYS_HXX
15
16
#ifndef _GLIBCXX_STRING
17
#include <string>
18
#endif
19
#ifndef ARBTOOLS_H
20
#include <
arbtools.h
>
21
#endif
22
23
// --------------------------
24
// class awt_hotkeys
25
// --------------------------
26
// this class automatically creates hotkeys from strings
27
// use one instance for one set of hotkeys
28
class
awt_hotkeys
:
virtual
Noncopyable
{
29
private
:
30
bool
used[26];
31
bool
USED[26];
32
char
artificial;
33
char
current[2];
34
35
public
:
36
awt_hotkeys
() {
37
for
(
int
i = 0; i<26; ++i) {
38
USED[i] = used[i] =
false
;
39
}
40
artificial =
'0'
;
41
current[0] = current[1] = 0;
42
}
43
virtual
~awt_hotkeys
() {}
44
45
// return a unique hotkey (returns an empty string if no hotkey left)
46
const
char
*
artificial_hotkey
();
47
// return a unique hotkey for label (uses one character from label if possible)
48
const
char
*
hotkey
(
const
std::string
&
label
);
49
};
50
51
52
53
#else
54
#error hotkeys.hxx included twice
55
#endif // HOTKEYS_HXX
56
string
return string(buffer, length)
awt_hotkeys::hotkey
const char * hotkey(const std::string &label)
Definition:
hotkeys.cxx:44
awt_hotkeys
Definition:
hotkeys.hxx:28
awt_hotkeys::~awt_hotkeys
virtual ~awt_hotkeys()
Definition:
hotkeys.hxx:43
arbtools.h
awt_hotkeys::awt_hotkeys
awt_hotkeys()
Definition:
hotkeys.hxx:36
awt_hotkeys::artificial_hotkey
const char * artificial_hotkey()
Definition:
hotkeys.cxx:19
label
const char * label
Definition:
item_sel_list.cxx:118
Noncopyable
Definition:
arbtools.h:39
Generated by
1.8.8