Commit Graph

71455 Commits

Author SHA1 Message Date
Vadim Zeitlin
3d5664cabe Merge branch 'samples-dpi-v2-aware'
Build all samples, not just one of them, as per-monitor DPI v2 programs
under MSW and minor cleanup of the samples .rc files.

See https://github.com/wxWidgets/wxWidgets/pull/2557
2021-10-25 13:16:55 +02:00
Vadim Zeitlin
1fb7b13812 Fix typo in "class" in wxUSE_STOPWATCH comment
Closes https://github.com/wxWidgets/wxWidgets/pull/2556
2021-10-22 01:42:53 +02:00
Vadim Zeitlin
fb93d7f101 Fix wrong class name in wxAuiTabContainer comment
No real changes, just fix a typo in a comment.

See https://github.com/wxWidgets/wxWidgets/pull/2556
2021-10-22 01:41:21 +02:00
Vadim Zeitlin
4d5bdfeb77 Fix shadow warning in wxHtmlHelpDialog ctor declaration
This is similar to 858248d055 (Fix declaration shadow warning in
wxHtmlHelpFrame, 2021-04-21) and fixes another -Wshadow from gcc 11 by
getting rid of the last parameter confusingly named as its type.

See #19153.
2021-10-22 01:37:20 +02:00
Stefan Csomor
98f056daf5 using GetPreferredSizeAtScale when assembling native NSImage from a bitmap bundle 2021-10-21 15:30:32 +02:00
Stefan Csomor
6f2a1fa55d adding bitmap bundle files to macOS xcodeproj 2021-10-21 15:29:46 +02:00
Jouk
5449136210 Fix inheritance of wxBitmapHelpers::Rescale as is needed on OpenVMS 2021-10-21 11:44:11 +02:00
Jouk
8b9a5c059e Add compilation of bmpbndl.cpp on OpenVMS 2021-10-21 08:07:35 +02:00
Vadim Zeitlin
a809b6f058 Merge branch 'add-dump-window'
Add wxDumpWindow() function.

See https://github.com/wxWidgets/wxWidgets/pull/2558
2021-10-21 00:24:47 +01:00
Stefan Csomor
4eb4c1706f Remove NSImage from public API of wxBitmapBundleImpl
Hide wxOSX implementation details by storing NSImage associated with the
bundle in a separate global map instead of making it part of
wxBitmapBundleImpl itself.

See https://github.com/wxWidgets/wxWidgets/pull/2555
2021-10-21 01:21:46 +02:00
Vadim Zeitlin
ae2d8c34f9 Use wxDumpWindow() in trace messages in wxWindow itself
Instead of just showing the class name and the window name, show the
result of wxDumpWindow() which is similar, but more informative.
2021-10-20 23:35:37 +01:00
Vadim Zeitlin
9e5c8eef24 Make wxDumpWindow() public and available in wxMSW too
This function was defined in wxGTK and wxOSX, but not in wxMSW or the
other ports, but it can be useful there too, so make it public and
define it in common code.
2021-10-20 23:35:37 +01:00
Vadim Zeitlin
85503d1dcd Get rid of CppUnit boilerplate in MiscGUIFuncsTestCase
Simplify code by not defining an unnecessary test case class and using
CATCH macros directly.

No real changes.
2021-10-20 23:35:37 +01:00
Vadim Zeitlin
87b394a555 Use wxScopedPtr in MiscGUIFuncsTestCase for automatic cleanup
Replace manual calls to Destroy() to ensure that the objects created in
this test will be destroyed even if a check fails.
2021-10-20 23:35:37 +01:00
Vadim Zeitlin
5341bf5b60 Remove unnecessary win32-res tags from samples bakefiles
Don't specify sample.rc as the resource file for the samples, it is used
by default anyhow, so this is unnecessary.
2021-10-20 17:47:47 +02:00
Vadim Zeitlin
16f2c7bb89 Remove unused samples resource files
These resource files didn't appear in the .bkl ones and so were not used
at all and were not worth being used anyhow, as they didn't differ
significantly from sample.rc.
2021-10-20 16:34:38 +01:00
Vadim Zeitlin
aa2780b472 Set wxUSE_DPI_AWARE_MANIFEST=2 for all samples, not just toolbar
This is required for high resolution bitmaps support and it will be
needed in other samples too, so use it for all of them.

This probably will result in some problems due to remaining bugs with
high DPI support, but it should make them more noticeable and so should
help with finding and fixing them.
2021-10-20 16:19:41 +01:00
Vadim Zeitlin
ec975c70cc Merge branch 'bmp-bundle-pref-size'
Allow wxBitmapBundle specify its preferred size and use it in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/2554
2021-10-20 16:17:51 +01:00
David Costanzo
07670667d9 Fix gcc 11 -Wzero-as-null-pointer-constant in wxMSW wxImageList
This warning was introduced by the recent 999340f288 (Check that
wxImageList::Create() is not called more than once, 2021-10-17), fix it
by using NULL for HIMAGELIST which is a pointer internally.

