misc_gui.c
changeset 1879 2ccc61e922e2
parent 1860 cc0019652d0e
child 1891 92a3b0aa0946
--- a/misc_gui.c	Mon May 30 15:50:20 2005 +0000
+++ b/misc_gui.c	Mon May 30 16:03:21 2005 +0000
@@ -784,6 +784,17 @@
 }
 
 /**
+ * Delete every character in the textbuffer
+ * @param tb @Textbuf buffer to be emptied
+ */
+void DeleteTextBufferAll(Textbuf *tb)
+{
+	memset(tb->buf, 0, tb->maxlength);
+	tb->length = tb->width = 0;
+	tb->caretpos = tb->caretxoffs = 0;
+}
+
+/**
  * Insert a character to a textbuffer. If maxlength is zero, we don't care about
  * the screenlength but only about the physical length of the string
  * @param tb @Textbuf type to be changed
@@ -875,6 +886,10 @@
 		if (InsertTextBufferClipboard(&WP(w, querystr_d).text))
 			InvalidateWidget(w, wid);
 		break;
+	case (WKC_CTRL | 'U'):
+		DeleteTextBufferAll(&WP(w, querystr_d).text);
+		InvalidateWidget(w, wid);
+		break;
 	case WKC_BACKSPACE: case WKC_DELETE:
 		if (DeleteTextBufferChar(&WP(w, querystr_d).text, we->keypress.keycode))
 			InvalidateWidget(w, wid);