Commit Graph

19763 Commits

Author SHA1 Message Date
PB
77d8926126 Simplify Windows application manifests
In section "dependency" use "*" in processorArchitecture instead of specifying
the concrete architecture such as "amd64" or "x86". This allows to have just one
manifest for all architectures instead of having them for all supported architectures
individually differing in just processorArchitecture.
2021-12-17 16:57:45 +01:00
Vadim Zeitlin
3c7b40e999 Merge branch 'clang-13-no-depr-copy'
Fix clang 13 -Wdeprecated-copy warnings and ensure that we test for them
in the allheaders test.

See https://github.com/wxWidgets/wxWidgets/pull/2619
2021-12-16 21:13:55 +01:00
Vadim Zeitlin
6f8bc1018b Avoid -Wdeprecated-copy for many event classes from clang 13
Add new macros wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY() and
wxDECLARE_NO_ASSIGN_DEF_COPY() and use them instead of
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN() and wxDECLARE_NO_ASSIGN_CLASS()
respectively to ensure that we declare a (default, if possible) copy
ctor in the classes declaring an assignment operator to avoid clang
warnings about not doing it.
2021-12-15 17:50:55 +01:00
Vadim Zeitlin
28c3605f6b Factor out 3 copies of identical code into wxInputStreamPeeker
Resolve the long standing "NOTE" comments about having the same code in
wxAnimationDecoder::CanRead(), wxImage::CanRead() and GetImageCount() by
extracting the common logic into a helper wxInputStreamPeeker class and
using it from all places.

This loses the possibility to log a debug message if rewinding the
stream fails, but this is probably not very valuable and the actual
error should be already logged by SeekI() itself when it fails on a
seekable stream.

No real changes.
2021-12-15 17:50:20 +01:00
Vadim Zeitlin
0a8f7233cc Merge branch 'virtual-list-sort-indicator'
Simplify recently added wxListCtrl sort indicators support and allow
using it with virtual list controls too.

See https://github.com/wxWidgets/wxWidgets/pull/2618
2021-12-14 19:28:20 +00:00
Vadim Zeitlin
e3ec9fb124 Fix using wxMemoryDC without a GUI wxApp instance
This used to work, at least in wxMSW, but stopped working after the
(perfectly valid, on their own) changes of 2508efdd6e (Initialize
wxMemoryDC with a default font, 2019-08-13), as this resulted in calling
wxApp::GetTopWindow() that can only be called from the GUI code.

Fix this by adding wxApp::GetGUIInstance() and using it in
GetMainTopWindow(), so that we only call GetTopWindow() if we actually
have a GUI wxApp object on which to call it.

Implement this in terms of a new virtual IsGUI() which seems slightly
better than, although roughly equivalent to, using wxDynamicCast().

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

Closes #19343.
2021-12-14 19:28:02 +00:00
Vadim Zeitlin
c834c0b8b7 Add GetUpdatedAscendingSortIndicator() helper function
It seems like this function will need to be used in every implementation
of EVT_LIST_COL_CLICK handler when using sorting, so it makes sense to
provide it in the library itself.
2021-12-14 14:22:08 +00:00
Vadim Zeitlin
0a8e82b010 Rename formal parameter of ShowSortIndicator() to "col"
No real changes, just use a more appropriate parameter name, as it's a
column index and not just "index".
2021-12-14 14:19:10 +00:00
Vadim Zeitlin
52649cc566 Remove wxListCtrl::EnableSortIndicator()
The old API seems unnecessarily complex, it is simpler to just let the
application call ShowSortIndicator() itself from its
wxEVT_LIST_COL_CLICK handler, which needs to be defined anyhow in order
to actually sort the items, rather than require it to enable sort
indicator, explicitly set it initially and then remember to not set it
any longer in response to the column clicks.

Also make RemoveSortIndicator() non-virtual and implement it simply as
ShowSortIndicator(-1) because this actually simplifies the code too.
2021-12-14 14:09:23 +00:00
Vadim Zeitlin
30ce892ed5 Let wxListCtrl::ShowSortIndicator() implicitly enable indicators
It doesn't seem right for ShowSortIndicator() to silently do nothing if
EnableSortIndicator() hadn't been called before, so make it enable the
sort indicators if they hadn't been enabled yet.

The alternative would be to assert in this function, but this seems less
useful.

