As we don't use any special value for the inactive caption background,
use the same value as for normal caption text for inactive caption text
too.
This is almost certainly not ideal, but at least allows the tab labels
to be readable.
Closes#18988.
This should have been done together with the changes of 41410610ef
(Don't force wxPU_CONTAINS_CONTROLS on wxPopupTransientWindow,
2020-07-10) as without this style controls inside wxComboPopup couldn't
accept focus any more, which broke the previously working code.
There is no need to check if the control is a wxComboBox if it turns out
to already be a wxTextCtrl.
No real changes, just a micro-optimization and simplification.
To fix the problem with GetValue() not returning the updated value from
the event handlers, just set the new value forcefully ourselves before
generating the event rather than postponing sending the event.
This makes the event order under Mac consistent with those elsewhere,
i.e. wxEVT_COMBOBOX_CLOSEUP is now received after wxEVT_COMBOBOX there
too, and not before, as without this change.
See #18973.
In particular, don't map them to left mouse clicks because this is
really wrong.
Ideal would be to handle them in some way, but for now just throwing
them away is better than generating wrong events.
Closes#18967.
We need to adjust the indices of the currently selected items as we need
to keep the same items, not the same indices, selected after new items
insertion.
Closes#18902.
This seems to have been needed in the past (see #12365), but is not
needed any more and results in unexpectedly scrolling down to the last
inserted item, which is undesirable and inconsistent with the other
platforms.
Simply revert f58438058b (Show the first, not the last, inserted item in
wxListBox in wxOSX., 2010-11-05) to fix this.
Closes#18861.
Update the width when items are expanded and collapsed and also take the
expander width into account.
Change m_ModelNotifier type to avoid casts when calling wxOSX-specific
method on it.
Closes#14939.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
This didn't work any more since IsShown() returned true even for
iconized windows, so we never did anything if all windows (and, in
particular, the only window) were (was) iconized.
Fix this by checking for IsIconized() first and IsShown() only if it
returns false because it seems that IsShown() is indeed supposed to
return true for iconized windows -- at least it also does it in wxMSW.
Closes#18998.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
Add the usual handlers for '-', '+' and '*' keys. The last one is
especially convenient, as it does something that couldn't be easily done
at all interactively before.
This convenient method allows to expand all children of the item
recursively.
This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
This code doesn't work (and probably doesn't compile) anyhow, but at
least try to do the right thing in it and override DoExpand() instead of
adding a virtual Expand() hiding the non-virtual version in the base
class.
This doesn't pass the indentation style check and TABs are likely to get
lost when copying/pasting anyhow, so remove them and add an explicit
note about TABs being needed here instead.
This was broken, possibly by 25c9b032a8 (Don't call CacheBestSize() from
DoGetBestSize() implementations, 2016-04-03), as it didn't change the
min size of the status bar and so it was resized to it when it was
managed by wxFrame.
See https://github.com/wxWidgets/wxWidgets/pull/2133Closes#18996.
Failing it is not useful, this results in the CI failure when in 99% of
the cases the transient network problem which resulted in this test
failure has nothing to do with the changes being tested.
Don't loop indefinitely until we run out of memory, possibly after
wrapping around INT_MAX, but impose an arbitrary limit of 128MiB for the
max allocation done by wxString::PrintfV() when the provided format
string or one of the arguments are invalid.
This notably fixes a crash when trying to use "%c" to output an invalid
Unicode character.
Also improve comment explaining DoStringPrintfV() logic and change the
size type to size_t from int.
Co-Authored-By: Arrigo Marchiori <ardovm@yahoo.it>
This makes it more compatible with the standard behaviour of vswprintf()
and allows to use the same logic in the builds using our version of this
function and the normal ones in DoStringPrintfV(), simplifying its
(already rather hairy) logic.
Update the tests to not require any particular return value in case of
buffer overflow, as this differs between Unicode and non-Unicode builds.
When we finally drop the latter, we should just check that it always
returns -1 in this case.
Note that ideal would be to return the actually needed size of the
buffer in case of the error due to buffer being too small, but this
isn't that simple to do and it's probably not worth spending time on
improving this code as long as we still need to use the buffer doubling
strategy in DoStringPrintfV() when using the standard vswprintf().
Ensure that vertical rules extend to the bottom of the window on the
non-first page of the control too.
This was probably broken in 5ae2a8ebb8 (Simplify API for extending
wxListCtrl background display, 2020-11-09).
Closes https://github.com/wxWidgets/wxWidgets/pull/2130
Reduce duplication and simplify the test code by using the same macro
for any number of printf() arguments.
Note that this relies on "##__VA_ARGS__" gcc extension to work even for
CMP0(), i.e. when there are no parameters at all. If this ever becomes a
problem, we can always reintroduce a separate CMP_NO_ARGS() macro.
Remove obsolete information and parts already documented elsewhere.
Also remove the part about wxWidgets crashing your harddisk or
destroying your monitor because I'm a killjoy.
This is not ideal, as resetting the page contents loses the current
selection and redoes a lot of work that could be avoided, but it's
(much) better than nothing, as it fixes the window appearance after e.g.
moving it to another monitor.
Closes#18564.
This replaces the fix of f4dcac9f44 (Return wxFont adjusted to DPI in
wxHtmlWinParser::CreateCurrentFont(), 2020-11-25) adjusting the font
explicitly under MSW with a better fix, associating the correct window
(and hence DPI) with the device context used in OnPaint().
See #18564.