Commit graph

4689 commits

Author SHA1 Message Date
Vadim Zeitlin
e187667e6b Merge branch 'msw-print-dialog-pages'
Add support for printing "selection" and "current page" in wxMSW and
printing code cleanup.

See #23338, #23372.
2023-03-29 12:20:38 +02:00
Vadim Zeitlin
30ffcfe22e Merge branch 'statbox-empty-label-draw'
Fix custom drawing wxStaticBox with empty label in wxMSW.

See #23343.

Closes #23342.
2023-03-29 11:19:15 +01:00
Stefan Ziegler
d75956d3e6 Add support for printing only the current page
Add wxPrintDialogData::EnableCurrentPage() and implement support for it
under MSW, where it enables selecting the "Current page" radio button in
the pages selection area of the native dialog.

Update the sample to show the new function.
2023-03-29 01:15:06 +02:00
Tobias Taschner
8038195952
Unify entries in wxWebViewEvent table 2023-03-24 15:10:42 +01:00
Tobias Taschner
e15a1ac18e
Add wxWebViewWindowFeatures and event
This replaces the previously implemented wxWebViewWindowInfo.

It explicitly breaks the previous API to enable WebKitGTK
integration and to make the usage in application code less error prone.

A new event wxEVT_WEBVIEW_NEWWINDOW_FEATURES is added to allow
access to the window features and the child web view.
2023-03-24 15:10:21 +01:00
Tobias Taschner
8d0685ee08
Add wxWebViewConfiguration support for webkitgtk2
Allows setting some webview settings which would be unavailable after
creation.
2023-03-24 15:10:20 +01:00
Dan Gudmundsson
23ccdb23c8 Improve and document wxGLCanvas::CreateSurface()
This function must be called to be able to re-create the EGL drawing
surface after the window layout have changed, such as after a reparent
of the canvas or of it's grandparents.

Make it suitable for use in this case by re-creating the surface if
there already was one and document this function to make it part of the
public API.

Closes #23366.
2023-03-22 18:41:27 +01:00
Stefan Ziegler
e93570f681 Implement support for printing only selected pages in wxMSW
While the user could select to print only the selection in the dialog,
there was no way for the program to specify which pages were selected,
making this choice impossible to handle.

Add new IsPageSelected() function which is now used to query which pages
are selected and should actually be printed.

Update the printing sample to show how this function is used.
2023-03-22 15:37:07 +01:00
Vadim Zeitlin
086a912e25 Improve wxMemoryDC scale factor documentation
Make it clear that the scale factor comes from the bitmap selected into
the device context and not from the "compatible" wxDC, as this is how
the code currently behaves (and this behaves arguably does make sense,
but also can't be changed without breaking the existing code in any
case).
2023-03-22 00:29:38 +01:00
Vadim Zeitlin
f82bd9ea67 Merge branch 'webview_configuration' of https://github.com/TcT2k/wxWidgets
Add wxWebViewConfiguration.

See #23349.
2023-03-18 20:55:39 +01:00
Vadim Zeitlin
9ad79ba03a Merge branch 'thread-fixes'
Fix TSAN errors in thread unit tests.

See #23340.
2023-03-18 20:53:10 +01:00
Vadim Zeitlin
c202385f3a Add a note about icons to wxMessageDialog documentation
Explain that the requested icon is not always used.

Closes #23353.
2023-03-18 20:50:10 +01:00
Tobias Taschner
b48e5b4c66
Add wxWebViewConfiguration::SetDataPath()
While currently only implemented for the Edge backend GTK webkit could
also make use of such a setting.

Fixes: #19317
2023-03-17 09:29:46 +01:00
Tobias Taschner
dd4d5c75af
Add wxWebViewConfiguration
In 40ff38b63b wxWebView::GetNativeConfiguration() was
added which isn't suitable if multiple wxWebViewEdge instances are created with
different options (as they must share the same options). To prevent such errors
the previous method is replaced by the new class wxWebViewConfiguration which
can be shared between various wxWebView instances.

This explicitly breaks API to improve usage.

In the future the new class could also enable a good way to wrap various
common options/configurations available via native API.
2023-03-17 09:29:46 +01:00
Vadim Zeitlin
59312f5ba0 Fix possibly fatal race condition when calling OnDelete()
This function could be called on an already deleted object, which could
result in a crash, and always resulted in a TSAN error.

Fix this by calling it before releasing the internal lock, which
prevents this from happening, but will result in a deadlock if this
function is overridden to do something requiring any lock held by the
thread.

This is not ideal, but still seems to be like a lesser evil.
2023-03-13 01:17:23 +01:00
Vadim Zeitlin
1c0e4dbf8e Merge branch 'webview_window_handling'
Add wxWebView child window handling.

See #23334.
2023-03-12 13:58:01 +01:00
Vadim Zeitlin
63ee6a3aa4 Consistently use "JavaScript", not "javascript", in documentation 2023-03-12 13:56:24 +01:00
Vadim Zeitlin
0fe6f04bfc Merge branch 'customize-dark-mode'
Allow customizing appearance in dark mode in wxMSW.

