1 /* 2 * Seven Kingdoms: Ancient Adversaries 3 * 4 * Copyright 1997,1998 Enlight Software Ltd. 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * 19 */ 20 21 // Filename : OGETA.H 22 // Description : get field, non-blocking 23 24 25 #ifndef __OGETA_H 26 #define __OGETA_H 27 28 class Font; 29 30 // ---------- Define class GetA ---------- // 31 32 class GetA 33 { 34 public: 35 short x; 36 short y; 37 short x_limit; 38 char* input_field; 39 unsigned field_len; 40 unsigned cursor_pos; 41 unsigned mark_cursor_pos; 42 Font* font_ptr; 43 char align_flag; 44 char enable_flag; 45 char esc_key_flag; // detect esc key to clear the field 46 char* back_ground_bitmap; 47 48 char hide_flag; 49 char* hide_field; 50 char* disp_field; 51 52 char mouse_drag_flag; 53 54 public: 55 GetA(); 56 ~GetA(); 57 void init(int x1, int y1, int x2, char *field, unsigned length, Font *, char align, char detectEsc, char hide=0); 58 int height(); 59 void clear(); 60 unsigned detect_key(); 61 int detect_click(); 62 unsigned detect(); 63 void paint(int paintCursor=1); 64 int cursor_x(int curPos); clear_select()65 void clear_select() { mark_cursor_pos = cursor_pos; } 66 unsigned mark_begin(); 67 unsigned mark_end(); is_select()68 int is_select() { return mark_cursor_pos != cursor_pos; } 69 void select_whole(); 70 }; 71 72 // ---------- define class GetAGroup ---------- // 73 74 class GetAGroup 75 { 76 public: 77 int geta_num; 78 GetA* geta_array; 79 int focused_geta; 80 char enable_flag; 81 82 public: 83 GetAGroup(int); 84 ~GetAGroup(); 85 86 void paint(); 87 int detect(); 88 int set_focus(int, int paintFlag=1); 89 90 GetA& operator[](int); 91 int operator()(); 92 }; 93 94 95 #endif 96 97 98