Also add some comments to wxMSW version.
2021-12-13 14:31:49 +00:00
Vadim Zeitlin
58290168e5 Remove top level "const" from {Enable,Show}SortIndicator()
Don't use "const int" or "const bool" for parameter types, the "const"
here is ignored and using it is inconsistent with all the rest of the
library.

No real changes.
2021-12-13 14:18:18 +00:00
Vadim Zeitlin
b9a1931394 Fix using MSW wxStaticBitmap with custom wxBitmapBundles
wxBitmapBundle-related changes introduced a bug when wxStaticBitmap
could be using an invalid handle (which manifested itself in not showing
any image on screen) if it was using wxBitmapBundle whose GetBitmap()
returned a wxBitmap that wasn't cached inside wxBitmapBundle itself.

In this case, this wxBitmap wasn't referenced anywhere after being
associated with wxStaticBitmap and so was destroyed, invalidating the
HBITMAP used by the native static control.

Fix this by keeping a copy of the bitmap in wxStaticBitmap itself. This
is not the most efficient, but is the simplest, solution.
2021-12-12 23:39:48 +00:00
Vadim Zeitlin
e211a451fe Re-realize wxAuiToolBar on DPI change to fix its layout
The layout of the toolbar depends on the size of its bitmaps, which
changes when the DPI does, so call Realize() again when this happens.

This fixes the layout of the toolbars in the aui sample when moving it
between screens using different DPI.
2021-12-12 23:16:28 +00:00
Vadim Zeitlin
6156bb1b84 Merge branch 'wxlistctrl-sort' of https://github.com/MaartenBent/wxWidgets
Add sort indicators support to wxListCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/2598
2021-12-09 21:29:39 +01:00
Simon Stone
0fc936ca41 Add wxIntegerValidatorctor ctor taking minimum and maximum value
Using this ctor is more convenient than using the default ctor and then
calling SetMin() and SetMax().

Document the new ctor and add tests showing that minimum and maximum
values are actually respected.

Closes https://github.com/wxWidgets/wxWidgets/pull/2610
2021-12-09 19:55:44 +01:00
Marco DeFreitas
a2389fc512 Add wxApp::GTKSuppressDiagnostics()
This allows to avoid GTK messages that are often more annoying and
confusing than useful.

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

Closes #19347.
2021-12-09 19:52:07 +01:00
Maarten Bent
4cb8539f72 Add missing wxOVERRIDE to MSWWindowProc of wxListCtrl 2021-12-09 18:18:28 +01:00
Maarten Bent
74823b20c0 Remove some virtual keywords from wxListCtrl implementations
This is not needed (it is already declared virtual in the base class), and
almost all other virtual functions in wxListCtrl don't have it.
2021-12-09 18:17:48 +01:00
Maarten Bent
d8ec0aa001 Support sort indicators in wxListCtrl header 2021-12-09 17:32:05 +01:00
Vadim Zeitlin
9bdce3077c Avoid MSVC bool conversion warning in wxBitmapBundle::IsOk()
This avoids C4800 from MSVC if this warning is enabled (it is disabled
by default in recent versions of the compiler).
2021-12-08 20:27:46 +01:00
Vadim Zeitlin
8311951f03 Don't use wxVector<T>::clear() when T is an incomplete type
At least the OpenVMS compiler doesn't like it and we can easily avoid
doing this by simply moving ClearExtraAccels() definition to the source
file.
2021-12-03 15:37:11 +01:00
Vadim Zeitlin
882a339a48 Move wxHAS_SVG definition to wx/features.h
This is more consistent with the other wxHAS_XXXs and makes it possible
to only include wx/bmpbndl.h in bmpsvg.cpp if SVG support is indeed
available.
2021-12-02 15:25:06 +01:00
Vadim Zeitlin
419a97a791 Merge branch 'svg-file'
Add wxBitmapBundle::FromSVGFile() helper.

