This removes the arbitrariness of using the first child which didn't make any
sense when the popup had several controls inside it, e.g. in wxRichToolTip
case this resulted in the mouse capture being given to wxStaticBitmap showing
the tooltip icon even though it didn't need it at all.
This probably doesn't really change the observable behaviour but seems more
logical.
See #15288.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This works even with irregularly shaped windows such as wxRichToolTip unlike
the old naive test using wxRect::Contains() which didn't and resulted in us
believing that the mouse was outside the window when it was still in it and
(somehow, the details are not totally clear) recapturing the mouse again and
again in the same window which resulted in assert failures with the new checks
in wxWindowBase::CaptureMouse() or the capture stack corruption before this.
Closes#15288.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Make GetCapture() return NULL during wxEVT_MOUSE_CAPTURE_{LOST,CHANGED} events
processing in wxMSW to help their handlers to avoid calling ReleaseCapture():
this shouldn't be done as the mouse capture is being lost anyhow and results
in reentrancy problems between NotifyCaptureLost() and ReleaseCapture() if
it's called.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Verify not only that we don't destroy the window having the capture now but
also that this window is not in the mouse capture stack at all, not
necessarily on top. This is important as keeping a dangling pointer in the
capture stack would result in difficult to diagnose bugs later.
Also check that we don't recapture the mouse in the same window as this should
never be necessary.
Finally, give more details in the assert checking that the window does have
capture in ReleaseMouse().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This doesn't work anyhow with our popup window implementation (it's a child of
the desktop and we can't set focus to it) and provokes error messages due to
::SetFocus() failures, so simply don't do this at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxRecursionGuard with the flag indicating whether the mouse capture is
changing to ensure that we always reset it correctly and make the code
slightly shorter.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
All mouse capture-related data doesn't have to be declared in wxWindow itself
and can just be global in wincmn.cpp, so move it there, this will facilitate
further changes as they won't require recompiling everything any more.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Otherwise comparison always failed as no existing fonts had
wxFONTFAMILY_DEFAULT as their family in all ports except wxOSX, which does
keep wxFONTFAMILY_DEFAULT.
Closes#15410.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
r72935 introduced code that created a temporary wxComboBox control to
take measurements. This is very expensive in MSW and adds noticeable
delay when creating more than a few controls.
Replace with equivalent wxMSW code that computes the height in the same
way other wxMSW controls do.
The wxGTK version cannot be eliminated in the same way, so at least add
some basic caching there. It's much less of a problem, because GTK+
controls creation is much cheaper than MSW one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This results in sending an unexpected wxShowEvent to an already half-destroyed
(because the derived class dtor had been already executed) by now object which
could provoke crashes. And it also seems to be completely unnecessary as the
window is going to be destroyed anyhow -- and the other ports don't hide it
before this happens (unless it's a TLW in which case it is already hidden in
wxTopLevelWindowBase::Destroy()).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method was declared and even documented but never actually implemented,
and GregorianAdoption enum used by it had many incorrectly defined elements.
Just remove both the method and the enum instead of fixing/implementing them
as they are not that important (as witnessed by the fact that nobody has
complained about the method being missing since almost 15 years).
Closes#15400.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't call the very expensive wxComboCtrlBase::DoGetBestSize() method
when not needed - it calls wxComboCtrlBase::DoGetSizeFromTextSize(),
which is very expensive.
Also fix the code so that it doesn't apply GetSizeFromTextSize() twice
(once in the base class' DoGetBestSize(), once here).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For historical/compatibility reasons we handle this colour as transparent in
wxMSW when loading the bitmaps from resources, but this is rather not obvious
for the new users, so document it and provide a way of compensating for this
in the documentation as well.
Closes#15371.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
During the refactoring of r74496, the logic of the check for Intel compiler
was slightly altered resulting in not defining __VISUALC__ for it any longer
which broke compilation with it.
Restore this definition now to fix it, even though it could admittedly be
better to explicitly check for __INTELC__ in the places where we currently
only check for __VISUALC__ and reserve the latter only for the case when we
are really using MSVC.
Closes#15359.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Install libcppunit-dev in order to be able to run the unit tests (at least the
non-GUI ones for now).
Also build in several configurations: shared/static, multilib/monolithic and
also STL. This should help to find problems appearing only in some specific
build variants.
Closes#15369.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Some file types have DDEExec subkey in the registry but no value for it, don't
use DDE for launching the files of these types in this case as this only
results in errors.
Closes#15388.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use -outlineView:didClickTableColumn: delegate method instead of
mouseDownInHeaderOfTableColumn: one to ensure that:
(a) We don't sort the column if it's being dragged/resized (closes#15340).
(b) We sort the column on mouse up, not down (closes#15386).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The use of wxSpinCtrlEventDisabler class ensures that we never forget to
reenable the events after disabling them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
After the changes of r53758 wxMSW didn't generate any wxEVT_TEXT events but
this was still the case for the generic version (and hence for
wxSpinCtrlDouble under MSW too) and wasn't documented.
Fix all versions to avoid sending events for programmatic actions, add unit
tests checking this behaviour and document it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Run the same NoEventsInCtor() test as we already had for wxSpinCtrl for
wxSpinCtrlDouble as well.
Unfortunately currently there is no way to reuse the tests between these two
classes, we should refactor these test cases to use a common
SpinCtrlTestCaseBase<T> base class.
See #15375 which fixed the underlying bug.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method allows to get the full width needed by wxPropertyGrid and is
useful for determining the space to allocate for it, e.g. when creating a
popup showing the property grid, as shown by the changes to the sample.
Closes#15368.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775