ShowHint() shouldn't be called directly, as it doesn't set m_hintFadeAmt
correctly and so the hint window is always shown directly, even when
wxAUI_MGR_HINT_FADE flag is set (which is the default).
Fix this by adding wxAuiManager::UpdateHint() which does update
m_hintFadeAmt and use it in wxAuiNotebook.
Also document that ShowHint() shouldn't be called directly.
Add wxAuiNotebook::SetManagerFlags() and use it in the sample to allow
testing how the different flags, such as wxAUI_MGR_HINT_FADE, affect
wxAuiNotebook behaviour.
Don't bother creating a separate object file for just a few lines of
code in the generic wxIcon implementation, just inline them into
wx/generic/icon.h.
There should be no need to ever have any non-trivial code here as
generic wxIcon is the same thing as wxBitmap anyhow.
This field could remain uninitialized, resulting in undefined behaviour
when accessing it later, as the random value it contained wasn't a valid
value for wxSashDragStatus enum.
It's not clear why should we be handling wxEVT_DESTROY for our own text
control when it can only be deleted as part of deleting the picker
itself and doing it resulted in UB as we accessed wxPickerBase object
after having already destroyed it, when the text control was destroyed
when destroying its children from wxWindowBase dtor.
These functions can't be really used, the controls are managed by the
picker itself and using SetTextCtrl(), in particular, has no chance of
working correctly because the picker wouldn't be connected to
wxEVT_TEXT and wxEVT_KILL_FOCUS events on it, as it should be.
Don't cast the not yet fully constructed object to wxScrollHelper when
passing it to wxWindow::SetScrollHelper() and call the latter in the
derived class ctors instead.
An alternative solution could be to store wxScrollHelperBase pointer in
wxWindow instead of wxScrollHelper, as this would be enough, but this
seems a bit ugly, as "Base" classes are supposed to be implementation
detail more than anything else, and duplicating SetScrollHelper() call
in both generic and GTK implementation doesn't seem to be that bad in
comparison.
Don't upcast wxDataViewColumnBase pointer to wxDataViewColumn before the
latter is constructed, this is UB.
Unfortunately this means that all the derived classes have to call
wxDataViewRenderer::SetOwner() themselves instead of relying on the base
class to do it, but the only reasonably way to avoid it would be to use
CRTP and this seems too heavy to save just a few of these calls.
This function is called from wxWindowBase dtor to detach the window
being destroyed from the containing sizer and casting the pointer to the
object to wxWindow is UB because the object is not actually a wxWindow
any more by then.
Remove the cast and pass wxWindowBase pointer to wxSizer::Detach()
instead, as it doesn't need the full wxWindow anyhow.
Also document that any wxSizer-derived classes overriding Detach() will
need to be modified to follow this change.
Using static_cast<className*>(obj) when the object is not actually of
the given type is UB, so avoid it even if should be harmless in
practice, by simply omitting it: we only need "obj" to be a wxObject
here.
Note that this means that using wxCheckCast() or wxStaticCast() with a
type not deriving from wxObject is always UB, but there is not much that
we can do about it, so just document this explicitly.
Don't rely on wxStatusBar dtor resetting the frame status bar, this was
awkward (because the frame should be responsible for maintaining its own
state, instead of letting other classes do it) and resulted in UB when
the status bar was deleted from wxFrameBase dtor, as the cast of its
parent pointer to wxFrame was invalid by then, as the half-destructed
frame wasn't a wxFrame any more.
Don't shift signed integer which can be negative, cast it to unsigned
first: as we shift it by 32 bits, it doesn't matter that it is not
sign-extended in this case.
In build with wxUSE_SECRETSTORE==0 the stand-in implementation of
wxSecretStore was broken (instead of just being insecure) because
objects of this type were never valid, as we forgot to set m_valid.
Thanks UBSAN for flagging access to this uninitialized variable.
Use the locale set using wxUILocale or the equivalent of the default "C"
locale (en-US) in the native date picker control instead of always using
the default user locale.
Closes#23956.
All supported platforms provide 64-bit integer types since many years,
so remove the legacy wxLongLongWx implementation and rename
wxLongLongNative to just wxLongLong and always compile it in.
Note that wxLongLong itself must still be kept for compatibility as it
has member functions, such as GetValue() or ToString(), that can be used
in the existing code.
Add wxAuiSerializer and wxAuiDeserializer classes and SaveLayout() and
LoadLayout() functions in wxAuiManager using them.
Show how these classes can be used to use XML for storing AUI layout in
the sample.
See #24225.
Try to make it as clear as possible that this class shouldn't be used
any longer without formally deprecating it (as it does still work in
wxMSW and, also, is still used in some of our own code).
wxWebRequest::AddHeader() was added to accompany the existing
SetHeader() method. In wxWebSession, AddCommonHeader() did exist
already but behaved like setting a header. Its behavior was adapted
to its name and SetCommonHeader() was added with the old behavior
to accompany AddCommonHeader().
The WinHTTP and CURL implementations of wxWebRequest do now append
multiple headers of the same name. The URLSession implementation
follows in the next commits.
HTTP headers like Set-Cookie can be present multiple times in a
web response by definition. The existing GetHeader() method is
not sufficient to cope with this situation.
This commit already adds an implementation for Windows.
Linux and macOS follow in the next commits.
Use the wxWARN_UNUSED attribute in wxString's definition. Compilers do not
typically warn about unused non-POD objects, but this attribute makes it
possible (on GCC and Clang).
Whether a warning is actually shown or not still depends on whether
the user has enabled warnings for unused variables in their compiler flags.
Also known as [[gnu::warn_unused]].
Use __has_attribute to check availability of the attribute. (Is available
on recent GCC and Clang versions, not available on MSVC.)
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