Restore correct translation language lookup taking into account message
IDs language correctly when it is present in the preferred UI languages
but is not the first language in them and other similar corner cases.
Also add unit tests verifying that this code logic, already changed many
times in the past, does behave correctly now.
See #24297.
Use wxOverlay to show sash feedback in wxAUI and in wxSplitterWindow to
implement non-live resizing in ports where it didn't work before (wxGTK3
with Wayland, wxOSX).
See #24193.
The list control needs to be updated after the user has edited an item
label because, for example, in icon view the column width and positions
of subsequent columns may change if the edited label is or was wider
than the icons and other labels in the column.
Closes#24311.
Add support for overriding GetPreferredUILanguages() return value by
setting the WXLANGUAGE environment variable to a colon-separated list
of desired languages (same as GNU's LANGUAGE variable).
Primarily used for unit tests, but may be more generally useful.
Knowing msgIdLanguage is necessary for correct evaluation of preferred
languages order; without it, it would be possible to load undesirable
translation file.
See 2af36e9560 for details.
This commit partially reverts 94b1a17aeb.
The above commit changed translation lookup logic to differentiate
between msgid and "available" translations (the latter being loaded from
a file or resource). It first attempted to use available translations
and only felt back to msgid language as the last resort.
Unfortunately, doing that broke lookup in cases when the user had msgid
language as not-last preference in their UI languages list, or even when
a similar translation was available. For example:
- msgid=en, user preference [cs,en,fr], only fr.po available: fr would
be used instead of en
- msgid=en_US or en, user preference [en], but en_GB.po available:
British English would be used even for US users
This commit fixes this by restoring the previous behavior where msgid
language was treated as a first-class citizen in lookup, while
preserving the API that allows distinguishing between the two cases.
It also reimplements AddStdCatalog() in a more straightforward way that
doesn't rely on AddAvailableCatalog().
Implicitly capturing "this" is deprecated in C++20, so do it explicitly,
even if it also requires explicitly capturing everything else as
combining implicit capture with explicitly capturing "this" is not
allowed in the previous C++ versions.
Ensure that all member variables are initialized instead of initializing
just some of them in the ctor and leaving others uninitialized, it's
simpler to just do this rather than to check if uninitialized values can
or not be used.
This was useful when we had AlwaysUsesLiveResize() and the related
complications, but now that live resizing is governed solely by
wxSP_LIVE_UPDATE again, it's not needed any longer.
No real changes.
- Support wxGLContext::SetCurrent.
- Pass GL canvas attributes via ParseAttribList to handle defaults.
- Remove OpenGL not implemented message.
- Prevent QGLWidget from changing OpenGL state before we paint.
- Set Qt::StrongFocus for wxQtGLWidget to allow keyboard input.
- Use QtCanPaintWithoutActivePainter to fix wxPaintDCImpl assert when using wxGLCanvas.
Refactor the code to use wxMessageDialog attributes (such as label,
style etc) values at the moment when the dialog is shown, not when it is
created. This still doesn't handle changing them after showing the
dialog before showing them again, but this is a much more rare use case
than creating the dialog and then setting its attributes later.
There should be no changes in behaviour.
GetBestTranslation() and GetBestAvailableTranslation() are documented to
return an empty string if they find no match, but actually didn't do
that due to the way GetPreferredUILanguage() was implemented to always
fall back to the locale and return it without additional checks.
The main advantage of using wxOverlay over wxFrame, besides reduced
code complexity, is that the docking hint now works correctly under
Wayland which it didn't work before.
wxAUI_MGR_RECTANGLE_HINT now works everywhere (including wxGTK and wxOSX)
We simply use a bitmap to draw the venetian blinds hint instead of the
exotic and esoteric code using wxRegion.
wxGTK2 now uses graphics context for transparency. If not available, the hint
will be drawn using wxINVERT raster operation mode.
This Workaround is needed because the DC used to draw on the wxOverlay clips
children by default under wxGTK2. This means that the sash will always appear
behind the sub-windows. making wxOverlay worthless under this platforms.
Notice that calling gdk_gc_set_subwindow() unconditionally in Destroy() is cheap
when DontClipSubWindows() has never been called.
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.
Also remove no longer needed function AlwaysUsesLiveUpdate and its documentation.
Make non-live resizing possible on all supported platforms thanks to wxOverlay.
Previously, live resizing was the only supported mode under these platforms:
wxMac, wxQt and wxGTK3 under Wayland.
By default, wxMSW overlay uses a constant alpha for the window's opacity which
can be changed by the added wxOverlay::SetOpacity() function. For some applications,
that's all they need. But for others, per-pixel alpha blending is a requirement.
This capability can be enabled by calling SetOpacity(-1) before initializing the
overlay. But the drawing must be done via a graphics context because the standard DC
under MSW does not support alpha drawing.
Also request that the overlay window be positioned below any floating windows
on the target (if any).
This used to be possible in 3.0 but was disallowed back in 29bf859fae
(Check if new index is in range before selecting new value in
wxPGProperty::SetChoiceSelection., 2014-11-29). However there doesn't
seem to be any real harm in still allowing to do this, so handle -1 as a
special case here.
Closes#24279.
Closes#24281.
Calling Hostname() when constructing wxIPV4address from an already
resolved IP address is unnecessary and can be slow, so don't do it and
just use the string representation of the IP address as "m_origHostname"
instead.
Closes#23109.
Closes#24269.
The only real change in this commit is the use of wxRound() instead of
truncating cast to int when rescaling icons.
The rest consists of just some cleanup:
- Initialize (mostly) pointer member variables in their declaration.
- Remove wxT() from strings.
- Replace checks for __WXMAC__ with checks for __WXOSX__.
- Replace macros with lambda functions.
- Add "explicit"
- Replace wxString::IsEmpty() with empty().
- Use wxNOT_FOUND instead of -1.
- Use static_cast<> instead of C-style casts.
Closes#24261.