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