Commit Graph

71396 Commits

Author SHA1 Message Date
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
Alexander Koshelev
e2aca9cbd5 Add wxStyledTextCtrl XRC handler
Closes https://github.com/wxWidgets/wxWidgets/pull/2530

Co-authored-by: VZ <vz-github@zeitlins.org>
2021-09-28 15:39:20 +02:00
IhateTrains
adef4c27c2 Support for VS 2022 in wxwidgets.props 2021-09-27 14:21:28 +02:00
rlbxku1r
7dcf004f0e wxMBConv_iconv: Fix wrong buffer size
This is an oversight in commit 878c265.
2021-09-27 00:21:03 +09:00
Vadim Zeitlin
44fe94fad8 Merge branch 'bitmap-rescale'
Add wxBitmap::Rescale() and use it instead of RescaleBitmap().

See https://github.com/wxWidgets/wxWidgets/pull/2534
2021-09-24 14:27:10 +02:00
Vadim Zeitlin
c5430cbbcd Fix self-assignment bug in wxObjectDataPtr
wxObjectDataPtr::operator=() didn't handle self-assignment correctly,
i.e. could delete the object when doing "x = x".

Fix this by incrementing the reference count before decrementing it on
possibly the same object to ensure that it never reaches 0.
2021-09-24 14:27:02 +02:00
Jouk
29c408c3c5 Add uilocale in OpenVMS makefiles 2021-09-24 08:59:20 +02:00
Vadim Zeitlin
5a91ab92f7 Use high quality in wxBitmap::Rescale()
This function is currently used for relatively small icons in
wxArtProvider and wxSearchCtrl, so it shouldn't be a problem to use
wxIMAGE_QUALITY_HIGH from performance point of view and if it ever does
become a problem, the application could easily use wxImage::Rescale()
with a different option directly instead.
2021-09-24 00:30:02 +02:00
Vadim Zeitlin
024c231624 Replace multiple RescaleBitmap() with wxBitmap::Rescale()
Define a single function and use it in both wxArtProvider and (the
generic implementation of) wxSearchCtrl instead of repeating the same
code elsewhere.

Note that another, but slightly different, version of RescaleBitmap()
still remains in wxPropertyGrid.

Deprecate undocumented wxArtProvider::RescaleBitmap() which is
completely useless now.

No real changes, this is just a refactoring.
2021-09-24 00:30:02 +02:00
Vadim Zeitlin
46314bd6b1 Merge branch 'toolbar-high-dpi'
Show how to use bitmaps appropriate for the current DPI in the toolbar
sample using the current API.

See https://github.com/wxWidgets/wxWidgets/pull/2520
2021-09-23 16:31:20 +02:00
Artur Wieczorek
b0331f58b5 Don't run CI builds on Ubuntu 16 not supported any longer
Support for Ubuntu 16.04 ended on September 20, 2021.
See: https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

See https://github.com/wxWidgets/wxWidgets/pull/2531
2021-09-23 16:29:10 +02:00
Vadim Zeitlin
79582adeb4 Merge branch 'list-std'
Fix build in STL mode under OpenVMS.

See https://github.com/wxWidgets/wxWidgets/pull/2528
2021-09-23 16:25:51 +02:00
Vadim Zeitlin
3b3169fa15 Fix refresh problems when scrolling with mousewheel in wxUniv/MSW
Use native scrolling under MSW, just as we already did under X11,
instead of our own version which doesn't work correctly when scrolling
using the mouse wheel.

See https://github.com/wxWidgets/wxWidgets/pull/2525
2021-09-23 16:24:20 +02:00
Vadim Zeitlin
7043963831 Add wxHAS_IMAGE_RESOURCES defined under MSW and Mac
Unlike the existing wxHAS_IMAGES_IN_RESOURCES constant defined only
under MSW, the new one is also defined under Mac and could be defined
for the other platforms/ports later (e.g. wxQt could probably support it
too).

It's unfortunate that two very similar constants are needed, but it
doesn't seem wise to change the meaning of the existing constant, as
this would change how the commonly used wxICON() and wxBITMAP() macros
behave and would break all our own samples that use them for their frame
icon but don't embed this icon into the bundle resources under Mac.

Do change the toolbar sample to use the new constant however, as this
one does include the bitmaps it uses in its bundle under Mac.
2021-09-22 23:24:32 +01:00
Artur Wieczorek
5ecf2e05a5 Execute ChoiceTestCase on wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
711b548c59 Invalidate selection of item being removed from wxChoice (wxOSX)
We need to explicitly invalidate selection of item being removed
because it's not done by wxChoiceWidgetsImpl::RemoveItem().
2021-09-22 22:19:45 +02:00
Artur Wieczorek
37ad7bb30e Adjust point to be tested in wxListBox::HitTest for macOS 11
On macOS >= 11 wxListBox has a new layout because underlying
NSTableView has a new style with padding so we need to move
the point to be tested to another position.
2021-09-22 22:19:45 +02:00
Artur Wieczorek
ce9f8d065a Execute ListBox-related tests under wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
c97cd8d280 Invalidate selection of item being removed from wxNSTableView
We need to explicitly invalidate selection of item being removed
because it's not done by NSTableView (selection index is retained).
2021-09-22 22:19:45 +02:00
Artur Wieczorek
5715c7f573 Execute ComboBoxTestCase under wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
61989086f2 Retain selection of wxComboBox item whose text has been changed
In wxComboBox::SetString() implementation for wxMac the item is
first removed from the list so its selection is invalidated.
We have to retain it so we need to re-select just inserted item.
2021-09-22 22:19:45 +02:00
Artur Wieczorek
2f3fc152bf Invalidate selection of item being removed from wxNSComboBoxControl
We need to explicitly invalidate selection of item being removed
because it's not done by NSComboBox (selection index is retained).
2021-09-22 22:19:45 +02:00
Vadim Zeitlin
d15bf90050 Attempt to work around build problem under OpenVMS
OpenVMS build was broken by 303d899cc0 (Make STL-based wxList more
compatible with the default one, 2021-09-02), try to blindly fix it by
casting the element to the same type it had had before.
2021-09-22 18:07:08 +02:00
Vadim Zeitlin
364835706c Add unit test for wxWindowList::Find()
Check that Find() of a list declared using WX_DECLARE_LIST_3 (as
wxWindowList is) can be passed a pointer to the base class object and
still compiles and works correctly.
2021-09-22 18:07:08 +02:00
Vadim Zeitlin
fee249f3ae Merge branch 'filename-misc-fixes'
Fix handling of single letter UNC paths and other wxFileName
improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2519
2021-09-22 16:12:23 +02:00