Commit Graph

71885 Commits

Author SHA1 Message Date
Vadim Zeitlin
2ca9951357 Merge branch 'tests-readme'
Explain how to build the tests.

See https://github.com/wxWidgets/wxWidgets/pull/2586
2021-11-12 17:16:13 +01:00
Lauri Nurmi
ed92c86785 Use semicolon after wxIMPLEMENT_*_CLASS* in wx's own implementations
wxIMPLEMENT_DYNAMIC/ABSTRACT_CLASS* is documented to be used with a
semicolon, though it is not mandatory.

Not touching headers yet, to avoid -pedantic warnings in user code.

See https://github.com/wxWidgets/wxWidgets/pull/2584
2021-11-12 17:15:29 +01:00
Alexander Bisono
5cea9f4649 Change wxwin.m4 to use non-deprecated macros
`AC_HELP_STRING` and `AC_CANONICAL_SYSTEM` are deprecated past autoconf
2.70+. A quick runthrough with `autoupdate` brings `wxwin.m4` in line
with this.

Closes https://github.com/wxWidgets/wxWidgets/pull/2585
2021-11-12 17:13:34 +01:00
Maarten Bent
c220ec1022 Add new image files used in the test to CMake too
This should have been done in 20208cc81f (Fix loading bitmaps with
malformed biClrUsed field, 2021-11-05), but was forgotten there.

See https://github.com/wxWidgets/wxWidgets/pull/2583
2021-11-12 17:12:10 +01:00
Lauri Nurmi
90c20798b9 Implement wxSecureZeroMemory() for clearing memory securely
Wrap native function when possible, and fallback to a generic
implementation.

Closes https://github.com/wxWidgets/wxWidgets/pull/2582
2021-11-12 17:10:02 +01:00
Dominic Letz
4f7e09374a Fix taskbar icon size when using high DPI under macOS
Change from old `m_statusItem` API to new `[m_statusItem button]` API
because the former is now deprecated and the new one does automatic
image scaling.

Closes https://github.com/wxWidgets/wxWidgets/pull/2573
2021-11-12 17:06:58 +01:00
Vadim Zeitlin
37dbf9f03a Merge branch 'threadname' of https://github.com/lanurmi/wxWidgets
Add wxThread::SetName for naming threads for debugging purposes.

See https://github.com/wxWidgets/wxWidgets/pull/2572
2021-11-12 17:05:12 +01:00
Vadim Zeitlin
40f06a3a70 Merge branch 'ci-ccache'
Enable use of ccache for Unix CI builds.

See https://github.com/wxWidgets/wxWidgets/pull/2571
2021-11-12 17:03:13 +01:00
Carlos Azevedo
9a32d602c4 Improve wxAuiToolbar separators colour when using dark themes
Presently the colour is darker than the background, making it
essentially invisible.

Closes https://github.com/wxWidgets/wxWidgets/pull/2553
2021-11-12 17:02:31 +01:00
Maarten Bent
e917c8c6a7 Also explain how to build the tests using CMake 2021-11-12 16:53:30 +01:00
Vadim Zeitlin
46973762ba Explain how to build the tests
It may not be obvious how to build the tests, so add a section
explaining this to the existing file containing the instructions about
writing the tests and add a README to the tests directory itself to
increase chances that this file will be found -- hopefully anybody
interested in the tests will look at the README in the directory
containing them.
2021-11-12 14:21:41 +01:00
Vadim Zeitlin
b4ba5ae0b6 Use icons set with SetImages() in Mac wxNotebook implementation
Use GetBitmapBundle(), via a helper GetPageBitmapBundle() function which
is going to be useful elsewhere too, rather than GetImageList(), as the
latter only works if the images were set using SetImageList(), while the
new version does the right thing both in this case and when the images
were set using SetImages().
2021-11-12 14:11:59 +01:00
Vadim Zeitlin
e58612661c Document wxWithImages::GetUpdatedImageListFor()
This function is sufficiently useful to be made public and it needs to
be documented in order to recommend using it instead of GetImageList().
2021-11-11 21:59:45 +00:00
Vadim Zeitlin
127389b1c7 Update images in wxMSW wxListCtrl on DPI change
Just reuse wxWithImages::GetUpdatedImageList() to update all the image
lists used by the control.
2021-11-11 21:48:31 +00:00
Vadim Zeitlin
6349d0b4ca Update link to the GTK stock items list in the docs
Retarget the link to developer-old.gnome.org, as this documentation is
not available on the current GTK documentation site any longer.

Closes #19316.
2021-11-11 22:39:59 +01:00
Vadim Zeitlin
aca0c74e60 Add wxListCtrl::Set{Normal,Small}Images()
These new functions allow to use wxBitmapBundle for the images in this
control instead of wxImageList.

Update the sample to use the new API.
2021-11-11 01:20:35 +00:00
Vadim Zeitlin
9ea8feec37 Make GetUpdatedImageListFor() work when using old API too
Return the image list set via {Set,Assign}ImageList() if SetImages()
hadn't been called to make this function return the correct image list
in any case, both when using the old wxImageList API and the new one
using wxBitmapBundle.

