The standard Windows ListBox class has no concept of checked/unchecked
state of items. WXWidgets obviously overcomes this with owner drawn
items so that the checked boxes can be drawn. But this info gets lost
when using the standard Windows IAccessible ListBox implementation
since said implementation has no concept of checked state for
individual items.
Fixes #25948
https://github.com/wxWidgets/wxWidgets/pull/26055
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz commented on this pull request.
Great, thanks for implementing this!
I didn't test it, but the code looks correct to me, it would just be nice to address the minor comments/questions below before merging it.
Thanks again!
> @@ -88,4 +91,15 @@ class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox);
};
+#if wxUSE_ACCESSIBILITY
+class WXDLLIMPEXP_CORE wxCheckListBoxAccessible : public wxWindowAccessible
Does this class need to be public? I'd hide it in src/msw/checklst.cpp and not export it (i.e. remove WXDLLIMPEXP_CORE) as I don't think the application code should ever use it directly.
> @@ -88,4 +91,15 @@ class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox);
};
+#if wxUSE_ACCESSIBILITY
+class WXDLLIMPEXP_CORE wxCheckListBoxAccessible : public wxWindowAccessible
+{
+public:
+ explicit wxCheckListBoxAccessible(wxCheckListBox* winm);
This is very minor, but why is this parameter called winm? Just win is fine, of course, but why m?
> @@ -3955,7 +3955,7 @@ wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent)
if (*parent)
return wxACC_OK;
else
- return wxACC_FAIL;
+ return wxACC_NOT_IMPLEMENTED;
Is this related to the other changes? If not, it should be ideally extracted into a separate commit, with the explanation of why is this necessary in its commit message.
> @@ -276,6 +276,10 @@ void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck)
GetItem(uiIndex)->Check(bCheck);
RefreshItem(uiIndex);
+#if wxUSE_ACCESSIBILITY
+ wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, uiIndex+1);
Extremely minor, but for consistency with the similar line just below:
⬇️ Suggested change- wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, uiIndex+1); + wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, uiIndex + 1);
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()