Explorar el Código

Don't automatically redraw the edit box; this allows better inheritance.

tags/v0.9.3
Michael Brown hace 18 años
padre
commit
3e0f7621eb
Se han modificado 2 ficheros con 15 adiciones y 20 borrados
  1. 0
    19
      src/hci/mucurses/widgets/editbox.c
  2. 15
    1
      src/include/gpxe/editbox.h

+ 0
- 19
src/hci/mucurses/widgets/editbox.c Ver fichero

@@ -94,22 +94,3 @@ void draw_editbox ( struct edit_box *box ) {
94 94
 	mvwprintw ( box->win, box->row, box->col, "%s", buf );
95 95
 	wmove ( box->win, box->row, ( box->col + cursor_offset ) );
96 96
 }
97
-
98
-/**
99
- * Edit text box widget
100
- *
101
- * @v box		Editable text box widget
102
- * @v key		Key pressed by user
103
- * @ret key		Key returned to application, or zero
104
- *
105
- */
106
-int edit_editbox ( struct edit_box *box, int key ) {
107
-
108
-	/* Update the string itself */
109
-	key = edit_string ( &box->string, key );
110
-
111
-	/* Update the display */
112
-	draw_editbox ( box );
113
-
114
-	return key;
115
-}

+ 15
- 1
src/include/gpxe/editbox.h Ver fichero

@@ -30,6 +30,20 @@ extern void init_editbox ( struct edit_box *box, char *buf, size_t len,
30 30
 			   WINDOW *win, unsigned int row, unsigned int col,
31 31
 			   unsigned int width );
32 32
 extern void draw_editbox ( struct edit_box *box );
33
-extern int edit_editbox ( struct edit_box *box, int key );
33
+
34
+/**
35
+ * Edit text box widget
36
+ *
37
+ * @v box		Editable text box widget
38
+ * @v key		Key pressed by user
39
+ * @ret key		Key returned to application, or zero
40
+ *
41
+ * You must call draw_editbox() to update the display after calling
42
+ * edit_editbox().
43
+ *
44
+ */
45
+static inline int edit_editbox ( struct edit_box *box, int key ) {
46
+	return edit_string ( &box->string, key );
47
+}
34 48
 
35 49
 #endif /* _GPXE_EDITBOX_H */

Loading…
Cancelar
Guardar