This commit is best viewed ignoring whitespace-only changes.
2021-11-11 01:20:35 +00:00
Vadim Zeitlin
907f6da047 Make wxWithImages::GetUpdatedImageListFor() public
It should be possible to call this function on wxWithImages objects
contained in derived classes too.

This commit is best viewed with --color-moved git option.
2021-11-11 00:52:12 +00:00
Vadim Zeitlin
8a3d886135 Replace wxImageLists in wxListCtrlBase with wxWithImages
Still no real changes, but this makes the code simpler and more robust
and prepares the way for adding wxListCtrl methods taking vectors of
bitmap bundles.
2021-11-11 00:52:12 +00:00
Vadim Zeitlin
638d865632 Add more useful wxWithImages::GetUpdatedImageListFor()
This replaces the previously added UpdateImageListIfNecessary() as we
almost always needed the image list after calling that function anyhow,
so it makes more sense to return the image list from it -- which also
required renaming it.

No real changes.
2021-11-11 00:52:12 +00:00
Vadim Zeitlin
5941dea234 Move wxImageList-related code to wxListCtrlBase
Put the code common to all wxListCtrl implementations in the common base
class instead of duplicating it in wxMSW, wxQt and generic versions.

No real changes yet, this is a pure refactoring which prepares for the
upcoming changes.
2021-11-11 00:52:12 +00:00
Vadim Zeitlin
cd385cf22d Trivial change to test rebuilding using ccache
Change the workflow file to trigger rebuild without affecting the other
builds.
2021-11-09 13:29:57 +01:00
Vadim Zeitlin
cffd5db562 Ignore the commit removing "$Id$" keywords for git-blame
Not sure if this is actually that useful, as this commit didn't modify
any of the still existing lines anyhow, but it seems logical to exclude
this commit, as it didn't make any real changes, but touched almost all
files.
2021-11-09 13:29:48 +01:00
Vadim Zeitlin
9d86ba11e2 Add support for wxBitmapBundle to wxGTK wxNotebook
Just use wxWithImages::GetBitmapBundle() directly with wxGtkImage
without passing by wxImageList -- this suffices to have working high DPI
support for notebook page icons.
2021-11-07 23:40:47 +01:00
Vadim Zeitlin
f1da96db27 Add helper wxWithImages::GetBitmapBundle()
This function can be used in the ports that don't require wxImageList
(i.e. anything but wxMSW) to use wxBitmapBundle if it's available,
rather than passing by wxImageList.
2021-11-07 23:39:59 +01:00
Vadim Zeitlin
0588bc8820 Fix size of wxImageList created by wxBitmapBundle
The size must be specified in logical, and not physical, pixels and the
failure to do use the correct units results in a silent (!) failure to
add any bitmaps to the wxImageList later.
2021-11-07 23:23:47 +01:00
Vadim Zeitlin
73886b1bb2 Significantly extend wxWithImages documentation
Notably explain that SetImages() should be preferred to the old methods
taking wxImageList and why.
2021-11-07 22:07:00 +00:00
Vadim Zeitlin
99c30e488c Document the use of wxWithImages methods with wxTreeCtrl
Also remove the documentation of the inherited methods from wxTreeCtrl
itself.
2021-11-07 21:57:42 +00:00
Vadim Zeitlin
ced845f006 Update wxTreeCtrl and its sample to work with wxBitmapBundle
Override OnImagesChanged() to call UpdateImageListIfNecessary() even in
wxGenericTreeCtrl for now, although in the future it would really make
sense to stop using wxImageList in its implementation and just use
wxBitmapBundle directly instead.

wxMSW is the only one which really needs an image list, as it's required
by the native control.

Also update the sample, even though it doesn't look very nice because
its icons are only available in a single size, so we have to always
scale them.
2021-11-07 21:46:42 +00:00
Artur Wieczorek
755ee1cf10 Get rid of unnecessary casting 2021-11-07 22:39:10 +01:00
Artur Wieczorek
789b39be81 Fix deleting wxPGProperty from wxPropertyGridPageState in alphabetical mode
Categories of properties can be nested so we need to search on all category
levels for the the category wxPGProperty belongs to.
And wxPGProperty removed from the alphabetical list can be a subproperty
of another property so it's parent doesn't have to be the root of the list
and we don't have to check this with assertion.

Closed #19310.
2021-11-07 22:35:22 +01:00
Vadim Zeitlin
e293a3a6e3 Remove unnecessary wxBusyCursor from the treectrl sample
This was added way back in 618a5e382a (Applied Greg's patch to tree
control and related., 2001-08-18) for some reason, but probably was
never needed and definitely isn't any more.
2021-11-07 21:15:02 +00:00
Vadim Zeitlin
c777a34d78 Move wxBookCtrlBase::WXHandleDPIChanged() to wxWithImages itself
This function is not really wxBookCtrl-specific and can be used with
other classes as well, so allow reusing it in them.

