source: branches/help/TEMPLATES/mode_text.h

Last change on this file was 15529, checked in by westram, 8 years ago
File size: 2.4 KB
Line 
1// ================================================================= //
2//                                                                   //
3//   File      : mode_text.hxx                                       //
4//   Purpose   : generate infotext for modes                         //
5//               (for use in AW_window_menu_modes)                   //
6//                                                                   //
7//   Coded by Ralf Westram (coder@reallysoft.de) in September 2013   //
8//   Institute of Microbiology (Technical University Munich)         //
9//   http://www.arb-home.de/                                         //
10//                                                                   //
11// ================================================================= //
12
13#ifndef MODE_TEXT_HXX
14#define MODE_TEXT_HXX
15
16#define MT_MODE(modeName) modeName " MODE"
17
18#define MT_LEFT(leftInfo)     "  LEFT: " leftInfo
19#define MT_RIGHT(rightInfo)   "  RIGHT: " rightInfo
20#define MT_MIDDLE(middleInfo) "  MIDDLE: " middleInfo
21#define MT_KEYS(keyInfo)      "  (" keyInfo ")"
22
23#define KEYINFO_ABORT           "ESC=abort"
24#define KEYINFO_RESET           "0=reset"
25#define KEYINFO_ABORT_AND_RESET KEYINFO_ABORT " " KEYINFO_RESET
26
27#define MODE_TEXT_1BUTTON(modeName,leftInfo)                       MT_MODE(modeName) MT_LEFT(leftInfo)
28#define MODE_TEXT_2BUTTONS(modeName,leftInfo,rightInfo)            MT_MODE(modeName) MT_LEFT(leftInfo) MT_RIGHT(rightInfo)
29#define MODE_TEXT_3BUTTONS(modeName,leftInfo,middleInfo,rightInfo) MT_MODE(modeName) MT_LEFT(leftInfo) MT_MIDDLE(middleInfo) MT_RIGHT(rightInfo)
30
31#define MODE_TEXT_1BUTTON_KEYS(modeName,leftInfo,keyInfo)                       MT_MODE(modeName) MT_LEFT(leftInfo) MT_KEYS(keyInfo)
32#define MODE_TEXT_2BUTTONS_KEYS(modeName,leftInfo,rightInfo,keyInfo)            MT_MODE(modeName) MT_LEFT(leftInfo) MT_RIGHT(rightInfo) MT_KEYS(keyInfo)
33#define MODE_TEXT_3BUTTONS_KEYS(modeName,leftInfo,middleInfo,rightInfo,keyInfo) MT_MODE(modeName) MT_LEFT(leftInfo) MT_MIDDLE(middleInfo) MT_RIGHT(rightInfo) MT_KEYS(keyInfo)
34
35#define MODE_TEXT_STANDARD_ZOOMMODE() MODE_TEXT_2BUTTONS_KEYS("ZOOM", "zoom in", "zoom out (click or drag)", KEYINFO_RESET)
36#define MODE_TEXT_PLACEHOLDER()       MT_MODE("PLACEHOLDER") "  (reserved)"
37
38inline const char *no_mode_text_defined() {
39    arb_assert(0); // please define an infotext for current mode in caller
40    return "No help for this mode available";
41}
42
43#else
44#error mode_text.hxx included twice
45#endif // MODE_TEXT_HXX
Note: See TracBrowser for help on using the repository browser.