Skip to content

Commit

Permalink
Don't automatically redraw the edit box; this allows better inheritance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brown committed Dec 20, 2006
1 parent 35dcbfe commit 3e0f762
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
19 changes: 0 additions & 19 deletions src/hci/mucurses/widgets/editbox.c
Expand Up @@ -94,22 +94,3 @@ void draw_editbox ( struct edit_box *box ) {
mvwprintw ( box->win, box->row, box->col, "%s", buf );
wmove ( box->win, box->row, ( box->col + cursor_offset ) );
}

/**
* Edit text box widget
*
* @v box Editable text box widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
*
*/
int edit_editbox ( struct edit_box *box, int key ) {

/* Update the string itself */
key = edit_string ( &box->string, key );

/* Update the display */
draw_editbox ( box );

return key;
}
16 changes: 15 additions & 1 deletion src/include/gpxe/editbox.h
Expand Up @@ -30,6 +30,20 @@ extern void init_editbox ( struct edit_box *box, char *buf, size_t len,
WINDOW *win, unsigned int row, unsigned int col,
unsigned int width );
extern void draw_editbox ( struct edit_box *box );
extern int edit_editbox ( struct edit_box *box, int key );

/**
* Edit text box widget
*
* @v box Editable text box widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
*
* You must call draw_editbox() to update the display after calling
* edit_editbox().
*
*/
static inline int edit_editbox ( struct edit_box *box, int key ) {
return edit_string ( &box->string, key );
}

#endif /* _GPXE_EDITBOX_H */

0 comments on commit 3e0f762

Please sign in to comment.