|
@@ -38,11 +38,11 @@
|
38
|
38
|
* @v row Row
|
39
|
39
|
* @v col Starting column
|
40
|
40
|
* @v width Width
|
41
|
|
- *
|
|
41
|
+ * @v flags Flags
|
42
|
42
|
*/
|
43
|
43
|
void init_editbox ( struct edit_box *box, char *buf, size_t len,
|
44
|
44
|
WINDOW *win, unsigned int row, unsigned int col,
|
45
|
|
- unsigned int width ) {
|
|
45
|
+ unsigned int width, unsigned int flags ) {
|
46
|
46
|
memset ( box, 0, sizeof ( *box ) );
|
47
|
47
|
box->string.buf = buf;
|
48
|
48
|
box->string.len = len;
|
|
@@ -51,6 +51,7 @@ void init_editbox ( struct edit_box *box, char *buf, size_t len,
|
51
|
51
|
box->row = row;
|
52
|
52
|
box->col = col;
|
53
|
53
|
box->width = width;
|
|
54
|
+ box->flags = flags;
|
54
|
55
|
}
|
55
|
56
|
|
56
|
57
|
/**
|
|
@@ -86,7 +87,11 @@ void draw_editbox ( struct edit_box *box ) {
|
86
|
87
|
len = ( strlen ( box->string.buf ) - first );
|
87
|
88
|
if ( len > width )
|
88
|
89
|
len = width;
|
89
|
|
- memcpy ( buf, ( box->string.buf + first ), len );
|
|
90
|
+ if ( box->flags & EDITBOX_STARS ) {
|
|
91
|
+ memset ( buf, '*', len );
|
|
92
|
+ } else {
|
|
93
|
+ memcpy ( buf, ( box->string.buf + first ), len );
|
|
94
|
+ }
|
90
|
95
|
|
91
|
96
|
/* Print box content and move cursor */
|
92
|
97
|
if ( ! box->win )
|