Commit Graph
22539 Commits
Author SHA1 Message Date
Vadim Zeitlin 234504141c Don't call virtual GetLabel() from Create() in wxOSX
The recent 07590bec33 (Use preceding label as accessibility title of
controls under macOS, 2026-09-21) started calling GetLabel() from
MacPostControlCreate() which is called before the object was fully
constructed and could (and did) result in crashes due to the use of the
not yet initialized members.

Avoid this by adding a new HasAccessibilityTitle() virtual function of
wxWidgetImpl which is fully constructed by the time this function is
used and also addresses the question of whether the preceding label
should be used as this window accessibility title more precisely.

See #27060, #27140.

Closes #27142.
2026-10-03 13:15:00 +02:00
Vadim Zeitlin 3c29b6f951 Merge branch 'aui-mac-drag-crash'
Fix crash when destroying AUI floating frames under Mac.

See #26264, #27125.
2026-10-01 16:23:54 +02:00
Vadim Zeitlin 5c22ec6877 Fix possible crash when destroying AUI floating frames
wxAuiFloatingFrame could receive wxEVT_SIZE during its destruction, even
if it was already hidden, and handling these events crashed due to
dereferencing dangling wxSizerItem pointers.

Fix this by overriding wxAuiFloatingFrame::Destroy() to perform the
necessary cleanup when the frame is about to be destroyed.

Add wxAuiManager::DestroyFloatingFrame() helper which makes the code say
more clearly what it does -- this is not required to fix the bug but
affects the same code, so do it in the same commit.

Also add a unit test confirming that destroying the floating frame in
various ways doesn't crash any longer.

Closes #26264.

Originally-by: alilie <alexandru.ilie@hexagon.com>
2026-09-29 17:22:25 +02:00
Vadim Zeitlin e1eb0f4bc4 Factor out wxAuiFloatingFrame::CleanUp()
Make it possible to reuse this function in the upcoming commit.

No real changes yet.
2026-09-29 17:12:11 +02:00
Richard 234bafd0c1 Reject non-tab panes in wxAuiNotebook manager
wxAuiNotebook's wxAuiManager is only an implementation detail used for
its tab frames, plus the hidden dummy pane created during initialization.
Reject attempts to add arbitrary windows to it instead of making notebook
code tolerate such panes.

Update the AUI test to cover the narrower contract by checking that an
external non-tab pane is rejected and not registered with the manager.

Fixes #4771.

Closes #26902.
2026-09-29 16:31:54 +02:00
Maarten Bent da04529805 Update 3rd party libraries submodules
Add new files to the build system and regenerate it.

Closes #27020.

Closes #27074.
2026-09-29 01:50:48 +02:00
Alexey ShelaevandStefan Csomor dcce105995 Fixes for dnd in wxOSX
Refactor pasteboard code for reuse in dnd.

Improve setting flags for file objects.

See #27047.

Closes #27117.

Co-authored-by: Stefan Csomor <csomor@advancedconcepts.ch>
2026-09-28 23:08:13 +02:00
Vadim Zeitlin de2186195c Merge branch 'accel-key-event'
Allow customizing priority of accelerators compared to normal key
events.

See #27106.

Closes #22625, #22630.
2026-09-28 16:36:27 +02:00
Vadim Zeitlin 776a9a2787 Add wxWidgetCocoaImpl::GetAccessibleView() to avoid code duplication
Extract code duplicated in wxWidgetCocoaImpl::SetAccessibilityLabel()
and SetAccessibilityTitleElement() into a new function.

No real changes.

See #27056, #27060.
2026-09-27 21:36:23 +02:00
Quin Gillespie 07590bec33 Use preceding label as accessibility title of controls under macOS
Under MSW, screen readers use the label preceding a control without its
own label, such as wxChoice or wxTextCtrl, as its name, so dialogs are
accessible without doing anything special. Under macOS this didn't
happen, and VoiceOver only read the labels as separate texts, so users
tabbing through a dialog didn't hear what the controls were for.

Now, when a native control without its own label is created right after
a wxStaticText, the label is set as its accessibility title element,
which VoiceOver reads as the name of the control. Notice that for most
controls the accessibility element is the cell and not the view itself,
so this uses NSAccessibilityUnignoredDescendant() to link the elements
actually used by VoiceOver, and uses the document view for the controls
inside a scroll view.

Closes #27060.
2026-09-27 21:28:25 +02:00
Quin Gillespie 787dcd2de0 Add wxWindow::SetAccessibleName()
The new function allows to set the name used by screen readers for any
window, e.g. for buttons showing only a bitmap or text controls without
a label before them.

Implement it for wxMSW and wxOSX and add documentation and a MSW-only
unit test.