Closes #19298.
2021-10-20 15:23:52 +02:00
Vadim Zeitlin
ae5bc69d9f Use preferred bundle bitmaps size in wxMSW wxToolBar
This avoids resizing the bitmaps in some common use cases and is similar
to the previous commit doing the same thing for wxButton.

Notice that this introduces a slight change of behaviour, as
AdjustToolBitmapSize() now can reduce, as well as increase, the size of
bitmaps used, which is necessary in order to shrink the bitmaps when
moving from a higher DPI resolution display to a lower-resolution one.
This is not 100% backwards-compatible, but should only have not very bad
cosmetic effects.
2021-10-19 02:20:26 +01:00
Vadim Zeitlin
1f8af4d5a2 Use preferred size for the button bitmaps in wxMSW
Avoid scaling the bitmaps by using the preferred size for them.

This results in significantly better appearance without any real
drawbacks in practice at 125% and 175% DPI scaling in the common case
when just a single and double-sized bitmaps are available, and still
seems to be acceptable at 150% scaling in this case.
2021-10-19 02:20:26 +01:00
Vadim Zeitlin
b20552116c Allow wxBitmapBundle to specify its preferred bitmap size
Using bitmaps of preferred size avoids scaling and results in much
better appearance, so add methods allowing querying the bundle about the
bitmaps it supports and implement them in the various implementations.

This is not actually used anywhere yet, but will be soon.
2021-10-19 02:20:26 +01:00
Vadim Zeitlin
1cda648206 Merge branch 'button-bmp-bundle'
Add support for wxBitmapBundle to wxButton and related classes to make
it possible to use high resolution images in them in high DPI.

See https://github.com/wxWidgets/wxWidgets/pull/2552
2021-10-19 03:09:03 +02:00
Vadim Zeitlin
7dbbe60d82 Give better error message if Nano SVG is unavailable, if possible
Getting errors due to "missing" Nano SVG headers can be confusing, as
it's not immediately clear why are they missing, so try to make things
more explicit by using __has_include(), if available, to test for the
header before including it and giving a better error message if it
fails.

It still won't help people not using C++17 or those not reading error
messages, but should be better than nothing.
2021-10-19 02:33:39 +02:00
Vadim Zeitlin
5bb6046ca9 Document remaining problems when changing DPI of wxMSW toolbar
Unfortunately even using CallAfter() doesn't allow to completely repair
the toolbar display after moving it to a display with a different
fractional scaling, e.g. from 125% to 175%. There are still some minor
but visible display artefacts in this case that we can't get rid of even
by resizing the window containing the toolbar programmatically -- even
though doing it interactively does help.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
04a8e0e5bd Use bitmap bundle rather than scaled bitmap size in wxToolBar
Get the minimum size needed for the bitmaps from wxBitmapBundle.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
62b6539eea Select the button size appropriate for the current DPI initially
Don't just update the bitmaps size when we receive the DPI changed
event, but also use size appropriate for the current DPI initially.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
2a0719818a Update bitmap shown by the buttons in wxMSW on DPI change
Recreate wxImageList used for the bitmaps internally with the bitmaps of
the size corresponding to the new DPI.

This commit is best viewed with --color-moved git option.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
4e5d2d97e2 Allow using wxBitmapBundle for wxButton bitmaps
Take wxBitmapBundle in wxButton::SetBitmapLabel() and related functions
in order to be able to associate several bitmaps to be used in different
resolutions with the button, instead of just a single bitmap.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
2910327ef3 Don't crash in wxOSXGetImageFromBundle() if the bundle is invalid
Just return a null image instead, as this function can be called when we
don't have any bitmaps too -- as it happens in the Button::Bitmap unit
test, for example.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
5965bc1910 Remove unused parts of wxMSW wxBitmapButton implementation
Nothing here, including the event table for this class using
non-existing wxBitmapButton::OnSysColourChanged (which is just the same
as wxWindow::OnSysColourChanged, in fact), was needed any longer ever
since the changes of a6fd73d33a (implement wxBitmapButton as just a
wrapper for wxButton under MSW, 2009-06-15), so simply remove all the
unused stuff.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
630e6b898f Add conversion ctor from wxIcon to wxBitmapBundle too
Existing code may call functions taking wxBitmap with wxIcon, due to an
existing conversion from wxIcon to wxBitmap, so we need to provide a
similar conversion to wxBitmapBundle for compatibility.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
d4bc1daf19 Revert "Remove unused code in wxGTK wxAnyButton"
This reverts commit 4e366b2cfb as it the
code removed by it is still needed and removing it results in unit test
failures in wxBitmapToggleButton unit tests with both GTK 2 and 3.

See https://github.com/wxWidgets/wxWidgets/pull/2548
2021-10-17 23:56:28 +02:00
Vadim Zeitlin
411cad6cd9 Merge branch 'gtk-always-use-wxgtkimage'
Ensure all buttons with images have associated wxGtkImage as this is
required for showing high resolution bitmaps in them in high DPI.

