1 /* 2 Copyright (C) 2003-2006 Andrey Nazarov 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 */ 20 21 22 /* 23 =============================================================================== 24 25 LINE EDITING 26 27 =============================================================================== 28 */ 29 30 #define MAX_FIELD_TEXT 256 31 32 typedef struct inputField_s { 33 char text[MAX_FIELD_TEXT]; 34 int maxChars; 35 int visibleChars; 36 int cursorPos; 37 int selectStart, selectEnd; 38 } inputField_t; 39 40 qboolean IF_KeyEvent( inputField_t *field, int key ); 41 qboolean IF_CharEvent( inputField_t *field, int key ); 42 void IF_Init( inputField_t *field, int visibleChars, int maxChars ); 43 void IF_InitText( inputField_t *field, int visibleChars, int maxChars, 44 const char *text ); 45 void IF_Clear( inputField_t *field ); 46 void IF_Replace( inputField_t *field, const char *text ); 47 void IF_Draw( inputField_t *field, int x, int y, uint32 flags, 48 qhandle_t hFont ); 49 50