Commit Graph
81024 Commits
Author SHA1 Message Date
Vadim Zeitlin de18a6d808 Don't handle Esc specially in wxTextEntry auto-complete code
This is not necessary any longer after the changes of the parent commit.

This is a partial revert of 59bdee5558 (Fix handling of Esc while an
auto-complete drop down is open in wxMSW., 2014-03-08), see #13945.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 058ce47c60 Handle Esc later in wxMSW to avoid stealing it prematurely
Generating wxEVT_CHAR_HOOK for "Esc" presses from the keyboard hook
resulted in multiple problems with IME (see #11386 and #22473 that were
already worked around as well as still open #27145) or other controls
that need to handle "Esc" themselves (see #9102 and #13945 for which we
added the workarounds and #16059 which is still open too).

Solve all of these issues by postponing wxEVT_CHAR_HOOK generation for
this key until later, when the message is already being processed. This
should avoid all such problems at the price of not generating these
events at all in some scenarios, e.g. when a native control really wants
Esc for itself or when wx is used in a modeless dialog in a plugin DLL
and its event loop is not running.

Hopefully this shouldn't be important in practice but this change should
avoid having any more problems with various IMEs.

Closes #16059.

Closes #27145.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 2ded9fc1f2 Factor out wxSendCharHookEvent() from wxKeyboardHook()
Extract this function from the keyboard hook to allow its reuse in
upcoming commits.

No real changes yet.

This commit is best viewed ignoring whitespace-only changes.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 0dd86a53d5 Don't define wxHAS_2CHAR_NEWLINES as 0 in wxTextCtrl unit test
By convention, wxHAS_XXX symbols should be defined or not, unlike
wxUSE_XXX ones that are always defined as either 1 or 0.

Change wxHAS_2CHAR_NEWLINES definition and tests for it to follow this
rule.

No real changes.
2026-10-03 13:23:12 +02:00
Richard 570d639451 Fix wxTextCtrl URL test click target
Compute the actual position of the URL text before clicking it instead
of using a fixed client coordinate. This keeps the test using
wxUIActionSimulator for mouse input while avoiding failures when the
fixed point doesn't land on the link text.

Also use a single wxHAS_TEXT_URL_TEST preprocessor symbol instead of
testing a complicated expression.

Closes #27143.
2026-10-03 13:19:41 +02:00
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 67f0790c85 Avoid warning for lzma_stream initialization from clang 20+
This compiler started giving -Wnontrivial-memcall for using memset()
with non-trivially copyable type wxLZMAStream, so avoid it by using
LZMA_STREAM_INIT instead, which is meant to be used exactly for this.
2026-10-01 19:55:01 +02:00
Vadim Zeitlin cbc51e8fd4 Simplify and fix wxMiniFrame documentation
Don't claim contradictory things in consecutive lines.

See #27139.
2026-10-01 16:55:04 +02:00
Richard e320e82ec9 Preserve AUI notebook selection after stale child focus
Use the current focused page when handling wxAuiNotebook child-focus
notifications so a delayed focus event from the previous page does not undo
a programmatic selection change made from an event handler.

Add a regression test covering a stale child-focus event after selection has
already moved to another page.

This commit is best viewed ignoring whitespace-only changes.

Fixes #13639.

Closes #27133.
2026-10-01 16:44:16 +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
Richard cb2cbef660 Fix grid autowrap row autosizing
Set the autowrap renderer DC font from the cell attribute before measuring
line heights, so small-font cells do not inherit another DC font when rows
are autosized.

Use the full spanned row or column extent when asking renderers for their
autosize measurement, and cover autowrap font and spanned-row sizing.

Fixes #14072.

Closes #27136.
2026-10-01 16:22:59 +02:00
Richard 4ff1b87a82 Dismiss previous rich tooltip before showing another
Track the currently active generic wxRichToolTip popup and dismiss it
through the popup notification path before showing a new one, while
ignoring delayed duplicate dismissals for popups already queued for
destruction.

Add a GUI regression test that shows two rich tooltips in sequence.

Fixes #13954.

Closes #27134.
2026-10-01 16:11:51 +02:00
Richard e690b71577 Document that STC marker line numbers are 0-based
Clarify that wxStyledTextCtrl marker methods use zero-based line
numbers.

Fixes #13581.

Closes #27132.
2026-10-01 16:10:17 +02:00
Richard 58f05eca0c Document wxStaticText Wrap markup behaviour
Clarify that wxStaticText::Wrap() operates on the plain text label and
strips formatting previously set with wxControl::SetLabelMarkup().

See #13389.

Closes #27131.
2026-10-01 16:08:38 +02:00
Richard 4b9f6b2bdd Add wxHTML BASE tag handling
Recognize BASE HREF while parsing wxHTML pages and update the parser file
system base so subsequent relative image and page URLs resolve against it.

Add a parser regression test covering relative image loading and default page
URL opening through the updated base.

Fixes #13125.

Closes #27130.
2026-10-01 16:06:04 +02:00
Richard 7043a8e704 Document wxActiveXEventNativeMSW
Add interface documentation for wxActiveXEventNativeMSW, including the native
IDispatch::Invoke() fields exposed by wxActiveXEvent::GetNativeParameters()
and the lifetime of the returned event parameters.

Fixes #12410.

Closes #27129.
2026-10-01 16:04:34 +02:00
Quin Gillespie 3167657be6 Handle Cmd-Up and Cmd-Down in the generic wxListCtrl under Mac
These keys should work as Home/End under Mac.

Closes #27096.
2026-10-01 02:06:04 +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
Vadim ZeitlinandEran Ifrah ac4cbd0c09 Fix crash when using wxGTK clipboard under WSL
Since the changes of f11053a2d3 (Fix copy/paste in wxGTK when a
clipboard manager is running, 2026-03-09) we were accumulating all
data passed to wxClipboard::AddData() because we never cleared the list
of targets in the active selection any more.

This resulted in a crash under WSL (probably due to overflowing some
implementation limits) and must have been problematic elsewhere too, so
stop doing this and do clear the list of targets before setting new
ones.

Still don't call wxClipboard::Clear() neither from AddData() nor from
SetData() to avoid reintroducing the original problem fixed by the
commit above.

See #26265, #26278.

Closes #27102.

Co-authored-by: Eran Ifrah <eran@codelite.org>
2026-09-29 15:05:58 +02:00
Wlodzimierz-ABX-Skiba bd13bf8f45 Fix flickering in wxActivityIndicator
Make the window double buffered to avoid noticeable flicker under
Windows.

Closes #27123.
2026-09-29 14:33:57 +02:00
PB 801b332ece Fix typos in the docs
Discovered by an LLM as the result of "a targeted scan for common
misspellings, duplicated words, and nearby wording errors".

Reviewed and confirmed by a human.

Closes #27122.
2026-09-29 14:32:54 +02:00
AliKet fc16a99d96 Enable TABs expansion in wxQt wxDC::DrawText() too
Enable the corresponding unit test for wxQt which passes now.

See #27087.

Closes #27119.
2026-09-29 01:53:41 +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
Steve Cornett c699cfb96a OSX: Allow wxOSX_USE_NSCELL_RENDERER=0 as compiler option
Wrap the definition of wxOSX_USE_NSCELL_RENDERER with #ifndef so that
this macro can be defined 0 as a compiler option, rather than requiring
the source file to be modified.

See #27101.

Closes #27118.
2026-09-28 23:11:01 +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
Richard 14200bf215 MSW: Expand tabs when drawing wxDC text
Use the native tab-aware text output path for MSW wxDC text containing
tab characters, so DrawText() and DrawLabel() render tab spacing instead
of missing-glyph boxes.

Add focused drawing coverage for leading tab characters.

Fixes #11563.

Closes #27087.
2026-09-28 23:05:13 +02:00
Vadim Zeitlin 16149b8f35 Make wxMSW clipboard functions more robust when clipboard is busy
Retry the clipboard operation if the clipboard happens to be busy
(because another application or the system is using it) just at the time
when we need it.

This should avoid spurious errors in CMake MSW CI jobs which are
probably due to the fact that multiple tests using clipboard may be
running in parallel now, but also seems to be useful for the real
applications which might run into the same problem, so fix it at the
library level rather than in the test.
2026-09-28 22:57:57 +02:00
Vadim Zeitlin 77009eaec9 Get rid of the warnings in ListCtrl::ColumnDrag test too
This amends the recent 49d8a0c6f8 (Make ListCtrl::ColumnDrag unit test
more robust, 2026-09-28) to wait for just the last event as this is all
we need for the test and we don't really need to wait for each event.
2026-09-28 22:45:20 +02:00
Richard 9e841f4049 Draw wxHtmlWindow focus indicator
Repaint wxHtmlWindow on focus changes and draw a native focus rectangle
around the visible client area when the window has keyboard focus.

This gives keyboard users a visible focus cue without changing HTML layout,
selection, or link handling.

Fixes #11278.

Closes #27086.
2026-09-28 18:49:23 +02:00
Richard c512a5fba7 Expand Windows percent env vars with parentheses
On Windows, wxExpandEnvVars() used the same identifier scan for %var% as
for $var, so %ProgramFiles(x86)% stopped at the opening parenthesis and
could expand the wrong variable.

Scan percent-delimited variable names up to the closing percent sign while
leaving the non-percent syntax unchanged. Add a regression test covering
both forms.

Fixes #11262.

Closes #27085.
2026-09-28 18:48:45 +02:00
Vadim Zeitlin 49d8a0c6f8 Make ListCtrl::ColumnDrag unit test more robust
Try to wait for longer to avoid spurious test failures that happen quite
often in this test.
2026-09-28 18:48:03 +02:00
Vadim Zeitlin 9d231c5d1a Fix linking with monolithic wxMSW library without using manifest
This is the case for console applications and it was broken by binding
to GetWindowSubclass() import of comctl32.dll by name because it's not
present in v5 of the DLL which is used in absence of the manifest,
resulting in the executable being unable to start.

Apply a local fix to this by loading this function during run-time, when
we can be sure that we're using v6 which does export it by name (v5 only
exports it by ordinal 411).

Closes #27114.
2026-09-28 18:40:28 +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
Vadim Zeitlin 6172601da6 Repaint wxMSW wxListCtrl after scrolling in dark mode
In dark mode wxListCtrl draws its items itself and decides whether an
item is hot from the mouse position at the time it is painted. But when
the control scrolls, the native control moves the rows that are already
drawn instead of repainting them, and doesn't invalidate anything for
the hot item if the mouse didn't move.

Scrolling with the keyboard while the mouse is over the control
therefore leaves a trail: the row drawn as hot keeps its highlight at
its new position, and the row that is now under the mouse is drawn as
hot too, so every row that passes under the mouse stays highlighted.

Refresh the control when a message that can scroll it did change the
top item.

Closes #27112.

Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
2026-09-27 21:18:55 +02:00
Vadim Zeitlin 2136fb6e4a Merge branch 'cmake-change-gtk-toolkit' of github.com:MaartenBent/wxWidgets
CMake: Fix changing from GTK3 to GTK2 toolkit.

See #27116.
2026-09-27 21:16:24 +02:00
Maarten Bent 1d2e23d55a CMake: Show FindSDL3 result only once
Don't show the message every time CMake is configured, but only the first time
(or when the library has changed).
Also change the message format to be similar to other find_package results.

See #27062
2026-09-27 19:17:45 +02:00
Maarten Bent a2ca2e231a CMake: Unset GTK3 specific variables when switching toolkit
Fixes #27010
2026-09-27 19:17:21 +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
Randalphwa 53d850ec3c Add a toolbar for moving back/forward
The menu approach is okay for a few files, but if you want to tests like
the W3C SVG HTML tests, the hundreds of files can be a pain to step
forward/backward using a menu only.

See #26474.
2026-09-27 16:07:27 +02:00
Vadim Zeitlin 16c3a76875 Rebake after adding tests/controls/dirctrltest.cpp
This should have been part of c87d669946 (Preserve wxGenericDirCtrl
hidden default path, 2026-07-09).

See #27033.
2026-09-27 16:07:26 +02:00
Vadim Zeitlin abef7a0a21 Merge branch 'osx-dnd-utf'
Fix text drag-and-drop regression in wxOSX.

See #27107.
2026-09-27 15:29:43 +02:00
Vadim Zeitlin e36f2b449b Merge branch 'msw-build-warnings' of github.com:MaartenBent/wxWidgets
Fix MSW build warnings with wxDEBUG_LEVEL==0 and build with C++ < 17.

See #27113.
2026-09-27 15:27:23 +02:00
Blake-Madden cf1bbdcf7e Minor corrections in CMake overview
wxBUILD_DEBUG_LEVEL has a value "Default" option that actually is the
real default.

CMake 3.10 is required now, don't mention supporting 3.5.

Closes #27111.
2026-09-27 15:12:50 +02:00
Maarten Bent 867e785e85 Fix build warnings with wxDEBUG_LEVEL=0 2026-09-27 13:03:28 +02:00