See #23275.
2023-03-12 13:42:45 +01:00
Vadim Zeitlin
24e8297bdd Change example in wxDarkModeSettings docs to avoid -Wswitch
As written, the code snippet in the docs would result in a warning from
gcc, so change it to avoid this.

See #23028.
2023-03-12 13:41:08 +01:00
Vadim Zeitlin
2ad3c0b428 Document restrictions on changing menu items appearance
Make it more clear that doing this should be avoided in portable code
and mention that owner drawn items are incompatible with dark mode.

See #23028.
2023-03-12 13:35:51 +01:00
Tobias Taschner
01ee3942f8
Add wxWebView child window handling
Add new class wxWebViewWindowInfo:
This new class returned by wxWebViewEvent::GetTargetWindowInfo() allows
to get information about the window that is about to be opened and to
set the window that will be used to display the content.
2023-03-09 14:30:19 +01:00
Tobias Taschner
45d5de6a26
Add wxEVT_WEBVIEW_WINDOW_CLOSE_REQUESTED
This event is usually triggered by javascript calling window.close()
2023-03-09 14:29:25 +01:00
Miguel Gimenez
cf3dcb230a Use wxCOL_WIDTH_DEFAULT instead of -1 in wxDataViewCtrl functions
Replace -1 with wxCOL_WIDTH_DEFAULT in the header and the documentation
for clarity.

See #23325.
2023-03-09 00:11:32 +01:00
Vadim Zeitlin
d5a90896ae Merge branch 'app-init'
Improvements to wxApp initialization and modernize the code to use
std::unique_ptr<> instead of wxScopedPtr or, worse, macro-based scoped
pointers.

See #23319.
2023-03-07 19:27:10 +01:00
Lotendan
4d62df488b Add support for initializer_list to wx dynamic arrays
While these array classes are deprecated in the user code, they're still
used, for compatibility, in many places in wxWidgets API and allowing to
create them from initializer_list makes using it more ergonomic as it's
now possible to just pass an initializer list of items to fill the
control with, for example, instead of appending them one by one.

Closes #23309.
2023-03-07 17:41:05 +01:00
Vadim Zeitlin
347d7fcccb Use std::unique_ptr<> instead of wxDECLARE_SCOPED_PTR
Replace macro-based scoped pointers with the standard class.

Also mention that using these macros and wxScopedPtr itself is
deprecated (but there are too many occurrences of the latter in the code
to change all of them now).

Note that wxMsgCatalog ctor and dtor had to be moved out of line to
allow using unique_ptr<> to an incomplete class as member. On the bright
side, we can just use unique_ptr<> instead of wxPluralFormsNodePtr which
was a local reimplementation of wxScopedPtr.

No real changes.
2023-03-06 18:36:37 +00:00
Vadim Zeitlin
1a314b4e10 Merge branch 'msw-about'
Improve "About" dialog appearance under MSW.

See #23294.
2023-02-28 18:26:26 +01:00
Blake-Madden
809d2918cc Document wxSplitterWindow::SetSashPosition() argument better
Explain the special meaning of 0 and negative values in this function.

Closes #23299.
2023-02-28 00:38:36 +01:00
Vadim Zeitlin
5b6b644e8b Remove wxSYS_COLOUR_MAX from documentation
There is no real need to document this, it's not a valid enum value and
having it in this file without a trailing comma was a syntax error.

Closes #23298.
2023-02-25 21:51:14 +01:00
Vadim Zeitlin
020aff8a7f Don't use "Copyright" word in wxAboutDialog under MSW
MSW platform convention is to show just "© whatever" instead of
"Copyright © whatever" in the "About" dialogs, so make it simpler to
conform to it but still keeping using the word under the other
platforms, where it usually is included, by removing the "Copyright"
word under MSW only in wx code.
2023-02-24 00:42:13 +00:00
Vadim Zeitlin
3d21a14f95 Merge branch 'msw-statbox-compositing'
Many fixes for handling elements not using wxStaticBox as parent inside
wxStaticBoxSizer.

See #23259.

Closes #23182, #23239.
2023-02-23 00:31:02 +00:00
Vadim Zeitlin
8687a0bad9 Add wxWindow::CallForEachChild()
Adding such function was discussed a few times in the past and it's
going to be needed by wxWidgets itself in the next commit, so do add it,
finally, so that it could also be used from the application code too.
2023-02-21 18:53:11 +00:00
Miguel Gimenez
609bcb633a Document that wxAuiToolBar::AddTool() does support client data
This is the case after the changes of 9f55d568c2 (Add support for client
data to wxAuiToolBar, 2023-02-20).

Closes #23283.
2023-02-21 17:08:58 +01:00
Vadim Zeitlin
95f16e63d2 Consistently use @see in Doxygen documentation
Although @see was used predominantly, a few places used @sa which is
equivalent to it but less readable, so switch to using @see everywhere.

No real changes.
2023-02-20 23:02:18 +01:00
Miguel Gimenez
9f55d568c2 Add support for client data to wxAuiToolBar
Store data passed to AddTool() in wxAuiToolBarItem and provide
wxToolBar-like functions for setting and getting this pointer.

See #23276.