Closes #27056.
2026-09-27 21:24:26 +02:00
Richard 22cee3b05b Re-dock floating AUI panes on title double-click
Handle double-clicks on wxAuiFloatingFrame by docking the pane back to
its saved dock position when the pane is still dockable. On MSW, handle
the native caption double-click message so the outer title bar redocks
instead of falling through to frame default handling.

Add coverage for the MSW non-client title-bar path and the resulting
manager state transition.

Fixes #10004.

Closes #27083.
2026-09-27 19:07:33 +02:00
Randalphwa 7ed229adcd Switch to using wxBitmapBundle instead of wxImage in wxHTML
Using wxBitmapBundle means SVG files can now be used, multi-resolution
bitmap bundles can be used, scaling for high DPI now uses scaling code
for bitmap bundles which generally provides better scaling results.

Also add support for loading SVG images from wxInputStream and use to
implement support for compressed .svgz files.

Closes #26474.
2026-09-27 16:07:27 +02:00
Vadim Zeitlin 82f0bc1824 Add labels to improve wxRibbonGallery items accessibility
Gallery items have just a bitmap, an ID and the application's client
data, so there is nothing a screen reader can announce for them and they
are read as "list item 3 of 39", which is useless.

Add Append(bitmap, id, label) and Set/GetItemLabel() and use the label
as the accessible name of the item. The label is not drawn, as the items
of a gallery are bitmaps by design, it only exists to be announced. It
could also be used for tooltips later, which the items don't have
either.

The ribbon sample already knows the names of the colours it puts in its
galleries, so it passes them as the labels now, which also makes them a
useful test case.

Closes #27100.
2026-09-27 01:48:55 +02:00
Quin Gillespie 00ee56c01d Allow opening wxSearchCtrl menu from keyboard with Alt-Down
The search menu could only be opened by clicking the button showing it,
which doesn't accept focus from the keyboard on purpose, so keyboard and
screen reader users couldn't use it at all.

Handle Alt-Down in the text part of the control and show the menu from
there, as suggested in the comments of the original ticket.

Fixes #18457.

Closes #27093.
2026-09-27 01:48:55 +02:00
Vadim Zeitlin 38227a3f4a Merge branch 'RibbonReader2' of github.com:Blake-Madden/wxWidgets
Add screen reader support to the ribbon under MSW.

See #27075.
2026-09-27 01:48:55 +02:00
Vadim Zeitlin e5ac9e8826 Implement configurable accelerators support for wxQt
Use the new API, i.e. call ClaimsKeyBeforeAccelerator() and send
wxEVT_ACCELERATOR_KEY, in wxQt too.

Update wxComboBox to override ClaimsKeyBeforeAccelerator() too.
Note that wxTextCtrl and wxSpinCtrl don't need to be modified because
they already do this in the base class.

This actually simplifies the existing code as we don't need
wxWindow::m_processingShortcut any more.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin b337ad2841 Factor out QtFillKeyEvent() from QtHandleKeyEvent()
No real changes, just refactor to allow reusing QtHandleKeyEvent() in
the upcoming commit.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin 5ca0f8aa73 Implement configurable accelerators support for wxOSX
Use the new API, i.e. call ClaimsKeyBeforeAccelerator() and send
wxEVT_ACCELERATOR_KEY, in wxOSX too, whenever possible, i.e. not for
Cmd-Letter used by the menu items as we never get key events for them at
all.

This probably could be worked around by overriding performKeyEquivalent:
but for now leave it like this because hopefully there should be no
conflict between menu accelerators and standard text editing keys as
Cmd+C etc act on the focused window anyhow by default, so the behaviour
should be already correct anyhow.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin 1043551376 Allow customizing priority of accelerators and normal key events
When deciding whether a key press should trigger an accelerator or be
handled by the currently focused window different ports behaved
differently, with wxGTK always prioritizing the focused window and the
other ports giving priority to the accelerator, and neither of them
allowed customizing this.

Change this now by introducing 2 ways to do it: first, a window can
override new ClaimsKeyBeforeAccelerator() virtual function to specify
which keys it wants to handle itself, even if they correspond to an
accelerator. And second, send wxEVT_ACCELERATOR_KEY event which can be
handled by the application, typically centrally in its wxFrame-derived
class, to decide if it wants some accelerator that it defines to not
steal the key from the window or, on the contrary, to always do it, even
if the window overrides ClaimsKeyBeforeAccelerator() as wxTextCtrl does.

Note that while ClaimsKeyBeforeAccelerator() replaces some uses of
wxMSW-specific MSWShouldPreProcessMessage(), but it's still needed to
prevent the key getting eaten by IsDialogMessage().

