Commit graph

4636 commits

Author SHA1 Message Date
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
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
Vadim Zeitlin
9106a8306e Document wxMessageBox dark mode limitation
The native task dialog just doesn't seem to support dark mode and it
doesn't seem possible to change its colours manually neither.
2022-12-25 19:45:52 +00:00
Vadim Zeitlin
7fd236bf4a Add msw.dark-mode system option to allow turning it on easily
It doesn't make much sense to set this option programmatically, as the
application could just call MSWEnableDarkMode() directly instead, but
it's useful to have to allow enabling dark mode for any wx application
by just setting WX_MSW_DARK_MODE environment variable.
2022-12-25 19:45:51 +00:00
Blake-Madden
77b1f5be77 Explain how to display text objects from SVG files
Mention that lack of support for text elements in NanoSVG can be worked
around by rasterizing them.

Closes #23074.
2022-12-25 03:16:32 +01:00
Vadim Zeitlin
82eb445722 Merge branch 'webview_BrowserAcceleratorKeys' of https://github.com/TcT2k/wxWidgets into master
Add wxWebView::EnableBrowserAcceleratorKeys().

See #23070.
2022-12-23 20:08:16 +01:00
Vadim Zeitlin
795190ffbe Merge branch 'log-enable-mt-safe' into master
Minor improvements to logging MT-safety.

See #23054.
2022-12-23 20:07:50 +01:00
Tobias Taschner
db9419af4b
Add wxWebView::EnableBrowserAcceleratorKeys()
The edge backend has various accelerator keys enable per default.
This include Ctrl-P, Ctrl-F, F5 and others. In many uses of webview
this might not be desirable and can be disabled.

This is currently only implemented for the Edge backend.

Raises required WebView2 SDK version from 1.0.705.50 to 1.0.864.35
2022-12-23 14:12:36 +01:00
Artur Wieczorek
cf661f9293 Specify what is the limit set by wxPGProperty::SetMaxLength()
It needs to be stated clearly that the limit applies only to the text
the user can enter in the editor associated with property.
This constraint does not apply to the length of text represenations
of values set programmatically.
Corresponding test were added.
2022-12-22 20:53:44 +01:00
Vadim Zeitlin
2c937f4ae7 Annotate some MT-safe and unsafe wxLog functions
Document that wxLog::SetLogLevel() is not MT-safe and that wxLogNull
should be used instead of calling it to temporarily change the log level
from the other threads.
2022-12-18 21:41:05 +01:00
ali kettab
51d813cab7 wxQt: Make wxListCtrl::SetColumnWidth() conformant to documentation
Also update the listctrl sample to show it's effect on the second column
wxLIST_AUTOSIZE (Ctrl+R) to resize the column to content
wxLIST_AUTOSIZE_USEHEADER (Ctrl+Shift+R) to resize it to header section
2022-12-10 18:48:07 +01:00
ali kettab
4192b28a7f wxQt: fix wxListCtrl::GetCountPerPage() implementation
Use QTreeView's viewport height to get the right count per page
Also document that the control must contain at least one item in
order to return a valid value from the function.
2022-12-10 18:48:06 +01:00
ali kettab
2578ffb54a Assert if wxListCtrl::EditLabel() is used without wxLC_EDIT_LABELS
Since wxListCtrl under wxMSW cannot edit labels without the presence of
this flag, and an assertion failure triggered if the flag is missing to
it and also all the other ports for consistency.

Also document that wxLC_EDIT_LABELS flag is required in EditLabel()
description.

See #23024.
2022-12-10 12:57:46 +01:00
Vadim Zeitlin
82b2e5fd68 Merge branch 'text-dataobj-len'
Get rid of extra unexpected NUL characters in strings copied from
clipboard.

See #23018.

Closes #22928.
2022-12-09 01:54:54 +01:00
Vadim Zeitlin
bcea384923 Start adding dark mode support to wxMSW
Add experimental wxApp::MSWEnableDarkMode().

For now this is very incomplete and just uses the basic API for setting
the preferred application mode, which only works for the standard
dialogs and popup menus, but it's a start.

