Commit Graph

71752 Commits

Author SHA1 Message Date
Vadim Zeitlin
3bc0f44163 Update copyright years to 2021
Just run misc/scripts/inc_year and commit the results.

Closes #18690.
2022-01-02 13:32:23 +01:00
Vadim Zeitlin
910f014065 Fix typo in year update script
Fix wrong function name from 81c4fa449b (Use CMake-compatible variable
names in configure Info.plist files, 2021-08-15).
2022-01-02 13:31:25 +01:00
Vadim Zeitlin
ffe73b4353 Merge branch 'fs-mem-string-data'
Use UTF-8 for memory FS data if it's not in Latin-1.

See https://github.com/wxWidgets/wxWidgets/pull/2622

See #19314.
2022-01-02 12:46:05 +01:00
Scott Talbert
21cdfc8eae Avoid creating wxGenericNotificationMessageImpl twice
In the case where native wxNotificationMessage is not available and
wxGenericNotificationMessage is used as wxNotificationMessage, m_impl was
being initialized twice.  This happens already in the constructor for
wxGenericNotificationMessage.  This was causing a leak of a
wxGenericNotificationMessageImpl and even more problematic, a leak of a
wxFrame, which caused some oddities.  So, just remove the initialization from
wxNotificationMessage.

Closes https://github.com/wxWidgets/wxWidgets/pull/2631
2022-01-02 12:45:23 +01:00
Lauri Nurmi
584282800e Don't log AddFontResourceEx() errors with wxLogSysError()
According to AddFontResourceEx documentation[1], there is no extended error
information available on failure, so any error logged by wxLogSysError()
is unrelated to the call.

In my experience, the sys error that was logged on failure (e.g.
corrupted/unsupported but existing font file) was ERROR_FILE_NOT_FOUND,
but the same error would be logged after a successful call also.

[1] https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontresourceexw

Closes https://github.com/wxWidgets/wxWidgets/pull/2630
2022-01-02 12:39:09 +01:00
Vadim Zeitlin
8085ba9156 Merge branch 'anybutton-dpi-change' of https://github.com/MaartenBent/wxWidgets
wxMSW wxButton fixes after switching to using wxBitmapBundle.

See https://github.com/wxWidgets/wxWidgets/pull/2628
2022-01-02 12:37:50 +01:00
Scott Talbert
44997466fb Undocument SetClippingRegion overload in wxSVGFileDC
Documentation of the other overloads was removed in 6a442d2 and there is
nothing special about the wxCoord variant in wxSVGFileDC, so remove it so
all the overloads are consistently documented in just wxDC.

Closes https://github.com/wxWidgets/wxWidgets/pull/2627
2022-01-02 12:30:53 +01:00
PB
2b7512269b Remove incorrect Release() calls from wxWebViewIEImpl code
When a COM interface is held by wxCOMPtr, one should not call
Interface->Release(), as it decreases the interface's reference
count without wxCOMPtr owning the interface being aware of that.
When then wxCOMPtr calls Interface->Release() in its destructor
the reference count is erroneously decreased again, which is bound
to result in bad things happening.

If one needs to release an interface held by wxCOMPtr immediately,
wxCOMPtr::reset() should be used instead.

These Release() calls should have been removed in 938506b1f7 (Use
wxCOMPtr throughout the wxWebViewIE Find code., 2013-05-18), which
introduced the use of wxCOMPtr, but were forgotten there.

Closes https://github.com/wxWidgets/wxWidgets/pull/2626

Closes #15207.
2022-01-02 12:30:09 +01:00
Paul Cornett
1be048fc53 Make sure there is a current row before comparing its position 2021-12-30 17:11:51 -08:00
Paul Cornett
21c3f10e28 Don't use gdk_window_set_composited() on toplevel windows
Or try to paint their contents onto a parent toplevel. From the GDK doc:
"It only makes sense for child windows to be composited".
See #18592
2021-12-30 11:49:04 -08:00
Paul Cornett
654c51f085 Handle deprecated wxBG_STYLE_COLOUR background style correctly in wxGTK 2021-12-30 11:34:22 -08:00
Paul Cornett
419501771b Avoid redefinition warnings for _GNU_SOURCE. See #19354 2021-12-30 11:11:01 -08:00
Scott Talbert
d68c3709e4 wxGLCanvas EGL: don't assert if eglChooseConfig fails
This assert prevents wxGLCanvas::IsDisplaySupported() from working properly
in the case where unsupported attributes are passed.
2021-12-30 11:06:11 -08:00
Paul Cornett
1700f62fd4 Don't take focus into account when setting selected state for cell text
The selected state is always set for the background of a selected cell,
so it should also be set for the text/foreground. Fixes text color for
unfocused selected cells with Windows high-contrast themes.
2021-12-28 23:20:05 -08:00
Maarten Bent
2855f6f0ad Use correct state bitmap when creating image list
Regression of 2a0719818a.
2021-12-23 23:40:04 +01:00
Maarten Bent
c6b745655f Prevent asserts when setting bitmap buttons at a different DPI
Closes #19353
2021-12-23 21:51:54 +01:00
Maarten Bent
fe50693304 Unbind from event handler when wxButtonImageData is destroyed
ImageData of a button can be reset. When this happens, make sure to unbind
the ImageData from the buttons event handler so no invalid access occurs when
the DPI changes.
2021-12-23 21:22:46 +01:00
Maarten Bent
971e50a45c Update bitmap shown by the buttons in wxMSW on DPI change
This was already done for buttons using wxXPButtonImageData to store the image data,
also do it for buttons that use wxODButtonImageData.
When the DPI changes, recreate the bitmaps with the size corresponding to the new DPI.

