From d7eaae0e2c816c0727ba0a1a5e497a934e0289b6 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sat, 11 Dec 2021 21:50:16 +0300 Subject: dialog-box: make handling keyboard actions and highlighting of widgets --- Library/UefiShellUfmCommandLib/dialog-box.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Library/UefiShellUfmCommandLib/dialog-box.h') diff --git a/Library/UefiShellUfmCommandLib/dialog-box.h b/Library/UefiShellUfmCommandLib/dialog-box.h index d6d6e43..4d7e899 100644 --- a/Library/UefiShellUfmCommandLib/dialog-box.h +++ b/Library/UefiShellUfmCommandLib/dialog-box.h @@ -4,10 +4,20 @@ #include #include "widget/input.h" +enum dbox_widgets { + DBOX_START_WID = 0, + DBOX_OK_BUTTON, + DBOX_CL_BUTTON, + DBOX_INPUT_BOX, + DBOX_END_WID +}; + struct dbox_ctx { struct window *wbg; struct widget_input *in; struct window *wok, *wcl; + + enum dbox_widgets active_widget; }; /* @@ -35,6 +45,15 @@ struct dbox_ctx *dbox_alloc(struct screen *scr, CONST CHAR16 *title, */ VOID dbox_release(struct dbox_ctx *dbox); +/* + * Handles all keyboard actions in the dialog box + * + * dbox: the dialog box on which to operate + * + * return: TRUE if user pressed OK. Otherwise FALSE +*/ +BOOLEAN dbox_handle(struct dbox_ctx *dbox); + /* * Does the output of dialog box to the terminal * -- cgit v1.2.3-18-g5258