1 /********************************************************************** 2 Freeciv - Copyright (C) 2006 - The Freeciv Project 3 This program is free software; you can redistribute it and/or modify 4 it under the terms of the GNU General Public License as published by 5 the Free Software Foundation; either version 2, or (at your option) 6 any later version. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 ***********************************************************************/ 13 14 #ifndef FC__WIDGET_EDIT_H 15 #define FC__WIDGET_EDIT_H 16 17 enum Edit_Return_Codes { 18 ED_RETURN = 1, 19 ED_ESC = 2, 20 ED_MOUSE = 3, 21 ED_FORCE_EXIT = 4 22 }; 23 24 #define create_edit_from_chars(pBackground, pDest, pCharString, iPtsize, length, flags) \ 25 create_edit(pBackground, pDest, \ 26 create_str16_from_char(pCharString, iPtsize), \ 27 length, flags) 28 29 #define create_edit_from_unichars(pBackground, pDest, pUniChar, pUniCharSize, iPtsize, length, flags) \ 30 create_edit(pBackground, pDest, create_string16(pUniChar, pUniCharSize, iPtsize), length, flags ) 31 32 #define edit(pEdit) edit_field(pEdit) 33 34 struct widget *create_edit(SDL_Surface *pBackground, struct gui_layer *pDest, 35 SDL_String16 *pString16, Uint16 lenght, 36 Uint32 flags); 37 enum Edit_Return_Codes edit_field(struct widget *pEdit_Widget); 38 int draw_edit(struct widget *pEdit, Sint16 start_x, Sint16 start_y); 39 40 #endif /* FC__WIDGET_EDIT_H */ 41