Commit Graph
21427 Commits
Author SHA1 Message Date
Maarten Bent 9d32805ce0 Remove unused wxUSE_COMMON_DIALOGS option 2024-10-05 20:33:48 +02:00
Maarten Bent b170a58b40 Cleanup and reorder wrapcdlg.h includes
Include wrappers in a specific order so missing.h does not cause macro redefinition warnings.
When wrapcdlg.h/<commdlg.h> is not needed, include wx/msw/private.h instead.

fixes #24851
2024-10-05 20:32:02 +02:00
Vadim Zeitlin 70de12cd32 Merge branch 'fix-gcc-unused-result'
Fix defining wxNODISCARD for gcc.

See #24847, #22943.
2024-09-29 17:42:58 +02:00
Vadim Zeitlin a8db996b54 Merge branch 'aui-art-font'
Fix using wxAuiTabArt fonts.

See #24829.
2024-09-29 17:30:23 +02:00
Vadim Zeitlin 47d3d0ad96 Merge branch 'gtk-print-fix-colours'
Fix colours in wxGTK wxPrinterDC.

See #24827.
2024-09-29 17:26:13 +02:00
Vadim Zeitlin de57a8f447 Fix defining wxNODISCARD for gcc
Fix the check in f1985c6ba2 (Use [[nodiscard]] with functions returning
object to be freed, 2022-11-04) for gcc which didn't work properly due
to a typo.

See #22943.
2024-09-28 23:11:55 +02:00
Vadim Zeitlin 0373d60a36 Use gtk_selection_add_targets() in wxGTK clipboard code
For some reason, calling gtk_selection_add_target() multiple times
doesn't work under some Wayland compositors, including at least Weston:
only the first call to it is taken into account, but the other atoms
don't appear to be added to the list of supported formats.

Work around this by calling gtk_selection_add_targets() to add all of
them at once, which works with at least Weston.

Closes #24701.
2024-09-28 19:48:26 +02:00
archivesilverandVadim Zeitlin 63536d32ff Fix using wxAuiTabArt fonts in wxAuiNotebook
Use the fonts set at wxAuiTabArt provider level in wxAuiNotebook, to
ensure that wxAuiNotebook::SetNormalFont() and SetSelectedFont()
actually work.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #24783.
2024-09-24 18:31:52 +02:00
Vadim Zeitlin 63f94a6d17 Fix using wrong colour in wxGTK wxPrinterDC
The logic for optimizing the colour changes was wrong as the stored
colour values could get out of sync with the values actually used by
Cairo after cairo_restore() was called to undo the changes to the
latter, but not to the former.

Restore m_currentSourceColour when restoring the context too, to prevent
this from happening.

Closes #24729.
2024-09-24 04:03:04 +02:00
Vadim Zeitlin 9e724c53ea Add RAII helper for saving/restoring Cairo context
This is safer than calling cairo_save() and cairo_restore() manually and
can also be extended to do more things, see the upcoming commit.

There are almost no changes in this commit, but CalcBoundingBox() is now
called before restoring the context in DoDrawEllipticArc() rather than
after. It is not clear if putting this call after cairo_restore() in the
old code was intentional, but it seems wrong and is definitely
inconsistent with all the other similar calls, so this is probably a bug
fix.
2024-09-24 03:58:10 +02:00
Vadim Zeitlin 2f39d1959c Simplify current colour variables in wxGtkPrinterDCImpl
No real changes, just use a single wxColour instead of 4 different
m_current{Red,Green,Blue,Alpha} variables as this is much simpler.

Also add a helper function for updating the source colour instead of
duplicating the same code in multiple places.
2024-09-24 03:49:47 +02:00
Vadim Zeitlin 91d09bf732 Add an even more prominent warning to wx/msw/ole/comimpl.h
The stuff here is either completely obsolete (wxAutoLong) or broken, so
there is really no good reason to use it any more and it should be
arguably removed completely, but this would require modifying all the
existing code in wxWidgets itself which still uses it.

