Commit Graph

72393 Commits

Author SHA1 Message Date
Alexander Koshelev
612c37f706 XRC: add GetBitmapBundle function
The function creates wxBitmapBundle from <bitmaps> xrc tag.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2022-01-11 17:04:27 +03:00
Vadim Zeitlin
8a006eb735 Merge branch 'msw-frozen-show-events'
Fix sending wxEVT_SHOW for frozen windows in wxMSW.

See https://trac.wxwidgets.org/ticket/19216
2022-01-11 14:55:53 +01:00
AliKet
e9bb4e80cb Fix wxStaticBox repainting in RTL layout under MSW
Calculate the clipping region correctly when repainting a wxStaticBox
containing windows that are its siblings (rather than children) when RTL
layout is used: the old AdjustRectForRtl() implementation didn't mirror
the child coordinates correctly.

See #19086.
2022-01-11 02:50:37 +01:00
Vadim Zeitlin
b8f69d2167 Enable test for wxEVT_SHOW for non-MSW platforms too
This test does pass with wxGTK, so run it there.
2022-01-11 02:36:46 +01:00
Vadim Zeitlin
b4ff385039 Revert addition of MSW-only test for notebook pages wxEVT_SHOW
This doesn't work in wxGTK and it doesn't seem useful to have a MSW-only
test for this, finally.
2022-01-11 02:10:36 +01:00
PB
2cb37faa9a Define NANOSVG_ALL_COLOR_KEYWORDS before including NanoSVG
When NANOSVG_ALL_COLOR_KEYWORDS is not defined, only 10
of the 147 SVG named colors are recognized and all the
others are displayed as black.
2022-01-09 17:10:59 +01:00
Dummy
006fd1a511 Fix sending show events when hiding frozen windows in wxMSW
Send these events ourselves because MSW itself doesn't generate them for
frozen windows. This makes wxMSW more consistent with the other ports.

Add unit tests to verify that the behaviour is really as expected for
both normal and frozen windows, at least under MSW -- under GTK these
events are not sent at all for the notebook pages.

Closes #19216.
2022-01-08 22:14:04 +01:00
Vadim Zeitlin
7f5fe09a34 Merge branch 'mac-dvc-freeze'
Optimize column adjustments when wxDVC is frozen under Mac.

See https://github.com/wxWidgets/wxWidgets/pull/2614
2022-01-08 19:59:02 +01:00
Vadim Zeitlin
666c9dbbd8 Restore correct return value of cancelled drag in wxMSW
Fix regression originally introduced in f5548e399e (Fix problem with
dragged icon remaining on screen under MSW 10, 2020-01-11) and changed,
but not fixed, in b6c593af45 (Fix regression in MSW DoDragDrop() return
code, 2020-05-03) by restoring the original code from before these
changes except for moving the cleanup logic in a local object dtor.

Closes #19274.
2022-01-08 19:15:33 +01:00
Paul Cornett
ef779835b4 Document when GetItemParent() was added 2022-01-07 22:00:00 -08:00
Paul Cornett
3cd791de21 Add GetItemParent() to wxDataViewTreeCtrl
Makes it a little easier to convert from using wxTreeCtrl to wxDataViewTreeCtrl
2022-01-07 14:48:36 -08:00
Vadim Zeitlin
27d5306bdd Make wxToolBar::SetToolBitmapSize() work again
It didn't do anything since wxBitmapBundle-related changes, as could be
seen by toggling the bitmap size in the toolbar sample -- the bitmaps
size didn't actually change.

Make it work again by only using the best bitmap size if it's greater
than the currently set bitmap size, but not shrinking the bitmaps to it
if it's smaller. This doesn't seem especially useful, but this is how
the code behaved with single bitmaps before and there doesn't seem to be
any good reason to change this.

At least document that calling SetToolBitmapSize() is unnecessary and
normally shouldn't be done.
2022-01-07 00:13:52 +01:00
Vadim Zeitlin
af641ba7b8 Merge branch 'skip-dpichange-events'
Fix wxGenericColourButton after recent bitmap changes and, more
generally, always skip wxDPIChangedEvent and document that this should
be done.

See https://github.com/wxWidgets/wxWidgets/pull/2637
2022-01-06 23:46:35 +01:00
Vadim Zeitlin
f5e0076f04 Advise to skip wxDPIChangedEvent when handling them in the manual
Not skipping them is almost invariably a bug, as shown by the
grandparent commit.
2022-01-06 23:45:28 +01:00
Maarten Bent
2cae38502f Fix wxGenericColourButton bitmaps for different button states
Only the bitmap of the normal state was updated, not of the other (focused, hover, disabled, etc) states.
This became obvious after ee93f4cae8, but already happened before that for the disabled state.

Invalidate the bitmapButton using wxNullBitmap, so all states will be updated when setting the bitmap.
2022-01-05 23:20:42 +01:00
Maarten Bent
e2d34e982e Skip all wxDPIChangedEvent
So base classes will process the event too.
This is need for (at least) wxGenericColourButton It has its own handler,
but also needs to handle the DPI event in wxButtonImageData.
2022-01-05 22:47:32 +01:00
Vadim Zeitlin
31279195f4 Fix building tests with MSVS 2022 in C++20 mode with /permissive-
Update Catch submodule to include the fix for std::uncaught_exception()
not being available with these compiler options.

Closes #19355.
2022-01-04 23:13:39 +01:00
Tobias Taschner
a5cec42bb6 macOS: Use public API for fullscreen in wxWebView
To enable fullscreen support with WKWebView private API which was
available since macOS 10.11 was used. Beginning with macOS 12.1 this
resulted in unpredictable layout issues inside the webview.

This reimplementation using java script and message handlers does only
use public API. This also makes the fullscreen message more controlable
as the webview does no longer put the containing window in fullscreen
mode without application code intervention. That also unifies macOS with
the way Edge sends this event in MSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/2629
2022-01-04 22:54:39 +01:00
Vadim Zeitlin
c864c9119b Document wxIMPLEMENT_{APP,WXWIN_MAIN}_CONSOLE macros too
Even though they're less useful than their non-CONSOLE counterparts,
they still should be documented.

Closes #19358.
2022-01-04 22:51:06 +01:00
PB
0f8ab824a3 Fix using const char* and wxString in ternary operator
Using a const char* and a wxString in the two branches of the ternary
operator resulted in compile-time errors since the result type of the
conditional expression was ambiguous, so add explicit conversions to fix
it.

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

See #19355.
2022-01-03 21:20:23 +01:00
DINAKAR T.D
55cb17df78 Correct some Tamil translations 2022-01-03 21:16:56 +01:00
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