Commit Graph

72023 Commits

Author SHA1 Message Date
Vadim Zeitlin
c08c539d18 Merge branch 'ak_wizard' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxWizard.

See #22124.
2022-02-13 00:30:26 +01:00
Vadim Zeitlin
9dc34611c7 Merge branch 'ak_htmllistbox' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxHtmlWindow.

See #22123.
2022-02-13 00:29:39 +01:00
Vadim Zeitlin
f0e6a8b15a Merge branch 'bitmap-scale-fixes'
Really fix setting wxBitmap scale factor in wxMSW and rename
wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize().

See #22118.
2022-02-13 00:27:24 +01:00
Blake-Madden
ddf90dc3e0 Fix comment in example for banner window
Should say top edge, not left.

Closes #22122.
2022-02-11 18:48:03 +01:00
Vadim Zeitlin
9ab6a5244f Merge branch 'fsw-tests'
Try to do something about recurrent failures in wxFSW unit tests.

See #22119.
2022-02-11 18:47:23 +01:00
Vadim Zeitlin
4436a126dc Merge branch 'tbar-hidpi'
Fix toolbar resizing when moving to a lower DPI screen.

See #22117.
2022-02-11 18:46:49 +01:00
Vadim Zeitlin
00bd8c5576 Fix high DPI support for MDI windows
High DPI support didn't work for wxMDIParentFrame (and everything
inside it) because it was only enabled when InheritAttributes() from
wxNonOwnedWindow was called and this was only done in wxTopLevelWindow
but not in this class.

Fix this by removing the need to call InheritAttributes() at all and
just initializing m_perMonitorDPIaware when the window is created
automatically, to ensure that it can't be forgotten.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>

Closes #22116.
2022-02-11 18:45:48 +01:00
Vadim Zeitlin
74424cbeb2 Rename wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize()
The new name, recently introduced in 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22), was perhaps more clear,
but also misleading and confusing because the postcondition

	CreateWithLogicalSize(size, 2).GetLogicalSize() == size

was not satisfied under MSW, so rename it once again, and hopefully
finally, because the new name is consistent with GetDIPSize() returning
the same size.

Also try to improve the documentation a bit more.
2022-02-11 17:30:57 +00:00
Vadim Zeitlin
20f82e2ccb Fix CreateWithLogicalSize() to set correct scale in wxMSW too
Unlike under Mac (see previous commit), this never worked correctly in
wxMSW at all, only SetScaleFactor() could be used to change the scale
factor of the bitmaps there.

Fix this and make CreateWithLogicalSize(..., scale) result in
GetScaleFactor() returning the same scale for the resulting bitmap, as
expected, under MSW too.

Also add a unit test verifying that this holds.
2022-02-11 17:15:51 +00:00
Vadim Zeitlin
6f5ac3c594 Fix CreateWithLogicalScale() to set correct scale in wxOSX
This got unfortunately broken by the changes of 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22).
2022-02-11 17:15:51 +00:00
Alexander Koshelev
d6271a6c10 XRC: use wxBitmapBundle in wxWizard 2022-02-11 18:04:56 +03:00
Alexander Koshelev
e6a8e8ccfb Use svg files in wizard sample 2022-02-11 18:04:56 +03:00
Alexander Koshelev
429b5561ff Use wxBitmapBundle in wxWizard 2022-02-11 18:04:56 +03:00
Alexander Koshelev
bbcaa7b9e0 Use wxBitmapBundle in html about sample 2022-02-11 16:47:47 +03:00
Alexander Koshelev
7a2a1e9074 Use wxBitmapBundle in wxHtmlWindow 2022-02-11 16:16:45 +03:00
Paul Cornett
2356dda034 Export IsX11/IsWayland symbols needed by wxMediaCtrl library 2022-02-10 11:16:36 -08:00
Paul Cornett
94868c6f41 Add functions for determining if GDK3 backend is X11 or Wayland 2022-02-10 10:15:08 -08:00
Vadim Zeitlin
d130323a4c Fix default size of wxBitmapBundle created from scaled bitmap
We need to use GetDIPSize(), not GetLogicalSize(), for this to work
correctly under MSW too.

Also add a unit test checking for this.
2022-02-10 14:01:09 +00:00
Vadim Zeitlin
20d1188e82 Really fix setting wxBitmap scale factor
Optimization of 2ae80673ff (Avoid unnecessarily unsharing bitmaps in
wxMSW, 2022-02-02) broke setting the scale factor because we didn't
update the right bitmap data in case bitmap hadn't had exclusive
ownership of its data before. Fix this by not using a reference which
may refer to another object after AllocExclusive() call.

