Commit Graph

19797 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Tobias Taschner
04e4b57a05
Remove unused m_runScriptCount
This was no longer used after the changes to the javascript wrapper
2021-11-05 09:54:44 +01:00
Tobias Taschner
9f9ccf33e1
Initialize syncScriptResult and remove unused parameter 2021-11-05 09:52:53 +01:00
Tobias Taschner
8613f3aa6b
Apply suggestions from code review
Co-authored-by: VZ <vz-github@zeitlins.org>
2021-11-05 09:41:39 +01:00
Vadim Zeitlin
eb6e0289d6 Make WXK_LAUNCH_x constants consecutive
No real changes, but don't complicate the constants definitions
needlessly just to avoid changing the numeric value of WXK_LAUNCH_APP
constants as nobody should rely on them anyhow.

Not doing it simplifies things and allows to condense the mapping from
GDK keys to wx ones.
2021-11-05 00:43:39 +01:00
Tobias Taschner
d31f1dc400
Add wxWebViewEvent::IsError() 2021-11-03 13:35:24 +01:00
Tobias Taschner
93f7df50d5
Implement RunScriptAsync for webkit2 2021-11-03 11:19:08 +01:00
Tobias Taschner
7aa1d84e4a
Implement RunScriptAsync for macOS 2021-11-03 11:19:08 +01:00
Tobias Taschner
e9dc74cb6d
Add wxWebView::RunScriptAsync() 2021-11-03 11:19:07 +01:00
Tobias Taschner
cf6a947dab
Use new JS wrapper with edge and IE 2021-11-03 11:19:00 +01:00
Tobias Taschner
2fe12ae6af
Restructure javascript result wrapper 2021-11-03 11:18:53 +01:00
Dominique Martinet
61d835d8b3 wxKeyCode: add WXK_LAUNCH_[0-9A-F] for gtk bindings
X11 defines Xf86Launch[0-9a-f], which are then also defined as
GDK_KEY_Launch[0-9A-F].

Unfortunately, keys which are not mapped are just plain ignored and the
application is then not able to receive these keyboard events at all.

The original PR https://github.com/wxWidgets/wxWidgets/pull/157 mapped
only LaunchA/B to WXK_LAUNCH_APP1/2, this patch adds the whole range of
keys and keeps LAUNCH_A/B as aliases for WXK_LAUNCH_APP1/2
2021-11-02 10:18:02 +09:00
Vadim Zeitlin
b0d9465921 Add wxWithImages::SetImages() and update wxMSW wxNotebook for it
This new function will allow selecting the bitmap of the most suitable
size and automatically react to DPI scale changes (although this hasn't
been implemented yet) in all controls using image lists.

For now, only wxNotebook in wxMSW has been updated to work with it, the
other classes and ports will be updated to override OnImagesChanged()
instead of SetImageList() later.

Also update the notebook sample to use SetImages() rather than
SetImageList() -- which means that it doesn't show the icons any longer
in non-MSW ports, which haven't been updated yet.
2021-10-31 20:54:58 +01:00