source: branches/species/SL/MASKS/hotkeys.hxx

Last change on this file was 19612, checked in by westram, 2 months ago
  • insert module purposes.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
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
28class awt_hotkeys : virtual Noncopyable {
29private:
30    bool used[26];
31    bool USED[26];
32    char artificial;
33    char current[2];
34
35public:
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
Note: See TracBrowser for help on using the repository browser.