Also change the other ports to unshared the bitmap when modifying its
scale factor so that the new unit test passes for them too.
2022-02-10 14:01:09 +00:00
Vadim Zeitlin
34ca92d362 Show logs in case of Mkdir or Rmdir failures in wxFSW unit tests
Try to gather more information about the test failures on GitHub Actions
when creating or removing the test directory that isn't reproducible
locally.
2022-02-10 13:55:54 +00:00
Vadim Zeitlin
046f228bb2 Reset watch directory in wxFileSystemWatcher unit test
Share the same variable between GetWatchDir() and RemoveWatchDir() to
make things more clear.

Also check for GetWatchDir() postcondition (i.e. that the directory
exists) in the function itself instead of doing it in the caller.
2022-02-10 13:38:00 +00:00
Vadim Zeitlin
93c86fe5cd Fix harmless signed/unsigned warning in wxRegEx unit test
Cast the expected number of matches to "int" to have the same type as
wxRegEx::Replace() return value -- there is no danger of truncation here
as we're never going to expect billions of matches.
2022-02-10 13:36:49 +00:00
Vadim Zeitlin
6ec36a900c Separate the requested and effective size of toolbar bitmaps
Add wxToolBarBase::DoSetToolBitmapSize() which does everything that
SetToolBitmapSize() used to do and make SetToolBitmapSize() itself also
remember the size passed to it in a new field, so that we could check
that we don't decrease the bitmap size below the size requested by the
application, while still being able to decrease it if necessary due to a
DPI change.

This allows SetToolBitmapSize() to continue working as before, i.e.
scale the bitmaps up if necessary without ever scaling them down, but
also allows them to resize in both directions when DPI changes.

Closes #22105.
2022-02-10 00:12:14 +00:00
Vadim Zeitlin
cde6f96ea8 Move wxToolBarBase::Get- and SetToolBitmapSize() out of line
No real changes, just don't define these functions inline, they're not
called often enough to make it worth it.
2022-02-10 00:11:27 +00:00
Vadim Zeitlin
eaa769a73a Merge branch 'ak_bmpcmb_xrc' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxBitmapComboBox XRC handler.

See #22111.
2022-02-09 14:24:16 +01:00
Alexander Koshelev
e5e93bba22 XRC sample: use wxBitmapBundle in wxBitmapComboBox 2022-02-09 14:43:14 +03:00
Alexander Koshelev
cbe6520b9a XRC: use wxBitmapBundle in wxBitmapComboBox 2022-02-09 14:36:29 +03:00
Maarten Bent
360691aa8e Set images for all states when using wxAnyButton::SetBitmap()
Delete the wxButtonImageData when setting the normal bitmap,
so when the new one is created all states are initialized.

Fixes #22109.

Closes #22110.
2022-02-09 01:16:55 +01:00
Tobias Taschner
61d6929808 MSW: Fix multi monitor and dpi wxTLW::RestoreToGeometry()
If a window was placed on a monitor with a different DPI than the
main display call SetWindowPlacement() a second time to apply
the window size correctly.

Closes #22108.
2022-02-08 21:13:47 +01:00
utelle
e129c7149d Generate much smaller code for language database initialization
The initialization function has become too huge to be compiled by some
compilers (notably MinGW-TDM 9.2) after the changes of deef116a09
(Update language database and move support for it to wxUILocale,
2021-11-23), so change the script generating this code to output just an
array element rather than code statements for each language.

This also makes this file much faster to compile with the other
compilers as a nice side effect.

Closes #22100, #22104.
2022-02-08 20:59:10 +01:00
Alexander Koshelev
685e3af613 Use wxBitmapBundle in combo sample
Replace PNG files with SVG ones.

Closes #22103.
2022-02-08 20:54:05 +01:00
Vadim Zeitlin
bd058106a3 Merge branch 'imaglist-mask'
Fixes for using mask and alpha in wxMSW wxImageList.

See #22101.
2022-02-08 20:52:20 +01:00
Lauri Nurmi
8380f92988 Use [[fallthrough]] for all MSVC versions accepting it
Since VS 2015 Update 3, the C++ standard targeted by the compiler can be
detected through _MSVC_LANG. This macro is like __cplusplus, but reflects the
actual standard understood by the compiler, unlike __cplusplus which by default
is left to an ancient value for compatibility.

