This is unnecessary, we only need to update the pending focus in the
immediate parent window to prevent a wrong radio button from being
focused (and hence selected) when it regains focus, there is no good
reason at all to interfere with the focus in the grandparent (and
higher) windows.
Doing this was not only useless, but actually harmful, as it overrode
explicit calls to SetFocus() in the user code, so just stop doing it.
This also allows to avoid having 2 functions related to this and keep
just a single virtual WXSetPendingFocus() one.
Closes#18653.
wxSetFocusToChild() could recurse to the parent TLW, which was clearly
nonsensical as it means that restoring last focus in a dialog could end
up setting it to the parent frame.
Fix this by breaking out of the loop as soon as we reach a TLW.
See #18653.
Remove the check that the size representation was the same as float and
as double, which was supposed to catch various edge cases (NaNs, huge
numbers etc) but actually caught plenty of perfectly valid font sizes
such as 13.8 that simply lost precision when converting from double to
float.
Just check that the size is positive and less than FLT_MAX to avoid
using values that really don't make sense as font sizes.
Also add a unit test checking that using fractional font sizes in
description string works as expected.
Closes#18590.
Closes https://github.com/wxWidgets/wxWidgets/pull/1707
MSVC++ doesn't seem to honour implicit int -> bool conversion and raises
warning C4800: "'int': forcing value to bool 'true' or 'false' (performance
warning)".
Previously, the column was updated, i.e. wxHeaderCtrl::UpdateColumn()
was called, after the column width was changed interactively by the
user. This was unnecessary and actually harmful as it resulted in
recursion and display corruption.
Stop doing this by adding yet another width-related function to the
generic wxDataViewColumn called WXOnResize(), which just updates the
main window display, but doesn't update the header at all, and calling
it instead of SetWidth(), which does both, when the column is resized.
Closes#18245.
If the width really changed, wxDataViewColumn::SetWidth() already calls
wxDataViewCtrl::OnColumnChange() (via UpdateWidth()), so it's
unnecessary to call the latter again immediately after calling the
former. And if the width didn't change, it's not necessary to call it at
all, so in either case the OnColumnChange() call can be just removed.
No real changes.
Calling wxGridCellChoiceEditor::SetParameters() didn't have any effect
if the editor had been already used because this method only updated the
internally stored m_choices, used for creating the combobox, but not the
strings actually used by the combobox, if it had been already created.
Also mention that this works in the documentation.
Closes#10465.
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.
Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.
Closes#18622.
See https://github.com/wxWidgets/wxWidgets/pull/1690
Minimized windows don't seem to get any events after "Close" menu item
is selected from the system menu, so they were never actually destroyed
when closing them in this way.
Fix this by explicitly waking up the message loop after deleting the
window to ensure that the delayed destruction does happen.
Closes#18622.
See https://github.com/wxWidgets/wxWidgets/pull/1690
Add another wxGrid::DrawTextRectangle() overload, taking wxGridCellAttr
and ellipsizing the string if necessary, i.e. if the fitting mode of
this attribute indicates that we should do it.
Switch the code of all renderers for which it makes sense to use
ellipsization to use the new overload.
This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.
Preserve the existing API by reimplementing it in terms of the new one.
Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
This is not the best solution, but getting dozens of lines of warnings
when compiling this file is not great neither and there doesn't seem to
be anything else to do about this.
This was already the case in the generic version, but wxMSW one just
silently returned 0 for invalid item index.
Make it consistent with the other platforms and SetItemState() by
checking the index in it too.
Closes https://github.com/wxWidgets/wxWidgets/pull/1702
Unhandled mouse events should be skipped. Otherwise wxEVT_CONTEXT_MENU
event couldn't be generated by right clicking anywhere inside wxGrid and
could be only generated for the main grid part (but not the labels) by
pressing Shift-F10 under MSW.
Closes https://github.com/wxWidgets/wxWidgets/pull/1697
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.
This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.
Closes https://github.com/wxWidgets/wxWidgets/pull/1696
This is important to allow catching the context menu events from the
composite control children at the main window level using the main
window ID: previously, these events used the (typically auto-generated
internally) ID of the child window, which was an implementation detail
and prevented the code binding to these events using the ID of e.g.
wxListCtrl itself from working under the other platforms, where
wxListCtrl is a generic composite window, even if it worked under MSW,
where wxListCtrl is native.
Put common code from all the different ports into it.
This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
This crash was introduced in 2d15218c9d
and could happens inside wxBitmap::MSWBlendMaskWithAlpha() because the
code checked for a mask and alpha, but the mask could be lost after
AllocExclusive().
In practice, this happened e.g. when using 16-bit color as is the case
for Windows 7 Hyper-V VMs.
Closes https://github.com/wxWidgets/wxWidgets/pull/1695