Commit graph

4661 commits

Author SHA1 Message Date
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
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
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
Vadim Zeitlin
c4b71b3694 Merge branch 'default-locale-improve'
Improvements for handling default locale under macOS and Unix.

See #23119, #23147, #23226.

Closes #23114.
2023-02-08 17:33:19 +01:00
Tobias Taschner
b9e776ae43 Allow calling wxWebViewEdge::SetUserAgent() after Create()
Additionally implement wxWebViewEdge::GetUserAgent() via SDK.

This functionality is available with the slightly newer
WebView2 SDK required by previous changes.

See #23225.
2023-02-06 13:55:30 +01:00
Artur Wieczorek
159c3b1c6d Don't cache strings and variant values in wxPGGlobalVarsClass
Optimization gain is doubtful but complexity is high.
2023-02-05 19:07:25 +01:00
Vadim Zeitlin
14714856b3 Add wxUILocale::GetSystemLocaleId()
This function replaces the existing GetSystemLocale() as it can
represent the locales that don't have any corresponding wxLanguage
values and for which GetSystemLocale() has no choice but to return
wxLANGUAGE_UNKNOWN.
2023-02-05 16:45:14 +01:00
Vadim Zeitlin
ce04dbc024 Recommend using wxUILocale::GetSystemLanguage() in wxLocale docs
The wxUILocale function really returns the default language unlike the
one in wxLocale which must kepe using the default locale for
compatibility, making its name confusing.
2023-02-05 15:51:33 +01:00
Vadim Zeitlin
0a1b0fbe01 Merge branch 'msw-about'
Improve generic and MSW "About" dialog appearance.

See #23196.
2023-02-03 15:11:48 +01:00
Vadim Zeitlin
255876075a Merge branch 'xrc-feature'
Add XRC "feature" attribute.

See #23184.
2023-02-03 15:09:55 +01:00
Scott Talbert
3cc00091e2 Document wxBookCtrlBase::GetControlSizer
The documentation for wxChoiceBook discusses using this method, but it
was not previously documented.

See #23211.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2023-02-03 15:08:55 +01:00
Vadim Zeitlin
05e49f7989 Add "About" dialog screenshots under different platforms
Show both "simple" and "fancy" (which just means with the web site
link specified here) forms from the dialogs sample.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
3fdebc96cd Add support for XRC "feature" attribute
This is a generalization of the existing "platform" attribute and allows
to only include some XRC elements if and only if an arbitrary "feature"
is enabled by the application before loading the XRC document.
2023-01-29 00:54:42 +00:00
Artur Wieczorek
5b92a7badc Use constexpr to declare constants in wxPropertyGrid 2023-01-22 20:15:01 +01:00
Vadim Zeitlin
0e9b52d335 Merge branch 'fontlist-findorcreate'
Fix wxFontList::FindOrCreateFont() for pixel and fractional point sizes.

See #23142.
2023-01-15 20:13:33 +00:00
Vadim Zeitlin
66f06effc2 Improve FindOrCreateFont() documentation
Explain that the overload taking wxFontInfo is preferred and why,
mention that the returned pointer must not be deleted and also give a
trivial example of using this function.
2023-01-14 16:39:41 +00:00
Vadim Zeitlin
4a38b9ea34 Document that wxFont::AddPrivateFont() needs an absolute path
It might have been unclear that an absolute path is required even under
Mac, where the fonts must be inside a fixed directory.
2023-01-14 14:51:04 +01:00
Vadim Zeitlin
f29e6fd8fe Add documentation for wxTEST_DIALOG() and related classes
Somehow this macro was never documented, do document it now, mostly by
reusing the existing documentation comments from include/wx/testing.h.
2023-01-13 17:53:39 +01:00
Blake-Madden
451772530c Fix typo in wxDEFINE_EVENT macro name in the documentation
Should be wxDEFINE_EVENT, not wxDEFINE_EVENT_TYPE.

Closes #23126.
2023-01-12 17:31:32 +01:00
Artur Wieczorek
f0b76076f4 Encapsulate data in wxPGValidationInfo
Implement more getters and setters to encapsulate data
in wxPGValidationInfo.
2023-01-06 18:06:38 +01:00
Vadim Zeitlin
e89f05faba Remove memory debugging/tracing support and all related options
Drop disabled by default and pretty useless memory tracing code and all
the overlapping and poorly documented build options related to it.

Remove memory.cpp entirely and update all the make/project files, but
preserve the now completely trivial wx/memory.h for compatibility and
also keep including wx/string.h from wx/object.h as it seems like a lot
of existing code actually depends on this, even if it should not.

Replace the options in the propgrid sample with a couple of other
debug-related options that were not used before to avoid leaving the
"Debugging Section" completely empty.
2023-01-05 21:41:38 +01:00
Blake-Madden
92b170b154
Offer workaround for embedded images in SVG 2023-01-03 17:54:11 -05:00
Blake-Madden
7f118d96d7
Mention embedded images in SVG not being supported
Also, fix minor doxygen formatting in note
2023-01-03 17:30:24 -05:00
Vadim Zeitlin
f5daf28932 Update copyright years to 2023
Just run misc/scripts/inc_year and commit the results.

See #18690.
2023-01-03 04:15:08 +01:00
Artur Wieczorek
d3c194590d Prevent from instantiation of wxPropertyGridIteratorBase
The purpose of this class is to be a base class
for wxPropertyGridIterator classes.
2022-12-30 14:10:29 +01:00
Vadim Zeitlin
208142c14a Merge branch 'msw-dark-mode'
Add experimental support for dark mode for wxMSW.

See #23028.
2022-12-27 22:20:34 +01:00
Vadim Zeitlin
7ce2ba9b0c Add wxSystemAppearance::AreAppsDark() and IsSystemDark()
This allows to determine if dark mode is enabled (for the applications
and/or the system UI itself, respectively) system-wide which is useful
now that IsDark() returns false unless MSWEnableDarkMode() is called.

Also document the incompatible change to IsDark().
2022-12-26 22:02:11 +00:00
Vadim Zeitlin
32daebe883 Don't return true from wxSystemAppearance::IsDark() in light mode
Even if the system is configured to use the dark mode, we shouldn't
return true from this function unless the application itself uses dark
mode, otherwise we're going to use wrong colours not providing enough
contrast with the system-provided ones.

This basically reverts #22020 as now that we have real dark mode
support, we should be using it instead.
2022-12-25 19:45:53 +00:00
Vadim Zeitlin
30dc3350dc Add wxSystemSettings::SelectLightDark() and use it
Add a convenient helper allowing to select between the two colours
depending on whether we're using light or dark mode.

Use this in a couple of places instead of manual tests for IsDark().

No real changes.
2022-12-25 19:45:53 +00:00
Vadim Zeitlin
61805ef7eb Improve wxToolBar appearance in dark mode
Fix labels and highlight colour and get rid of the white line on top of
the toolbar.

Unfortunately drop-down items are still not drawn correctly as I
couldn't find any way to customize the colour used for their arrow.
2022-12-25 19:45:53 +00:00
Vadim Zeitlin
717dfda9be Document that date/time picker controls don't support dark mode
There doesn't seem to be any way to change the appearance of these
controls, DTM_SETMCCOLOR only works when not using themes.
2022-12-25 19:45:52 +00:00