Commit graph

76260 commits

Author SHA1 Message Date
AliKet
29c8bfc249 Use wxOverlay to show docking hint instead of transparent wxFrame
The main advantage of using wxOverlay over wxFrame, besides reduced
code complexity, is that the docking hint now works correctly under
Wayland which it didn't work before.

wxAUI_MGR_RECTANGLE_HINT now works everywhere (including wxGTK and wxOSX)

We simply use a bitmap to draw the venetian blinds hint instead of the
exotic and esoteric code using wxRegion.

wxGTK2 now uses graphics context for transparency. If not available, the hint
will be drawn using wxINVERT raster operation mode.
2024-02-09 23:26:36 +01:00
ali kettab
7491ac5b7a Make wxAUI and wxSplitterWindow work properly with wxOverlay under wxGTK2
This Workaround is needed because the DC used to draw on the wxOverlay clips
children by default under wxGTK2. This means that the sash will always appear
behind the sub-windows. making wxOverlay worthless under this platforms.

Notice that calling gdk_gc_set_subwindow() unconditionally in Destroy() is cheap
when DontClipSubWindows() has never been called.
2024-02-09 23:26:36 +01:00
ali kettab
a38175885c Use wxOverlay to show sash feedback in non-live resize mode in wxSplitterWindow
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.

Also remove no longer needed function AlwaysUsesLiveUpdate and its documentation.
2024-02-09 23:26:36 +01:00
ali kettab
fafc714057 Use wxOverlay to show sash feedback in non-live resize mode in wxAUI
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.
2024-02-09 23:26:35 +01:00
AliKet
7b75d0a256 Added per-pixel alpha blending capability to wxOverlay under wxMSW
By default, wxMSW overlay uses a constant alpha for the window's opacity which
can be changed by the added wxOverlay::SetOpacity() function. For some applications,
that's all they need. But for others, per-pixel alpha blending is a requirement.
This capability can be enabled by calling SetOpacity(-1) before initializing the
overlay. But the drawing must be done via a graphics context because the standard DC
under MSW does not support alpha drawing.

Also request that the overlay window be positioned below any floating windows
on the target (if any).
2024-02-09 23:26:35 +01:00
AliKet
e79466f02b Fix wxOverlay when used with a TLW under wxMSW
Correctly position the overlay window over the TLW's client area.
2024-02-09 23:26:34 +01:00
AliKet
c0140d12c9 Remove unnecessary override from wxOverlayImpl under wxMSW
The base class version already returns true by default.
2024-02-09 22:47:42 +01:00
Paul Cornett
d8c5a87fe3 Partial fix for wxSearchCtrl mouse enter/leave events
The events only occur for part of the widget area,
but it's better than the previous nothing.
See #24245
2024-02-09 12:52:30 -08:00
Vadim Zeitlin
82cb7d1074 Merge branch 'generic-listctrl-center-label'
Fix centering of item label in generic wxListCtrl

See #2340, #24292.
2024-02-09 18:36:53 +01:00
Ian McInerney
9d3b8ba339 Test short labels in the listctrl sample too
This allows to easily verify that they work correctly in the icon view.

