-
When we show a dialog box with DialogWindow::showModalDialog() the contentComponent do not have keyboard focus: User need to perform a mouse click to obtain it.
It’s because TempDialogWindow inherit form TopLevelWindow who does a setWantsKeyboardFocus (true) in its constructor.
A way to fix it is to setWantsKeyboardFocus (false) on the TempDialogWindow constructor or directly in DialogWindow::showModalDialog(). -
Another minor Keyboard focus issue is related to AlertWindow :
By default TextEditor created by AlertWindow::addTextEditor can have keyboard focus.
But non editable ComboBox created by AlertWindow::addComboBox cannot.
So the user can navigate between TextEditors with [tab] key but cannot do it with ComboBox components.
For example, it can be usefull when user what to change ComboBox selection with arrow keys.
It’s because ComboBox do not have setWantsKeyboardFocus (true) in it’s constructor like TextEditor class.
I understand that ComboBox::setEditableText behavior was an explanation of this exception.
I think it can be cool that AlertWindow::addComboBox activate the keyboard focus on non editable ComboBox by default,
preventing developer to add the following code in it’s AlertWindow child class.
addComboBox("name", theStringArray, "onScreenLabel");
getComboBoxComponent("name")->setWantsKeyboardFocus(true);
Do you think so?
Thanks for reading this huge post full of minor things…