The warning added in 0caddb4472 (Document important COM implementation
macro limitation, 2022-05-27) was not clear enough, so make it as
obvious as possible that it shouldn't be used now.
2024-09-23 00:27:06 +02:00
taler21 6418bc261d Fix print preview in high DPI
Take the DPI scaling factor into account.

Closes #24666.

Closes #24815.
2024-09-20 17:50:03 +02:00
Scott Talbert 2d79dfc7a2 Fix docs generation for datetime with doxygen 1.11.0
It seems that as of the below commit, doxygen changed its handling of
parsing backticks in comments such that it now fails to properly
generate documentation for the entire datetime.h file.  Fix this by
closing the open backtick.

Also update the actual, non-documentation, header to match for
consistency, even if non-matching backticks are not a problem there.

See: https://github.com/doxygen/doxygen/commit/f18767307be20ca8d2ca81f74cc1f3446205282b

Closes #24814.
2024-09-20 17:46:18 +02:00
JP MattiaandVadim Zeitlin 18765efc05 Remember last error in wxSocketImpl
Instead of calling GetLastError() multiple times, and possibly getting
different errors, make it private and call UpdateLastError(), which
remembers the value returned by GetLastError() in m_error, so that we
can be sure it doesn't change.

This commit is best viewed with Git --color-moved option.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #24811.
2024-09-20 17:43:44 +02:00
Blake-Madden 39cafe20ee Remove outdated wxALWAYS_SHOW_SB comment
This style is supported under all major platforms since quite some time.

Closes #24810.
2024-09-15 19:17:22 +02:00
Lauri Nurmi 4d5fe6f9b5 Add missing #include "wx/string.h" for wx/sysopt.h
wxSystemOptions depends on wxString, but wx/string.h is not included,
except via wx/object.h when WXBUILDING is not defined.

Closes #24806.
2024-09-15 19:15:50 +02:00
Vadim Zeitlin 089dc4e200 Merge branch 'updateui-checkboxstate' of https://github.com/wsu-cb/wxWidgets
Allow using wxCHK_UNDETERMINED with wxUpdateUIEvent.

See #24764.
2024-09-15 19:00:45 +02:00
Vadim Zeitlin fa23c93832 Merge branch 'webview-cef-devtools'
Implement dev tools support for wxWebViewChromium.

See #24799.
2024-09-15 18:59:30 +02:00
Vadim Zeitlin 9cc48d7ec1 Merge branch 'webview-version'
Add possibility to retrieve both build- and run-time wxWebView version

See #24778.
2024-09-15 18:58:57 +02:00
Bill Su 59affd0346 make use of wxUpdateUIEvent::Set3StateValue()
Add a virtual function to wxWindow to let its subclasses
configure wxUpdateUIEvent specific to the subclass.
2024-09-05 21:04:59 -04:00
Bill Su cb17adac5a add wxCHK_UNDETERMINED support to wxUpdateUIEvent 2024-09-05 21:04:57 -04:00
Vadim Zeitlin 2e6d79acf2 Add wxWebView::ShowDevTools()
Implement it for Edge, WebKit2GTK and Chrome backends.

It doesn't seem possible to implement this for WebKit macOS backend and
IE backend doesn't support dev tools at all.

Also note that Edge backend doesn't seem to support closing the dev
tools window, so don't provide this functionality for now, even if it
could be implemented for WebKit2 and Chrome backends.
2024-09-05 22:09:57 +02:00
Juan FontenlaandVadim Zeitlin 01eed1e36c Implement wxWebViewChromium::EnableAccessToDevTools()
Add context menu items for showing/hiding CEF developer tools and
inspecting the current element to the context menu if access is enabled.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2024-09-05 02:30:47 +02:00
Vadim Zeitlin 2fe0715144 Merge branch 'gtk-stattext-size'
Fixes for computing wxStaticText best size in wxGTK.

