summaryrefslogtreecommitdiffstats
path: root/src/hci/mucurses/widgets/editbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci/mucurses/widgets/editbox.c')
-rw-r--r--src/hci/mucurses/widgets/editbox.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/hci/mucurses/widgets/editbox.c b/src/hci/mucurses/widgets/editbox.c
index 5c066fda..a52089ce 100644
--- a/src/hci/mucurses/widgets/editbox.c
+++ b/src/hci/mucurses/widgets/editbox.c
@@ -38,11 +38,11 @@
* @v row Row
* @v col Starting column
* @v width Width
- *
+ * @v flags Flags
*/
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 width, unsigned int flags ) {
memset ( box, 0, sizeof ( *box ) );
box->string.buf = buf;
box->string.len = len;
@@ -51,6 +51,7 @@ void init_editbox ( struct edit_box *box, char *buf, size_t len,
box->row = row;
box->col = col;
box->width = width;
+ box->flags = flags;
}
/**
@@ -86,7 +87,11 @@ void draw_editbox ( struct edit_box *box ) {
len = ( strlen ( box->string.buf ) - first );
if ( len > width )
len = width;
- memcpy ( buf, ( box->string.buf + first ), len );
+ if ( box->flags & EDITBOX_STARS ) {
+ memset ( buf, '*', len );
+ } else {
+ memcpy ( buf, ( box->string.buf + first ), len );
+ }
/* Print box content and move cursor */
if ( ! box->win )