Hello,
I have quite a simple and classic dialog box with text fields,
checkboxes and buttons. Everything works as expected as long as the app
is in light or unspecified appearance mode.
However, when the app is in dark mode, checkboxes are notified as
buttons by screen readers (Jaws and NVDA), and their state checked or
unchecked isn't announced. They continue to work properly, i.e. the
state correctly switches when clicking or pressing space, but they keep
being indicated as buttons without state. So screen reader users can no
longer know that they are checkboxes, and if they are checked or not.
Am I missing something ? Is that a limitation of dark mode ? Or this is
just a bug ?
I'm using WXWidgets developement / master branch, last updated about
10-15 days ago, on Windows 11.
There was no problem with version 3.2.
I activate dark mode with:
SetAppearance(Appearance::Dark);
in wxApp::OnInit, according to user configuration.
My dialog box is pretty simple, some example code:
MyDialog::MyDialog (App& app0):
wxDialog(nullptr, wxID_ANY,
U(translate("MyDialogTitle")),
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
app(app0)
{
auto label1 = new wxStaticText(this, wxID_ANY, U(translate("label1")));
field1 = new wxTextCtrl(this, ID_FIELD1, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
auto label2 = new wxStaticText(this, wxID_ANY, U(translate("label2")));
field2 = new wxTextCtrl(this, ID_FIELD2, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0);
checkbox1 = new wxCheckBox(this, ID_CHECKBOX1, U(translate("checkbox1")));
checkbox2 = new wxCheckBox(this, ID_CHECKBOX2, U(translate("checkbox2")));
auto okBtn = new wxButton(this, wxID_OK, U(translate("Continue")));
...
auto dlgSizer = new wxFlexGridSizer(2, 5, 5);
dlgSizer->Add(label1, 0);
dlgSizer->Add(field1, 0, wxEXPAND);
dlgSizer->Add(label2, 0);
dlgSizer->Add(field2, 0, wxEXPAND);
dlgSizer->Add(new wxStaticText(this, wxID_ANY, wxEmptyString), 0);
dlgSizer->Add(checkbox1, 0, wxEXPAND);
dlgSizer->Add(new wxStaticText(this, wxID_ANY, wxEmptyString), 0);
dlgSizer->Add(checkbox2, 0, wxEXPAND);
dlgSizer->Add(okBtn, 0);
...
SetSizerAndFit(dlgSizer);
...