Commit graph

74255 commits

Author SHA1 Message Date
Vadim Zeitlin
ff0a255a80 Replace wxGenericAboutDialog::Init() with member initialization
No real changes, just modernize the code a bit.
2023-02-23 19:07:25 +00:00
Vadim Zeitlin
964f2ee0c5 Stop centering text in the generic "About" dialog
This didn't look good with the icon on the left, so left-justify the
text too, which also seems to be much more standard under MSW, where
this dialog is probably going to be used most often.
2023-02-23 19:03:59 +00:00
Vadim Zeitlin
ef47a04769 Merge branch 'sizer-cleanup'
Clean up and modernize sizer code without any real changes.

See #23291.
2023-02-23 18:09:34 +01:00
Vadim Zeitlin
dcfe387102 Add checks for Scintilla and Lexilla submodules to configure too
Hopefully this will save some time to people building wx from Git.

Closes #23290.
2023-02-23 18:07:19 +01:00
Vadim Zeitlin
860cc7913b Use compound assignment for clarity
Make it more clear that we increment "x" and "y" in wxGridSizer code.

No real changes.
2023-02-23 15:37:33 +00:00
Vadim Zeitlin
0935e330da Avoid using Item() in a loop in wxGridSizer::RepositionChildren()
Use iterators to make RepositionChildren() O(N) instead of O(N^2) it was
before because Item() performs a linear search in the list.

While this shouldn't matter much with a typical number of items, it's
still better to avoid O(N^2) algorithms and it doesn't cost anything
here -- in fact, using iterators makes the code shorter and simpler.
2023-02-23 15:37:33 +00:00
Vadim Zeitlin
a0380723ff Loop over columns first in wxGridSizer::RepositionChildren()
No real changes, just inverse the two loops in preparation for further
changes.

This commit is best viewed with Git --color-moved option.
2023-02-23 15:37:33 +00:00
Vadim Zeitlin
7ae9e9b974 Add test really checking wxGridSizer::Layout()
The existing test with this name only checked wxFlexGridSizer::Layout()
and the base class uses a different implementation, which merits its own
unit test.
2023-02-23 15:37:32 +00:00
Vadim Zeitlin
46bfb43d21 Centralize index checking in wxSizer code
Add GetChildNode() helper and give more information in the assert
message generated there if the index is invalid, notably the value of
the index itself.

No real changes, this is just a small code simplification and quality of
debugging improvement.
2023-02-23 15:37:32 +00:00
Vadim Zeitlin
ab14eecb17 Remove useless assert from the sizer code
Asserting that a pointer is non-null before dereferencing it is useless
as if it were null, we'd crash anyhow.

In this particular case, the pointer is guaranteed to never be null
because we only call Item() if the index passed to it is valid, so the
assert can never be triggered.
2023-02-23 00:35:42 +00:00
Vadim Zeitlin
c8adb54029 Use range-for loops in wxSizer code
No real changes, just replace the loops using iterators explicitly to
use range-for instead as this makes the code shorter and more clear.

Note that there are still other loops, that need the iterators (usually
to delete the item corresponding to it) remaining.
2023-02-23 00:35:42 +00:00
Vadim Zeitlin
00ea032483 Merge branch 'collpane-bg'
Fix collapsible pane background inside a wxNotebook in wxMSW.

See #23278.

Closes #23274.
2023-02-23 00:32:55 +00:00
Vadim Zeitlin
3d21a14f95 Merge branch 'msw-statbox-compositing'
Many fixes for handling elements not using wxStaticBox as parent inside
wxStaticBoxSizer.

See #23259.

Closes #23182, #23239.
2023-02-23 00:31:02 +00:00
Vadim Zeitlin
8b5f049315 Fix losing underline/strike-through in wxFont in wxOSX sometimes
The call to wxNativeFontInfo::InitFromFont(), added to
wxFontRefData::Alloc() in 74c0fe6dcc (Serialize font style correctly in
Mac wxNativeFontInfo, 2022-04-28), lost the existing values of the
underline and strike-through attributes that are not represented by
CTFont and so resulted in some underlined fonts being actually rendered
without underline.

Fix this by explicitly preserving and restoring these attributes before
and after calling InitFromFont().

Also remove the unneeded assignment to m_info, as InitFromFont() already
fully reinitializes it anyhow.

Closes #23264.
2023-02-22 17:27:25 +01:00
Vadim Zeitlin
6f5703a885 Fix wxStaticBox drawing after disabling composition for parent
We need to switch to custom-drawing the box if we stop using
WS_EX_COMPOSITED as WS_EX_TRANSPARENT doesn't work correctly without it
(the background is not being painted correctly), so do this by
overriding the new MSWOnDisabledComposited() which is now called by
MSWDisableComposited() if/when it actually does disable it.
2023-02-21 18:53:11 +00:00
Vadim Zeitlin
8687a0bad9 Add wxWindow::CallForEachChild()
Adding such function was discussed a few times in the past and it's
going to be needed by wxWidgets itself in the next commit, so do add it,
finally, so that it could also be used from the application code too.
2023-02-21 18:53:11 +00:00
Vadim Zeitlin
18002cf6ca Use custom painting in wxStaticBox even with double buffering on
Unfortunately the fact that is on when wxStaticBox is created doesn't
guarantee that it remains on when it is painted later, as
MSWDisableComposited() could be called in the meanwhile, breaking the
redraw of the box.

