Commit graph

74871 commits

Author SHA1 Message Date
Vadim Zeitlin
2b6be286ee Fix using generated wx-config in CMake builds
Since 1c64bd506c (Use grep instead of fgrep and egrep, 2023-05-10) EGREP
wasn't defined in CMake build any longer, so finding the correct config
script always failed.

Fix this by using "grep -E" directly instead of "$EGREP".
2023-06-12 20:46:57 +02:00
Vadim Zeitlin
27aa7e90a7 Merge branch 'gtk-fixes-textctrl' of https://github.com/dsa-t/wxWidgets
Really fix wxTextCtrl size computation in wxGTK and improve
wxTreeTextCtrl positioning in wxTreeCtrl.

See #23001.

Closes #23610.

See #23623.
2023-06-10 17:09:53 +02:00
Richard Powell
6c35c708d5 Fix -Wdeprecated-copy warnings when building in C++20 mode
Avoid implicit copy constructor warnings by using
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN_DEF_COPY/wxDECLARE_NO_ASSIGN_DEF_COPY
instead of wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN.

Closes #23625.

Closes #23626.
2023-06-10 17:02:13 +02:00
matyalatte
c8fcb0be8f Fix a linker error when wxUSE_PROTOCOL_FILE is off
Fix a linker error for wxProtocolUsewxFileProto when wxUSE_PROTOCOL_FILE
is off but wxUSE_PROTOCOL is on.

Closes #23629.
2023-06-10 17:00:09 +02:00
Alex Shvartzkop
210884ac52 Better positioning for wxTreeTextCtrl. 2023-06-09 18:24:50 +03:00
Alex Shvartzkop
17b72d372f Use calculated margins in wxTextCtrl::DoGetSizeFromTextSize
instead of hardcoded for single-line controls.
2023-06-08 22:04:20 +03:00
Alex Shvartzkop
f9eea9fdfd Gets rid of gtk_entry_get_layout_offsets in GTKGetEntryMargins
due to returning invalid values when used before size_allocate.

Using padding + border on GTK3 and thickness + inner border on GTK2
looks correct.
2023-06-08 21:28:12 +03:00
Vadim Zeitlin
58c49d06fa Minor updates to wxUIActionSimulator documentation
Don't say that it's experimental in configure but do mention that it
doesn't work under Wayland.

Closes #23619.
2023-06-08 01:26:16 +02:00
Tobias Taschner
db09adf6b5 Include macOS 14 name in wxGetOsDescription()
Recognize macOS Sonoma too.

Closes #23615.
2023-06-06 21:20:00 +02:00
Maarten Bent
a801057f1a CMake: Check and enable use of libxkbcommon
CMake's has built-in support for checking xkbcommon using FindX11 since
3.18.

But because older CMake versions are supported, add our own module that
checks if the header and library is available.

See #23410.

Closes #23613.
2023-06-06 21:18:48 +02:00
PB
241ed70b5b Copy all data files needed by XRC sample when building with CMake
XPM files demonstrating the use of wxBitmapBundle in the XRC files
were not copied when building the XRC sample with CMake.

This should have been part of eaa769a (Use wxBitmapBundle in
wxBitmapComboBox XRC handler, 2022-02-09).

Closes #23612.
2023-06-06 21:18:03 +02:00
matyalatte
609b7e2535 Fix compile errors for wxNO_RTTI with some controls disabled
Fix compilation errors when wxNO_RTTI and wxUSE_UIACTIONSIMULATOR are
on, but one or more of wxUSE_COMBOBOX, wxUSE_CHOICE and wxUSE_LISTBOX
are off.

Closes #23611.
2023-06-06 21:16:59 +02:00
Vadim Zeitlin
d80887f302 Merge branch 'listctrl-dark-win11'
Fixes for wxListCtrl drawing under Windows 11 in dark mode and drawing
when using WS_EX_COMPOSITED.

See #23608.
2023-06-05 15:32:58 +02:00
Vadim Zeitlin
4c8ec0ed5d Revert "Add wxWindow::MSWAfterReparent() virtual function"
This reverts commit cd637663c8 (Add wxWindow::MSWAfterReparent() virtual
function, 2022-10-16) and removes wxListCtrl::MSWAfterReparent() added
in ff629f3853 (Fix drawing wxListCtrl since enabling double buffering by
default, 2022-10-16) which is not used any more now.
2023-06-05 14:30:56 +01:00
Brian Nixon
381c39a051 Clear grid attribute cache when loading new table
Clear the cached attributes when replacing the table they were used
with.

Add unit test checking that the attributes are not used any longer.

Closes #23607.
2023-06-05 15:22:49 +02:00
Brian Nixon
567a66aac2 Remove dependency of wxUSE_SOCKETS on wxUSE_STOPWATCH
It isn't actually needed, so don't check for it in wx/chkconf.h and
remove the comment claiming that it is from various setup.h files.

