XenevaOS
Loading...
Searching...
No Matches
textbox.h
Go to the documentation of this file.
1
30#ifndef __TEXT_BOX_H__
31#define __TEXT_BOX_H__
32
33#include <stdint.h>
34#include "base.h"
35#include "window.h"
36
37#define CH_TEXTBOX_MAX_STRING 32767 //~32KiB
38
39typedef struct _text_box_ {
42 char* text;
43 //to PlainText, toHTML properties
44 //font format
50 //cursor
52 int textCursorPosY;// future use
54
55#ifdef __cplusplus
57#endif
58
59 /*
60 * ChCreateTextBox -- create a new instance of textbox widget
61 * @param x -- X position
62 * @param y -- Y position
63 * @param width -- Width of the textbox
64 * @param height -- Height of the textbox
65 */
66 XE_EXPORT ChTextBox * ChCreateTextBox(ChWindow* win, int x, int y, int width, int height);
67
68 /*
69 * ChTextBoxSetText -- set text to textbox
70 * @param tb -- Pointer to textbox
71 * @param text -- text to set
72 */
73 XE_EXPORT void ChTextBoxSetText(ChTextBox* tb, char* text);
74
75 /*
76 * ChTextBoxUpdate -- updates the textbox with
77 * current graphical content
78 * @param tb -- Pointer to textbox
79 * @param mainWin -- Pointer to main window
80 */
82
83 /*
84 * ChTextBoxSetFont -- set font for particular given
85 * text box
86 * @param tb -- Pointer to textbox
87 * @param font -- Font to set
88 */
90
91 /*
92 * ChTextBoxSetFontSize -- set font size for the text box
93 * @param tb -- Pointer to teh textbox
94 * @param sz -- font sz in pixels
95 */
97
98 #ifdef __cplusplus
99}
100#endif
101
102#endif
ChWindow * mainWin
Definition main.cpp:54
#define XE_EXPORT
Definition _xeneva.h:46
#define XE_EXTERN
Definition _xeneva.h:50
unsigned int uint32_t
Definition acefiex.h:163
ChTextBox * tb
Definition ctrl.cpp:93
ChWindow * win
Definition namdapha.cpp:45
Definition window.h:114
Definition font.h:62
Definition window.h:90
Definition textbox.h:39
ChFont * font
Definition textbox.h:45
int textCursorPosX
Definition textbox.h:51
char * text
Definition textbox.h:42
bool editable
Definition textbox.h:41
ChWidget wid
Definition textbox.h:40
uint32_t textBackgroundColor
Definition textbox.h:47
uint32_t textColor
Definition textbox.h:46
int textHeight
Definition textbox.h:49
int textCursorPosY
Definition textbox.h:52
int textWidth
Definition textbox.h:48
int x
Definition term.cpp:49
XE_EXPORT void ChTextBoxSetText(ChTextBox *tb, char *text)
Definition textbox.cpp:130
XE_EXPORT ChTextBox * ChCreateTextBox(ChWindow *win, int x, int y, int width, int height)
Definition textbox.cpp:104
XE_EXPORT void ChTextBoxSetFont(ChTextBox *tb, ChFont *font)
Definition textbox.cpp:142
XE_EXPORT void ChTextBoxSetFontSize(ChTextBox *tb, int sz)
Definition textbox.cpp:151
XE_EXPORT void ChTextBoxUpdate(ChTextBox *tb, ChWindow *mainWin)
Definition textbox.cpp:90
struct _text_box_ ChTextBox