No real changes, just refactor the code to reset all drag-related
variables in a single function instead of doing it manually in several
places.
As this function also resets m_clickTab, which could previosuly remain a
dangling pointer, change the code to get its value before calling it.
Ensure that all of them are initialized, including m_clickTab, which
didn't seem to be always initialized before.
No real changes (as m_clickTab doesn't seem to have been used before it
was initialized).
Since the changes of 4d76a87015 (Make wxSearchCtrl inherit from
wxTextEntry in all ports, 2023-07-09, see #23697) GetEditHWND() returned
null for wxSearchCtrl which was considered to be correct because all
wxTextEntry functions were supposed to be forwarded to wxSearchTextCtrl
anyhow.
This wasn't really correct, however, as GetEditHWND() was also called
from SetHint(), resulting in an assert failure and falling back on
generic hint implementation which, while mostly working, suffers from
some problems that the native implementation doesn't have.
So make this function return the actual HWND used by the associated text
entry to fix this and allow SetHint() to work as before and also
forestall any problems due to not having the right HWND in the future.
See #23983.
Closes#23975.
This is currently implemented for single line control only. But unfortunately the
wxEVT_TEXT_MAXLEN event is only emitted when the Qt version used is 5.12 or higher.
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.
Keep the non-blank lines for historical purposes.
QtSet{Min,Max}Size() were added for use by Set{Min,Max}Size() and
DoSetSizeHints() overrides. and since we have canceled overriding
Set{Min,Max}Size() in previous commit, there is no need to keep them
around without good reason.
This partially reverts commit 3c68696 (Make wxTopLevelWindow::SetSizeHints()
work in wxQt) because it breaks some wxSizer tests. and more importantly, it
breaks the documented behaviour of SetMinSize() which says:
Notice that calling this method doesn't prevent the program from making the
window explicitly smaller than the specified size by calling SetSize(), it just
ensures that it won't become smaller than this size during the automatic layout.
Using both wxDEPRECATED_MSG and wxNODISCARD for some reason breaks
compilation with clang (when using C++17 or newer standard).
Since wxBasicString::Get() is deprecated, one warning should be enough
so just remove wxNODISCARD from the method declaration.
Closes#23952.
Also make it clear that wxCHOICE_{HEIGHT,WIDTH} constants are not really
used for anything.
Closes#23949.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
The new function only returns true if the catalog could be really
loaded and not if it is considered not to be needed because the message
ID language (which is typically "en-US") happens to be present in the
preferred UI languages list (which seems to always include "en-US" in at
least Western European MSW).
This allows to distinguish, albeit in a rather awkward (but
backwards-compatible) way between having a translation for the given
language and not needed such translation.
It is still not clear if it is really correct to return "en-US" from the
list of preferred languages even if the user has never intentionally
configured the OS to indicate that English is acceptable, but at least
now we can work around this issue and use AddAvailableCatalog() in
AddStdCatalog() to make sure we only skip loading unversioned wxstd.mo
if the versioned wxstd-x.y.mo file is really found instead of never
doing it, as was the case until now (see #23886).
Also add GetBestAvailableTranslation() helper which seems more useful
than the existing GetBestTranslation() one and is similarly related to
it.
See #18227.
Improve consistency of checkboxes in wxListCtrl between virtual and
report mode, and between the generic and MSW implementation, see #23869.
Also disable WS_EX_COMPOSITED for virtual wxListCtrl because it
generates an endless stream of cache events, see #23878.
See #23890.
Override Set{Min,Max}Size and DoSetSizeHints() to pass size information
to Qt: setting min/max widget size at the wxWidgets level is not enough
to take effect unless the information is also set at the Qt level.
Closes#23917.
When calling wxSimplebook::ChangeSelection(), the focus remained on the
previous, now hidden, page, unless it was explicitly set to one of the
controls on the new page.
This was completely unexpected as it could result in the user
(inadvertently) changing the values of the already "accepted" controls
on the last page, so don't let this happen and always set the focus to
the new page explicitly, even if this hasn't been done by
ShowWithEffect() which doesn't do it at least under wxMSW.
Closes#23914.
Change wxTreeCtrl default style under wxMSW to make it look more
up-to-date by default: use twisting buttons and full-row highlight and
don't display connector lines.
Using wxTR_LINES_AT_ROOT together with wxTR_NO_LINES may look odd but it
is needed because without wxTR_LINES_AT_ROOT, the buttons would not be
displayed.
Also update wxTreeCtrl screenshot in the docs.
Closes#23844.
Postpone calling this function until we get the (first) frame callback
as by this time the EGL context is fully valid and can be used inside it
and it doesn't fail any longer.
Blend mask with alpha channel and remove the mask.
We need this function for performance reasons. e.g. the wxImageList (used by
wxTreeCtrl and wxListCtrl) calls this function to convert the mask (if any)
to alpha. Because the controls (under wxQt) using the image list ignore the
mask on the bitmaps and expect alpha instead.
This is similar to MSWBlendMaskWithAlpha() found in wxMSW port.
Store two possible action codes in std::pair instead of packing them
into one int value with bitmasks. This reduces level of indirection
in accessing keyboard actions and make the code more maintainable.
wxPG_PROP_ACTIVE_BTN used in wxStringProperty is misinterpreted
as wxPG_PROP_PASSWORD so these flags they can't share the same value
(wxPG_PROP_CLASS_SPECIFIC_2).
Closes#23856.
The changes of 5f17915e63 (Store original command line options passed to
main(), 2023-09-02) didn't account for the possibility of the
application using an entry point such as wxEntry(), wxEntryStart() or
wxInitialize() with wide character argv under Unix -- where this is
typically not the case but still possible and if any of the wide string
overloads of these functions were called, wxInitData::arg[cv] remained
uninitialized resulting in a crash in gtk_init_check() later.
Fix this by ensuring we do initialize them in this case too and also
reconstruct the original narrow string argvA from wide string arguments
in this case, which is a bit wasteful but unavoidable if we're not
provided access to the original main() arguments.
See #23877.