Closes #23609.
2023-06-05 15:13:21 +02:00
Vadim Zeitlin
15e4f5b185 Work around wxListCtrl repainting problems with WS_EX_COMPOSITED
It seems that simply creating wxPaintDC, i.e. calling BeginPaint(),
ourselves and then letting the native control draw into it, disables
whichever optimizations are used by the control that break its drawing
with WS_EX_COMPOSITED, so always do this in our OnPaint(), even if we
don't need to draw anything ourselves.

This allows to avoid disabling WS_EX_COMPOSITED when wxListCtrl is used,
which resulted in horrible flicker before.

See #23585.
2023-06-05 00:55:53 +01:00
Vadim Zeitlin
9710592cc4 Erase unwanted list view separators in dark mode under Windows 11
For some reason, "DarkMode_Explorer" theme started drawing vertical item
separators under Windows 11 even though it did not do this under Windows
10. These separators are unwanted, as they are not shown in the Explorer
list control that we try to emulate, and look ugly because they are
shifted by 1px compared to the separators drawn by the header control
with "ItemsView" theme, which is the only one in which the header looks
right in dark mode.

So explicitly erase everything below the last item when using dark mode
under Windows 11 to get rid of these separators.
2023-06-05 00:55:53 +01:00
Vadim Zeitlin
4cd1483122 Draw all wxListCtrl items ourselves in dark mode
Unfortunately drawing just the selected item ourselves and let the
control draw all the other ones doesn't work too well as the offsets
used for the items differ between Windows versions and so it's difficult
to get them right, but getting them wrong is very noticeable as when
browsing through the control the current item seems to jump because it's
shifted compared to the other ones.

So just draw all the items ourselves: this is not as nice as letting
Windows do it, but it ensures that they use consistent positions.
2023-06-05 00:55:53 +01:00
Vadim Zeitlin
456449bcc1 Support wxWinVersion_11 in the private wxGetWinVersion() helper
This can be more convenient to use than public functions and it's just
better to support all Windows versions in this function too.
2023-06-05 00:55:53 +01:00
Brian Nixon
b9d0541f9a Make wxSocket::Peek() work with UDP too
Fix wxSocketImpl::RecvDgram() when caller requests fewer bytes than
are present in datagram, as we must always read all the available bytes
when using UDP -- they are not buffered by the OS and so won't be
provided by the next Read() call.

Closes #23594.

Closes #23604.
2023-06-05 01:49:41 +02:00
Vadim Zeitlin
5546733c12 Merge branch 'qt-dc-clip' of https://github.com/AliKet/wxWidgets
Fix wxDC and wxGCDC clipping in wxQt.

See #23600.
2023-06-05 01:47:15 +02:00
Vadim Zeitlin
54a2eb1687 Restore setting CRT locale in wxLocale under macOS
This was accidentally broken by the previous changes and the C-level
locale was not set at all any more, even when using wxLocale (and not
just wxUILocale, which is not supposed to set it) under macOS.

Fix this by explicitly calling setlocale() on this platform to restore
the previous, and documented, behaviour.

Closes #23557.

See #23603.
2023-06-05 01:46:27 +02:00
Brian Nixon
b473163da2 Correct delta-RLE bitmap background colour
Use black instead of the first palette colour for the implicit
background for RLE bitmaps for consistency with Windows itself.

Closes #23599.
2023-06-04 00:38:39 +02:00
Vadim Zeitlin
4c94d5d1e5 Merge branch 'dark-statusbar'
Fixes for status bar and dialog grippers appearance in dark mode.

See #23602.
2023-06-03 22:20:32 +01:00
ali kettab
d06c00f466 Remove no longer used code from wxGCDCImpl::DestroyClippingRegion()
None of the major ports need the removed code anyhow. We can always restore it
later if any of the (still) supported ports are affected by this removal.
2023-06-03 20:49:06 +01:00
Brian Nixon
d78e9fb1cb Correct loading of BI_BITFIELDS bitmaps
This fixes several minor bugs in the loading of `BI_BITFIELDS` bitmaps,
related to handling different header sizes and the colour and alpha
masks.

Closes #23601.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
6bba7055aa Exclude descrip.mms files everywhere from the whitespace check
Previously only the top-level one was excluded, but others use TABs too.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
e95073c24b Merge branch 'init-keyevent-repeat'
Ensure that wxKeyEvent::m_isRepeat is initialized.

See #23596.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
1a1790350f Merge branch 'htmllbox-fix-ub'
Fix undefined behaviour in wxHtmlListBox::OnDrawItem().

See #23595.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
a3e925df0a Merge branch 'mac-uilocale-script-fix'
Locale-related fixes for macOS and new calendar names localization
functions.

Closes #23209.

See #23556.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
946aa6bbc4 Remove redundant "const" from wxItemId conversion operator
This "const" is ignored and just results in a warning from MSVS 17.6.

Closes #23590.
2023-06-03 21:07:40 +02:00
Ian McInerney
5d0c4066d8 Add operators for boolean conversions to wxPGGlobalVars
The old API allowed for users to directly test the variable and find if
it was null, so recreate that API with the new system to preserve
compatibility.

