Commit graph

74062 commits

Author SHA1 Message Date
Artur Wieczorek
ec25a5c83c Execute automated tests for wxPropertyGrid
Move existing manually executed tests in propgrid sample to the test
suite executed automatically.
2023-01-30 17:28:17 +01:00
Vadim Zeitlin
93c6551364 Fix signature of dark-mode related uxtheme.dll functions
They were wrongly declared as taking (which is not very important) and
returning (which was very bad as it resulted to interpreting the return
values incorrectly in optimized builds) Win32 4-byte BOOL instead of the
C++ 1-byte bool that they actually use.

Closes #23169.

See #23186.
2023-01-29 20:35:30 +01:00
Tobias Taschner
12e65399e4 macOS: Fix wxWebViewHandlerRequest::GetDataString
An additional call to wxWebViewHandlerRequest::GetDataString() would
return an empty string because the underlying memory stream wasn't
reset.

Closes #23181.
2023-01-29 20:34:24 +01:00
Maarten Bent
e51bc73659 Work around MSVS 2022 optimizer bug in wxImage::ShrinkBy()
Move "alpha" initialization inside the conditional to ensure that it's
calculated correctly, as it was apparently hoisted out of the loop due
to an optimizer bug otherwise.

This commit is best viewed with Git --color-moved option.

Closes #23164.
2023-01-29 01:50:44 +01:00
Vadim Zeitlin
b91be88c0b Merge branch 'xrc-cleanup'
Modernize and clean up XRC code.

See #23180.
2023-01-29 01:44:45 +01:00
Vadim Zeitlin
429a56cbbc Merge branch 'remove-unused-setup-h-defs'
Remove unused definitions from setup headers.

See #23178.
2023-01-29 01:44:13 +01:00
Stefan Csomor
bf9076e2cd Fix keyboard shortcuts handling in wxWebView under macOS
Feed back selectors on WebView to process them correctly.

See #23174.

Closes #23151.
2023-01-29 01:43:09 +01:00
Blake-Madden
dc7e970177 Initialize some wxString structs members in their declarations
This avoids some spurious -Wmaybe_unitialized warning when using
`std::optional<wxString>` with gcc and is also generally better practice
as it ensures that the fields are always initialized correctly.

Closes #23167.
2023-01-29 01:42:08 +01:00
Vadim Zeitlin
8780422a5a Hide all vectors inside wxXmlResourceInternal
This allows to avoid including <memory> from the public header as user
code shouldn't pay for including the headers used only in wxXmlResource
implementation.

No real changes.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
2f70ace920 Use vector of wxXmlResourceDataRecord objects, not pointers
Yet another simplification and micro-optimization.

Also use range-for loops.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
2c49a6c143 Make wxXmlResource::ms_subclassFactories vector of smart pointers
Replace another (pointer to a) wxVector of raw pointers with a vector of
smart pointers.

This is just another simplification.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
f457f991c6 Make wxXmlResourceDataRecord::Doc a smart pointer
Don't manage the pointer lifetime manually.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
a8e5553176 Use vector of unique_ptr<> instead of raw pointers
Make the code more robust by avoiding manual memory management.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
7b542ed141 Remove "xrc" tag from XRC test disabled by default
This test is only supposed to be executed by giving its name on the
command line, specifying "[xrc]" shouldn't enable it.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
af9260a483 Replace another wxVector with std::vector
No real changes, just simplify the code a little and use range for.
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
11659cbfd5 Replace wxVector<wxIdRange*> with std::vector<wxIdRange>
Don't use heap-allocated pointers needlessly, when we can just use the
values directly.

Also remove the useless Find() and FindRangeForItem() functions as it's
just as simple to iterate over all items than to call them.

We may want to use a map instead of a vector here later, but for now
this is already a simplification (and a micro optimization).
2023-01-27 02:14:57 +00:00
Vadim Zeitlin
101efe5fd6 Use std::unordered_set<> instead of WX_DECLARE_HASH_SET_PTR
Get rid of the ugly macro and just use the standard class directly.

No real changes.
2023-01-27 01:51:44 +00:00
Vadim Zeitlin
b4f1ae68b5 Update bundled zlib to 1.2.13.1
This fixes CVE-2022-37434 (which shouldn't normally affect the use of
zlib in wxWidgets but it still seems better to not have it than to
have).