See #24781.
2024-08-25 17:35:53 +02:00
Vadim Zeitlin e9934fbba3 Merge branch 'msw-aui-bar-bg'
Fix background of controls with transparent areas in wxAuiToolBar in
wxMSW.

See #24780.
2024-08-25 17:33:37 +02:00
Vadim Zeitlin 54ba1404e1 Merge branch 'app-exit-code'
Allow customizing exit code in case of OnInit() and other failures.

See #24770.
2024-08-25 17:32:12 +02:00
Vadim Zeitlin e6500a4e31 Compute wxStaticText best size ourselves if GTK does it wrongly
GTK doesn't take into account changes to the font of a hidden
wxStaticText and returns wrong preferred (i.e. best) size for it which
still uses the old font in this case, which results in all sorts of
problems when this wrong best size is used for the layout.

Work around it by computing the best size ourselves in this case using
the correct font. This seems to return exactly the same results as GTK
returns as long as the font is not changed, but also works correctly
when it is.

This commit is best viewed ignoring whitespace-only changes.

See #16088.
2024-08-24 15:39:29 +02:00
Vadim Zeitlin 32f3dbd8f4 Fix background of transparent controls in wxAuiToolBar in wxMSW
Just painting the background doesn't make it "show through" the controls
with transparent area, such as wxStaticText or wxCheckBox, in wxMSW and
the special wxCustomBackgroundWindow base class must be used for this,
so derive wxAuiToolBar from it to fix background of custom controls in
it.

Add an example of a wxStaticText in a wxAuiToolBar to show that this
works correctly now.

Closes #24765.
2024-08-23 21:37:23 +02:00
Vadim Zeitlin a23f130d8e Remove unnecessary wxAuiToolBar::OnEraseBackground()
Calling SetBackgroundStyle(wxBG_STYLE_PAINT) meant that
wxEVT_ERASE_BACKGROUND was never generated for wxAuiToolBar anyhow, so
it's unnecessary to have a handler preventing its default handling.
2024-08-23 21:35:32 +02:00
Vadim Zeitlin 435fa14076 Add possibility to retrieve compile-time wxWebView version
This is currently only implemented for GTK WebKit2 and CEF backends.

Show both the compile- and run-time versions in the sample.
2024-08-23 00:19:53 +02:00
Vadim Zeitlin 41e8148ef2 Add wxVersionInfo::IsOk() helper
This allows to easily check if we have any version information at all.
2024-08-23 00:06:10 +02:00
Vadim Zeitlin d78e96a902 Add wxVersionInfo::GetNumericVersionString() helper
GetVersionString() includes the name into the returned string, which is
not always helpful, so provide a function not doing it too.
2024-08-23 00:03:56 +02:00
Vadim Zeitlin b034664af1 Change default error exit code to 255 from -1
This is an incompatible change, but it doesn't change anything under
Unix systems, where exit codes are most useful, and makes behaviour
consistent across all platforms, so it seems to be worth doing.
2024-08-22 15:29:25 +02:00
Vadim Zeitlin 412c12b47e Add wxApp::SetFatalErrorExitCode()
Allow to customize the exit code returned in case of abnormal
termination too.
2024-08-22 15:25:38 +02:00
Vadim Zeitlin 33ede81818 Use the provided exit code in wxSEH_HANDLE()
Don't hard code exit code of 3, this is inconsistent with -1 currently
used (but to be changed soon) when the object terminates due to an
unhandled C++ exception.
2024-08-22 14:52:53 +02:00
Vadim Zeitlin fb7454ad4a Remove unused wxSEH_DUMMY_RETURN() macro
This was left over when removing support for older MSVC versions but
became completely useless then and can be just removed now.
2024-08-22 14:51:32 +02:00
Vadim Zeitlin e2de7dc625 Allow setting the exit code when returning false from OnInit()
Unfortunately returning false from the (overridden) wxApp::OnInit() has
a side effect of exiting the application with inconsistent error code:
255 under Unix but 127 under MSW with MSVC.

