71592 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
77e3983091 Create disabled bitmap in BitmapProviderDefault on demand
There is no need to always do it in advance when we might never actually
need it.
2021-10-16 17:46:20 +02:00
Vadim Zeitlin
8f1be368e9 Add some comments to wxGtkImage
Document which pointers can, and can't, be null and when exactly is the
stored bitmap valid, as this is far from being immediately obvious.

No real changes.
2021-10-16 17:01:48 +02:00
Vadim Zeitlin
eb54c65e24 Separate GTK 2/3 version of BitmapProviderDefault
No real changes, just move the trivial GTK 2 stab out of the way.
2021-10-16 16:56:31 +02:00
Vadim Zeitlin
fbb2ec85ef Install 32-bit version of xvfb in 32-bit wxMSW cross-build
libgl1:i386 conflicts with 64-bit version of xvfb in the latest Sid, so
try using 32-bit version of the latter.
2021-10-16 16:44:44 +02:00
Cătălin Răceanu
6fb64da922 Fix selection when wxOwnerDrawnComboBox contains identical items
Ensure that the drop-down selection is correct even if there are
multiple items with the same label in wxOwnerDrawnComboBox.

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

Closes #19289.
2021-10-16 15:56:40 +02:00
Vadim Zeitlin
e8a15050d2 Add missing references to wxSize parameters in wxBitmapBundle
Pass wxSize by const reference instead of "const" value.

Note that passing wxSize by value might be not such a bad thing,
actually, but we use const reference for it everywhere else, so do it
here as well for consistency (and the original intention was to do it
like this, missing "&" was just a typo subsequently propagated through
copy-pasting).

No real changes.
2021-10-16 15:56:40 +02:00
Paul Cornett
e9bf514976 Fix creating wxButton using stock id with GTK
Broken by 85d63c3150 (Add a class derived from GtkImage to support HiDPI bitmaps, 2020-09-15)
See #19288
2021-10-13 22:37:11 -07:00
Mehmet Soyturk
c1250bc0e7 Replaced assert by wxASSERT 2021-10-12 16:35:33 +03:00
Vadim Zeitlin
700dd3e905 Merge branch 'cmake_glu' of https://github.com/swt2c/wxWidgets
Link with GLU when using EGL too in CMake build.

Also build all samples in the CMake CI builds.

See https://github.com/wxWidgets/wxWidgets/pull/2543
2021-10-12 00:39:54 +02:00
Scott Talbert
769e24bae0 cmake: build all samples under Linux CI 2021-10-11 13:03:15 -04:00
Scott Talbert
28f59e8900 cmake: also link with GLU when using EGL
Fixes #19282
2021-10-11 12:43:52 -04:00
Vadim Zeitlin
af1069374e Merge branch 'bitmap-bundle'
Add wxBitmapBundle and use it in wxToolBar.

See https://github.com/wxWidgets/wxWidgets/pull/2535
2021-10-05 18:58:18 +02:00
Vadim Zeitlin
fb4e188cea Add wxHAS_SVG feature test macro
This is more clear and future-proof than using wxHAS_RAW_BITMAP for
checking for SVG availability.
2021-10-05 16:12:01 +01:00
Vadim Zeitlin
0216654272 Make wxBitmapBundleImpl public and show how to use it
Show how a custom implementation of wxBitmapBundleImpl can be defined in
the toolbar sample.
2021-10-05 16:06:43 +01:00
Stefan Csomor
fe3e0c558e wxArtProvider with wxBitmapBundle 2021-10-05 16:06:43 +01:00
Vadim Zeitlin
ab619010bd Add FromSVG() overload taking const data
Passing non-const data is inconvenient and error-prone, as data can't be
used again after it was modified by Nano SVG, which resulted in the
button using SVG bitmap not working any longer in the toolbar sample
after recreating the toolbar.

So make it easier to do the right thing, while still keeping the
overload taking non-const data for the situations when avoiding an extra
copy is worth it.
2021-10-05 16:06:43 +01:00
Vadim Zeitlin
6783df71a7 Cache the last returned bitmap in wxBitmapBundleImplSVG
This seems to be enough to avoid inefficiencies and doesn't consume as
many resources as caching all bitmaps ever generated.
2021-10-05 16:06:43 +01:00
Vadim Zeitlin
ac02ae877f Add simple wxBitmapBundle::FromSVG() implementation using NanoSVG
Add nanosvg submodule and use it in the generic implementation of this
function.

