home *** CD-ROM | disk | FTP | other *** search
- // Zinc Interface Library - UI_MAP.HPP
- // COPYRIGHT (C) 1990, 1991. All Rights Reserved.
- // Zinc Software Incorporated. Pleasant Grove, Utah USA
-
- #ifndef UI_MAP_HPP
- #define UI_MAP_HPP
- #ifndef UI_EVT_HPP
- #include <ui_evt.hpp>
- #endif
-
- #ifdef ZIL_MSWINDOWS // ---------------------------------------------------
-
- // ----- MS Windows scan-codes --------------------------------------------
- // ----- virtual key codes OR'ed with shift state found in event.rawCode --
- #ifdef USE_RAW_KEYS
- const USHORT ESCAPE = 0x001B; // Miscellaneous keys
- const USHORT ENTER = 0x000D;
- const USHORT BACKSPACE = 0x0008;
- const USHORT CTRL_BACKSPACE = 0x0408;
- const USHORT TAB = 0x0009;
- const USHORT CTRL_TAB = 0x0409;
- const USHORT BACKTAB = 0x0309;
-
- const USHORT CTRL_BREAK = 0x0403;
- const USHORT CTRL_C = 0x0443;
-
- const USHORT ALT_ESCAPE = 0x081B;
- const USHORT ALT_PERIOD = 0x08BE;
- const USHORT ALT_SPACE = 0x0820;
- const USHORT ALT_WHITE_MINUS = 0x08BD;
- const USHORT ALT_WHITE_PLUS = 0x08BB;
-
- const USHORT ALT_A = 0x0861;
- const USHORT ALT_B = 0x0862;
- const USHORT ALT_C = 0x0863;
- const USHORT ALT_D = 0x0864;
- const USHORT ALT_E = 0x0865;
- const USHORT ALT_F = 0x0866;
- const USHORT ALT_G = 0x0867;
- const USHORT ALT_H = 0x0868;
- const USHORT ALT_I = 0x0869;
- const USHORT ALT_J = 0x086A;
- const USHORT ALT_K = 0x086B;
- const USHORT ALT_L = 0x086C;
- const USHORT ALT_M = 0x086D;
- const USHORT ALT_N = 0x086E;
- const USHORT ALT_O = 0x086F;
- const USHORT ALT_P = 0x0870;
- const USHORT ALT_Q = 0x0871;
- const USHORT ALT_R = 0x0872;
- const USHORT ALT_S = 0x0873;
- const USHORT ALT_T = 0x0874;
- const USHORT ALT_U = 0x0875;
- const USHORT ALT_V = 0x0876;
- const USHORT ALT_W = 0x0877;
- const USHORT ALT_X = 0x0878;
- const USHORT ALT_Y = 0x0879;
- const USHORT ALT_Z = 0x087A;
-
- const USHORT ALT_1 = 0x0831;
- const USHORT ALT_2 = 0x0832;
- const USHORT ALT_3 = 0x0833;
- const USHORT ALT_4 = 0x0834;
- const USHORT ALT_5 = 0x0835;
- const USHORT ALT_6 = 0x0836;
- const USHORT ALT_7 = 0x0837;
- const USHORT ALT_8 = 0x0838;
- const USHORT ALT_9 = 0x0839;
- const USHORT ALT_0 = 0x0840;
-
- const USHORT GRAY_ENTER = 0x000D; // Grey keys
- const USHORT GRAY_UP_ARROW = 0x0026;
- const USHORT GRAY_DOWN_ARROW = 0x0028;
- const USHORT GRAY_LEFT_ARROW = 0x0025;
- const USHORT GRAY_RIGHT_ARROW = 0x0027;
- const USHORT GRAY_INSERT = 0x002D;
- const USHORT GRAY_DELETE = 0x002E;
- const USHORT GRAY_HOME = 0x0024;
- const USHORT GRAY_END = 0x0023;
- const USHORT GRAY_PGUP = 0x0021;
- const USHORT GRAY_PGDN = 0x0022;
- const USHORT GRAY_DIVIDE = 0x006F;
- const USHORT GRAY_MULTIPLY = 0x006A;
- const USHORT GRAY_PLUS = 0x006B;
- const USHORT GRAY_MINUS = 0x006D;
-
- const USHORT CTRL_GRAY_UP_ARROW = 0x0426;
- const USHORT CTRL_GRAY_DOWN_ARROW = 0x0428;
- const USHORT CTRL_GRAY_LEFT_ARROW = 0x0425;
- const USHORT CTRL_GRAY_RIGHT_ARROW = 0x0427;
- const USHORT CTRL_GRAY_INSERT = 0x042D;
- const USHORT CTRL_GRAY_DELETE = 0x042E;
- const USHORT CTRL_GRAY_HOME = 0x0424;
- const USHORT CTRL_GRAY_END = 0x0423;
- const USHORT CTRL_GRAY_PGUP = 0x0421;
- const USHORT CTRL_GRAY_PGDN = 0x0422;
- const USHORT CTRL_GRAY_DIVIDE = 0x046F;
- const USHORT CTRL_GRAY_MULTIPLY = 0x046A;
- const USHORT CTRL_GRAY_PLUS = 0x046B;
- const USHORT CTRL_GRAY_MINUS = 0x046D;
-
- const USHORT ALT_GRAY_UP_ARROW = 0x0826;
- const USHORT ALT_GRAY_DOWN_ARROW = 0x0828;
- const USHORT ALT_GRAY_LEFT_ARROW = 0x0825;
- const USHORT ALT_GRAY_RIGHT_ARROW = 0x0827;
- const USHORT ALT_GRAY_INSERT = 0x082D;
- const USHORT ALT_GRAY_DELETE = 0x082E;
- const USHORT ALT_GRAY_HOME = 0x0824;
- const USHORT ALT_GRAY_END = 0x0823;
- const USHORT ALT_GRAY_PGUP = 0x0821;
- const USHORT ALT_GRAY_PGDN = 0x0822;
- const USHORT ALT_GRAY_DIVIDE = 0x086F;
- const USHORT ALT_GRAY_MULTIPLY = 0x086A;
- const USHORT ALT_GRAY_PLUS = 0x086B;
- const USHORT ALT_GRAY_MINUS = 0x086D;
-
- const USHORT WHITE_UP_ARROW = 0x0026; // White keys
- const USHORT WHITE_DOWN_ARROW = 0x0028;
- const USHORT WHITE_LEFT_ARROW = 0x0025;
- const USHORT WHITE_RIGHT_ARROW = 0x0027;
- const USHORT WHITE_INSERT = 0x002D;
- const USHORT WHITE_DELETE = 0x002E;
- const USHORT WHITE_HOME = 0x0024;
- const USHORT WHITE_END = 0x0023;
- const USHORT WHITE_PGUP = 0x0021;
- const USHORT WHITE_PGDN = 0x0022;
- //const USHORT WHITE_CENTER = 0x002A;
-
- const USHORT CTRL_WHITE_UP_ARROW = 0x0426;
- const USHORT CTRL_WHITE_DOWN_ARROW = 0x0428;
- const USHORT CTRL_WHITE_LEFT_ARROW = 0x0425;
- const USHORT CTRL_WHITE_RIGHT_ARROW = 0x0427;
- const USHORT CTRL_WHITE_INSERT = 0x042D;
- const USHORT CTRL_WHITE_DELETE = 0x042E;
- const USHORT CTRL_WHITE_HOME = 0x0424;
- const USHORT CTRL_WHITE_END = 0x0423;
- const USHORT CTRL_WHITE_PGUP = 0x0421;
- const USHORT CTRL_WHITE_PGDN = 0x0422;
- //const USHORT CTRL_WHITE_CENTER =0x042A;
-
- const USHORT F1 = 0x0070; // Function keys
- const USHORT F2 = 0x0071;
- const USHORT F3 = 0x0072;
- const USHORT F4 = 0x0073;
- const USHORT F5 = 0x0074;
- const USHORT F6 = 0x0075;
- const USHORT F7 = 0x0076;
- const USHORT F8 = 0x0077;
- const USHORT F9 = 0x0078;
- const USHORT F10 = 0x0079;
- const USHORT F11 = 0x007A;
- const USHORT F12 = 0x007B;
-
- const USHORT SHIFT_F1 = 0x0370;
- const USHORT SHIFT_F2 = 0x0371;
- const USHORT SHIFT_F3 = 0x0372;
- const USHORT SHIFT_F4 = 0x0373;
- const USHORT SHIFT_F5 = 0x0374;
- const USHORT SHIFT_F6 = 0x0375;
- const USHORT SHIFT_F7 = 0x0376;
- const USHORT SHIFT_F8 = 0x0377;
- const USHORT SHIFT_F9 = 0x0378;
- const USHORT SHIFT_F10 = 0x0379;
- const USHORT SHIFT_F11 = 0x037A;
- const USHORT SHIFT_F12 = 0x037B;
-
- const USHORT CTRL_F1 = 0x0470;
- const USHORT CTRL_F2 = 0x0471;
- const USHORT CTRL_F3 = 0x0472;
- const USHORT CTRL_F4 = 0x0473;
- const USHORT CTRL_F5 = 0x0474;
- const USHORT CTRL_F6 = 0x0475;
- const USHORT CTRL_F7 = 0x0476;
- const USHORT CTRL_F8 = 0x0477;
- const USHORT CTRL_F9 = 0x0478;
- const USHORT CTRL_F10 = 0x0479;
- const USHORT CTRL_F11 = 0x047A;
- const USHORT CTRL_F12 = 0x047B;
-
- const USHORT ALT_F1 = 0x0870;
- const USHORT ALT_F2 = 0x0871;
- const USHORT ALT_F3 = 0x0872;
- const USHORT ALT_F4 = 0x0873;
- const USHORT ALT_F5 = 0x0874;
- const USHORT ALT_F6 = 0x0875;
- const USHORT ALT_F7 = 0x0876;
- const USHORT ALT_F8 = 0x0877;
- const USHORT ALT_F9 = 0x0878;
- const USHORT ALT_F10 = 0x0879;
- const USHORT ALT_F11 = 0x087A;
- const USHORT ALT_F12 = 0x087B;
- #endif // USE_RAW_KEYS
-
- #else // not ZIL_MSWINDOWS
-
- // ----- Raw DOS scan-codes -------------------------------------------------
- #ifdef USE_RAW_KEYS
- #define ESCAPE 0x011B // Miscellaneous keys
- #define ENTER 0x1C0D
- #define BACKSPACE 0x0E08
- #define CTRL_BACKSPACE 0x0E7F
- #define TAB 0x0F09
- #define CTRL_TAB 0x9400
- #define BACKTAB 0x0F00
-
- #define CTRL_BREAK 0x0000
- #define CTRL_C 0x2E03
-
- #define ALT_ESCAPE 0x0100
- #define ALT_PERIOD 0x3400
- #define ALT_SPACE 0x3920
- #define ALT_WHITE_MINUS 0x8200
- #define ALT_WHITE_PLUS 0x8300
-
- #define ALT_Q 0x1000
- #define ALT_W 0x1100
- #define ALT_E 0x1200
- #define ALT_R 0x1300
- #define ALT_T 0x1400
- #define ALT_Y 0x1500
- #define ALT_U 0x1600
- #define ALT_I 0x1700
- #define ALT_O 0x1800
- #define ALT_P 0x1900
-
- #define ALT_A 0x1E00
- #define ALT_S 0x1F00
- #define ALT_D 0x2000
- #define ALT_F 0x2100
- #define ALT_G 0x2200
- #define ALT_H 0x2300
- #define ALT_J 0x2400
- #define ALT_K 0x2500
- #define ALT_L 0x2600
-
- #define ALT_Z 0x2C00
- #define ALT_X 0x2D00
- #define ALT_C 0x2E00
- #define ALT_V 0x2F00
- #define ALT_B 0x3000
- #define ALT_N 0x3100
- #define ALT_M 0x3200
-
- #define ALT_1 0x7800
- #define ALT_2 0x7900
- #define ALT_3 0x7A00
- #define ALT_4 0x7B00
- #define ALT_5 0x7C00
- #define ALT_6 0x7D00
- #define ALT_7 0x7E00
- #define ALT_8 0x7F00
- #define ALT_9 0x8000
- #define ALT_0 0x8100
-
- #define GRAY_ENTER 0xE00D // Grey keys
- #define GRAY_UP_ARROW 0x48E0
- #define GRAY_DOWN_ARROW 0x50E0
- #define GRAY_LEFT_ARROW 0x4BE0
- #define GRAY_RIGHT_ARROW 0x4DE0
- #define GRAY_INSERT 0x52E0
- #define GRAY_DELETE 0x53E0
- #define GRAY_HOME 0x47E0
- #define GRAY_END 0x4FE0
- #define GRAY_PGUP 0x49E0
- #define GRAY_PGDN 0x51E0
- #define GRAY_DIVIDE 0xE02F
- #define GRAY_MULTIPLY 0x372A
- #define GRAY_PLUS 0x4E2B
- #define GRAY_MINUS 0x4A2D
-
- #define CTRL_GRAY_UP_ARROW 0x8DE0
- #define CTRL_GRAY_DOWN_ARROW 0x91E0
- #define CTRL_GRAY_LEFT_ARROW 0x73E0
- #define CTRL_GRAY_RIGHT_ARROW 0x74E0
- #define CTRL_GRAY_INSERT 0x92E0
- #define CTRL_GRAY_DELETE 0x93E0
- #define CTRL_GRAY_HOME 0x77E0
- #define CTRL_GRAY_END 0x75E0
- #define CTRL_GRAY_PGUP 0x84E0
- #define CTRL_GRAY_PGDN 0x76E0
- #define CTRL_GRAY_DIVIDE 0x9500
- #define CTRL_GRAY_MULTIPLY 0x9600
- #define CTRL_GRAY_PLUS 0x9000
- #define CTRL_GRAY_MINUS 0x8E00
-
- #define ALT_GRAY_UP_ARROW 0x9800
- #define ALT_GRAY_DOWN_ARROW 0xA000
- #define ALT_GRAY_LEFT_ARROW 0x9B00
- #define ALT_GRAY_RIGHT_ARROW 0x9D00
- #define ALT_GRAY_INSERT 0xA200
- #define ALT_GRAY_DELETE 0xA300
- #define ALT_GRAY_HOME 0x9700
- #define ALT_GRAY_END 0x9F00
- #define ALT_GRAY_PGUP 0x9900
- #define ALT_GRAY_PGDN 0xA100
- #define ALT_GRAY_DIVIDE 0xA400
- #define ALT_GRAY_MULTIPLY 0x3700
- #define ALT_GRAY_PLUS 0x4E00
- #define ALT_GRAY_MINUS 0x4A00
-
- #define WHITE_UP_ARROW 0x4800 // White keys
- #define WHITE_DOWN_ARROW 0x5000
- #define WHITE_LEFT_ARROW 0x4B00
- #define WHITE_RIGHT_ARROW 0x4D00
- #define WHITE_INSERT 0x5200
- #define WHITE_DELETE 0x5300
- #define WHITE_HOME 0x4700
- #define WHITE_END 0x4F00
- #define WHITE_PGUP 0x4900
- #define WHITE_PGDN 0x5100
- #define WHITE_CENTER 0x4C00
-
- #define CTRL_WHITE_UP_ARROW 0x8D00
- #define CTRL_WHITE_DOWN_ARROW 0x9100
- #define CTRL_WHITE_LEFT_ARROW 0x7300
- #define CTRL_WHITE_RIGHT_ARROW 0x7400
- #define CTRL_WHITE_INSERT 0x9200
- #define CTRL_WHITE_DELETE 0x9300
- #define CTRL_WHITE_HOME 0x7700
- #define CTRL_WHITE_END 0x7500
- #define CTRL_WHITE_PGUP 0x8400
- #define CTRL_WHITE_PGDN 0x7600
- #define CTRL_WHITE_CENTER 0x8F00
-
- #define F1 0x3B00 // Function keys
- #define F2 0x3C00
- #define F3 0x3D00
- #define F4 0x3E00
- #define F5 0x3F00
- #define F6 0x4000
- #define F7 0x4100
- #define F8 0x4200
- #define F9 0x4300
- #define F10 0x4400
- #define F11 0x8500
- #define F12 0x8600
-
- #define SHIFT_F1 0x5400
- #define SHIFT_F2 0x5500
- #define SHIFT_F3 0x5600
- #define SHIFT_F4 0x5700
- #define SHIFT_F5 0x5800
- #define SHIFT_F6 0x5900
- #define SHIFT_F7 0x5A00
- #define SHIFT_F8 0x5B00
- #define SHIFT_F9 0x5C00
- #define SHIFT_F10 0x5D00
- #define SHIFT_F11 0x8700
- #define SHIFT_F12 0x8800
-
- #define CTRL_F1 0x5E00
- #define CTRL_F2 0x5F00
- #define CTRL_F3 0x6000
- #define CTRL_F4 0x6100
- #define CTRL_F5 0x6200
- #define CTRL_F6 0x6300
- #define CTRL_F7 0x6400
- #define CTRL_F8 0x6500
- #define CTRL_F9 0x6600
- #define CTRL_F10 0x6700
- #define CTRL_F11 0x8900
- #define CTRL_F12 0x8A00
-
- #define ALT_F1 0x6800
- #define ALT_F2 0x6900
- #define ALT_F3 0x6A00
- #define ALT_F4 0x6B00
- #define ALT_F5 0x6C00
- #define ALT_F6 0x6D00
- #define ALT_F7 0x6E00
- #define ALT_F8 0x6F00
- #define ALT_F9 0x7000
- #define ALT_F10 0x7100
- #define ALT_F11 0x8B00
- #define ALT_F12 0x8C00
- #endif // USE_RAW_KEYS
- #endif // ZIL_MSWINDOWS
-
- // ----- Logical events used by Zinc Interface Library ----------------------
- const UCHAR HOT_KEY_MAXIMIZE = 252;
- const UCHAR HOT_KEY_MINIMIZE = 253;
- const UCHAR HOT_KEY_SYSTEM = 254;
- const UCHAR HOT_KEY_SUB_WINDOW = 255;
-
- const int L_EXIT = 1000; // general logical events
- const int L_VIEW = 1001;
- const int L_SELECT = 1002;
- const int L_BEGIN_SELECT = 1003;
- const int L_CONTINUE_SELECT = 1004;
- const int L_END_SELECT = 1005;
- const int L_BEGIN_ESCAPE = 1006;
- const int L_CONTINUE_ESCAPE = 1007;
- const int L_END_ESCAPE = 1008;
- const int L_HELP = 1009;
- const int L_CANCEL = 1010;
- const int L_EXIT_FUNCTION = 1011;
-
- const int L_RESTORE = 1020; // window manager
- const int L_MOVE = 1021;
- const int L_SIZE = 1022;
-
- const int L_UP = 1050; // window object
- const int L_DOWN = 1051;
- const int L_LEFT = 1052;
- const int L_RIGHT = 1053;
- const int L_PREVIOUS = 1054;
- const int L_NEXT = 1055;
- const int L_FIRST = 1056;
- const int L_LAST = 1057;
- const int L_TOP = 1056;
- const int L_BOTTOM = 1057;
- const int L_PGUP = 1058;
- const int L_PGDN = 1059;
-
- const int L_BEGIN_MARK = 1101; // string
- const int L_CONTINUE_MARK = 1102;
- const int L_END_MARK = 1103;
- const int L_CUT = 1104;
- const int L_PASTE = 1105;
- const int L_CUT_PASTE = 1106;
- const int L_MARK = 1107;
- const int L_COPY_MARK = 1127;
- const int L_DELETE = 1108;
- const int L_DELETE_WORD = 1109;
- const int L_DELETE_EOL = 1110;
- const int L_INSERT_TOGGLE = 1114;
- const int L_WORD_LEFT = 1115;
- const int L_WORD_RIGHT = 1116;
- const int L_BOL = 1117;
- const int L_EOL = 1118;
-
- // ----- OBJECT IDENTIFICATIONS - THESE NUMBERS CANNOT BE CHANGED -----------
-
- const int ID_END = -1; // Special value
- // int ID_SCREEN = 0; // Defined in ui_dsp.hpp
-
- // Simple object types: 1 through 999
- const int ID_BORDER = 1;
- const int ID_BUTTON = 2;
- const int ID_DATE = 3;
- const int ID_FORMATTED_STRING = 4;
- const int ID_ICON = 5;
- const int ID_INTEGER = 6;
- const int ID_MAXIMIZE_BUTTON = 7;
- const int ID_MINIMIZE_BUTTON = 8;
- const int ID_NUMBER = 9;
- const int ID_POP_UP_WINDOW = 10;
- const int ID_PROMPT = 11;
- const int ID_REAL = 12;
- const int ID_STRING = 13;
- const int ID_TEXT = 15;
- const int ID_TIME = 16;
- const int ID_TITLE = 17;
- const int ID_WINDOW_OBJECT = 18;
- const int ID_POP_UP_ITEM = 19;
- const int ID_HELP_CONTEXT = 20;
-
- // Complex object types: 1000 through 1999
- const int ID_MATRIX = 1000;
- const int ID_POP_UP_MENU = 1002;
- const int ID_PULL_DOWN_ITEM = 1003;
- const int ID_PULL_DOWN_MENU = 1004;
- const int ID_SCROLL_BAR = 1005;
- const int ID_SYSTEM_BUTTON = 1006;
- const int ID_WINDOW = 1007;
-
- // Special identifications: 2000 through 2999
- const int ID_DISPLAY = 2000;
- const int ID_EVENT_MANAGER = 2001;
- const int ID_WINDOW_MANAGER = 2002;
-
- const int ID_OUTLINE = 2100;
- const int ID_WHITE_SHADOW = 2101;
- const int ID_LIGHT_SHADOW = 2102;
- const int ID_DARK_SHADOW = 2103;
- const int ID_BLACK_SHADOW = 2104;
- const int ID_MENU = 2105;
- const int ID_MENU_ITEM = 2106;
-
- // ----- Palette flags ------------------------------------------------------
-
- const USHORT PM_ANY = 0x0000;
- const USHORT PM_ACTIVE = 0x0001;
- const USHORT PM_INACTIVE = 0x0002;
- const USHORT PM_SELECTED = 0x0004;
- const USHORT PM_CURRENT = 0x0008;
- const USHORT PM_INVALID = 0x0010;
- const USHORT PM_VIEW = 0x0020;
- const USHORT PM_HOT_KEY = 0x0040;
- const USHORT PM_NON_SELECTABLE = 0x0080;
-
- // ----- UI_EVENT_MAP -------------------------------------------------------
- // ----- functions found in MAP.CPP -----------------------------------------
-
- struct EXPORT UI_EVENT_MAP
- {
- // Fields described in UI_EVENT_MAP reference chapter.
- int windowID;
- int logicalValue;
- int eventType;
- USHORT rawCode;
- };
-
- extern UI_EVENT_MAP *_eventMapTable;
- extern UI_EVENT_MAP *_hotKeyMapTable;
-
- extern int EXPORT MapEvent(UI_EVENT_MAP *mapTable, const UI_EVENT &event,
- int currentID, int id1 = ID_WINDOW_OBJECT, int id2 = ID_WINDOW_OBJECT,
- int id3 = ID_WINDOW_OBJECT, int id4 = ID_WINDOW_OBJECT,
- int id5 = ID_WINDOW_OBJECT);
-
- // ----- UI_PALETTE_MAP -----------------------------------------------------
- // ----- functions found in MAP1.CPP ----------------------------------------
-
- struct EXPORT UI_PALETTE_MAP
- {
- // Fields described in UI_PALETTE_MAP reference chapter.
- int windowID;
- int logicalValue;
- UI_PALETTE palette;
- };
-
- extern UI_PALETTE_MAP *_normalPaletteMapTable;
- extern UI_PALETTE_MAP *_helpPaletteMapTable;
- extern UI_PALETTE_MAP *_errorPaletteMapTable;
-
- extern UI_PALETTE * EXPORT MapPalette(UI_PALETTE_MAP *mapTable, int logicalValue,
- int id1 = ID_WINDOW_OBJECT, int id2 = ID_WINDOW_OBJECT,
- int id3 = ID_WINDOW_OBJECT, int id4 = ID_WINDOW_OBJECT,
- int id5 = ID_WINDOW_OBJECT);
-
- #endif // UI_MAP_HPP
-