See https://github.com/wxWidgets/wxWidgets/pull/2600
2021-12-01 23:27:33 +01:00
Vadim Zeitlin
8adfaa37f7 Add wxBitmapBundle::FromSVGFile() helper
This is just a trivial wrapper for wxBitmapBundle::FromSVG(), but it can
still be convenient to have.
2021-11-29 12:55:22 +00:00
Vadim Zeitlin
d14e035580 Fix uses of wxDEPRECATED in WXWIN_COMPATIBILITY_2_8-only code
wxDEPRECATED must be used for the entire declaration to really work,
but this wasn't the case for a few functions (and one typedef) guarded
by WXWIN_COMPATIBILITY_2_8, resulting in gcc -Wattributes warning about
the attribute being ignored and the declaration not being really marked
as deprecated.

Fix this by applying the deprecation macro to the entire declaration,
which works well for gcc and should hopefully work for MSVC too.
2021-11-28 21:42:06 +01:00
Paul Cornett
03706e9fef Fix build with WXWIN_COMPATIBILITY_2_8==1
Use wxBitmapBundle to avoid wxToolBar::AddTool() ambiguity
2021-11-28 08:48:50 -08:00
Paul Cornett
9a40669aad Fix build with WXWIN_COMPATIBILITY_2_8==1
Reverts what seems to be an unintentional change from
5ae30d2fbe (Use wxBitmapBundle() instead of wxNullBitmap as default value, 2021-11-12)
2021-11-28 08:44:13 -08:00
Artur Wieczorek
288b208a0a Fix setting clipping region for wxDC with RTL enabled (wxMSW)
It turns out that region being added to DC with enabled RTL layout needs
to be defined using mirrored device x-coordinates.
So if we have DC with RTL layout we need to create a temporary mirrored
region and pass it to the DC instead of the original one.

Closes #19325.
2021-11-28 17:04:26 +01:00
utelle
deef116a09 Update language database and move support for it to wxUILocale
Update the language database from the canonical sources:

- It now includes most locales supported by Windows 10.
- It now also has the following attributes for each entry:
 - BCP 47-like locale tag.
 - Reference to canonical name for generic language entries.
 - Language name in this language itself.
- Also add data file with list of language script identifiers and
  aliases based on ISO 15924.
- And update genlang.py to handle all the new attributes and data.

Also move database-related methods of wxLocale to wxUILocale and
just redirect wxLocale methods to the new wxUILocale ones (they are
still preserved for compatibility).

Closes https://github.com/wxWidgets/wxWidgets/pull/2594
2021-11-27 17:44:20 +01:00
Stefan Csomor
e765756555 OSX file dialog extensions (#2592)
Re-introduce OpenSavePanelDelegate for filtering when wildcard is provided (Spotlight search field was not working correctly, if extension was not known)
(and on macOS 10.11 allow programmatically showing the extra panel)

see http://www.github.com/wxWidgets/wxWidgets/pull/2592 and https://trac.wxwidgets.org/ticket/19324

co-authered-by: Jeff Young <jeff at rokeby dot ie>
2021-11-26 22:26:49 +01:00
Vadim Zeitlin
c5f023a829 Fix wxGTK1 build after wxBitmapBundle changes in wxStaticBitmap
This should have been done in 3abec9254f (Take wxBitmapBundle in
wxStaticBitmap::SetBitmap(), 2021-10-21) but was forgotten there.
2021-11-26 18:31:19 +01:00
Vadim Zeitlin
2bbe126dca Add operator/(wxSize, double)
For some reason, while both operator*(wxSize, double) and
wxSize::operator/=(double) existed, this one did not, which was
unexpected, so add it too.
2021-11-20 22:06:28 +01:00
Vadim Zeitlin
7a03d5fe9b Merge branch 'mediaplayer_sample'
Add wxMC_NO_AUTORESIZE and use it in mediaplayer sample to fix it
layout.

See https://github.com/wxWidgets/wxWidgets/pull/2562
2021-11-20 21:46:29 +01:00
Artur Wieczorek
87394856f5 Use wxBitmapBundle in wxPropertyGrid 2021-11-19 17:52:56 +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
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
Scott Talbert
149f3804a8 Add style for manually resizing wxMediaCtrl
Previously, wxMediaCtrl would always automatically resize itself
whenever a video was loaded.  If a wide video was loaded, this could
cause wxMediaCtrl to take up the entire space, hiding any other
widget(s) that might exist within the same sizer.  Allow avoiding this
behavior by adding a new style, wxMC_NO_AUTORESIZE, which disables this
automatic resize behavior and allows handling the resize behavior
manually.
2021-11-15 20:00:17 -05: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
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
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
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
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
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