36 #define EDITBOX_MIN_CHARS 3 51 WINDOW *win,
unsigned int row,
unsigned int col,
52 unsigned int width,
unsigned int flags ) {
70 size_t width =
box->width;
71 char buf[ width + 1 ];
72 signed int cursor_offset, underflow, overflow,
first;
76 cursor_offset = (
box->string.cursor -
box->first );
78 overflow = ( cursor_offset - ( width - 1 ) );
80 if ( underflow > 0 ) {
84 }
else if ( overflow > 0 ) {
88 cursor_offset = (
box->string.cursor -
first );
91 memset ( buf,
'_', width );
Editable text box widget.
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
int box(WINDOW *win, chtype verch, chtype horch)
Draw borders from single-byte characters and renditions around a window.
#define mvwprintw(win, y, x, fmt,...)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static void init_editstring(struct edit_string *string, char *buf, size_t len)
Initialise editable string.
An editable text box widget.
void init_editbox(struct edit_box *box, char *buf, size_t len, WINDOW *win, unsigned int row, unsigned int col, unsigned int width, unsigned int flags)
Initialise text box widget.
size_t strlen(const char *src)
Get length of string.
void draw_editbox(struct edit_box *box)
Draw text box widget.
Show stars instead of contents (for password widgets)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define EDITBOX_MIN_CHARS
uint32_t first
Length to skip in first segment.
void * memset(void *dest, int character, size_t len) __nonnull