Currently the NativeMessageBox class can display 4 types of dialog boxes, each with a set of buttons to communicate the user’s feedback (ok, ok/cancel, yes/no, yes/no/cancel).
I would like to add to this a NativeMessageBox that allows for text entry. It could display multiple text entry fields, allowing it to be used as a login form. It would also display an Enter button and a Cancel button.
Here is one idea for the method prototype:
/** Shows a dialog box with multiple text entry fields. @param title the headline to show at the top of the box @param message a longer, more descriptive message to show underneath the title @param textFields pass in a StringArray holding the names of each text entry field to display. The method will overwrite each StringArray element with the corresponding text contents entered by the user. @returns true if Enter button was pressed, false if Cancel button was pressed. */ bool showTextEntryBox (const String& title, const String& message, StringArray& textFields);
While JUCE’s DialogWindow can already be used to display highly customizable text entry dialogs, it has the disadvantage of not being interactive with system accessibility features in the way that NativeMessageBox windows are. In other words, screen readers cannot read the text in a Dialog Window, nor the names of the button choices, nor the text as the user enters it into the text fields.