Commit Graph

71613 Commits

Author SHA1 Message Date
Artur Wieczorek
7fef360b0d Set proper bitmap scale for default icons in wxPropertyGridManager tool bar 2021-11-19 17:54:04 +01:00
Artur Wieczorek
87394856f5 Use wxBitmapBundle in wxPropertyGrid 2021-11-19 17:52:56 +01:00
Vadim Zeitlin
17c1bfc0f4 Suppress "Unix" spelling warnings in the samples overview
There doesn't seem to be any good way to avoid codespell warnings about
"unx", so just add the lines containing it to the exceptions file.
2021-11-18 15:47:28 +01:00
David Costanzo
0985996d01 Fix loading of RLE bitmaps in wxBMPHandler
- Fix handling of delta encoding that change vertical position
- Fix handling of end-of-line encodings that are given mid-line
- Removed unnecessary computation for linepos

Add regression tests for the bitmaps using RLE and loading which
previously didn't work correctly.

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

Closes #19318.
2021-11-18 15:37:03 +01:00
Vadim Zeitlin
94f10eba4e Merge branch 'extra_accels' of https://github.com/vadz/wxWidgets
Allow defining additional accelerators for the menu items.

See https://github.com/wxWidgets/wxWidgets/pull/2588
2021-11-18 15:29:56 +01:00
Vadim Zeitlin
e6686373ec Add instructions for building the samples
Document various ways of building the samples.
2021-11-18 15:28:32 +01:00
Artur Wieczorek
f989b1b875 Rephrase descriptions of some parameters of wxPGManager functions 2021-11-17 23:06:23 +01:00
Artur Wieczorek
6b7712bc14 Use empty wxBitmapBundle instead of wxNullBitmap as an argument
Pass explicitly wxBitmapBundle instead of wxBitmap to
wxPropertyGridManager::AddPage to avoid implicit conversion from wxBitmap
to wxBitmapBundle.
2021-11-17 22:54:54 +01:00
Vadim Zeitlin
c36cc54d74 Simplify checking for menu events in the unit test
This should make the explicit casts such as added in 8db55e9653
(Explicitly cast enum to int inside CHECK(), 2019-09-30) and the
previous commit unnecessary, result in better messages if a test fails
and allow the other tests to still run after the failing tests, as we
use CHECK() instead of CPPUNIT_ASSERT(), which maps to REQUIRE(), now.
2021-11-16 20:34:19 +01:00
Vadim Zeitlin
5f5d61f759 Apply workaround for ancient MinGW to the menu unit test
Do the same thing for the just added tests as was already done in
8db55e9653 (Explicitly cast enum to int inside CHECK(), 2019-09-30) for
the other ones.
2021-11-16 20:21:51 +01:00
Vadim Zeitlin
d156058d41 Avoid warnings in tif_print.c by excluding it from build
This is a rather drastic solution, but warnings given when
cross-compiling this file with MinGW are annoying, really fixing them is
not completely trivial and risks conflicting with the upstream changes
later, and we don't need the TIFFPrintDirectory() function defined in
this file anyhow, so just exclude it from the build.

Closes https://github.com/wxWidgets/wxWidgets/pull/2587
2021-11-16 17:34:32 +01:00
Vadim Zeitlin
a7803a752d Merge branch 'imagelist-bundle'
Allow using vectors of bitmap bundles instead of wxImageList in the most
common controls using the latter: wxBookCtrl-derived classes (including
wxNotebook), wxListCtrl and wxTreeCtrl.

Also update more parts of wxAUI to use wxBitmapBundle.

See https://github.com/wxWidgets/wxWidgets/pull/2574
2021-11-16 17:32:47 +01:00
Vadim Zeitlin
63f83c096c Merge branch 'webview_runscript_improvements' of https://github.com/TcT2k/wxWidgets
Add WebView::RunScriptAsync() for running scripts asynchronously.

See https://github.com/wxWidgets/wxWidgets/pull/2316
2021-11-16 17:30:55 +01:00
Alexander Koshelev
0cd898975c Allow to add extra accelerators to wxMenuItem
These accelerators are not shown in wxMenuItem label, but still will
work.

Implement support for them in all major ports and XRC.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2021-11-16 17:26:39 +01:00
Vadim Zeitlin
e729791222 Allow creating GtkAccel from an existing wxAcceleratorEntry
Refactor the existing code to allow using an already existing
accelerator instead of always extracting it from wxMenuItem.

This is not used yet, but will be in the next commit.
2021-11-16 03:20:13 +01:00
Vadim Zeitlin
4f5f309d1b Add GtkAccel helper abstracting operations with GTK accelerators
This simple struct combines both the accelerator code and flags and is
simpler to work with than two different variables.

It will also allow reusing this functionality in the upcoming changes
more easily.