See #24292.
2024-02-09 18:35:53 +01:00
taler21
e7dba90bd0 Make auto-grow of in-place editor in generic wxListCtrl work again
Auto-growing of the editor has not worked since the changes of
a8a8915453 (Made code more similar to
wxTreeCtrl' code, 2008-01-10).

Closes #24293.
2024-02-09 17:30:21 +01:00
DietmarSchwertberger
bfc3fcf0f4 Fix grid selection when deleting grid rows or cols
The new selection right/bottom coordinate was off by 1 and could become
invalid.

Closes #24286.
2024-02-09 17:26:17 +01:00
Vadim Zeitlin
308815bafd Merge branch 'msw-button-getdefaultsize'
Fix wxButton::GetDefaultSize() in high DPI under MSW.

See #24285.

Closes #24285.
2024-02-09 17:23:06 +01:00
Vadim Zeitlin
a6cc89777b Allow passing -1 to wxPGProperty::SetChoiceSelection() again
This used to be possible in 3.0 but was disallowed back in 29bf859fae
(Check if new index is in range before selecting new value in
wxPGProperty::SetChoiceSelection., 2014-11-29). However there doesn't
seem to be any real harm in still allowing to do this, so handle -1 as a
special case here.

Closes #24279.

Closes #24281.
2024-02-09 17:21:52 +01:00
Vadim Zeitlin
33ef342dcc Merge branch 'propgrid-xrc'
Add support for loading wxPropertyGrid from XRC.

See #24274.
2024-02-09 17:20:22 +01:00
Vadim Zeitlin
21255ee197 Document wxIPV4address::Hostname(unsigned long) overload
Just mention that it exists too.
2024-02-09 17:19:49 +01:00
SMMB-DEV
388050513d Don't perform DNS lookup when constructing wxIPV4address from IP
Calling Hostname() when constructing wxIPV4address from an already
resolved IP address is unnecessary and can be slow, so don't do it and
just use the string representation of the IP address as "m_origHostname"
instead.

Closes #23109.

Closes #24269.
2024-02-09 17:17:14 +01:00
Vadim Zeitlin
a401106da0 Merge branch 'cmake-misc' of https://github.com/MaartenBent/wxWidgets
Miscellaneous CMake improvements.

Note that the new required CMake version is 3.5 now.

See #24263.
2024-02-09 17:12:18 +01:00
Blake Madden
7555bba1bf Modernize ribbon code
The only real change in this commit is the use of wxRound() instead of
truncating cast to int when rescaling icons.

The rest consists of just some cleanup:

- Initialize (mostly) pointer member variables in their declaration.
- Remove wxT() from strings.
- Replace checks for __WXMAC__ with checks for __WXOSX__.
- Replace macros with lambda functions.
- Add "explicit"
- Replace wxString::IsEmpty() with empty().
- Use wxNOT_FOUND instead of -1.
- Use static_cast<> instead of C-style casts.

Closes #24261.
2024-02-09 17:04:43 +01:00
taler21
82b5f85418 Fix centering of item label in generic wxListCtrl
The item label was not centered if the icon is wider than the label.
2024-02-08 08:44:20 +01:00
Mark Wagner
8eb3729fec Fix reading GIF images without CLEAR code
The encoder may chose not to emit a CLEAR code when the alphabet is full
according to the specification, but wxGIFDecoder assumed it always did,
preventing it from reading some valid GIF files (in practice, most often
animated ones).

This commit is best viewed ignoring whitespace-only changes.

Closes #22799.

Closes #24234.
2024-02-06 19:14:20 +01:00
Maarten Bent
c72f4efc9c Fix crash when closing a wxColourDialog under MSW
Check that ms_pfnSetThreadDpiAwarenessContext function pointer was
initialized before using it.

This fixes a regression introduced in 9befda5c26 (Only use
AutoSystemDpiAware when displays have different DPI, 2023-12-10).

See #24121, #24196.

Closes #24288.
2024-02-06 19:07:46 +01:00
Vadim Zeitlin
be5fa77839 Reuse wxButton::GetDefaultSize() instead of duplicating it
Just reuse the existing function in IncreaseToStdSizeAndCache() helper
instead of using a separate and, until the parent commit, different, way
of computing the default button size here.

This will hopefully avoid introducing any discrepancies between the size
returned by GetDefaultSize() and the size actually used for the buttons
by default in the future.

See #24283.
2024-02-05 19:05:02 +01:00
Vadim Zeitlin
57b408ed88 Fix wxButton::GetDefaultSize() in high DPI under MSW
Using button size in dialog units doesn't work well in high DPI, as it
gives sizes wildly different from those actually used by Windows itself
for the buttons (e.g. for those in Explorer dialogs still using Win32
API), so switch to using DIPs, just as it was done for determining the
initial size of the buttons when actually creating them in c6d2f6d9fe
(Really fix the standard button size in high DPI under MSW, 2019-10-19)

See #18528.

Closes #24283.
2024-02-05 19:04:52 +01:00
Maarten Bent
e41fd2052c
CMake: Mention that CMake 3.5 is the minimum version
Generating project files has been confirmed to work with this version.
2024-02-04 18:11:10 +01:00
Maarten Bent
f0061b3c04
CMake: Only keep unicode definitions on Windows 2024-02-04 18:03:06 +01:00
Maarten Bent
f0d2d0e748
CMake: Prevent possible policy warnings 2024-02-04 18:01:36 +01:00
Vadim Zeitlin
f6a1b1a18a Show loading wxPropertyGrid from XRC in the sample
Demonstrate defining wxPropertyGridManager in XRC.
2024-02-03 22:03:17 +01:00
Vadim Zeitlin
36583f13e1 Merge branch 'fix-vlistbox-out-of-range' of https://github.com/wsu-cb/wxWidgets
Prevent scrolling beyond specified range.

See #24278.
2024-02-03 21:54:40 +01:00
Vadim Zeitlin
42839def49 Merge branch 'fix_webkit_tests'
Fix WebView tests with WebKitGTK 2.43+.

See #24276.
2024-02-03 21:54:05 +01:00
Vadim Zeitlin
e20a994b1f Merge branch 'really-fix-cleanup'
Really fix logging during app cleanup.

See #24272.
2024-02-03 21:53:24 +01:00
Vadim Zeitlin
dba79a2d67 Merge branch 'avoid-impl-string-conv-logstatus'
Avoid implicit string conversions when using wxLog functions.

See #24271.
2024-02-03 21:52:27 +01:00
Vadim Zeitlin
edf94f684c Remove dependency on wxxml and wxxrc from wxpropgrid library
It shouldn't, and now doesn't, use these libraries directly and
shouldn't depend on them to avoid introducing unnecessary requirements
for the applications which use it without XRC.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
52c60628fa Don't use wxXmlNode directly in wxPropertyGridXmlHandler
Use wxXmlResourceHandler functions such as GetNodeContent(),
GetNodeName() and GetNodeAttribute() instead, which are defined in the
core library and so don't create a dependency on wxxrc.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
fe599e4757 Add wxXmlResourceHandler::GetNodeAttribute()
Add another helper function that can be used in XRC handlers without
using wxXmlNode directly.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
921018cfc8 Add wxXmlResourceHandler::GetNodeName()
This allows to get the name of the node which is needed for XRC handlers
using specific elements instead of using the object elements with
specific name attribute.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
9ab62c02fd Make wxXmlResourceHandlerImpl::GetNodeContent() const
There doesn't seem to be any reason not to and it's more consistent with
the other similar functions.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
f943635da8 Reuse wxXmlNode::GetNodeContent() in wxXmlResourceHandlerImpl
Don't duplicate wxXmlNode function logic but just call it instead.

This shouldn't result in any changes.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
9550c37e29 Support inherited attributes in wxPropertyGrid XRC handler
Allow specifying recurse="1" to inherit the attribute, as this is much
nicer than having to specify it for all the children.

Also add support for this to wxPropertyGridPopulator, which is used by
the XRC handler.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
0ddbf965c9 Get rid of unnecessary "emptyString" when calling GetAttribute()
This is just extra noise, so remove it.

No real changes.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
f513c08876 Add DLL export declaration to wxPropertyGridXmlHandler 2024-02-03 21:46:15 +01:00
Vadim Zeitlin
65715453e7 Add minimal support for wxPropertyGrid to the XRC schema
This is too lax and might also not cover everything but it better than
nothing.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
8c586b6ff5 Add minimal documentation of wxPropertyGrid XRC format
Not everything is documented yet, mostly because it's not really easy to
find out what "everything" actually is.
2024-02-03 21:46:15 +01:00
Bill Su
95054f3d4a wxVListBox: fix Page Down being unable to reach last item 2024-02-03 00:21:49 -05:00
Vadim Zeitlin
9c33be4f5e Use a helper lambda for naming history menu items
Shorten the code a bit more.

No real changes.
2024-02-02 18:01:24 +01:00
Vadim Zeitlin
44bc26f087 Use range-for loops for iterating over wxWebViewHistoryItems
No real changes, just simplify the code a bit.
2024-02-02 17:59:01 +01:00
Bill Su
66dfd0ae89 prevent scrolling beyond specified range
Fix #24277
2024-02-02 00:41:10 -05:00
Scott Talbert
3ef1aee986 Fix WebView sample when there are blank title pages in history
Otherwise, the wxMenu code asserts due to an empty item.
2024-02-01 20:56:36 -05:00
Scott Talbert
1622a5c9c2 Fix WebView tests with WebKitGTK 2.43+
It seems that WebKitGTK is now failing to navigate to about: URLs unless
they are about:blank or about:srcdoc, so use about:srcdoc as the
alternate URL to fix the WebView tests.

Ref: 3c3163e71f
2024-02-01 20:56:32 -05:00
Vadim Zeitlin
a01c870dbb Don't let exceptions escape from events handled during idle time
This resulted in immediate program termination, at least with wxGTK, if
an event handler called when dispatching pending events during idle time
threw an exception (which, in particular, covers all the exceptions
inside lambdas passed to CallAfter()).

Just catch and handle them as usual, i.e. as we do with the event
handlers called immediately in response to a user action.
2024-01-31 04:08:26 +01:00