textbuf_gui.h
Go to the documentation of this file.00001
00002
00005 #ifndef TEXTBUF_GUI_H
00006 #define TEXTBUF_GUI_H
00007
00008 #include "window_type.h"
00009 #include "string_type.h"
00010
00011 struct Textbuf {
00012 char *buf;
00013 uint16 maxlength, maxwidth;
00014 uint16 length, width;
00015 bool caret;
00016 uint16 caretpos;
00017 uint16 caretxoffs;
00018 };
00019
00020 struct querystr_d {
00021 StringID caption;
00022 Textbuf text;
00023 const char *orig;
00024 CharSetFilter afilter;
00025 bool handled;
00026 };
00027 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
00028
00029
00030 void DrawEditBox(Window *w, querystr_d *string, int wid);
00031 void HandleEditBox(Window *w, querystr_d *string, int wid);
00032 int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *we);
00033 bool HandleCaret(Textbuf *tb);
00034
00035 void DeleteTextBufferAll(Textbuf *tb);
00036 bool DeleteTextBufferChar(Textbuf *tb, int delmode);
00037 bool InsertTextBufferChar(Textbuf *tb, uint32 key);
00038 bool InsertTextBufferClipboard(Textbuf *tb);
00039 bool MoveTextBufferPos(Textbuf *tb, int navmode);
00040 void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
00041 void UpdateTextBufferSize(Textbuf *tb);
00042
00043 void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
00044 void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
00045
00046 #endif