Closes #22919.
2023-01-26 23:41:10 +01:00
Vadim Zeitlin
c076721af7 Remove NEED_PBT_H not used any longer
It is not used nor defined since f1a6c1d024 (Don't include pbt.h from
wxMSW code unnecessarily., 2011-11-29).
2023-01-26 17:45:10 +01:00
Vadim Zeitlin
2433e201e4 Remove HAVE_RE_SEARCH
It is not used any longer since removing non-PCRE-based wxRegEx
implementation.
2023-01-26 17:43:54 +01:00
Vadim Zeitlin
fa84aa7605 Remove unused non-PCRE code from wxRegEx implementation
As no catastrophic problems with using PCRE have been discovered (or, at
least, reported), it should be safe to completely remove all the remains
of the non-PCRE version now.

See #22924.
2023-01-26 17:43:08 +01:00
Vadim Zeitlin
6a47ee1b0c Remove PACKAGE_XXX definitions from Xcode config header
They were not used anyhow and could conflict with the other packages
defining them.

We also don't need to update the version in this file now.

See #23162.
2023-01-26 17:36:14 +01:00
Vadim Zeitlin
f205dca9dc Remove wxUSE_UNICODE definition from VMS setup.h
It can't be defined as 0 any longer and will always be 1 anyhow.
2023-01-26 17:32:55 +01:00
Vadim Zeitlin
4060201f77 Remove __DOS__ definition
This is another one which wasn't used since an awfully long time.
2023-01-26 17:32:09 +01:00
Vadim Zeitlin
eb22752516 Remove long obsolete hack for MacTypes compilation problem
This is not relevant and we shouldn't have this __Point__ in our headers
any longer.
2023-01-26 17:31:18 +01:00
Vadim Zeitlin
e5380e739b Remove Alpha architecture detection
This architecture doesn't exist and is not supported since a very long
time, so stop testing for it and defining __ALPHA__ which was never used
anyhow.
2023-01-26 17:31:05 +01:00
Vadim Zeitlin
15e556e027 Remove vestiges of PowerPC support
It may still be supported for wxGTK, but we don't need to do anything
special for it, so we don't need to define __POWERPC__, which was never
used anyhow, neither.
2023-01-26 17:27:48 +01:00
Vadim Zeitlin
e039d78ed3 Remove CONST_COMPATIBILITY which was never used
It already wasn't used in c801d85f15 (Initial revision, 1998-05-20).
2023-01-26 17:24:58 +01:00
Vadim Zeitlin
67ad244a94 Merge branch 'joystick-sample' of https://github.com/MaartenBent/wxWidgets
wxJoystick-related improvements.

See #23175.
2023-01-25 14:27:20 +01:00
ali kettab
eeaef96d82 Fix initializing wxFont from wxNativeFontInfo in wxQt
Don't round the fractional point size.

Closes #23163.
2023-01-25 14:20:42 +01:00
Vadim Zeitlin
b0056f8ce5 Re-re-enable using pkg-config when targeting Linux systems
The change of 7899850496 (Do use host-specific pkg-config when
cross-compiling, 2022-12-15) should have been done in addition to the
previous logic instead of replacing it, as it has resulted in not using
pkg-config any more when targeting Linux systems, which wasn't the
intention.

So re-apply the changes of d6ddfe87e1 (Disable build system pkg-config
when cross-compiling to non-Linux, 2022-11-30) to handle cross-compiling
to Linux specially.

This makes the logic even uglier than before, but it still seems like
the most pragmatic solution and the original intention was always to do
this and not the wrongly simplified version that was actually applied.

See #22886, #23037, #23171.
2023-01-25 01:12:36 +01:00
Maarten Bent
601f8c840c
Update joystick sample
Draw on a wxPanel, there is no need for a wxScrolledWindow.
Remove unused constructor arguments.
Use wxID_EXIT instead of JOYTEST_QUIT.
Show in the statusbar which buttons are pressed.