This is incomplete yet and, notably, doesn't cache the rasterized
images, but already shows that using SVG images works (at least in the
toolbar sample).
2021-10-05 16:06:43 +01:00
Stefan Csomor
5ebd76156d adapting buttonbar 2021-10-05 16:06:43 +01:00
Stefan Csomor
388d322b68 carry changes to toolbar over to prefs on osx 2021-10-05 16:06:43 +01:00
Stefan Csomor
edc95443a3 OSX toolbar adaptations to wxBitmapBundle 2021-10-05 16:06:43 +01:00
Stefan Csomor
95aa8e40fd first part of OSX adaptations 2021-10-05 16:06:43 +01:00
Vadim Zeitlin
ba6c691c22 Add wxBitmapBundle::FromImpl() and GetImpl()
For now they're only used internally but at least the latter will be
made public later.
2021-10-05 16:02:44 +01:00
Vadim Zeitlin
043461077e Use wxBitmapBundle::GetDefaultSize() in the toolbar sample
This actually reverts the sample to the version in master, which used
wxBitmap::Get{Width,Height}(), but just replaces "w" and "h" variables
with a single "sizeBitmap" one.
2021-10-05 15:49:44 +01:00
Vadim Zeitlin
15e35a5e7c Document that FromDIP() is not needed with SetToolBitmapSize()
wxMSW wxToolBar adjusts the bitmap size to DPI automatically.
2021-10-05 15:49:44 +01:00
Vadim Zeitlin
24df75a27f Simplify frame construction in the toolbar sample
Also stop hard-coding (100, 100) position for it, there is no real need
for it and it's better to let the window be positioned automatically.

No real changes.
2021-10-05 15:49:44 +01:00
Vadim Zeitlin
9a578b9c8f Update bitmap size automatically on DPI change in wxMSW wxToolBar
Remove the now unnecessary wxEVT_DPI_CHANGED event handler in the
sample.
2021-10-05 15:49:44 +01:00
Vadim Zeitlin
7337bf1da1 Add a simple wxBitmapBundle unit test
Check for the minimal functionality when using vector-based
implementation.
2021-10-05 15:49:43 +01:00
Vadim Zeitlin
b33df7360a Implement loading resource bundle from Windows resources
This allows to use resources defined in the .rc files under MSW instead
of embedding them in the program text as arrays.
2021-10-05 15:49:43 +01:00
Vadim Zeitlin
97f6c85d9b Add first version of wxBitmapBundle and use it in wxToolBar
This first version provides only a generic implementation of
wxBitmapBundle using a collection of bitmaps and only supports using it
in wxToolBar in wxMSW and wxGTK.

More methods of creating wxBitmapBundle will be provided later and more
functions taking wxBitmap will be changed to take wxBitmapBundle later
too and, of course, all the other ports will be updated to use the new
API too.
2021-10-05 15:49:43 +01:00
Vadim Zeitlin
9b5a72bd1e Document Connect() limitations compared to Bind()
Instead of just saying that Bind() is better, provide some points
illustrating why is it better.

Notable mention that Connect() can only be used with methods of the
classes publicly inheriting from wxEvtHandler, unlike Bind().

Closes #19266.
2021-10-04 00:27:53 +02:00
Burak Koray
34989c614d Focus the contents of the generic preferences dialog initially
This is more useful than leaving the focus on the "OK" button, which can
already be easily activated from keyboard.

Closes #19277.
2021-10-03 23:42:16 +02:00
Vadim Zeitlin
9c17ff731a Ignore the parent commit for git blame purposes
Typo fixes don't affect anything else, so skip the parent commit when
searching for the reason of some change in the future.
2021-10-03 17:09:08 +02:00
Blake Madden
668a2186cd Fix comment typos in sources
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/2541
2021-10-03 17:07:44 +02:00
Kvaz1r
cfdd4127b5 Fix handling wxSHOW_SB_ALWAYS in SetScrollbar() in wxUniv
Range may be -1 when wxSHOW_SB_ALWAYS is used, see
wxScrollHelper::DoAdjustScrollbar(), so check for it to avoid spurious
asserts in this case.

Closes https://github.com/wxWidgets/wxWidgets/pull/2540
2021-10-02 15:04:34 +02:00
Thierry Bultel
746da37c4d Fix missing mouse events when using gesture events in wxGTK
When touch events were enabled, normal mouse move and click events were
not generated any longer. Fix this by doing the following two things:

First, emulate the LeftDown, LeftUp, and Motion events, that are no
longer triggered when using the "touch-event".

In addition, remove GDK_BUTTON1_MASK in the press callback, that is
never set when using a mouse, but that is set for some reason by GTK
when using a touchscreen.

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

Closes #19265.

Signed-off-by: Thierry Bultel <tbultel@free.fr>
2021-10-02 14:59:34 +02:00