Move m_btn to wxButtonImageData so it can be used for both ImageData implementations.
2021-12-23 21:22:45 +01:00
Maarten Bent
ee93f4cae8 Initialize all bitmaps in wxODButtonImageData
This is the same initialization as wxXPButtonImageData does.
2021-12-23 20:57:49 +01:00
Paul Cornett
c61b6fad7d Avoid an unnecessary gtk_tree_path_copy() 2021-12-23 11:39:25 -08:00
Paul Cornett
5f563d9ecb Set position for wxEVT_DATAVIEW_ITEM_CONTEXT_MENU with GTK wxDataViewCtrl
See #19188
2021-12-23 11:24:26 -08:00
Paul Cornett
3611a41e07 Set position for wxEVT_DATAVIEW_ITEM_CONTEXT_MENU with generic wxDataViewCtrl
See #19188
2021-12-22 17:24:06 -08:00
Paul Cornett
aacada0ea2 wxEVT_DATAVIEW_ITEM_CONTEXT_MENU position should be in client coordinates
For consistency with wxTreeCtrl and wxListCtrl. See #19188
2021-12-22 17:12:45 -08:00
Paul Cornett
95a11eef3e Remove unneeded size event handler 2021-12-22 09:35:02 -08:00
Paul Cornett
025b8a447c Avoid unreadable text with unfocused selected item
With non-themed MSW renderer, avoid using wxSYS_COLOUR_BTNFACE for unfocused
item selection unless it has sufficient contrast with the text color.
2021-12-22 09:23:41 -08:00
Paul Cornett
4eeae960a3 Avoid drawing selection rectangle when not selected
The draw used wxTRANSPARENT_BRUSH in that case, so it was a no-op,
but better to not do it at all
2021-12-22 08:51:52 -08:00
PB
419f899b3d Revert changes to the code generating the manifest name in wx.rc
This undoes the part of 77d8926126 (Simplify Windows application
manifests, 2021-12-17) which removed special handling of MSVC from
wx.rc, as it's still needed.
2021-12-18 21:50:15 +01:00
Vadim Zeitlin
10d2354125 Merge branch 'simplify-application-manifests'
Don't use arch-specific manifests for MSVS and also add manifests and
missing project/solution files MSVS 2022.

See https://github.com/wxWidgets/wxWidgets/pull/2623
2021-12-18 20:17:33 +01:00
PB
afb4870f9d Add MSVS 2022 solutions for the library and minimal sample
Closes https://github.com/wxWidgets/wxWidgets/pull/2625
2021-12-18 20:16:59 +01:00
Vadim Zeitlin
64ad6933b5 Document that bakefiles need to be updated for a new MSVS version 2021-12-18 20:14:09 +01:00
Vadim Zeitlin
559ea66e55 Use DPI aware manifests for MSVS 2022 too 2021-12-18 13:22:59 +01:00
Vadim Zeitlin
e4ff06ebdd Also remove mentions of amd64_dpi_aware_pmv2.manifest from the manually maintained MSVS projects 2021-12-17 22:00:42 +01:00
Vadim Zeitlin
a3c89f38dc Switching to using Debian Testing for CI MSW cross builds
Sid is currently broken and installing dependencies fails, so switch to
Testing at least temporarily.
2021-12-17 21:40:50 +01:00
Vadim Zeitlin
5d6b2f6704 Rebake after parent commit changes 2021-12-17 21:29:49 +01:00
PB
77d8926126 Simplify Windows application manifests
In section "dependency" use "*" in processorArchitecture instead of specifying
the concrete architecture such as "amd64" or "x86". This allows to have just one
manifest for all architectures instead of having them for all supported architectures
individually differing in just processorArchitecture.
2021-12-17 16:57:45 +01:00
Vadim Zeitlin
f84c3a7968 Fall back to using UTF-8 in wxMemoryFSHandler::AddFile()
This seems to be better than just losing the data completely if
converting it to Latin-1 fails.
2021-12-16 21:54:43 +01:00
Vadim Zeitlin
673593f911 Document that wxString passed to AddFile() must use Latin-1
Otherwise To8BitData() would return an empty buffer for it.
2021-12-16 21:48:49 +01:00
Vadim Zeitlin
3c7b40e999 Merge branch 'clang-13-no-depr-copy'
Fix clang 13 -Wdeprecated-copy warnings and ensure that we test for them
in the allheaders test.