No real changes, this is just a refactoring.
2021-11-07 21:13:39 +00:00
Artur Wieczorek
5f0dc6cc0a Fix adding wxPGProperty to wxPropertyPageState in alphabetical mode
If given wxPGProperty is a subproperty of another property (its parent
is neither root nor category) it shouldn't be added directly
to the alphabetical list. It should be just added as a child property.
2021-11-07 22:09:05 +01:00
Artur Wieczorek
198bd1fe1f Fix setting categorized/alphabetic mode for inserted wxPropertyGridPage
State of the newly added wxPropertyGridPage should have the same
categorized/alphabetic mode like associated wxPropertyGrid.
2021-11-07 21:59:47 +01:00
Vadim Zeitlin
ddb3b4a80a Use wxWithImages in wxTreeCtrl
Replace direct use of wxImageList with the use of wxWithImages, which
will make adding support for using wxBitmapBundle later simpler.

In fact, this already somewhat simplifies the code by removing the need
to manually take care of m_ownsImageListXXX flags.
2021-11-07 17:52:35 +00:00
Vadim Zeitlin
34a730f89c Small cleanup of wxGenericTreeCtrl-specific parts of the sample
Use HAS_GENERIC_TREECTRL for testing whether we're actually using it or
not instead of checking for USE_GENERIC_TREECTRL and then port names
with a native control, which was done inconsistently, as it included
wxQt in one place, but not the other one.

Also avoid repeating CreateButtonsImageList() declaration twice, as this
resulted in having unbalanced curly braces in this file, which was just
unpleasant.

No real changes.
2021-11-07 16:36:43 +00:00
Vadim Zeitlin
725c3d5608 Update images when DPI changes in wxBookCtrlBase-derived classes
Just pretend that the images themselves have changed, this should be
enough to recreate wxImageList from the bundle using the new scale
factor in UpdateImageListIfNecessary().
2021-11-07 16:06:55 +00:00
David Costanzo
20208cc81f Fix loading bitmaps with malformed biClrUsed field
Stop throwing std::bad_alloc when BMP has large/negative biClrUsed by
checking that biClrUsed has a reasonable value before attempting to
allocate however much memory it indicates.

Add unit tests showing the loading such invalid bitmaps now correctly
returns an error rather than throwing an exception.

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

Closes #19295.
2021-11-06 16:12:04 +01:00
Vadim Zeitlin
58d2243f7b Improve wxTE_RICH(2) styles documentation
Mention that wxTE_RICH2 should be used instead of wxTE_RICH and that it
can now be turned out automatically if the initial text is too long.

See #19303.
2021-11-06 16:00:49 +01:00
Lauri Nurmi
aace36b17f Add static SetNameForCurrent for setting name of non-wxThreads
Co-authored-by: PB <PBforDev@gmail.com>
2021-11-05 16:11:56 +02:00
Lauri Nurmi
fc756d06a6 Add wxThread::SetName for naming threads for debugging purposes
Such thread names can be shown by some debuggers, and depending on
the OS and compiler versions used, they can be visible in process
lists and crash dumps.

Co-authored-by: PB <PBforDev@gmail.com>
2021-11-05 16:11:55 +02:00
Vadim Zeitlin
590d3f1b75 Merge branch 'macos_versionname12' of https://github.com/TcT2k/wxWidgets
Recognize Windows 11 and macOS 12 in wxGetOsDescription().

See https://github.com/wxWidgets/wxWidgets/pull/2580
2021-11-05 13:58:09 +01:00
Lauri Nurmi
7c6b041469 Simplify function pointer syntax in GetPreferredUILanguage()
No need for (*func)(args), just call func(args).

No real changes.

This commit is best viewed ignoring whitespace-only changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/2579
2021-11-05 13:56:55 +01:00
PB
d7e33a5291 Extend wxMSW contributor guide
List useful wrapper classes for Windows API provided by wxWidgets.

Closes https://github.com/wxWidgets/wxWidgets/pull/2578
2021-11-05 13:56:10 +01:00
Vadim Zeitlin
cce8e41b20 Merge branch 'gtk_unknown_keys' of https://github.com/martinetd/wxWidgets
Generate wxKeyEvents even for unknown keys in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2576
2021-11-05 13:55:12 +01:00
Vadim Zeitlin
de3d95a7b3 Merge branch 'gtk-launch-keys'
Generate events for GDK_KEY_LaunchX keys too in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2575
2021-11-05 13:53:30 +01:00
Vadim Zeitlin
089b72b762 Merge branch 'msw-long-text'
Fixes for creating wxTextCtrl with long text in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/2570

Closes #19303.
2021-11-05 13:50:20 +01:00
Tobias Taschner
69aedae382 Include Windows 11 in wxGetOsVersion() table 2021-11-05 13:07:32 +01:00
Tobias Taschner
6cef0c0464 Include Windows 11 name in wxGetOsDescription()
The major version is not changed for Windows 11 from
Windows 10, but the build number 22000 can be used to
determine it's Win 11.
2021-11-05 11:55:51 +01:00