While changing the default exit code in this case is probably a bad idea
because there are surely people relying on the current values, at least
allow changing it by explicitly calling the new SetErrorExitCode()
function.
2024-08-21 18:47:21 +02:00
Vadim Zeitlin 1d89729c79 Add wxWebSession::SetBaseURL() to simplify a common use case
It's often convenient to make multiple requests using the same prefix,
e.g. when using a web API, so make this more convenient by allowing to
set the common base URL for all requests.
2024-08-21 02:29:41 +02:00
Vadim Zeitlin a2f5ca9999 Add wxWebRequest::SetData() overload taking unique_ptr<>
Make it possible to give the ownership of wxInputStream to wxWebRequest
in a more idiomatic way by just passing it a std::unique_ptr<> instead
of passing it the raw pointer.
2024-08-21 01:19:08 +02:00
Vadim Zeitlin c3875a8c86 Make wxWebSession::GetLibraryVersionInfo() const
There is no reason for this simple accessor to modify the session
object.
2024-08-20 22:18:04 +02:00
Vadim Zeitlin 6c204085ab Merge branch 'webrequest-proxy'
Add proxy support to wxWebRequest.

See #24762.
2024-08-20 19:01:08 +02:00
Vadim Zeitlin ad635a406a Merge branch 'webrequest-sync'
Add synchronous wxWebRequest.

See #24760.
2024-08-20 02:43:10 +02:00
Vadim Zeitlin eaf0552abd Disable proxy support under iOS
This is apparently not supported by the platform, so don't even try to
do it and just document this limitation.
2024-08-19 19:57:32 +02:00
Vadim Zeitlin c53740c798 Merge branch 'msw-darkmode-bg'
Appearance fixes for wxMSW in dark mode.

See #24753.
2024-08-19 03:10:21 +02:00
Sean BuddandVadim Zeitlin 9b043d8f26 Forbid using wxFileDialogs on Windows from secure desktop
When running on the secure desktop (which doesn't happen for normal
desktop applications but can happen for DLLs loaded by the login
screen), accessing the file system is a security disk but could happen
due to showing the log dialog which provides a "Save" button opening the
file dialog.

Prevent this from happening by adding a check to wxFileDialog verifying
that it doesn't run on the secure desktop.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2024-08-19 03:06:29 +02:00
Vadim Zeitlin 3e8a84ee86 Disallow overriding wxBitmap::Create() outside of wxWidgets
This doesn't really make much sense, this function is only virtual in
the first place to force wxBitmap (in all ports except for wxMSW) to
implement wxBitmapBase pure virtual functions, but it's implemented only
by wxWidgets itself and shouldn't be overridden again, so declare it as
final in all the ports overriding it and make it non-virtual in wxMSW.

Also, none of the other Create() functions in wxWindow-derived classes
is virtual, so this improves consistency as well.

Finally, this avoids clang-analyzer-optin.cplusplus.VirtualCall warning
from clang-tidy due to calling a virtual function from wxBitmap ctor,
which is the right thing to do only because we really want to call
wxBitmap's own version and not anything defined in a derived class.

Closes #24759.
2024-08-19 02:51:42 +02:00
Vadim Zeitlin 6e8c5fa397 Fix warning about missing "override" in wxiOS 2024-08-19 02:50:29 +02:00
Vadim Zeitlin f3872a6ce9 Add support for specifying proxy in wxWebRequest
Allow disabling the proxy used by default or specifying a custom proxy.

Unfortunately NSURLSession implementation doesn't support neither paths
in the proxy URLs nor proxy authentication when using synchronous
requests, but there doesn't seem to be any way around it.
2024-08-18 21:15:49 +02:00
Vadim Zeitlin b8583942bb Return upper case string from GetHTTPMethod()
This doesn't matter for WinHTTP and URLSession backends, but simplifies
code in the libcurl one.

No real changes.
2024-08-17 20:32:53 +02:00