Conservatively fix this by just always painting the box ourselves, but
mention a possibly better solution.
2023-02-21 16:31:34 +00:00
Miguel Gimenez
609bcb633a Document that wxAuiToolBar::AddTool() does support client data
This is the case after the changes of 9f55d568c2 (Add support for client
data to wxAuiToolBar, 2023-02-20).

Closes #23283.
2023-02-21 17:08:58 +01:00
Vadim Zeitlin
674bfb5e5a Really fix using sibling wxOwnerDrawnComboBox in wxStaticBoxSizer
This wasn't fixed by 61c28b35e1 (Apply workaround to all sibling
children, not just the first one, 2023-02-20) because the change to
calling MSWDisableComposited() on the window itself, rather than the
static box, was accidentally omitted from it.
2023-02-21 14:43:17 +00:00
Vadim Zeitlin
8505c48a34 Cancel in progress builds of PRs when a new one starts
Add a snippet based on the example in

https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow

to all CI workflows to cancel the currently running build when a new one
starts. This should ensure that we don't keep building the old version
of the PR after a new one has been pushed.
2023-02-21 14:58:57 +01:00
Vadim Zeitlin
0becef5591 Remove unnecessary argument from wxGenericCollapsiblePane code
No real changes, just don't specify wxDefaultSize explicitly when it's
the default value for size anyhow.
2023-02-20 22:12:47 +00:00
Vadim Zeitlin
6bdac08b75 Allow parent background to show through wxCollapsibleHeaderCtrl
This fixes wxCollapsiblePane appearance inside a wxNotebook in wxMSW, as
it now correctly uses wxNotebook (white) background instead of the
default (light grey) one.

Closes #23274.
2023-02-20 22:11:23 +00:00
Vadim Zeitlin
95f16e63d2 Consistently use @see in Doxygen documentation
Although @see was used predominantly, a few places used @sa which is
equivalent to it but less readable, so switch to using @see everywhere.

No real changes.
2023-02-20 23:02:18 +01:00
Miguel Gimenez
9f55d568c2 Add support for client data to wxAuiToolBar
Store data passed to AddTool() in wxAuiToolBarItem and provide
wxToolBar-like functions for setting and getting this pointer.

See #23276.