Closes #23445.
2023-06-03 21:07:40 +02:00
Vadim Zeitlin
8f423fc48d Use TABP_PANE constant in wxNotebook code
This constant was already used in wxAuiMSWTabArt, so there are clearly
no problems with using it with the currently supported compilers/SDKs.

No real changes.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
b7c89669ba Draw wxStatusBar gripper ourselves in dark mode
The "ExplorerStatusBar" theme used to make the rest of the status bar
appear (almost) correctly in dark mode doesn't seem to define SP_GRIPPER
at all and doesn't draw it, so handle WM_PAINT and draw the gripper
ourselves using "Status" theme, which looks fine in dark mode too.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
0e3f010eec Add wxUxThemeHandle::GetTrueSize() and GetDrawSize() helpers
These functions are more convenient to use and, arguably, more clear to
read than calls to ::GetThemePartSize(), so add these wrappers and
replace most of the uses of the Win32 function with them.

This shouldn't result in any real changes to behaviour.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
ef93da3160 Add wxUxThemeHandle::DrawBackground() wrapper and use it
This is sightly shorter/more convenient to use than providing all the
parameters to ::DrawThemeBackground() every time.

Similarly to ca5f244f15 (Add wxUxThemeHandle::GetColour() replacing
MSWGetThemeColour(), 2022-12-09), this is just a refactoring which
shouldn't result in any changes in behaviour.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
259a487475 Add support for getting theme data for non-default DPI too
Use OpenThemeDataForDpi() if necessary to retrieve the correct metrics
values for non-default DPI.

Change the existing wxUxThemeHandle ctor taking wxWindow to use the
window DPI automatically and replace the ctor taking HWND with a pair of
functions either explicitly specifying the DPI or indicating that it is
not used -- the latter can be useful to avoid unnecessary complications
when the theme is only used to retrieve some colour values that don't
depend on the DPI anyhow.

Also make wxUxThemeHandle class movable as a side, but possibly useful,
effect of these changes.
2023-06-03 19:18:57 +01:00
Vadim Zeitlin
d6ec8ea1ea Use wxUxThemeHandle overload taking wxWindow in menu drawing code
This is simpler than calling GetHwndOf() in the caller, but otherwise
does exactly the same thing right now.
2023-06-03 19:18:56 +01:00
Vadim Zeitlin
3e055eeac5 Reuse wxGetTopLevelParent() in wxStatusBar code
No real changes, just use the existing function instead of redoing what
it does.
2023-06-03 19:18:56 +01:00
Vadim Zeitlin
e0ec525680 Use vector instead of C array in wxStatusBar code
No real changes, just avoid manual memory allocation.
2023-06-03 19:18:56 +01:00
Vadim Zeitlin
341be192bf Fix drawing of the dialog size grip in dark mode
We need to manually adjust the background of this window as it uses
fixed background colour, which is wrong even in the default light mode
if the dialog uses a different background colour, and wrong even with
the default background in dark mode (where the gripper uses #383838
while the default dialog background is #202020).

Reuse the CustomPaint() function which was already used for drawing some
other controls in dark mode to do it.
2023-06-03 19:18:56 +01:00
Vadim Zeitlin
3bf953bcc3 Factor out CustomPaint() function from dark mode code
No real changes yet, just make it possible to use the function
customizing the default WM_PAINT handle from other places too.
2023-06-03 19:15:12 +01:00
Artur Wieczorek
57a9247889 Fix wxPG_PROP_ACTIVE_BTN flag definition
wxPG_PROP_ACTIVE_BTN and wxPG_PROP_SHOW_FULL_FILENAME can be used together
(like e.g. in wxFileProperty) so they can't share the same value
(wxPG_PROP_CLASS_SPECIFIC_1).

Closes #23565.
2023-06-03 00:07:45 +02:00
ali kettab
1033770999 Make wxGCDC clipping works correctly in wxQt 2023-06-02 19:35:12 +01:00
ali kettab
61e3c65872 Simplify setting the clipping region in QtPreparePainter() 2023-06-02 19:14:06 +01:00
ali kettab
ec6e78ab92 Reimplement DoSetClippingRegion() and DoSetDeviceClippingRegion()
For one hand this is a simplification. In the other hand, SetClippingRegion()
and SetDeviceClippingRegion() are both working the same as in the other ports.
2023-06-02 19:05:23 +01:00
ali kettab
f26f1cc701 Fix wxDC::GetClippingBox() in wxQt 2023-06-02 18:38:08 +01:00
Vadim Zeitlin
865def904b Merge branch 'html-dark-mode'
Fixes for wxHtmlWindow in dark mode.

See #23588.
2023-06-02 19:15:45 +02:00
Vadim Zeitlin
30de30eec1 Merge branch 'rle-bitmaps'
Fix loading RLE bitmaps in wxMSW.

See #23573, #23584.
2023-06-02 19:14:36 +02:00