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.
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.
The existing test with this name only checked wxFlexGridSizer::Layout()
and the base class uses a different implementation, which merits its own
unit test.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Store data passed to AddTool() in wxAuiToolBarItem and provide
wxToolBar-like functions for setting and getting this pointer.
See #23276.
Closes#23271.
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.
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.
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.
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.
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.
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).
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.
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.
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.