Closes #23271.
2023-02-20 22:59:03 +01:00
Vadim Zeitlin
996f1f5415 Update Circle CI workflow to get Scintilla submodules
This is necessary since 3ed5e42441 (Merge branch 'scintilla-5.0' of
https://github.com/MaartenBent/wxWidgets, 2023-02-20).

See #23117.
2023-02-20 18:43:35 +01:00
Ulrich Telle
a0be352a3f Fix setting locale to wxLANGUAGE_UKRAINIAN
Use GetCanonicalWithRegion() (instead of LocaleTag)  in the Windows
implementation of method wxLanguageInfo::TrySetLocale() -- as is done in
the non-Windows implementation of this method -- and to ensure that we
use the correct "uk-UA" for Ukrainian instead of the wrong (because
conflicting with the UK English) "uk".

See #23269.

Closes #23210.
2023-02-20 18:32:03 +01:00
Lauri Nurmi
cf66709e5f Use © instead of (c) in wxGetLibraryVersionInfo()
See #23265.
2023-02-20 18:31:15 +01:00
Vadim Zeitlin
49e6f50208 Remove wxGTKPrivate::GetTextEntryWidget(), use GetEntryWidget()
These functions are identical, so leave only one of them and simply
remove the other one.

See #23262.
2023-02-20 18:30:29 +01:00
Vadim Zeitlin
f932046a5c Merge branch 'msw-overlay'
Add native wxOverlay implementation using layered windows to wxMSW.

See #23261.
2023-02-20 18:28:21 +01:00
Vadim Zeitlin
41be6dbdbe Merge branch 'opengl-default-attrs'
Stop requesting multi-sampling in wxGLCanvas by default.

See #23260.
2023-02-20 18:26:52 +01:00
Vadim Zeitlin
3ed5e42441 Merge branch 'scintilla-5.0' of https://github.com/MaartenBent/wxWidgets
Update Scintilla to 5.0.

See #23117.
2023-02-20 18:25:35 +01:00
Vadim Zeitlin
d4e9b9b95d Ensure wxRadioBox is big enough to fit its contents in wxMSW
Since the changes of ce1ee46b0c (Use wxRadioButton in MSW wxRadioBox
implementation, 2022-12-24) the control could be too small because we
only accounted for the extra static box margins in two directions (top
and left) but not the two other ones.

Fix this by adding the border around the buttons in all directions and
also increasing its size to preserve more or less the same appearance as
before.

Closes #23267.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
238050bd51 Mention that wxAuiToolBar::AddTool() ignores client data
This parameter is not supported, so at least mention this in the
documentation.

See #23271.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
ec4ff44479 Don't show wrongly rounded value of π in the internat sample
We formatted the value with lesser precision than was used for
displaying it, resulting in unexpected display. Fix this by reducing the
number of digits used in the source (because they're lost anyhow when
formatting using the default precision) and the precision used when
displaying the number.

Closes #23192.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
f12d35afe2 Make generic "About" dialog slightly more symmetrical
Add an extra margin on the right to at least partially compensate for
the icon on the left.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
3ee3d9eab6 Check return code of IFileDialog::SetDefaultExtension()
Log a debugging message if it fails (which is not supposed to happen).

No real changes.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
8e3dcf8cf8 Fix wxUILocale::GetSystemLocaleId() documentation
Somehow the function prototype was omitted, restore it.

Also update the @since version after backporting this function to 3.2.
2023-02-20 18:24:48 +01:00
Vadim Zeitlin
a101bfafaf Simplify wxStaticBoxSizer non-box children checks
After the grandparent commit we don't need to use 3 states for
m_hasNonBoxChildren any longer and it can become a simple "bool".

No real changes, this is just a simplification.
2023-02-20 17:20:45 +00:00
Vadim Zeitlin
61c28b35e1 Apply workaround to all sibling children, not just the first one
This is important as while giving debug message is optional (and might
even be not ideal, see the grandparent commit description), we do need
to call MSWDisableComposited() when all sibling children already exist
as otherwise it wouldn't reset WS_EX_COMPOSITED for them -- and many
windows, such as wxOwnerDrawnComboBox are not drawn correctly if they
have WS_EX_COMPOSITED and overlap a sibling window (worse, this somehow
seems to break the redrawing of the entire TLW, with even the controls
completely outside of the static box being affected, see #23239).

This commit is best viewed ignoring whitespace-only changes.
2023-02-20 16:55:04 +00:00
Vadim Zeitlin
ce75f27bf9 Improve workaround for sibling children in wxStaticBoxSizer
Call CheckForNonBoxChildren() not only if we had never called it before
but also if we did already call it, but we don't have any real children
of the static box yet, as this may indicate that the application added
sibling children to the sizer since then (alternatively, the sizer is
completely empty, but this should be very rare and the overhead of an
extra call to CheckForNonBoxChildren() doesn't matter anyhow in this
case).
2023-02-20 16:51:31 +00:00
Artur Wieczorek
1e6b5c5927 Get rid of unnecessary headers
Since we can't use std::underlying_type_t<> its header is not needed.
2023-02-20 00:49:59 +01:00
Vadim Zeitlin
f3d8e6395c Remove another constexpr not supported by g++ 4.8
This should have been done in the parent commit.
2023-02-20 00:42:48 +01:00
Vadim Zeitlin
d40f0470da Don't use constexpr for operator|=(wxPGSetValueFlags)
g++ 4.8 doesn't support this and while we could make this constexpr
conditional on the compiler/language version, for now just don't make it
constexpr to fix the build quickly.
2023-02-20 00:35:18 +01:00
Vadim Zeitlin
ed362b62f6 Commit another file with std::underlying_type_t<> changes
This should have been part of the parent commit.
2023-02-20 00:28:42 +01:00
Vadim Zeitlin
08be6a74b3 Get rid of more std::underlying_type_t<> occurrences
See the previous commit.
2023-02-20 00:23:17 +01:00
Vadim Zeitlin
b77233bf43 Yet another build fix after recent wxPropertyGrid changes
Stop using std::underlying_type_t<>, it's C++14 and not provided by g++
4.8 that is still supposed to be supported.

Just use int instead, it's not like we need all this heavy and verbose
stuff anyhow for an enum declared using int as the underlying type just
a few lines above.
2023-02-20 00:03:33 +01:00
Vadim Zeitlin
c6a18264e1 Fix signed/unsigned comparison warnings in wxPropertyGrid tests
Use size_t for a variable being compared with a size_t expression.
2023-02-19 23:47:08 +01:00
Vadim Zeitlin
b4ab8de248 Avoid deprecation warnings due to recent wxPropertyGrid changes
Rename the new overload of DoSetSplitterPosition() to use a different
name: not only this avoids deprecation warnings that broke all the CI
builds, but it also makes things more clear and simpler to use as all
the derived classes don't need to override both the deprecated overload
and the new one to avoid warnings about hiding a base class virtual
function and can just override the new one.

Also remove the default value "Refresh" for the flags which seems to be
inconsistent with the default value "Null" used elsewhere and prefer to
specify it explicitly.
2023-02-19 23:38:04 +01:00
Artur Wieczorek
74e599df7b Disable deprecation message 2023-02-19 23:36:59 +01:00
Artur Wieczorek
a22f5e97f9 Add missing header 2023-02-19 23:29:25 +01:00