Support of dark mode is also limited to Windows 10 20H1 and later, but
this should, hopefully, be not a problem in practice as few people
should be using pre-2020 Windows 10 versions by now.
2022-12-08 00:15:18 +00:00
Vadim Zeitlin
6e940d1a10 Improve documentation of events sent by wxTreeCtrl::EditLabel()
Make it clear that wxEVT_TREE_END_LABEL_EDIT is sent whether the user
accepts or cancels editing the label.

Closes #22867.
2022-12-05 23:35:31 +01:00
Vadim Zeitlin
9440b473c0 Deprecate unused wxTextDataObject::GetTextLength()
This function was supposed to be overridden in the subclasses to allow
efficiently implementing GetDataSize(), but it wasn't actually called
any longer since 229f00eb69 (Translate wxTextDataObject to/from native
EOL format., 2012-07-29).

And while it was probably a mistake to stop calling it in that commit,
the fact that nobody has complained about it since then seems to prove
that nobody was overriding it anyhow and it's not worth resurrecting it,
so just deprecate it instead.
2022-12-04 20:38:43 +00:00
Vadim Zeitlin
0473e6ba6b Merge branch 'wine-fixes'
Use more functionality available in recent Wine versions.

See #23006.
2022-12-04 01:12:07 +01:00
Vadim Zeitlin
d05a909c58 Merge branch 'msw-composited-parent'
Fixes for using WS_EX_COMPOSITED in wxMSW.

See #23002.
2022-12-04 01:04:27 +01:00
Vadim Zeitlin
2a39377ca4 Add wxVersionInfo::AtLeast()
Allow easily checking if the version is at least equal to the given one.
2022-12-04 00:44:09 +01:00
Artur Wieczorek
1d85e22543 Implement new wxPGProperty::HasAnyChild() method
There are many checks in the code whether wxPGProperty has any child.
Doing so by checking if GetChildCount() is greater than zero doesn't
seem to express intent simply and clearly. With dedicated method this
could be done simpler and hopefully in a more optimal way.
2022-12-03 17:15:28 +01:00
Vadim Zeitlin
e72c3855d3 Optionally return Wine version from wxIsRunningUnderWine()
We're going to need to do it in a couple of places, so extend the
existing function for testing for Wine presence to also return its
version, if requested.

Use it to show the version of Wine being used when running the tests.
2022-12-01 01:30:27 +01:00
Vadim Zeitlin
b76e2b728a Fix example of using wxLoadUserResource() in the docs
Pass wide string to this function as this is what it takes.
2022-11-30 02:23:37 +01:00
Vadim Zeitlin
c5f613c941 Revert "Remove wxStaticBox custom drawing code entirely"
This reverts commit 616586f301 because it
turns out that using WS_EX_TRANSPARENT is incompatible with using
WS_EX_COMPOSITED (see parent commit).

Reintroducing all this code is painful, but there doesn't seem to be any
way of avoiding to have it as long as we use WS_EX_COMPOSITED. If we
stop using this style, we could revert this commit, this re-applying the
original change.

Closes #22982.
2022-11-28 19:04:59 +00:00
Vadim Zeitlin
20bbc43a20 Redefine wxTRANSPARENT_WINDOW as 0 and stop using it
This style never did anything useful in wxMSW and did nothing at all in
all the other ports, so always was rather useless, but became actively
harmful not that WS_EX_COMPOSITED is used in wxMSW because using it and
WS_EX_TRANSPARENT, enabled by wxTRANSPARENT_WINDOW, together doesn't
work and results in an endless stream of WM_PAINT messages being sent to
the _siblings_ of the window with wxTRANSPARENT_WINDOW style.
2022-11-28 19:04:56 +00:00
Vadim Zeitlin
5c6bce627b Check wxImageList validity in all of its methods
Some of wxImageList methods asserted when called on an invalid image
list while others just failed silently.

Assert in all of them now for consistency and to help detecting problems
in the code using invalid wxImageList objects.

Extend the documentation and the tests.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
d458af3ca7 Merge branch 'qt-menu-fixes' of https://github.com/AliKet/wxWidgets
Make accelerators and radio items work in wxQt menus.

See #22985.
2022-11-26 16:57:00 +01:00