textbuf_gui.h

Go to the documentation of this file.
00001 /* $Id: textbuf_gui.h 14514 2008-10-22 19:12:10Z smatz $ */
00002 
00005 #ifndef TEXTBUF_GUI_H
00006 #define TEXTBUF_GUI_H
00007 
00008 #include "window_type.h"
00009 #include "string_type.h"
00010 #include "strings_type.h"
00011 #include "core/enum_type.hpp"
00012 
00013 struct Textbuf {
00014   char *buf;                
00015   uint16 maxsize, maxwidth; 
00016   uint16 size, width;       
00017   bool caret;               
00018   uint16 caretpos;          
00019   uint16 caretxoffs;        
00020 };
00021 
00022 bool HandleCaret(Textbuf *tb);
00023 
00024 void DeleteTextBufferAll(Textbuf *tb);
00025 bool DeleteTextBufferChar(Textbuf *tb, int delmode);
00026 bool InsertTextBufferChar(Textbuf *tb, uint32 key);
00027 bool InsertTextBufferClipboard(Textbuf *tb);
00028 bool MoveTextBufferPos(Textbuf *tb, int navmode);
00029 void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 maxsize, uint16 maxwidth);
00030 void UpdateTextBufferSize(Textbuf *tb);
00031 
00033 enum QueryStringFlags {
00034   QSF_NONE             =    0,
00035   QSF_ACCEPT_UNCHANGED = 0x01, 
00036   QSF_ENABLE_DEFAULT   = 0x02, 
00037 };
00038 
00039 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
00040 
00041 
00042 typedef void QueryCallbackProc(Window*, bool);
00043 
00044 void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
00045 void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
00046 
00048 static const uint OSK_KEYBOARD_ENTRIES = 50;
00049 
00055 extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
00056 
00057 #endif /* TEXTBUF_GUI_H */

Generated on Wed Jun 3 19:05:15 2009 for OpenTTD by  doxygen 1.5.6