Remove wxClientDC and draw in the paint handler instead.
Use different colours for the first 4 buttons.
Fix size and drawing coordinates when using high DPI.
2023-01-24 23:20:27 +01:00
Maarten Bent
ab12443d0f
Fix determining joystick product name
Check both HKCU and HKL registry.
Fixes #23172
2023-01-24 22:15:59 +01:00
Paul Cornett
997d20e0b2 Update TLW size before showing on Wayland when decoration size becomes known
Fixes initial TLW size being larger than requested
See #23041
2023-01-24 09:43:00 -08:00
Artur Wieczorek
c0b1d371b0 Include proper header file
std::acumulate is declared in <numeric> header.
2023-01-22 20:34:47 +01:00
Artur Wieczorek
c64e504b73 Avoid implicit conversions 2023-01-22 20:23:11 +01:00
Artur Wieczorek
266dc567fb Get rid of declaration of unused class in propgrid sample 2023-01-22 20:22:28 +01:00
Artur Wieczorek
e7b405ec08 Refactor internal flags in wxPropertyGrid
Move wxPropertyGrid and wxPropertyGridManager internal flags
from global namespace to the corresponding classes.
2023-01-22 20:18:40 +01:00
Artur Wieczorek
d0ed852bae Use std::array instead of raw array in wxPGProperty 2023-01-22 20:17:00 +01:00
Artur Wieczorek
5b92a7badc Use constexpr to declare constants in wxPropertyGrid 2023-01-22 20:15:01 +01:00
Artur Wieczorek
b727e47df7 Simplify sorting children of wxPGProperty 2023-01-22 20:13:48 +01:00
Artur Wieczorek
4c463c416d Use std::vector instead of wxVector in wxPropertyGrid 2023-01-22 20:11:43 +01:00
Jens Göpfert
842ca1e8b8 Improve ScrollTo() when using wxDV_VARIABLE_LINE_HEIGHT
Calculate the last visible item based on item position instead of the
first visible row when using variable line heights.

Also extend the sample for testing EnsureVisible with item and column.

Closes #23102.

Closes #23128.
2023-01-19 21:02:13 +00:00
Vadim Zeitlin
38bc9c2a8d Merge branch 'generic-listctrl-improv'
Fix margins in generic wxListCtrl and modernize its code.

See #23156.
2023-01-19 21:48:51 +01:00
David Connet
ed14fd19d2 Fix WXWIN_COMPATIBILITY_3_2 test in wxMSW wxRadioBox declaration
Avoid the warning and actually behave correctly when
WXWIN_COMPATIBILITY_3_2==0 by replacing the wrong "#ifdef" added in
c216744f78 (Deprecate MSW-specific wxRadioBox::Set{Label,Button}Font(),
2022-12-24) with the correct "#if".

Closes #23161.
2023-01-19 21:27:24 +01:00
Vadim Zeitlin
c966b7abd1 Exclude a few more files from the distribution archive
Exclude Git-specific .mailmap and the config files for the other CI
services for consistency with the already excluded ones for GitHub
Actions and AppVeyor CI.

This results in less clatter at the top level for the source archives.
2023-01-19 14:57:46 +01:00
Stefan Csomor
a8937c394d
always transfer font family (#23158)
see #23144

only doing this when no font name was given lead to a test failure in richtextctrltest.cpp RichTextCtrlTestCase::Font
2023-01-19 14:20:31 +01:00
Vadim Zeitlin
b6937799e6 Store wxListLineData objects, not pointers, in the vector
This could be a noticeable optimization as it should be much more
efficient to store many lines in a single block of memory instead of
using pointers to them and it also simplifies the code as we don't need
to delete the pointers any more.
2023-01-19 02:11:43 +01:00
Vadim Zeitlin
93da9ff74e Use std::unique_ptr<> in wxListLineData and make it movable
Don't manage the pointer lifetime manually but use a smart pointer for
it: this is simpler and allows to make this class default-movable.

Also make it non-copyable as it never actually was (copying it would
have resulted in a double free of the owned pointer).
2023-01-19 02:11:43 +01:00
Vadim Zeitlin
f62047f867 Replace wxList classes used in wxGenericListCtrl with vectors
This simplifies the code and avoids unnecessary heap allocations as we
can store the objects in the vectors directly instead of storing
pointers to them.
2023-01-19 02:11:43 +01:00