Commit Graph

72213 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
7d92f321c7 Add wxImageList::Init() to wxMSW version
Initialize all fields in a single place, just as it's done in most of
the other classes.

No real changes.
2022-02-06 22:53:57 +00:00
Kvaz1r
f0c6b42ad0 Fix wxNotebook repainting in wxUniv
Set tab offset to zero if all tabs are visible.

Closes #22097.
2022-02-06 16:05:36 +01:00
Vadim Zeitlin
0dd31947b5 Merge branch 'statbmp-mask-fix'
Fix using bitmaps with masks in wxStaticBitmap and bitmap rescaling in
wxArtProvider.

See #22096.

Closes #22094.
2022-02-06 16:03:52 +01:00
Vadim Zeitlin
d860015d6d Merge branch 'bitmap-bundle-menu'
Use wxBitmapBundle for the menu items.

See #22087.
2022-02-06 16:03:32 +01:00
Tobias Taschner
0a7b3bb3cf Add wxTopLevelWindow::SetContentProtection()
This method allows to exclude a top level window from screen captures.
Windows 7 or newer is required and any macOS version is supported.
Other platforms are not implemented and will return false.

The display example has been extended to demo this ability.

Closes #22066.
2022-02-06 15:59:22 +01:00
Vadim Zeitlin
a34ddaa006 Use scalable icon in the menu sample
Replace the old XPM with a call to wxArtProvider::GetBitmapBundle(),
which looks well even in high DPI.

Also add an item to a popup menu for testing.
2022-02-05 20:53:36 +01:00
Vadim Zeitlin
338cd95c2d Move GetBitmapFromBundle() to wxMenuItemBase
This is just a refactoring to avoid duplicating this function code in
all ports and just have it once in the base class.
2022-02-05 20:39:19 +01:00
Vadim Zeitlin
bec31f1919 Setup bitmaps for all menu item kinds in wxGTK
This doesn't change anything for now, but doesn't cost anything and
might avoid problems in the future if another menu item kind is added.
2022-02-05 20:34:54 +01:00
Vadim Zeitlin
d745ff0a90 Remove wxMenuItem::GetBitmapBundle() from wxGTK
This function doesn't exist in the other ports and is not really needed
in this one neither, so just remove it for now.

If we really want to have it, we need to make it available everywhere.
2022-02-05 20:34:04 +01:00
Vadim Zeitlin
99948ffc1d Ensure that menu item HBITMAPs live for long enough
We must keep storing the currently used bitmap in wxMSW wxMenuItem to
ensure that its HBITMAP remains valid, as keeping wxBitmapBundle is not
enough: it may not preserve the bitmap at all (if it generates it on
demand, for example), and we may also use a different bitmap from what
we get from it (e.g. we convert mask to alpha).
2022-02-05 20:31:18 +01:00