Closes #22099.
2022-02-08 20:51:18 +01:00
Vadim Zeitlin
25fec4aca9 Merge branch 'webview_edge_static' of https://github.com/TcT2k/wxWidgets
Allow usage of static loader with wxWebViewEdge.

See #22083.
2022-02-08 20:49:35 +01:00
Vadim Zeitlin
e90ab5f550 Merge branch 'ak_bmpcbox'
Change wxBitmap to wxBitmapBundle in wxBitmapComboBox.

Closes #22033.
2022-02-08 20:48:46 +01:00
Alexander Koshelev
72e25c49fa Generic: change wxBitmap to wxBitmapBundle in wxBitmapComboBox 2022-02-08 20:48:36 +01:00
Alexander Koshelev
5e0591b297 GTK: change wxBitmap to wxBitmapBundle in wxBitmapComboBox 2022-02-08 20:48:36 +01:00
Alexander Koshelev
d57bc78eea wxBitmapComboBox: store bitmaps in wxVector 2022-02-08 20:48:36 +01:00
Vadim Zeitlin
85853db83b Update wxAUI documentation after wxBitmapBundle transition
Change various occurrences of wxBitmap to wxBitmapBundle to reflect the
changes of 9a5123afed (Use wxBitmapBundle in wxAuiToolBar and
wxAuiPaneInfo too, 2021-11-14).

Closes #22106.
2022-02-08 20:40:55 +01:00
Paul Cornett
b401dfbdac Use wxOverlay::IsNative() rather than wxHAS_NATIVE_OVERLAY 2022-02-08 09:56:36 -08:00
Paul Cornett
38a7861391 Add wxOverlay::IsNative() method
This will replace the wxHAS_NATIVE_OVERLAY macro, allowing the determination
to be made at runtime. Ideally this should not be necessary, but it seems the
generic implementation may not always be good enough.
2022-02-08 09:34:07 -08:00
paulcor
0c1a66dc5d Use a common base class for wxOverlay implementations (#22107)
Use a common base class for wxOverlay implementations

This will allow for the possibility of choosing the implementation
dynamically at runtime.
2022-02-07 19:28:55 -08:00
Tobias Taschner
d2a17b37c8 Rebake for static web view edge 2022-02-07 22:49:33 +01:00
Tobias Taschner
57ebad4f7d Allow usage of static loader with wxWebViewEdge
Add a new build option wxUSE_WEBVIEW_EDGE_STATIC.
If it is set to 1 the WebView2 loader is static linked into the binary
and removes the runtime dependency on WebView2Loader.dll.
2022-02-07 22:49:33 +01:00
Alexander Koshelev
d225b8d56c MSW: change wxBitmap to wxBitmapBundle in wxBitmapComboBox 2022-02-07 16:09:54 +03:00
Vadim Zeitlin
4c0269b0d1 Simplify code in GetMaskForImage() by using wxScopedPtr
Use smart pointer to cleanup the temporary mask, if any, rather than
tracking it manually.

No real changes.
2022-02-06 22:54:11 +00:00
Vadim Zeitlin
9e683e0137 Remove code not used any more from GetMaskForImage() helper
This function is never called for the bitmaps with alpha now, so don't
bother converting it to mask in it.
2022-02-06 22:53:57 +00:00
Vadim Zeitlin
689ce0a138 Always use alpha if it's defined in wxMSW wxImageList
Use the alpha channel of bitmaps added to wxImageList even if it was
created with "mask = true" ctor parameter (which is the default value).
To avoid using both mask and alpha, which is not supported by the native
image list, convert mask to alpha if we have it and either we also have
alpha or we are not using mask at all.

This restores the behaviour until the changes of 8f08233a13 (Fix adding
wxBitmap with mask to wxImageList not supporting masks (wxMSW),
2021-01-12), fixes compatibility with the other ports and, last but not
least, is the expected and actually useful behaviour: alpha shouldn't be
ignored if it exists in the bitmap.

Closes #22021.
2022-02-06 22:53:57 +00:00
Vadim Zeitlin
436c92f834 Remove extraneous semicolon after namespace closing brace
No real changes.
2022-02-06 22:53:57 +00:00
Vadim Zeitlin
5fc5e5a734 Simplify initializing wxImageList::m_useMask
Set it to true at the same time as turning ILC_MASK on instead of
checking for this flag separately later.

No real changes.
2022-02-06 22:53:57 +00:00