source: branches/stable/AWT/awt_hotkeys.hxx

Last change on this file was 15082, checked in by westram, 8 years ago
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1//  ==================================================================== //
2//                                                                       //
3//    File      : awt_hotkeys.hxx                                        //
4//    Purpose   :                                                        //
5//                                                                       //
6//                                                                       //
7//  Coded by Ralf Westram (coder@reallysoft.de) in August 2001           //
8//  Copyright Department of Microbiology (Technical University Munich)   //
9//                                                                       //
10//  Visit our web site at: http://www.arb-home.de/                       //
11//                                                                       //
12//                                                                       //
13//  ==================================================================== //
14
15#ifndef AWT_HOTKEYS_HXX
16#define AWT_HOTKEYS_HXX
17
18#ifndef _GLIBCXX_STRING
19#include <string>
20#endif
21#ifndef ARBTOOLS_H
22#include <arbtools.h>
23#endif
24
25//  --------------------------
26//      class awt_hotkeys
27//  --------------------------
28// this class automatically creates hotkeys from strings
29// use one instance for one set of hotkeys
30class awt_hotkeys : virtual Noncopyable {
31private:
32    bool used[26];
33    bool USED[26];
34    char artificial;
35    char current[2];
36
37public:
38    awt_hotkeys() {
39        for (int i = 0; i<26; ++i) {
40            USED[i] = used[i] = false;
41        }
42        artificial  = '0';
43        current[0] = current[1] = 0;
44    }
45    virtual ~awt_hotkeys() {}
46
47    // return a unique hotkey (returns an empty string if no hotkey left)
48    const char* artificial_hotkey();
49    // return a unique hotkey for label (uses one character from label if possible)
50    const char* hotkey(const std::string& label);
51};
52
53
54
55#else
56#error awt_hotkeys.hxx included twice
57#endif // AWT_HOTKEYS_HXX
58
Note: See TracBrowser for help on using the repository browser.