Lines Matching full:box
27 * Editable text box widget
34 * Initialise text box widget
36 * @v box Editable text box widget
45 void init_editbox ( struct edit_box *box, char *buf, size_t len, in init_editbox() argument
48 memset ( box, 0, sizeof ( *box ) ); in init_editbox()
49 box->string.buf = buf; in init_editbox()
50 box->string.len = len; in init_editbox()
51 box->string.cursor = strlen ( buf ); in init_editbox()
52 box->win = ( win ? win : stdscr ); in init_editbox()
53 box->row = row; in init_editbox()
54 box->col = col; in init_editbox()
55 box->width = width; in init_editbox()
56 box->flags = flags; in init_editbox()
60 * Draw text box widget
62 * @v box Editable text box widget
65 void draw_editbox ( struct edit_box *box ) { in draw_editbox() argument
66 size_t width = box->width; in draw_editbox()
71 /* Adjust starting offset so that cursor remains within box */ in draw_editbox()
72 cursor_offset = ( box->string.cursor - box->first ); in draw_editbox()
75 first = box->first; in draw_editbox()
83 box->first = first; in draw_editbox()
84 cursor_offset = ( box->string.cursor - first ); in draw_editbox()
89 len = ( strlen ( box->string.buf ) - first ); in draw_editbox()
92 if ( box->flags & EDITBOX_STARS ) { in draw_editbox()
95 memcpy ( buf, ( box->string.buf + first ), len ); in draw_editbox()
98 /* Print box content and move cursor */ in draw_editbox()
99 if ( ! box->win ) in draw_editbox()
100 box->win = stdscr; in draw_editbox()
101 mvwprintw ( box->win, box->row, box->col, "%s", buf ); in draw_editbox()
102 wmove ( box->win, box->row, ( box->col + cursor_offset ) ); in draw_editbox()