Commit graph

74267 commits

Author SHA1 Message Date
Vadim Zeitlin
1a314b4e10 Merge branch 'msw-about'
Improve "About" dialog appearance under MSW.

See #23294.
2023-02-28 18:26:26 +01:00
Blake-Madden
809d2918cc Document wxSplitterWindow::SetSashPosition() argument better
Explain the special meaning of 0 and negative values in this function.

Closes #23299.
2023-02-28 00:38:36 +01:00
Vadim Zeitlin
2c530fa513 Merge branch 'fix-shorten-64-to-32-warn'
Fix clang warnings about truncating 64 bit ints to 32 bits.

See #23301.
2023-02-27 16:08:55 +01:00
Stefan Csomor
fa23d607e9 Fix initial width of wxTextCtrl in wxOSX
In the process of fixing #22374 by using native best sizes, empty fields
were getting a small, but positive best width, this broke the trigger
for using default widths for empty fields, so fix this by checking that
the width is big enough and not just zero in DoGetSizeFromTextSize().

See #23295.

Closes #23250.
2023-02-27 16:06:59 +01:00
Vadim Zeitlin
7bad8b1060 Fix more -Wshorten-64-to-32 occurrences and test for them
Add more static casts to avoid harmless warnings about long and/or
size_t to unsigned int conversions and enable -Wshorten-64-to-32 in the
allheaders test to ensure they don't get introduced again in the future.
2023-02-27 13:47:57 +01:00
Stefan Csomor
e49b791ca9 Fix background of shaped frames under macOS
Don't set it to avoid overriding the "clear background" used for shaped
windows.

Closes #23286.

See #23296.
2023-02-25 23:02:41 +01:00
Hartwig Wiesmann
313a415e2e Fix harmless warning in wxString in wxUSE_UNICODE_UTF8 build
Add an explicit cast from ptrdiff_t to unsigned int to avoid the
warning which is harmless because the difference here is bound by the
cache size.

See #23297.
2023-02-25 22:51:47 +01:00
Vadim Zeitlin
1e98812a56 Fix menu width for owner-drawn items using bitmap in wxMSW
Do _not_ provide a valid HBITMAP for them, as this seems to break
measuring such items by not using our WM_MEASUREITEM handler at all.

Note that we could also use HBMMENU_CALLBACK for the bitmap, which also
fixes the problem, but it seems better to just not do anything at all.

Closes #23230.

Co-Authored-by: Jacob Gillespie <jacobgillespie@gmail.com>
2023-02-25 21:46:03 +00:00
Vadim Zeitlin
5b6b644e8b Remove wxSYS_COLOUR_MAX from documentation
There is no real need to document this, it's not a valid enum value and
having it in this file without a trailing comma was a syntax error.

Closes #23298.
2023-02-25 21:51:14 +01:00
Vadim Zeitlin
fdef316f40 Update wxAboutDialog screenshot under MSW after recent changes 2023-02-24 00:42:13 +00:00
Vadim Zeitlin
020aff8a7f Don't use "Copyright" word in wxAboutDialog under MSW
MSW platform convention is to show just "© whatever" instead of
"Copyright © whatever" in the "About" dialogs, so make it simpler to
conform to it but still keeping using the word under the other
platforms, where it usually is included, by removing the "Copyright"
word under MSW only in wx code.
2023-02-24 00:42:13 +00:00
Vadim Zeitlin
a0a49f5391 Make wxGenericAboutDialog look more similar to MSW message box
Use white background for the upper part to mimic the message box
appearance.
2023-02-24 00:42:13 +00:00
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