Commit Graph

4270 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
cffb866edf Minor additions to wxMC_NO_AUTORESIZE documentation
Mention that this flag is new in 3.1.6 and also point to it in ctor and
Create() documentation.
2021-11-20 21:41:28 +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
Artur Wieczorek
f989b1b875 Rephrase descriptions of some parameters of wxPGManager functions 2021-11-17 23:06:23 +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
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
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
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
73886b1bb2 Significantly extend wxWithImages documentation
Notably explain that SetImages() should be preferred to the old methods
taking wxImageList and why.
2021-11-07 22:07:00 +00:00
Vadim Zeitlin
99c30e488c Document the use of wxWithImages methods with wxTreeCtrl
Also remove the documentation of the inherited methods from wxTreeCtrl
itself.
2021-11-07 21:57:42 +00:00
Vadim Zeitlin
58d2243f7b Improve wxTE_RICH(2) styles documentation
Mention that wxTE_RICH2 should be used instead of wxTE_RICH and that it
can now be turned out automatically if the initial text is too long.

See #19303.
2021-11-06 16:00:49 +01: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
Vadim Zeitlin
590d3f1b75 Merge branch 'macos_versionname12' of https://github.com/TcT2k/wxWidgets
Recognize Windows 11 and macOS 12 in wxGetOsDescription().

See https://github.com/wxWidgets/wxWidgets/pull/2580
2021-11-05 13:58:09 +01:00
Vadim Zeitlin
cce8e41b20 Merge branch 'gtk_unknown_keys' of https://github.com/martinetd/wxWidgets
Generate wxKeyEvents even for unknown keys in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2576
2021-11-05 13:55:12 +01:00
Tobias Taschner
69aedae382
Include Windows 11 in wxGetOsVersion() table 2021-11-05 13:07:32 +01:00
Tobias Taschner
ab7098b33b
Add note to RunScript() to recommend RunScriptAsync() 2021-11-05 10:04:45 +01:00
Dominique Martinet
5f0749f4fd Document generation of WXK_NONE key events for unknown keys
Add a paragraph for keys where GetUnicodeKey and GetKeyCode both return
WXK_NONE, that GetRawKeyCode is platform specific, and that such keys
generate no wxEVT_CHAR event.
2021-11-05 09:46:53 +09:00
Vadim Zeitlin
77f81bae07 Improve multimedia key constants documentation
Add "since 3.1.0" for the constants introduced back in abd46cb99a (Add
support for multimedia keys to wxMSW and wxGTK, 2016-01-08) and also for
the new constants added in the previous commit.

Also document that WXK_LAUNCH_n keys are only generated by wxGTK.
2021-11-05 00:42:46 +01:00
Tobias Taschner
9114122837
Additional wxWebView::RunScriptAsync() documentation 2021-11-03 14:04:23 +01:00
Tobias Taschner
d31f1dc400
Add wxWebViewEvent::IsError() 2021-11-03 13:35:24 +01:00
Tobias Taschner
d93db6bba5
Add initial RunScriptAsync() documentation 2021-11-03 11:19:09 +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
Vadim Zeitlin
0df49f0a54 Add wxWithImages::GetImageCount() and HasImages() helpers
These functions allow avoiding using wxImageList explicitly in a couple
of places.

No real changes, this just prepares for adding new API not based on
wxImageList.
2021-10-31 17:34:44 +01:00
Stefan Csomor
a7f5e3c5c3
OSX wxBitmapBundle::FromFiles implementation for macOS (#2561)
* adding macOS wxBitmapBundle::FromFiles implementation

* adding FromFiles overload, generic implementation

* Update interface/wx/bmpbndl.h

* Removing outdated comment

Co-authored-by: VZ <vz-github@zeitlins.org>
2021-10-26 22:27:36 +02:00
Vadim Zeitlin
9326aa3b6c Add wxBitmapBundle::GetBitmapFor() helper
This can be used to get the bitmap of the size appropriate for the DPI
scaling used for the given window.
2021-10-25 13:40:18 +01:00
Vadim Zeitlin
e5a7e9ccbd Take const wxWindow in wxBitmapBundle::GetPreferredSizeFor()
This function should be usable in const methods of wxWindow-derived
classes too.
2021-10-25 12:21:15 +01:00
Vadim Zeitlin
2c1f4c002d Add wxBitmap::SetScaleFactor()
We need to be able to change the scale factor of the bitmaps returned by
wxBitmapBundle::GetBitmap(), so add a function allowing to do this.

Also add wxHAS_BITMAP_SCALE_FACTOR allowing to check whether this
function actually does something non-trivial and explain in the docs
that GetScaleFactor() always returns 1 on the platforms where this
symbol is not defined.
2021-10-24 19:04:51 +02:00
Vadim Zeitlin
b258d02be3 Document wxBitmap::GetScaleFactor() and related methods
These methods were added 8+ years ago but never documented for some
reason, finally do it now.
2021-10-23 21:38:32 +02:00
Vadim Zeitlin
691a11989e Move wxBitmap::ConvertToDisabled() to respect alphabetic order
No real changes, just keep the functions sorted as they're clearly
intended to be here.

This commit is best viewed with --color-moved git option.
2021-10-23 21:38:32 +02:00
Vadim Zeitlin
9e5c8eef24 Make wxDumpWindow() public and available in wxMSW too
This function was defined in wxGTK and wxOSX, but not in wxMSW or the
other ports, but it can be useful there too, so make it public and
define it in common code.
2021-10-20 23:35:37 +01:00
Vadim Zeitlin
b20552116c Allow wxBitmapBundle to specify its preferred bitmap size
Using bitmaps of preferred size avoids scaling and results in much
better appearance, so add methods allowing querying the bundle about the
bitmaps it supports and implement them in the various implementations.

This is not actually used anywhere yet, but will be soon.
2021-10-19 02:20:26 +01:00
Vadim Zeitlin
4e5d2d97e2 Allow using wxBitmapBundle for wxButton bitmaps
Take wxBitmapBundle in wxButton::SetBitmapLabel() and related functions
in order to be able to associate several bitmaps to be used in different
resolutions with the button, instead of just a single bitmap.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
630e6b898f Add conversion ctor from wxIcon to wxBitmapBundle too
Existing code may call functions taking wxBitmap with wxIcon, due to an
existing conversion from wxIcon to wxBitmap, so we need to provide a
similar conversion to wxBitmapBundle for compatibility.
2021-10-18 11:50:10 +02:00
Vadim Zeitlin
def2691fd2 Merge branch 'gtk-image-bundle'
Use wxBitmapBundle in wxGtkImage and select the appropriately-sized
bitmaps depending on DPI in wxGTK wxToolBar.

See https://github.com/wxWidgets/wxWidgets/pull/2547
2021-10-17 23:19:00 +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
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
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
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