Windows Accessibility: Report checked checked state of items in wxCheckListBox (PR #26055)

12 views
Skip to first unread message

glenrgordon

unread,
Dec 27, 2025, 12:00:36 PM (4 days ago) Dec 27
to wx-...@googlegroups.com, Subscribed

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


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26055

Commit Summary

  • b4a48ce Windows Accessibility: Report checked checked state of items in wxCheckListBox

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26055@github.com>

VZ

unread,
9:21 AM (22 minutes ago) 9:21 AM
to wx-...@googlegroups.com, Subscribed

@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!


In include/wx/msw/checklst.h:

> @@ -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.


In include/wx/msw/checklst.h:

> @@ -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?


In src/common/wincmn.cpp:

> @@ -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.


In src/msw/checklst.cpp:

> @@ -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.Message ID: <wxWidgets/wxWidgets/pull/26055/review/3620966537@github.com>

Reply all
Reply to author
Forward
0 new messages