See https://github.com/wxWidgets/wxWidgets/pull/2619
2021-12-16 21:13:55 +01:00
Vadim Zeitlin
9aaadab7d6 Check for most clang warnings in our headers in the test suite
Make allheaders unit test also enable -Wall, -Wextra and -Wpedantic for
clang to detect any warnings it might give in wx headers.

Don't use -Weverything because there are just too many warnings we'd
need to disable then.
2021-12-15 17:50:55 +01:00
Vadim Zeitlin
6f8bc1018b Avoid -Wdeprecated-copy for many event classes from clang 13
Add new macros wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY() and
wxDECLARE_NO_ASSIGN_DEF_COPY() and use them instead of
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN() and wxDECLARE_NO_ASSIGN_CLASS()
respectively to ensure that we declare a (default, if possible) copy
ctor in the classes declaring an assignment operator to avoid clang
warnings about not doing it.
2021-12-15 17:50:55 +01:00
Vadim Zeitlin
e2d13c2d94 Show build environment and compiler version for Mac CI builds
This is similar to 6e96c6dda0 (Add "Show build environment" step,
2021-10-27) done for the Unix CI builds.
2021-12-15 17:50:55 +01:00
Vadim Zeitlin
28c3605f6b Factor out 3 copies of identical code into wxInputStreamPeeker
Resolve the long standing "NOTE" comments about having the same code in
wxAnimationDecoder::CanRead(), wxImage::CanRead() and GetImageCount() by
extracting the common logic into a helper wxInputStreamPeeker class and
using it from all places.

This loses the possibility to log a debug message if rewinding the
stream fails, but this is probably not very valuable and the actual
error should be already logged by SeekI() itself when it fails on a
seekable stream.

No real changes.
2021-12-15 17:50:20 +01:00
Vadim Zeitlin
0a8f7233cc Merge branch 'virtual-list-sort-indicator'
Simplify recently added wxListCtrl sort indicators support and allow
using it with virtual list controls too.

See https://github.com/wxWidgets/wxWidgets/pull/2618
2021-12-14 19:28:20 +00:00
Vadim Zeitlin
e3ec9fb124 Fix using wxMemoryDC without a GUI wxApp instance
This used to work, at least in wxMSW, but stopped working after the
(perfectly valid, on their own) changes of 2508efdd6e (Initialize
wxMemoryDC with a default font, 2019-08-13), as this resulted in calling
wxApp::GetTopWindow() that can only be called from the GUI code.

Fix this by adding wxApp::GetGUIInstance() and using it in
GetMainTopWindow(), so that we only call GetTopWindow() if we actually
have a GUI wxApp object on which to call it.

Implement this in terms of a new virtual IsGUI() which seems slightly
better than, although roughly equivalent to, using wxDynamicCast().

Closes https://github.com/wxWidgets/wxWidgets/pull/2617

Closes #19343.
2021-12-14 19:28:02 +00:00
Vadim Zeitlin
c834c0b8b7 Add GetUpdatedAscendingSortIndicator() helper function
It seems like this function will need to be used in every implementation
of EVT_LIST_COL_CLICK handler when using sorting, so it makes sense to
provide it in the library itself.
2021-12-14 14:22:08 +00:00
Vadim Zeitlin
0a8e82b010 Rename formal parameter of ShowSortIndicator() to "col"
No real changes, just use a more appropriate parameter name, as it's a
column index and not just "index".
2021-12-14 14:19:10 +00:00
Vadim Zeitlin
52649cc566 Remove wxListCtrl::EnableSortIndicator()
The old API seems unnecessarily complex, it is simpler to just let the
application call ShowSortIndicator() itself from its
wxEVT_LIST_COL_CLICK handler, which needs to be defined anyhow in order
to actually sort the items, rather than require it to enable sort
indicator, explicitly set it initially and then remember to not set it
any longer in response to the column clicks.

Also make RemoveSortIndicator() non-virtual and implement it simply as
ShowSortIndicator(-1) because this actually simplifies the code too.
2021-12-14 14:09:23 +00:00
Vadim Zeitlin
30ce892ed5 Let wxListCtrl::ShowSortIndicator() implicitly enable indicators
It doesn't seem right for ShowSortIndicator() to silently do nothing if
EnableSortIndicator() hadn't been called before, so make it enable the
sort indicators if they hadn't been enabled yet.

The alternative would be to assert in this function, but this seems less
useful.

Also add some comments to wxMSW version.
2021-12-13 14:31:49 +00:00
Vadim Zeitlin
c287840faa Optimize changing sort indicator in wxGenericListCtrl
Don't do anything at all if nothing changes and if the indicator does
change, refresh only the header window and not the whole list control,
which seems unnecessary.
2021-12-13 14:29:59 +00:00
Vadim Zeitlin
58290168e5 Remove top level "const" from {Enable,Show}SortIndicator()
Don't use "const int" or "const bool" for parameter types, the "const"
here is ignored and using it is inconsistent with all the rest of the
library.

No real changes.
2021-12-13 14:18:18 +00:00