See https://github.com/wxWidgets/wxWidgets/pull/2548
2021-10-17 23:27:49 +02:00
Vadim Zeitlin
4e366b2cfb Remove unused code in wxGTK wxAnyButton
The GtkImage can always be retrieved using the appropriate GTK function,
there is no need to get the button child directly any longer.
2021-10-17 23:25:45 +02:00
Vadim Zeitlin
def2691fd2 Merge branch 'gtk-image-bundle'
Use wxBitmapBundle in wxGtkImage and select the appropriately-sized
bitmaps depending on DPI in wxGTK wxToolBar.

See https://github.com/wxWidgets/wxWidgets/pull/2547
2021-10-17 23:19:00 +02:00
Vadim Zeitlin
efb82320c6 Merge branch 'imaglist-destroy'
Add wxImageList::Destroy() and other minor improvements to this class.

See https://github.com/wxWidgets/wxWidgets/pull/2551
2021-10-17 19:38:54 +02:00
Vadim Zeitlin
271926fde0 Fix description of wxUSE_SPELLCHECK option in configure and CMake
Don't say that it's only for MSW and GTK 3, as it's also available under
Mac. Also don't use "spellchecking" non-word in the description of a
spell-checking option.

No real changes.
2021-10-17 19:36:56 +02:00
Vadim Zeitlin
da79145101 Merge branch 'cmake-spellcheck' of https://github.com/MaartenBent/wxWidgets
Add wxUSE_SPELLCHECK option to CMake build too.

See https://github.com/wxWidgets/wxWidgets/pull/2550
2021-10-17 19:35:08 +02:00
Vadim Zeitlin
999340f288 Check that wxImageList::Create() is not called more than once
Or at least not until Destroy() is called.
2021-10-17 16:19:19 +02:00
Vadim Zeitlin
a66e5cdb38 Add wxImageList::Destroy()
This will be useful in wxMSW implementation and seems to make sense to
have as a public function, as long as we have Create().
2021-10-17 16:19:19 +02:00
Vadim Zeitlin
6b3fd04e24 Initialize wxGenericImageList members in default ctor
Don't leave m_useMask and m_scaleFactor uninitialized -- even if this
probably doesn't matter, call Create() to make sure they have
well-defined values for the default-constructed objects.
2021-10-17 16:19:19 +02:00
Maarten Bent
d2642b4c07 CMake: Enable wxUSE_SPELLCHECK
Find gspell-1 when using GTK3. Also need to find enchant.h.
2021-10-17 14:55:46 +02:00
Maarten Bent
fef2d7d05b Fix wxListCtrl checkbox style when reapplying extended styles
Fixes #19263
2021-10-17 13:41:56 +02:00
Maarten Bent
b102afc316 CMake: Don't include generator expression in wxPLATFORM_LIB_DIR
So wxPLATFORM_LIB_DIR can be used in locations where generator expressions are not supported.
2021-10-17 11:52:30 +02:00
Maarten Bent
6d6567d41c CMake: remove duplicate install for builtin libraries 2021-10-17 11:50:34 +02:00
Vadim Zeitlin
10b7659acd Ensure all buttons with images have associated wxGtkImage
Replace GtkImage with wxGtkImage if necessary, to ensure that we can
always use our own class, to profit from its support for high DPI
images, even for the buttons using stock IDs and so creating GtkImage by
default.

See #19288.
2021-10-17 00:58:26 +02:00
Vadim Zeitlin
3333356624 Really support wxBitmapBundle in wxGTK wxToolBar
Use the appropriately sized bitmap instead of always using the (scaled
version of the) default one, as was the case since 97f6c85d9b (Add first
version of wxBitmapBundle and use it in wxToolBar, 2021-09-24).

With this change, toolbar bitmaps work correctly in 100% and 200% DPI
scaling.
2021-10-16 20:05:51 +02:00
Vadim Zeitlin
0f5c2851f4 Add wxToolBarTool::Get{Normal,Disabled}BitmapBundle() accessors
The existing variants returning wxBitmap are insufficient for non-MSW
ports where the toolbar bitmap size is unavailable otherwise, as
GetToolBitmapSize() value doesn't really correspond to it (which is a
problem on its own, but there is not much that can be done about it by
now).

Having these functions allows to retrieve the actually used bitmap size
by using wxBitmapBundle::GetDefaultSize().
2021-10-16 20:01:28 +02:00
Vadim Zeitlin
399b0ff9ae Use wxBitmapBundle instead of bitmap scale factor in wxGtkImage
Minimal changes to the code to allow using bigger bitmaps from
wxBitmapBundle in high DPI instead of having to create individual
bitmaps with scale factor greater than 1.

Notice that this is not actually used anywhere in wxGTK yet, but will be
soon.
2021-10-16 19:58:55 +02:00