Document change of wxGetTranslation() return type to wxString See #26196.
wxRichTextCtrl: Basic screen reader support Add rudimentary (IAccessibility/MSAA) accessibility to wxRichTextCtrl to allow screen readers to read the rich text content as plain text on Windows. Full accessibility support would require using IAccessibility2 and IAccessibilityText (contextual reading of lines or characters, etc.) which is not yet implemented, but in the meanwhile this is better than nothing. See #26051 which is somewhat mitigated even if not really fixed by this.
Use generic rich tooltips for text controls in wxMSW dark mode Native ones use light mode colours and so don't look appropriately. See #25891.
Document wxStockHelpStringClient used by wxGetStockHelpString() This should have been done in e80d78c2c9 (Document wxGetStockHelpString() function, 2026-02-04) as all types used by the documented functions should themselves be documented. Closes #26206.
| ... | ... | @@ -136,6 +136,12 @@ Changes in behaviour not resulting in compilation errors |
| 136 | 136 | changed when called with "false" argument, please review the documentation
|
| 137 | 137 | and update your code if you called them with "false" (which is rarely done).
|
| 138 | 138 | |
| 139 | +- wxGetTranslation() and related functions now return wxString by value, not
|
|
| 140 | + as const reference. This may affect code returning wxGetTranslation() result
|
|
| 141 | + as const reference from its own functions, please change the return type of
|
|
| 142 | + the function to wxString to fix this.
|
|
| 143 | + |
|
| 144 | + |
|
| 139 | 145 | Changes in behaviour which may result in build errors
|
| 140 | 146 | -----------------------------------------------------
|
| 141 | 147 |
| ... | ... | @@ -2303,6 +2303,10 @@ protected: |
| 2303 | 2303 | #endif
|
| 2304 | 2304 | #endif // !__WXUNIVERSAL__
|
| 2305 | 2305 | |
| 2306 | +#if wxUSE_ACCESSIBILITY
|
|
| 2307 | + virtual wxAccessible *CreateAccessible() override;
|
|
| 2308 | +#endif
|
|
| 2309 | + |
|
| 2306 | 2310 | // Overrides
|
| 2307 | 2311 | protected:
|
| 2308 | 2312 |
| ... | ... | @@ -81,6 +81,16 @@ wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC); |
| 81 | 81 | |
| 82 | 82 | ///@}
|
| 83 | 83 | |
| 84 | +/**
|
|
| 85 | + Used with wxGetStockHelpString() to specify the context in which help
|
|
| 86 | + string is used.
|
|
| 87 | + */
|
|
| 88 | +enum wxStockHelpStringClient
|
|
| 89 | +{
|
|
| 90 | + /// Help string to use for menu items.
|
|
| 91 | + wxSTOCK_MENU
|
|
| 92 | +};
|
|
| 93 | + |
|
| 84 | 94 | /** @addtogroup group_funcmacro_misc */
|
| 85 | 95 | ///@{
|
| 86 | 96 |
| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | #include "wx/generic/private/richtooltip.h"
|
| 30 | 30 | #include "wx/msw/private.h"
|
| 31 | 31 | #include "wx/msw/uxtheme.h"
|
| 32 | +#include "wx/msw/private/darkmode.h"
|
|
| 32 | 33 | |
| 33 | 34 | // Provide definitions missing from some compilers SDK headers.
|
| 34 | 35 | |
| ... | ... | @@ -66,8 +67,9 @@ public: |
| 66 | 67 | wxRichToolTipMSWImpl(const wxString& title, const wxString& message) :
|
| 67 | 68 | wxRichToolTipGenericImpl(title, message)
|
| 68 | 69 | {
|
| 69 | - // So far so good...
|
|
| 70 | - m_canUseNative = true;
|
|
| 70 | + // We can't use native tooltips in dark mode as they use light mode
|
|
| 71 | + // colours.
|
|
| 72 | + m_canUseNative = !wxMSWDarkMode::IsActive();
|
|
| 71 | 73 | |
| 72 | 74 | m_ttiIcon = TTI_NONE;
|
| 73 | 75 | }
|
| ... | ... | @@ -5583,5 +5583,68 @@ int wxRichTextContextMenuPropertiesInfo::AddItems(wxRichTextCtrl* ctrl, wxRichTe |
| 5583 | 5583 | return GetCount();
|
| 5584 | 5584 | }
|
| 5585 | 5585 | |
| 5586 | +#if wxUSE_ACCESSIBILITY
|
|
| 5587 | + |
|
| 5588 | +#include "wx/access.h"
|
|
| 5589 | + |
|
| 5590 | +class wxRichTextCtrlAccessible : public wxWindowAccessible
|
|
| 5591 | +{
|
|
| 5592 | +public:
|
|
| 5593 | + explicit wxRichTextCtrlAccessible(wxRichTextCtrl *win) : wxWindowAccessible(win)
|
|
| 5594 | + {
|
|
| 5595 | + }
|
|
| 5596 | + |
|
| 5597 | + wxAccStatus GetName(int childId, wxString *name) override
|
|
| 5598 | + {
|
|
| 5599 | + if (childId != wxACC_SELF)
|
|
| 5600 | + return wxWindowAccessible::GetName(childId, name);
|
|
| 5601 | + |
|
| 5602 | + *name = _("Rich Text Control"); // wxString::operator= copies, so this is safe
|
|
| 5603 | + return wxACC_OK;
|
|
| 5604 | + }
|
|
| 5605 | + |
|
| 5606 | + wxAccStatus GetRole(int childId, wxAccRole *role) override
|
|
| 5607 | + {
|
|
| 5608 | + if (childId != wxACC_SELF)
|
|
| 5609 | + return wxWindowAccessible::GetRole(childId, role);
|
|
| 5610 | + |
|
| 5611 | + *role = wxROLE_SYSTEM_TEXT;
|
|
| 5612 | + return wxACC_OK;
|
|
| 5613 | + }
|
|
| 5614 | + |
|
| 5615 | + wxAccStatus GetState(int childId, long *state) override
|
|
| 5616 | + {
|
|
| 5617 | + if (childId != wxACC_SELF)
|
|
| 5618 | + return wxWindowAccessible::GetState(childId, state);
|
|
| 5619 | + |
|
| 5620 | + wxRichTextCtrl *ctrl = wxStaticCast(GetWindow(), wxRichTextCtrl);
|
|
| 5621 | + |
|
| 5622 | + *state = wxACC_STATE_SYSTEM_FOCUSABLE;
|
|
| 5623 | + if (ctrl->HasFocus())
|
|
| 5624 | + *state |= wxACC_STATE_SYSTEM_FOCUSED;
|
|
| 5625 | + if (!ctrl->IsEditable())
|
|
| 5626 | + *state |= wxACC_STATE_SYSTEM_READONLY;
|
|
| 5627 | + |
|
| 5628 | + return wxACC_OK;
|
|
| 5629 | + }
|
|
| 5630 | + |
|
| 5631 | + wxAccStatus GetValue(int childId, wxString *strValue) override
|
|
| 5632 | + {
|
|
| 5633 | + if (childId != wxACC_SELF)
|
|
| 5634 | + return wxWindowAccessible::GetValue(childId, strValue);
|
|
| 5635 | + |
|
| 5636 | + wxRichTextCtrl *ctrl = wxStaticCast(GetWindow(), wxRichTextCtrl);
|
|
| 5637 | + *strValue = ctrl->GetValue();
|
|
| 5638 | + return wxACC_OK;
|
|
| 5639 | + }
|
|
| 5640 | +};
|
|
| 5641 | + |
|
| 5642 | +wxAccessible *wxRichTextCtrl::CreateAccessible()
|
|
| 5643 | +{
|
|
| 5644 | + return new wxRichTextCtrlAccessible(this);
|
|
| 5645 | +}
|
|
| 5646 | + |
|
| 5647 | +#endif // wxUSE_ACCESSIBILITY
|
|
| 5648 | + |
|
| 5586 | 5649 | #endif
|
| 5587 | 5650 | // wxUSE_RICHTEXT |
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help