This is not a backwards-compatible change as it changes the default
wxGTK behaviour, but it is now compatible with the other ports and can
be easily customized if necessary.

This commit only implements this for wxMSW and wxGTK, other ports will
be updated too soon.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin a30884694b Extract keys used for text editing into a portable function
The list of the keys which are used for editing the text and which
shouldn't be taken by the accelerators using the same keys existed only
in wxMSW and only as a function taking a MSG, move it to the common code
as wxTextEntryBase::IsUsedForEditing() taking wxKeyEvent, as it is going
to be needed by the other ports too in the upcoming commits.

Note that this also slightly changes wxMSW behaviour because the keys
producing printable characters, as well as Backspace, are now considered
as being used for editing too and so are not passed to the accelerators
any longer, which seems more correct as typing text in a control
shouldn't trigger the accelerators using the same keys.
2026-09-26 19:40:55 +02:00
Vadim Zeitlin 881d0f0461 Implement wxAcceleratorTable::GetEntry() in all ports
It was previously available only in the generic version which was used
by wxGTK and wxUniv, add it to the other ports too as it's going to be
needed in the upcoming commit.

In wxMSW this required storing the accelerators, as it is simpler than
converting them back from the native HACCEL and more consistent with the
other ports that already did this.
2026-09-26 19:30:40 +02:00
Vadim Zeitlin de0c03d5ab Add wxMenuBar::FindItemForAccelKey() and unit test for it
This function will be used in the upcoming commits, for now just add it
and a simple test showing that it works as intended.
2026-09-26 19:00:15 +02:00
Vadim Zeitlin 833dcf56f9 Add const wxWindow::GetAcceleratorTable() overload
This will allow const member functions to call GetAcceleratorTable()
without const_casts.
2026-09-25 18:21:23 +02:00
Blake-Madden cf57a85c31 Notify screen readers about focus changes inside wxRibbon controls 2026-09-25 06:28:35 -04:00
Vadim Zeitlin fb1258f87d Extract existing code into wxAcceleratorEntry::MatchesEvent()
Add the new function checking if a (key) event and wxAcceleratorEntry
correspond to the same key combination.

This was already used in the generic wxAccelerator implementation and
wxOSX and will be used in the other ports too soon, so move this code
into common function.

It can also be useful for the applications, so document it as well.
2026-09-25 03:20:14 +02:00
Vadim Zeitlin 8f82bf6edf Merge branch 'ime-control'
Provide some control over IME and use it to fix wxGrid when using IME.

See #27026.
2026-09-25 00:05:20 +02:00
Vadim Zeitlin 1afd6fba71 Merge branch 'msw-non-bmp-keys'
Add support for handling characters outside of BMP to wxMSW.

See #27016.
2026-09-25 00:04:20 +02:00
Avery King 2446cea5cc wxQt: Add missing wxFont::Create() overload
Add an overload accepting a regular int instead of wxSize for the font
size.

Closes #27080.
2026-09-25 00:02:07 +02:00
Steve Cornett 8926764e03 Remove MSWSetDarkOrLightMode() SetMode parameter
The MSWSetDarkOrLightMode() SetMode parameter was only ever used in one
place, and not really needed there.

Closes #27076.
2026-09-24 23:55:10 +02:00
Blake-Madden 4100a81057 Add screen reader (MSW) support to the ribbon 2026-09-23 18:31:15 -04:00
Quin Gillespie f91f5ae270 Allow giving focus to read-only wxTextCtrl from keyboard in wxMSW
In wxMSW, single line read-only wxTextCtrl doesn't accept focus from
keyboard, so keyboard and screen reader users can't Tab to it and read
its contents.

Add wxWindow::EnableFocusFromKeyboard(), the counterpart of the existing
DisableFocusFromKeyboard(), to let the application allow this.

Update the documentation and add a wxMSW-only unit test.

Fixes #10760.

Closes #27054.
2026-09-22 23:07:25 +02:00
Vadim Zeitlin a16da69037 Merge branch 'generic-treectrl-getbestclientwidth'
Fix best size computation in wxGenericTreeCtrl and several bugs
discovered while working on this.

See #27043.
2026-09-22 23:03:06 +02:00
Quin Gillespie 950d4918cf Fix wxCollapsibleHeaderCtrl accessibility in wxMSW
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
The generic collapsible header, used by wxCollapsiblePane and so by the
generic about dialog, had two problems for keyboard and screen reader
users under MSW:

- Pressing Enter on the header activated the default button of the
  dialog. In wxAboutBox this closed the dialog. Enter now toggles the
  header, the same as Space.

- Screen readers could not tell what the header was or if it was open.
  It now reports itself as a button with an expanded or collapsed state,
  sends a state change event when it toggles, and has a default action.
  This also stops screen readers from reading the label twice.

