1 #ifndef TEXTBOX_H 2 #define TEXTBOX_H 3 4 #include "flt.h" 5 6 #define MAX_TEXT_SIZE 100 7 8 // Note: if using the text box module pass in a function to the 'on_select' parameter 9 // the text box will call this function with the user entered text in 'newstr' 10 11 // If supplied the 'input_buffer' array will be used to store the user input text, 12 // this will also be the address passed to 'on_select' in 'newstr' - in this case 13 // the calling function owns the data buffer. Ensure that the size of 'input_buffer' 14 // is at least 'maxsize + 1'. 15 16 // If 'input_buffer' is null then a local buffer in the module will be used to 17 // store the text, the maximum size of this buffer is MAX_TEXT_SIZE. 18 // In this case the module owns the buffer and the contents must be copied to local 19 // storage in the 'on_select' code. 20 21 // Update version if changes are made to the module interface 22 #define GUI_TBOX_VERSION {2,0} 23 24 typedef struct 25 { 26 base_interface_t base; 27 28 int (*textbox_init)(int title, int msg, const char* defaultstr, unsigned int maxsize, void (*on_select)(const char* newstr), char *input_buffer); 29 } libtextbox_sym; 30 31 extern libtextbox_sym* libtextbox; 32 33 #endif