Commit graph

76239 commits

Author SHA1 Message Date
Václav Slavík
f248f0593c Clarify GetAvailableTranslations() return value
Add a note explaining that the msgid language is not included.
2024-02-13 16:12:57 +01:00
Václav Slavík
f0ed987010 Warn about a GetBestAvailableTranslation() quirk 2024-02-13 16:12:57 +01:00
Václav Slavík
1030147aff Fix AddAvailableCatalog() API
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.
2024-02-13 16:12:56 +01:00
Václav Slavík
2af36e9560 Partially revert "Add AddAvailableCatalog() and use it in AddStdCatalog()"
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().
2024-02-13 16:12:38 +01:00
Vadim Zeitlin
acee397e4c Avoid implicit "this" capture in a lambda to avoid C++20 warning
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.
2024-02-13 02:39:56 +01:00
Vadim Zeitlin
4261e1d07d Erase overlay contents when resetting it in wxOSX
Without this, the old contents continues to be shown for some time
before the display was refreshed.
2024-02-13 01:00:48 +01:00
Vadim Zeitlin
0217f54894 Initialize wxOverlayImpl members in their declarations
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.
2024-02-13 00:43:54 +01:00
Vadim Zeitlin
c4658ec8f2 Get rid of IsLive() helper in wxSplitterWindow code
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.
2024-02-12 22:27:25 +01:00
Vadim Zeitlin
7584c04ff8 Inline DrawResizeHint() function into its only caller
It seems to be more clear to just draw the sash in DrawSashTracker()
itself instead of calling a function which does it.
2024-02-12 22:25:39 +01:00
Vadim Zeitlin
c1325983cf Avoid using "x2" and "y2" for sash width and height
This was confusing, so get rid of these variables and use more clearly
named "posSash" and "sizeSash" instead.

No real changes.
2024-02-12 22:23:40 +01:00
Alex Shvartzkop
bff40b6cb6 Blend mask with alpha for wxCursor initialized from wxImage on wxQt. 2024-02-12 20:11:26 +03:00
Alex Shvartzkop
6aa928d624 Call base class in SetLabel for some widgets on wxQt. 2024-02-12 18:57:33 +03:00
Alex Shvartzkop
afa4294ef1 Support SetLabel/GetLabel for wxRadioBox/wxRadioButton on wxQt. 2024-02-12 18:57:33 +03:00
Alex Shvartzkop
7a0149dfcb Show popup menu at cursor on wxQt if needed. 2024-02-12 18:42:49 +03:00
Alex Shvartzkop
94e73dace5 Protect non-editable wxComboBox from nullptr on wxQt. 2024-02-12 15:34:56 +03:00
Alex Shvartzkop
8730858eae Fix wxStatusBar crash when calling GetFieldRect early on wxQt. 2024-02-12 15:34:56 +03:00
Alex Shvartzkop
966b6e9460 Improve wxQt OpenGL canvas implementation:
- 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.
2024-02-12 15:34:56 +03:00
Vadim Zeitlin
4b1a129f6f Give bigger initial size to the XRC window in propgrid sample
It was too small to show much of anything by default, especially in high
DPI.
2024-02-12 00:51:26 +01:00
Vadim Zeitlin
d445d79508 Don't leave a border around wxPropertyGrid in sample XRC file
This looks ugly under wxMSW where the frame doesn't have the same
background and isn't really necessary.
2024-02-12 00:50:35 +01:00
Vadim Zeitlin
770481613f Fix wxPropertyGrid expand buttons height in high DPI
It was too small, and twice (at 200% scaling) smaller than width,
resulting in tiny and ugly buttons.
2024-02-12 00:49:32 +01:00
Vadim Zeitlin
09fe965219 Add support for custom button labels to Qt wxMessageDialog
Just set the label if it's specified.
2024-02-11 13:53:24 +01:00
Vadim Zeitlin
f3260b3b16 Add support for extended message to Qt wxMessageDialog
After the refactoring of the previous commit it has become trivial to
handle this too.
2024-02-11 13:47:43 +01:00
Vadim Zeitlin
b960271f97 Allow changing wxMessageDialog after creating it
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.
2024-02-11 13:45:42 +01:00
Vadim Zeitlin
4b577f2932 Fix indentation in wxQtMessageDialog
No real changes.
2024-02-11 13:32:52 +01:00
Vadim Zeitlin
d8d562ba1d Remove unnecessary QMessageBox forward declaration from header
This is not used at all.
2024-02-11 13:28:53 +01:00
Vadim Zeitlin
6cc4662651 Don't call PostCreation() for wxMessageDialog
Other dialogs don't do it and it doesn't seem to be really useful for
them.
2024-02-11 13:26:03 +01:00
Vadim Zeitlin
57349c2aaa Fix wxSearchCtrl::GTKGetWindow() added in the previous commit
Use the usual indent and, more importantly, avoid the warning about
unused parameter in wxGTK2 builds which broke CI.
2024-02-11 01:35:01 +01:00
Václav Slavík
34a90ba3af Fix GetBestAvailableTranslation to return no match
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.
2024-02-10 12:55:12 +01:00
AliKet
bad07efa70 wxAuiManager::AlwaysUsesLiveResize() documentation updated
This is no longer true as wxAUI now uses wxOverlay to display the resizing hint
in non-live resize mode, which should work on all platforms.
2024-02-09 23:26:37 +01:00
AliKet
29c8bfc249 Use wxOverlay to show docking hint instead of transparent wxFrame
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.
2024-02-09 23:26:36 +01:00
ali kettab
7491ac5b7a Make wxAUI and wxSplitterWindow work properly with wxOverlay under wxGTK2
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.
2024-02-09 23:26:36 +01:00
ali kettab
a38175885c Use wxOverlay to show sash feedback in non-live resize mode in wxSplitterWindow
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.
2024-02-09 23:26:36 +01:00
ali kettab
fafc714057 Use wxOverlay to show sash feedback in non-live resize mode in wxAUI
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.
2024-02-09 23:26:35 +01:00
AliKet
7b75d0a256 Added per-pixel alpha blending capability to wxOverlay under wxMSW
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).
2024-02-09 23:26:35 +01:00
AliKet
e79466f02b Fix wxOverlay when used with a TLW under wxMSW
Correctly position the overlay window over the TLW's client area.
2024-02-09 23:26:34 +01:00
AliKet
c0140d12c9 Remove unnecessary override from wxOverlayImpl under wxMSW
The base class version already returns true by default.
2024-02-09 22:47:42 +01:00
Paul Cornett
d8c5a87fe3 Partial fix for wxSearchCtrl mouse enter/leave events
The events only occur for part of the widget area,
but it's better than the previous nothing.
See #24245
2024-02-09 12:52:30 -08:00
Vadim Zeitlin
82cb7d1074 Merge branch 'generic-listctrl-center-label'
Fix centering of item label in generic wxListCtrl

