This is not necessary as wxIcon is implicitly convertible to wxBitmap
anyhow, so calling Add(icon) works using the existing Add(wxBitmap)
overload, and is actually harmful because of the wrong icon size check
in this function, which used physical bitmap size instead of the logical
(scaled) size.
Closes#18188.
Comment stated that InsertionPoint() didn't pass, but it was actually
already running (and passing) and the only excluded test was the
TextChangeEvents() one which really should pass for multiline controls
as well, so run it too.
These functions combine the sizes of all displays and so only return the
correct size when there is only a single display.
This fixes wildly wrong PPI values returned when more than one display
is used.
We need to account for the scale factor under GTK+ (and, presumably,
under macOS) to compute the correct PPI value as it must use the number
of physical and not logical pixels.
Reimplement wxCheckOsVersion() to use wxGetOsVersion() on windows.
An executable without the Windows 8.1+ compatibility info in a
manifest would not detect the version based on the VerifyVersionInfo()
API previously used.
Closes https://github.com/wxWidgets/wxWidgets/pull/992
Surprisingly, ::SuspendThread() doesn't actually do it, but only
schedules the thread for suspension in some undetermined near future.
This could result in problems as Pause() could exit, releasing the CS
protecting wxThread internal data in the main thread, and allowing the
worker thread to enter it (e.g. in its TestDestroy()) before being
actually suspended, meaning that the thread got suspended inside a CS,
which resulted in later deadlocks.
Fix this by calling ::GetThreadContext() which is supposed to ensure
that the scheduler does really suspend the thread before it returns (as
it's impossible to get the context of a thread while it's running).
Closes#18137.
Reimplement wxPopupWindow using WS_POPUP instead of WS_CHILD window in
wxMSW as the new approach allows using the controls inside the popup
normally, unlike the old one.
See https://github.com/wxWidgets/wxWidgets/pull/986Closes#18243.
This will just hide the window immediately, so prefer to ignore the
"focus" argument of Popup() but show the popup instead.
Update the documentation to mention that setting focus outside of popup
is not supported under all platforms.
This fixes another bug from 3518f1a7d8
(after the one fixed in 5766280311): if a
window was maximized by user and then hidden, its IsMaximized() returned
false because it examined m_showCmd which didn't have SW_MAXIMIZE value
in this case.
The same was true for IsMinimised() as well.
Fix both problems by updating the value of m_showCmd when hiding the
window.
Calling Set() resets the existing items order, which makes sense from
the implementation point of view, but not necessarily expected by the
users.
See #18262.
It is no use adding it to the generated setup.h because this section is commented out,
so add it as compiler option instead.
The default option is 'Default' in which case no compiler option is added.
Always set a value to ICONV_CONST so it will be defined in setup.h.
Add a check for strtoull to prevent a macro redefined warning.
Link with WebKit framework to fix macOS build with wxUSE_WEBKIT.
This allows to keep the existing makefiles or configure scripts for
building wxWidgets applications using wx-config unchanged to keep them
working with the existing wxWidgets releases without adding an
unnecessary dependency on the "adv" library when using the latest Git or
3.1.2, when it's released.
As wxCollapsiblePane doesn't use sizers for layout (and while this could
be changed for the generic version, it still wouldn't fix the problem
for the native one), default InformFirstDirection() implementation
forwarding it to the window sizer doesn't work for it and we need to
explicitly let the contents of wxCollapsiblePane know about the
available size.
InformFirstDirection() is required to let wxWrapSizer calculate its best
height from its current width (or vice versa, but usually in this
sense), but it only worked if wxWrapSizer was an immediate child of
another size doing layout but not if wxWrapSizer was inside another
wxBoxSizer which was contained in a top-level sizer.
Explicitly forward calls to InformFirstDirection() to wxBoxSizer
children to fix this and make wxWrapSizers nested in wxBoxSizer work.
Note that there are still many problems in this code, including but not
limited to:
- Doing this forwarding for the sizer minor direction only.
- Not passing the correct value of "availableOtherDir".
- Still calling InformFirstDirection() from RecalcSizes(), when it's too
late to change the min size returned by CalcMin().
- Inconsistency: wxGridSizer calls InformFirstDirection() from its
CalcMin(), wxFlexGridSizer calls it from its RecalcSizes(),
wxGridBagSizer doesn't call it at all.
All this size-in-first-direction logic really needs to be completely
reviewed, but for now at least make wxWrapSizer inside a wxBoxSizer work
as well, or as badly, as wxWrapSizer on its own.
This is especially important under macOS where we modify CC, CPP and CXX
to use the specified SDK, and it's important to compile the code of 3rd
party libtiff and expat libraries using the same SDK, but also matters
for the other platforms when using non-default CC and CXX values.
By exporting these values we ensure that tiff and expat use the same
compilers and flags as the main libraries linking with them.
Don't use the child window of the desktop window for popup windows under
MSW, while this worked in simplest cases, it didn't allow having
functional controls inside a wxPopupWindow as e.g. wxTextCtrl didn't
accept input it at all if created as a child of such window.
Instead, switch to using a top-level window, with WS_POPUP style, and
fix the problem with the loss of activation by explicitly pretending to
still be active in the owner window when losing activation to our own
popup (thanks to Barmak Shemirani for providing this solution).
Also use an MSW-specific and much simpler implementation of detecting
when the popup should be dismissed in wxPopupTransientWindow: instead of
capturing mouse or tracking focus, just react to activation loss
directly.
Add a wxTextCtrl to the popup in samples/popup to show that editing it
works now.
IsTopLevel() returns true for wxPopupWindow, even if it's not a subclass
of wxTopLevelWindow, so GetTLWParentIfNotBeingDeleted() asserted when
called with a button inside a wxPopupWindow.
Just return null from it instead for now. A better solution could be to
return wxNonOwnedWindow from GetTLWParentIfNotBeingDeleted() (which
would need to be renamed to something more suitable) and move the
{Get,Set}TmpDefaultItem() methods into it.