No real changes yet.
2021-11-16 03:20:04 +01:00
Vadim Zeitlin
47daa523d6 Always create bitmaps with alpha channel in wxAuiBitmapFromBits()
This is simpler and results in much better results when scaling the
bitmaps up currently (in fact, there is probably a bug either in
wxBitmap to/from wxImage conversion in wxGTK or wxImage::Scale() itself,
as the results are too bad to be correct when using the mask).

This commit is best viewed ignoring whitespace-only changes.
2021-11-14 19:27:07 +00:00
Vadim Zeitlin
9a5123afed Use wxBitmapBundle in wxAuiToolBar and wxAuiPaneInfo too
Allow specifying bitmap bundles instead of single bitmaps for the AUI
toolbar images and pane icons.
2021-11-14 18:55:42 +00:00
Artur Wieczorek
2120236a29 Implement SVG icons in wxPropertyGridManager 2021-11-14 19:16:56 +01:00
Artur Wieczorek
12af82ca38 Use wxBitmapBundle in wxPropertyGridManager
wxBitmapBundle can be used in wxPropertyGridManager to pass images
to the toolbar.
2021-11-14 19:16:00 +01:00
Stefan Csomor
91402a0de8 fixing embedded usage
when running under OSX embedded, we must NOT allocate an autorelease pool, it gets corrupted otherwise
2021-11-14 13:19:06 +01:00
Vadim Zeitlin
391080e77d Use wxBitmapBundle for AUI tab pages bitmaps
Take wxBitmapBundle instead of just wxBitmap in various public functions
and select the bitmap appropriate for the current DPI scaling when we
need to use it.

Note that this removes wxAuiScaleBitmap() which used custom scaling
logic that might be better than the generic approach used by
wxBitmapBundle, and so could result in a temporary regression in the
icons appearance in high DPI, but they will hopefully be replaced with
SVG versions soon, so that this shouldn't matter.
2021-11-14 00:50:24 +01:00
Vadim Zeitlin
8dcedf56d7 Add wxWindow parameter to wxAuiTabArt::SetSizingInfo()
We need a valid window pointer to use the correct DPI scaling factor for
anything sizing-related, but this function didn't have any, so add one
to it now.

Unfortunately we need to have a default value for the new parameter for
backwards-compatibility purposes, but document that this parameter is
not really optional and must always be specified.

Also add wxWindow parameter to wxAuiTabContainer::SetRect(), which needs
it in order to pass it to this function.

Currently this window is only used for converting logical pixels to
physical ones, but it will also be used for selecting the correct bitmap
size in the upcoming commits.
2021-11-13 23:20:21 +00:00
Vadim Zeitlin
0b51dfe134 Remove useless wxAuiMSWTabArt::SetSizingInfo() override
No need to have a function which just calls the base class version.
2021-11-13 23:05:40 +00:00
Vadim Zeitlin
9d1972fd11 Use wxBitmapBundle in wxToolbook
This allows using the version of the bitmap appropriate for the current
DPI scaling.

It also simplifies the code.
2021-11-12 17:54:37 +00:00
Vadim Zeitlin
bf12e8e99a Remove unnecessary wxToolbook::m_maxBitmapSize
We don't need to keep track of the bitmap size and call
SetToolBitmapSize() ourselves, wxToolBar should be (and is) able to do
it on its own.
2021-11-12 17:54:02 +00:00
Vadim Zeitlin
717225c205 Don't call wxBitmap::ConvertToDisabled() in wxToolbook
Let wxToolBar itself do it if necessary to create the disabled tool
button, there is no need to create the disabled bitmap ourselves as the
toolbar will do it at least as well and possibly better, if the native
control has some better way of greying out the toolbar buttons.
2021-11-12 17:52:13 +00:00
Vadim Zeitlin
5d1c79d218 Remove unnecessary wxToolbook::SetImageList() override
This wasn't doing anything and is just unnecessary.
2021-11-12 17:51:17 +00:00
Vadim Zeitlin
31cd4b0aea Show images set with SetImages() in wxListbook too
Override OnImagesChanged() rather than SetImageList() in wxListbook to
handle the images set with SetImages() correctly too.
2021-11-12 17:49:54 +00:00
Vadim Zeitlin
3bd28ef9e8 Add wxWithImages::GetImages() protected accessor
This is required to be able to implement an object delegating actual
images display to another one, as e.g. wx{List,Tree}book do with
wx{List,Tree}Ctrl.
2021-11-12 17:49:54 +00:00
Vadim Zeitlin
5ae30d2fbe Use wxBitmapBundle() instead of wxNullBitmap as default value
Using the default-constructed wxBitmapBundle object makes more sense
(and might be marginally more efficient) for the default value of a
wxBitmapBundle parameter.

No real changes.
2021-11-12 16:48:38 +00:00
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