2 * Acess2 GUI Version 3 (AxWin3)
3 * - By John Hodge (thePowersGang)
6 * - Rich Text line editor
8 #ifndef _AXWIN3_RICHTEXT_H_
9 #define _AXWIN3_RICHTEXT_H_
14 typedef int (*tAxWin3_RichText_KeyHandler)(tHWND Window, int bPress, uint32_t Sym, uint32_t Unicode);
15 typedef int (*tAxWin3_RichText_MouseHandler)(tHWND Window, int bPress, int Button, int Row, int Col);
16 typedef int (*tAxWin3_RichText_LineHandler)(tHWND Window, int Row);
18 #define AXWIN3_RICHTEXT_NOSCROLL 0x0001 // Disables server-side scrolling
19 #define AXWIN3_RICHTEXT_READONLY 0x0002 // Disables automatic insertion of translated characters
20 enum eAxWin3_RichText_CursorType {
21 AXWIN3_RICHTEXT_CURSOR_NONE,
22 AXWIN3_RICHTEXT_CURSOR_VLINE, // Vertical line
23 AXWIN3_RICHTEXT_CURSOR_ULINE, // Underline
24 AXWIN3_RICHTEXT_CURSOR_INV, // Inverted
27 extern tHWND AxWin3_RichText_CreateWindow(tHWND Parent, int Flags);
28 extern void AxWin3_RichText_SetKeyHandler(tHWND Window, tAxWin3_RichText_KeyHandler Handler);
29 extern void AxWin3_RichText_SetMouseHandler(tHWND Window, tAxWin3_RichText_MouseHandler Handler);
31 * \brief Sets the function called when the server requests an update on a line's contents
33 extern void AxWin3_RichText_SetLineHandler(tHWND Window, tAxWin3_RichText_LineHandler Handler);
34 extern void AxWin3_RichText_EnableScroll(tHWND Window, int bEnable);
35 extern void AxWin3_RichText_SetLineCount(tHWND Window, int Lines);
36 extern void AxWin3_RichText_SetColCount(tHWND Window, int Cols);
37 extern void AxWin3_RichText_SetBackground(tHWND Window, uint32_t ARGB_Colour);
38 extern void AxWin3_RichText_SetDefaultColour(tHWND Window, uint32_t ARGB_Colour);
39 extern void AxWin3_RichText_SetFont(tHWND Window, const char *FontName, int PointSize);
40 extern void AxWin3_RichText_SetCursorType(tHWND Window, int Type);
41 extern void AxWin3_RichText_SetCursorBlink(tHWND Window, int bBlink);
42 extern void AxWin3_RichText_SetCursorPos(tHWND Window, int Row, int Column);
44 * \brief Scroll the specified range of data down (moving lines up)
45 * \note This is NOT a visual scroll, it scrolls the data
47 * Top/Bottom `DownCount` lines are discarded (bottom if DownCount is -ve)
48 * UNLESS DownCount is -ve and RangeCount is -1 (indicating insertion of lines)
50 extern void AxWin3_RichText_ScrollRange(tHWND Window, int FirstRow, int RangeCount, int DownCount);
51 extern void AxWin3_RichText_SendLine(tHWND Window, int Line, const char *Text);