See #2340, #24292.
2024-02-09 18:36:53 +01:00
Ian McInerney
9d3b8ba339 Test short labels in the listctrl sample too
This allows to easily verify that they work correctly in the icon view.

See #24292.
2024-02-09 18:35:53 +01:00
taler21
e7dba90bd0 Make auto-grow of in-place editor in generic wxListCtrl work again
Auto-growing of the editor has not worked since the changes of
a8a8915453 (Made code more similar to
wxTreeCtrl' code, 2008-01-10).

Closes #24293.
2024-02-09 17:30:21 +01:00
DietmarSchwertberger
bfc3fcf0f4 Fix grid selection when deleting grid rows or cols
The new selection right/bottom coordinate was off by 1 and could become
invalid.

Closes #24286.
2024-02-09 17:26:17 +01:00
Vadim Zeitlin
308815bafd Merge branch 'msw-button-getdefaultsize'
Fix wxButton::GetDefaultSize() in high DPI under MSW.

See #24285.

Closes #24285.
2024-02-09 17:23:06 +01:00
Vadim Zeitlin
a6cc89777b Allow passing -1 to wxPGProperty::SetChoiceSelection() again
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.
2024-02-09 17:21:52 +01:00
Vadim Zeitlin
33ef342dcc Merge branch 'propgrid-xrc'
Add support for loading wxPropertyGrid from XRC.

See #24274.
2024-02-09 17:20:22 +01:00
Vadim Zeitlin
21255ee197 Document wxIPV4address::Hostname(unsigned long) overload
Just mention that it exists too.
2024-02-09 17:19:49 +01:00
SMMB-DEV
388050513d Don't perform DNS lookup when constructing wxIPV4address from IP
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.
2024-02-09 17:17:14 +01:00
Vadim Zeitlin
a401106da0 Merge branch 'cmake-misc' of https://github.com/MaartenBent/wxWidgets
Miscellaneous CMake improvements.

Note that the new required CMake version is 3.5 now.

See #24263.
2024-02-09 17:12:18 +01:00
Blake Madden
7555bba1bf Modernize ribbon code
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.
2024-02-09 17:04:43 +01:00
taler21
82b5f85418 Fix centering of item label in generic wxListCtrl
The item label was not centered if the icon is wider than the label.
2024-02-08 08:44:20 +01:00
Mark Wagner
8eb3729fec Fix reading GIF images without CLEAR code
The encoder may chose not to emit a CLEAR code when the alphabet is full
according to the specification, but wxGIFDecoder assumed it always did,
preventing it from reading some valid GIF files (in practice, most often
animated ones).

This commit is best viewed ignoring whitespace-only changes.

Closes #22799.

Closes #24234.
2024-02-06 19:14:20 +01:00