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
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.
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.
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.
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.
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.
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.
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.
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/f18767307be20ca8d2ca81f74cc1f3446205282bCloses#24814.
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.
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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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>
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.
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.