Commit graph

20501 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Vadim Zeitlin
a5777cdcbd Make wxListItemData movable and not copyable
This class contains (sometimes) owned pointers and so can't be copied
but it can be moved, so make it moveable.

No real changes, this is done in preparation for storing objects of this
type in a std::vector.
2023-01-19 02:11:43 +01:00
Vadim Zeitlin
f547bf0647 Replace wxListItemData::Init() with member initialization
Get rid of Init() function and just initialize all the members in their
declarations, as this is less verbose, more clear and more robust.

Note that we also initialize m_rect now, which was left uninitialized by
Init() before, as it's simpler and more reliable to always do even if we
happen to overwrite it in the ctor.
2023-01-19 02:11:43 +01:00
Vadim Zeitlin
53188d30f0 Make wxListHeaderData::GetItem() const
Because there is no reason for it not to be it.
2023-01-19 00:27:24 +00:00
Vadim Zeitlin
b7e7d506c5 Use std::vector instead of wx array in wxGenericListCtrl code
This not only simplifies the code but also makes it more efficient by
avoiding unnecessary heap allocations, as we can now just store the
objects themselves in the vector instead of storing pointers to them.

No real changes, this is just a code cleanup/modernization.
2023-01-18 23:56:55 +00:00
Vadim Zeitlin
b8cff3d5cf Slightly reformat FindOrCreateFont() declaration and add comments
Explain that the new overload is preferred and why.
2023-01-14 15:24:36 +00:00
PB
87b80995a4 Fix wxFontList::FindOrCreateFont() for pixel and fractional point sizes
wxFontList::FindOrCreateFont() worked properly only for integral point sizes.

Make it work also when a pixel size or fractional point size is used.
2023-01-13 21:41:55 +01:00
Vadim Zeitlin
bed3896189 Allow, and even require, semicolon after wxTEST_DIALOG() macro
This macro was documented (in its comment) and even used with a
semicolon after it, but it didn't require one and using one after it
resulted in a warning with gcc in pedantic mode.

Change the macro definition to use wxSTATEMENT_MACRO_BEGIN/END to
require (and, trivially, also allow to be used without warnings) a
semicolon after it now.
2023-01-13 17:27:53 +01:00
Vadim Zeitlin
00c541934d Merge branch 'remove-ansi-branches'
Remove leftover blocks that used to be used in ANSI build.

