Commit Graph

72393 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
bd0db4a5f9 Still resize (16, 15) bitmaps to (16, 16) ones in wxArtProvider
Don't rescale these bitmaps because, as the pre-existing comment said,
this would be too ugly, but still ensure that the returned bitmap has
the correct size to satisfy the post-condition of GetBitmap().
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
52bff00b19 Add accelerators to artprov sample menu entries
Allow testing various things more quickly.
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
2b72d94af0 Fix using dangling pointer in artprov sample
Don't cast wxString pointer to const char*, this could never work and
didn't crash only by some miracle.
2022-02-05 17:53:29 +00:00
Vadim Zeitlin
3871824da6 Reuse wxBitmap::Rescale() in wxArtProvider::RescaleOrResize()
No real changes, just use the common function instead of reimplementing
it here.
2022-02-05 17:53:20 +00:00
Vadim Zeitlin
5aa53a0336 Use RescaleOrResize() in wxArtProvider::GetBitmap()
This ensures that we don't rescale 16x15 bitmaps to 16x16 ones, which is
very noticeable and very ugly.

This was previously done in wxDefaultArtProvider, but not here and
didn't seem to be necessary, but since wxBitmapBundle-related changes it
has become possible for bitmaps to be rescaled here too, so use the same
logic for them.

See #22094.
2022-02-05 17:52:59 +00:00
Vadim Zeitlin
2b7e668221 Move bitmap resizing from wxDefaultArtProvider to base class
No real changes, this is just a refactoring in preparation for the next
commit.

This commit is best viewed with --color-moved git option.
2022-02-05 17:52:47 +00:00
Vadim Zeitlin
6e7fe0de35 Fix using bitmaps with mask in wxMSW wxStaticBitmap
This was broken by c1abbe6473 (Refactor wxMSW wxStaticBitmap to separate
bitmaps and icons, 2021-10-21), where the code for creating an icon for
a bitmap with mask was simply lost.

Note that an alternative fix could be to convert mask to alpha and use
this instead of switching to using an icon in this case, but for now
keep doing what we did before, even if it's not really clear which
approach is better.

See #22094.
2022-02-05 15:32:47 +00:00
Scott Talbert
f172f53ac4 Create our own socket file for socket file test
/dev/log doesn't exist in certain types of containers (e.g., Fedora's
build system).  Additionally, this enables us to run this test on
platforms other than Linux.

Closes #22090.
2022-02-05 16:18:22 +01:00
Alexander Koshelev
80bb72468c Use wxBitmapBundle in wxComboCtrl instead of wxBitmap
Replace wxBitmap with wxBitmapBundle in wxComboCtrl to make it show the
bitmap appropriate to the current DPI scaling.

Also add an event handler updating bitmaps on DPI change.

Closes #22032.
2022-02-05 16:11:14 +01:00
Vadim Zeitlin
ff8e60caea Fix regression in selection change in wxOSX wxDataViewCtrl
The change of 8aae7ad937 (Fatal exception fixed in DVC on macOS while
wxDataViewModel::Cleared call + editing item., 2022-01-17) broke change
of selection when deleting an item from wxDataViewCtrl and the unit test
checking for this but, somehow, only when it was merged into the latest
master and not when it was originally done.

It's not really clear how did it work before, but fix this now by
distinguishing between just deleting some items and clearing everything
and only returning nil from -[wxCocoaOutlineDataSource
outlineView🧒ofItem:] in the latter case, but not the former one.

Also replace wxDataViewCtrl::m_Deleting boolean with an (opaque)
pointer, so that we could improve this further in the future without
breaking the ABI.

See #22025.
2022-02-04 17:12:40 +01:00
Alexander Koshelev
28d8ed37d6 wxBitmapBundle for wxMenuItem on GTK 2022-02-04 15:45:49 +03:00
Alexander Koshelev
337940f009 wxBitmapBundle for wxMenuItem on Mac 2022-02-04 15:45:49 +03:00
Alexander Koshelev
27be2ed641 wxBitmapBundle for wxMenuItem on MSW 2022-02-04 15:45:49 +03:00
Vadim Zeitlin
dbc8506883 Merge remote-tracking branch 'github/msw-menu-bitmaps-alpha'
Fix alpha in copies of wxBitmap.

See #22085.

Closes #22059.
2022-02-04 01:35:37 +00:00
Vadim Zeitlin
bd86215843 Merge branch 'macos-dvc-isdeleting'
Fix crash in wxDataViewModel::Cleared() under Mac.

See #22025.
2022-02-04 02:28:55 +01:00
Vadim Zeitlin
c701a47176 Simplify code using wxDataViewCtrl::m_Deleting in wxOSX
Use a RAII-based helper class to reset this flag automatically on scope
exit instead of doing it manually.

This also ensures that we restore the original value rather than just
resetting it which would be more correct in the (admittedly, very
unlikely) case when any of the functions changing m_Deleting is called
recursively.
2022-02-04 02:27:27 +01:00
oneeyeman1
995c6e6df5 Add wxSpinCtrl::SetIncrement() and implement it for all ports
SetIncrement() was already available in wxSpinCtrlDouble and GTK version
of wxSpinCtrl, now implement support for it in wxMSW and wxOSX as well.

In fact, in wxMSW, implement it at wxSpinButton level, so that both this
class and wxSpinCtrl inheriting from it (in wxMSW only) support setting
custom increment now.

Also add support for it to XRC, show it in the sample and add a unit
test verifying that it works.

Closes #2597.
2022-02-04 02:16:06 +01:00
Scott Talbert
57b4a11f24 Install Python wheel module to fix Windows CI
This is needed since GitHub CI images update to windows-2022 base image,
which notably changes Python version from 3.7 to 3.9 and requires
building wheels for some of the packages not available on PyPI for this
version.

Closes #22091.
2022-02-04 02:06:11 +01:00
Vadim Zeitlin
28401d0fde Update zlib submodule to fix CMake configuration errors in it
See https://github.com/wxWidgets/zlib/pull/2
2022-02-03 23:39:55 +01:00
James Pan
866cdfe200 Complete Chinese translations
There are no more untranslated or fuzzy messages remaining.
2022-02-03 16:02:04 +01:00