Closes #27048.
2026-09-22 13:04:27 +02:00
Quin Gillespie b841d3c0f5 Announce generic wxInfoBar messages for the screen reader
When the generic wxInfoBar showed a message, screen readers said
nothing, so their users did not know it had appeared.

The info bar now has the alert accessible role with the message as its
name, and sends an alert event every time ShowMessage() is called. NVDA
reads the message when it is shown, and also when a new message is shown
while the bar is already visible.

Closes #27053.
2026-09-22 02:33:28 +02:00
Quin Gillespie ef316972b3 Fix Tab navigation in generic wxInfoBar
The generic wxInfoBar was a plain wxControl, not a container, so Tab
gave focus to the info bar window itself and never moved to the close
button or other buttons inside it.

wxInfoBarGeneric now derives from wxNavigationEnabled, the same as
wxGenericCollapsiblePane, so Tab moves to the buttons inside it.

Closes #27052.
2026-09-22 02:03:14 +02:00
Quin Gillespie ffb5580936 Fix missing accessible name for bitmap-only buttons in wxMSW
Buttons that show only a bitmap have no label, so screen readers only
announce them as "button". This affects, for example, the buttons of
wxEditableListBox and the close button of the generic wxInfoBar.

When a button has no label but has a tooltip, its tooltip is now used as
its accessible name. Buttons with a label are not changed.

Closes #27051.
2026-09-22 01:43:24 +02:00
Blake-Madden bf5e42866c Fix confusing var names, improve comment 2026-09-21 16:04:44 -04:00
Blake-Madden 065d774ee5 Handle tabbing in/out when not inside of navigation supporting parent
This will get the demo to work without integrating a wxPanel into it.
2026-09-21 11:44:46 -04:00
Blake-Madden 71494f3265 Add keyboard navigation to ribbon gallery 2026-09-21 11:35:45 -04:00
Blake-Madden 6275a0e00d Add ribbon toolbar keyboard navigation 2026-09-21 11:19:23 -04:00
Blake-Madden a7de985504 Add keyboard navigation to ribbon panel 2026-09-21 11:14:56 -04:00
Blake-Madden c33455a85d Add keyboard navigation to ribbon button bar (tabs and buttons) 2026-09-21 11:09:17 -04:00
Robert RoeblingandVadim Zeitlin 15df498092 Fix best size computation in wxGenericTreeCtrl
Implement DoGetBestClientWidth() so that the control can compute the
appropriate width when its height is known, as is the case when it's
used as wxTreeBook controller: this prevents the appearance of ugly
and unnecessary horizontal scrollbar in this case.

Add a unit test checking that the best size is computed correctly.

Closes #26097.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2026-09-21 16:46:55 +02:00
Vadim Zeitlin 81ea3c8854 Handle characters outside of BMP in wxRichTextCtrl under MSW
Change wxRichTextEvent::m_char to be of type wxUniChar and not wxChar.
This is mildly backwards-incompatible but the break is arguably worth
not adding some new GetUnicodeCharacter().
2026-09-20 22:17:37 +02:00
Vadim Zeitlin 9bf5a10d99 Pass wxUniChar to wxVListBoxComboPopup::HandleKey()
wxChar can't hold all possible characters under MSW, so prefer using
wxUniChar even if it's not clear if this have any practical benefits in
this particular case.
2026-09-20 22:12:27 +02:00
Vadim Zeitlin 6b4a5fd64c Add support for non-BMP characters in wxKeyEvent in wxMSW
Recombine the 2 WM_CHAR messages we receive for high and low surrogate
pair into a single Unicode character which can be retrieved using the
new wxKeyEvent::GetUnicodeChar() member function.

Update documentation and comments to recommend using the new function
instead of GetUnicodeKey().

Also update the keyboard sample to use it to be able to show events for
supplementary characters under MSW.

Closes #25135.
2026-09-20 21:46:44 +02:00
Vadim Zeitlin 82f2d9bddb Add wxWindow::SendAfterCharEvent()
This trivial helper can be used from wxComboBox too, which will be
useful for the upcoming commits.

No real changes yet.
2026-09-20 21:40:55 +02:00
Vadim Zeitlin dbf58d2748 Always initialize wxKeyEvent::m_rawCode and m_rawFlags
They are supposed to be initialized from platform-specific code, but
don't leave them with garbage values if they are somehow not.
2026-09-20 21:40:55 +02:00
Vadim Zeitlin 1e2e4d794d Initialise wxKeyEvent members in their declarations
No real changes, just make it clear what values are various members
initialized with.
2026-09-20 21:40:55 +02:00