See #23137.
2023-01-13 16:03:00 +00:00
Vadim Zeitlin
5f6fe1c71b Make wx/debug.h included as first wx header compile again
This was broken by 0f6c54cdb6 (Define __WXFUNCTION__ as __func__ and
don't use it any more, 2022-11-11) which mistakenly removed the
inclusion of wx/cpp.h from here under the belief that it was only needed
for __WXFUNCTION__, as its comment indicated.

But this isn't really the case, so restore the removed #include and just
update its comment.
2023-01-13 16:50:24 +01:00
Vadim Zeitlin
94e3827988 Remove leftover blocks that used to be used in ANSI build
Update some comments and prefer using #if/#else when testing for
wxUSE_UNICODE_UTF8 and wxUSE_UNICODE_WCHAR rather than #if/#elif as
exactly one of them is always defined now. Similarly, test for
wxUSE_UNICODE_WCHAR directly instead of testing !wxUSE_UNICODE_UTF8 and
vice versa.

It could be nice to actually test for just a single one of these symbols
everywhere, but this would require a lot of noisy changes, so for now
keep the code as is.

No real changes, just simplify.
2023-01-12 17:08:59 +00:00
Vadim Zeitlin
3c782927c4 Merge branch 'ci-clang-werror'
Enable -Werror for clang wxMSW CI build.

See #23118.
2023-01-07 16:45:27 +01:00
Artur Wieczorek
f0b76076f4 Encapsulate data in wxPGValidationInfo
Implement more getters and setters to encapsulate data
in wxPGValidationInfo.
2023-01-06 18:06:38 +01:00
Artur Wieczorek
e43190ea79 Code cleanup: wxPGProperty helper classes
Move declarations and implementations of wxPGProperty-related helper
classes to the files containing wxPGProperty (and derived classes) code.
2023-01-06 17:56:49 +01:00
Artur Wieczorek
dec03c5d89 Use dedicated function to get common value label in wxPropertyGrid 2023-01-06 17:51:33 +01:00
Artur Wieczorek
6d9e362b1f Use standard container to store dedicated keys in wxPropertyGrid
Dedicated keys can be stored in std::unordered_set
instead of wxPGHashSetInt.
2023-01-06 17:50:23 +01:00
Artur Wieczorek
dc77fb5bd4 Deprecate unused wxPropertyGrid items 2023-01-06 17:47:59 +01:00
Artur Wieczorek
81cd35a662 Get rid of unused member variables 2023-01-06 17:31:26 +01:00
Artur Wieczorek
3e5b6b4d66 Use standard containers to handle mappings in wxPropertyGrid
Use unordered_map explicitly (instead of using wxPGHashMapS2P alias).
2023-01-06 17:20:54 +01:00
Vadim Zeitlin
e064f6b912 Suppress GetCompositeWindowParts() override warning for clang too
This uses the macro suppressing the warning for both gcc and clang
instead of doing it just for gcc as 58840fe7fd (Suppress unavoidable
-Wsuggest-override in wxCompositeWindow, 2022-12-25) did.

This is more correct and also simpler and shorter.
2023-01-06 00:58:05 +01:00
Vadim Zeitlin
e89f05faba Remove memory debugging/tracing support and all related options
Drop disabled by default and pretty useless memory tracing code and all
the overlapping and poorly documented build options related to it.

Remove memory.cpp entirely and update all the make/project files, but
preserve the now completely trivial wx/memory.h for compatibility and
also keep including wx/string.h from wx/object.h as it seems like a lot
of existing code actually depends on this, even if it should not.

Replace the options in the propgrid sample with a couple of other
debug-related options that were not used before to avoid leaving the
"Debugging Section" completely empty.
2023-01-05 21:41:38 +01:00
Vadim Zeitlin
bdc260bf53 Include wx/string.h from the files that use wxString
Don't rely on this header being implicitly included by wx/object.h even
though it does include it right now.

No real changes.
2023-01-05 18:58:24 +01:00
Vadim Zeitlin
0016bdc308 Merge branch 'dark-mode-collapse-button'
Improve collapse button appearance in dark mode.

See #23098.
2023-01-05 01:56:28 +00:00
Artur Wieczorek
37817d7c38 Include unordered_map header 2022-12-30 15:20:45 +01:00
Artur Wieczorek
c24b9476fa Use unordered_map to store action triggers in wxPropertyGrid
Use standard container explicitly (instead of alias wxPGHashMAPI2I).
2022-12-30 15:13:21 +01:00
Artur Wieczorek
d3c194590d Prevent from instantiation of wxPropertyGridIteratorBase
The purpose of this class is to be a base class
for wxPropertyGridIterator classes.
2022-12-30 14:10:29 +01:00
Artur Wieczorek
6863b0a92d Use default ctor's and dtor's instead of functions with empty bodies 2022-12-30 14:09:04 +01:00
Artur Wieczorek
357f611a48 Simplify returnig two values from wxPropertyGrid::KeyEventToActions()
Use std::pair to return pair of values from function.
2022-12-30 14:08:15 +01:00
Artur Wieczorek
eb630a0781 Fix wxDCClipper
Initial clipping box needs to be stored in device coordinates to allow
restoring it properly if wxDC logical coordinates were changed
in the meantime.

Closes #23083.
2022-12-29 12:39:27 +01:00
Blake-Madden
2ae3d4a015 Add wxNODISCARD to wxBitmapBundle functions
This ensures that static methods are not mistakenly used in the belief
that they change the object they're called on.

Closes #23092.
2022-12-29 01:44:32 +01:00
Vadim Zeitlin
52750c2ee9 Factor our wxMSWDarkMode::InvertBitmap() function
Extract it from PaintIfNecessary() to allow reusing it elsewhere.

No real changes yet.
2022-12-29 00:37:25 +00:00