Closes #23271.
2023-02-20 22:59:03 +01:00
Vadim Zeitlin
41be6dbdbe Merge branch 'opengl-default-attrs'
Stop requesting multi-sampling in wxGLCanvas by default.

See #23260.
2023-02-20 18:26:52 +01:00
Vadim Zeitlin
3ed5e42441 Merge branch 'scintilla-5.0' of https://github.com/MaartenBent/wxWidgets
Update Scintilla to 5.0.

See #23117.
2023-02-20 18:25:35 +01:00
Vadim Zeitlin
238050bd51 Mention that wxAuiToolBar::AddTool() ignores client data
This parameter is not supported, so at least mention this in the
documentation.

See #23271.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
8e3dcf8cf8 Fix wxUILocale::GetSystemLocaleId() documentation
Somehow the function prototype was omitted, restore it.

Also update the @since version after backporting this function to 3.2.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
76fffafcd0 Allow customizing menu bar menus colours in MSW dark mode
This allows to customize the hard-coded colours used for drawing the
menu bar too.
2023-02-19 23:20:19 +00:00
Vadim Zeitlin
b4ab8de248 Avoid deprecation warnings due to recent wxPropertyGrid changes
Rename the new overload of DoSetSplitterPosition() to use a different
name: not only this avoids deprecation warnings that broke all the CI
builds, but it also makes things more clear and simpler to use as all
the derived classes don't need to override both the deprecated overload
and the new one to avoid warnings about hiding a base class virtual
function and can just override the new one.

Also remove the default value "Refresh" for the flags which seems to be
inconsistent with the default value "Null" used elsewhere and prefer to
specify it explicitly.
2023-02-19 23:38:04 +01:00
Vadim Zeitlin
d051ff0215 Allow customizing wxStaticBox border colour in dark mode
This is useful because there is no really standard value for this colour
and the choice of grey (0x808080) is completely subjective, but also
because it may be useful to disable custom drawing of the border
entirely if it results in any problems with the future Windows versions.

See #23107.
2023-02-19 21:57:05 +00:00
Vadim Zeitlin
d3ab43ae02 Add a possibility to customize dark mode colours in wxMSW
Add MSW-specific wxDarkModeSettings class which can be used to customize
the colours used in the dark mode (and will be also used for other
customizations in the future).

This commit is best viewed using Git --color-moved option.
2023-02-19 21:57:05 +00:00
Artur Wieczorek
f1273ce152 Use class enums to implement bitmask types
To improve type safety of flags.
2023-02-19 22:36:21 +01:00
Vadim Zeitlin
d4cf530359 Check that all wxStaticBoxSizer items use the same parent
Using the box itself as the parent for some items and its parent window
as the parent for the other ones results in layout problems because the
correct offset is not used when positioning the items not using the box
as parent.

This has always been the case and it doesn't seem to be worth fixing, as
the scenario with the items not using the box as the parent is only
still supported for backwards compatibility anyhow, so just add an
assert checking for this and document this limitation.

Closes #23239.
2023-02-15 15:18:49 +00:00
Vadim Zeitlin
e1d18b3b6c Fix painting of wxStaticBox siblings inside it in wxMSW
Disable compositing when adding a window which is not a child of
wxStaticBox to wxStaticBoxSizer as sibling windows can't be painted
correctly inside one another when compositing is on.

Also add a debug warning when not using the static box as parent for the
windows inside it, to make it easier to notice the windows using a wrong
parent, and emphasize even more strongly that this is not the right way
to do it in the documentation.

Closes #23182.
2023-02-15 15:18:07 +00:00
Maarten Bent
2a18a04dee
Regenerate wxSTC files after Scintilla update
Add both the Scintilla and Lexilla iface to the script.
Remove unused LinkLexers code.

Allow to get the Lexilla version, and show it in the stc sample.
2023-02-14 22:43:18 +01:00
Vadim Zeitlin
1f9113b40a Add default ctor to wxGLCanvas
It didn't make any sense to have Create() functions in this class
without the default ctor as they could be never used -- calling them
would result in creating the window twice.

Add the default ctor to make this class more similar to all the other
windows.
2023-02-14 16:03:56 +00:00
Tobias Taschner
be10ce0713 Add wxWebViewEvent::IsTargetMainFrame()
Allows to determine if a navigation is happening in the main frame
or an embedded iframe when handling wxEVT_WEBVIEW_NAVIGATING.

Additionally implement previously missing wxEVT_WEBVIEW_NAVIGATING
events for frames with the Edge backend.

See #23238.
2023-02-08 17:42:06 +01:00
Vadim Zeitlin
453a52b942 Fix return value of wxToolBar::GetToolBitmapSize() under GTK/Mac
Fix another pixel units confusion in wxToolBar code and ensure that
"sizeNeeded" is expressed in logical units when a fixed bitmap size is
set, to make it consistent with the case when it is not set, and also
because bitmap size is supposed to be expressed in logical pixels, in
both SetToolBitmapSize() and, for consistency, GetToolBitmapSize() too.

Also explicitly mention the latter in the documentation.

See #23228.

Closes #23222.
2023-02-08 17:35:20 +01:00