Commit graph

20517 commits

Author SHA1 Message Date
Tobias Taschner
b9e776ae43 Allow calling wxWebViewEdge::SetUserAgent() after Create()
Additionally implement wxWebViewEdge::GetUserAgent() via SDK.

This functionality is available with the slightly newer
WebView2 SDK required by previous changes.

See #23225.
2023-02-06 13:55:30 +01:00
Artur Wieczorek
dce28fe788 Mark deprecated variables as used internally
When v3.2 compatibility is enabled all deprecated variables are still
present and initialized.
2023-02-05 20:08:00 +01:00
Artur Wieczorek
159c3b1c6d Don't cache strings and variant values in wxPGGlobalVarsClass
Optimization gain is doubtful but complexity is high.
2023-02-05 19:07:25 +01:00
Pavel Tyunin
31ca15fa47
Add noexcept to wxString::swap() 2023-02-03 22:09:52 +02:00
Pavel Tyunin
e438079485
Add non-member swap to wxString 2023-02-03 22:09:52 +02:00
Pavel Tyunin
bcda42a082
Add rvalue versions of wxString assignment and construction functions 2023-02-03 22:09:52 +02:00
Pavel Tyunin
d00a072dc5
Add move operations to wxString 2023-02-03 22:09:51 +02:00
Vadim Zeitlin
e3e7130d4a Merge branch 'new-redef-fix'
Fix errors due to "new" redefintion.

See #23201.
2023-02-03 15:13:04 +01:00
Vadim Zeitlin
0a1b0fbe01 Merge branch 'msw-about'
Improve generic and MSW "About" dialog appearance.

See #23196.
2023-02-03 15:11:48 +01:00
Vadim Zeitlin
255876075a Merge branch 'xrc-feature'
Add XRC "feature" attribute.

See #23184.
2023-02-03 15:09:55 +01:00
Vadim Zeitlin
ef3c8dd408 Explain why including wx/msw/msvcrt.h is a bad idea
This breaks any use of placement new and so the best solution is to
avoid including this header.
2023-01-31 14:48:45 +00:00
Vadim Zeitlin
6e4d0202ad Work around placement new breakage by wx/msw/msvcrt.h
Including that header breaks any use of placement new, such as the one
in wx/any.h, so we need to explicitly undefine (and then redefine it
back) "new" to make it compile in case wx/msw/msvcrt.h is included
first.
2023-01-31 14:45:04 +00:00
Vadim Zeitlin
0130282987 Create wxPGGlobalVars on demand and not on startup
This is slightly more efficient as it avoids allocating an object which
is possibly not ever going to be used on startup of any application
linking with the propgrid library (at the price of slower access to this
object, but this should never be done in performance-critical parts of
the code, hopefully) and avoids a problem with losing the previously
registered editors when re-initializing wx modules, as wxPython does.

Closes #23165.

See #23187.
2023-01-31 01:26:54 +01:00
Vadim Zeitlin
2969453637 Move copyright to the bottom of the generic About dialog
This is consistent with the native GTK and macOS dialogs and it makes
sense to try be more consistent with them, as the generic version is
used as a fallback under Mac.

Also use a smaller font for the copyright as is customary.
2023-01-30 21:11:42 +01:00
Vadim Zeitlin
dbbf509e18 Fix link when using wxSimplebook both directly and indirectly
This resulted in its base class wxNavigationEnabled<wxBookCtrlBase>
being instantiated both in the application itself (when using it
directly) and inside the wx DLLs (when using another class using the
same base class, but defined in the DLL, such as wxAuiNotebook) and gave
linking errors.

Work around this by explicitly defining wxCompositeBookCtrlBase,
corresponding to this base class, ourselves and export it from the DLL
so that it's the single instance which is always used.

Closes #22805.
2023-01-29 16:26:09 +01:00
Vadim Zeitlin
3fdebc96cd Add support for XRC "feature" attribute
This is a generalization of the existing "platform" attribute and allows
to only include some XRC elements if and only if an arbitrary "feature"
is enabled by the application before loading the XRC document.
2023-01-29 00:54:42 +00: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
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