These functions, added in the recent fce8780297 (Add 64-bit integers
support to wxConfig, 2021-03-09) break compilation of existing code
defining classes inheriting from wxConfig, and we can avoid it by using
strings for storing long long values by default -- as this is what
wxFileConfig is doing, and wxRegConfig provides its own overridden
version anyhow.
We already did it just before processing the state change event, but
this was too late, as the object could have been already deleted by then
and this actually happened with the example from wxWebRequest
documentation.
Do it earlier now, as soon as the request becomes active, which normally
happens when Start() is called, and keep the reference until the event
is processed after the request reaches one of the final states
(completed, failed or cancelled).
Add a unit test checking that deleting the wxWebRequest object doesn't
prevent the request from running to the completion any more.
Show message box from wxSafeShowMessage() in the other ports too, if
possible.
Currently this is done using wxMessageBox() if it can be sure that it's
safe to call and only MSW uses native function which is always safe to
call. Ideal would be to also use a native function under Mac, where it
should also be the case, but this doesn't seem to work for whichever
reason.
See https://github.com/wxWidgets/wxWidgets/pull/2270
This doesn't seem to be doing anything useful but does result in
-Wdeprecated-copy from clang 10, as normally a custom copy ctor should
be defined as well, if the assignment operator is defined.
For GTK, the current implementation assumes X11 is the only window option.
Introduce runtime checks to manage Wayland too.
Signed-off-by: Pierluigi Passaro <pierluigi.p@variscite.com>
Closes https://github.com/wxWidgets/wxWidgets/pull/2257
This allows the caller to log the message to the console in addition to
showing the message box, for example. Previously, this would be
impossible to do without getting the duplicates if the message box was
not shown, but now it is.
Honor wxFont's strikethrough and underline attributes when converting
label markup to NSAttributedString. On macOS, strikethrough and
underline are properties of (rich) text, not of fonts, so a conversion
like this is necessary.
Serialize them to strings in wxFileConfig, just as we always did for
long, but use wxRegKey support for storing them directly to the registry
in wxRegConfig.
Back-propagate the fixes of 28d705424b (Fix double words and article
mismatches in docs., 2021-03-10) to interface/wx/stc/stc.h to the files
that this header is generated from to avoid losing these changes when
it's regenerated the next time.
See https://github.com/wxWidgets/wxWidgets/pull/2273
This uses the native registry support for 64-bit values available since
Windows XP.
Note that SetValue64() can't be just called SetValue() as this would
introduce ambiguities when writing an int or an enum to the registry.
This could be avoided by providing overloads for all the arithmetic
types, but it's arguably better to be more clear about what exactly is
being written to the registry in this low-level class and using a
different name is definitely simpler.
Don't repeat exactly the same code for 3 different types, just use a
template function instead.
Change the existing TryGetValue() helpers to take all output parameters
consistently by pointer, rather than taking only long by pointer and the
other by reference. This allows to isolate the inconsistency of the type
of wxRegKey::QueryValue() parameter in a single place here, hiding it
from the rest of wxRegConfig code.
Add an extra unit test for writing/reading longs to/from wxRegConfig.
This allows to show message boxes in ports other than wxMSW too by doing
it only when it is safe, i.e. when the GUI is initialized, while still
keeping the old code directly using the native MessageBox() function for
MSW for maximal robustness.
Pass correct parent HWND to ::MessageBox() in order to disable the
window while the message box is shown, as this function is supposed to
be similar to modal wxMessageBox() and it was unexpected that the
application could be reentered via the event handlers from inside it.
This required adding wxAppTraits::GetMainHWND() in order to only use the
HWND in GUI applications from the function defined in non-GUI code.
This trivial function just allows to avoid checking if wxTheApp is not
null before calling GetTopWindow() on it.
Replace the existing "wxTheApp && wxTheApp->GetTopWindow()" calls with
wxApp::GetMainTopWindow().
No real changes.
This internal function will be useful to check if the modules are
already initialized, i.e. if the library is in the "steady state"
between the end of the initialization and the beginning of the cleanup
phases.
Simply use wxVector instead, this shouldn't be less efficient (we rarely
remove the modules from the list and iterating over a vector should
actually be faster, as well as consuming less memory), but it avoids
ugly macros, is simpler to use and to debug and will be trivial to
replace with std::vector<> in the future.
No real changes, this is just pure cleanup.
This adds a yet another conversion function, which is not ideal, but
still better than having to write ToStdString(wxConvUTF8) every time for
losslessly converting wxString to std::string: not only this is too
long, but it's also too easy to forget to specify wxConvUTF8, resulting
in data loss when using non-UTF-8 locale.