Carbon is not supported any more and defining m_overlayWindow, which was
only used by Carbon code, resulted in "unused private variable" warning
from clang.
This should be less important now that we don't rely on CanFocus() to
determine if we should set focus to the window any longer, but it seems
to still be better to try to make it work better for hidden windows, so
at least return true from it when full keyboard access is on.
When it's off, the behaviour is the same as before, but this doesn't
affect wxTextCtrl, whose peer NSView overrides CanFocus() to always
return true.
We almost certainly need to override CanFocus() in other views, notably
wxDataViewCtrl, wxSearchCtrl, and any other controls that can have focus
even when full keyboard access is off.
See #17340.
Previously calls to SetFocus() during construction/initialization of the
parent window simply didn't do anything for windows other than
wxTextCtrl because CanFocus() always returned false for them because
they were not shown yet (while wxTextCtrl implementation overrides
CanFocus() to always return true, probably to work around the same
problem).
Now use [NSView setInitialFirstResponder:] if the window is currently
hidden to try to focus it when it's shown. This might still fail if the
window is really not focusable (e.g. for non-text windows when full
keyboard access is off), but it's not worse than what happens now, and
it also may work -- unlike now.
Closes#17340.
This is partially a workaround for AcceptsFocus() not working as
expected for hidden windows under Mac (see the upcoming commits), but
also makes sense on its own: the other ports don't check whether the
window accepts focus in their SetFocus() implementation and it's not
clear why should Mac do this.
See #17340.
We can't handle the accelerators (known as "key equivalents" in Cocoa)
in this function because it is called for the views in top to bottom
order, while wx semantics is for accelerators to be handled in the
accelerator table closest to the focused window.
So just remove this code and rely on accelerator handling happening in
wxWindowMac::OSXHandleKeyEvent() instead.
Closes#13937.
This is not relevant any longer, all supported macOS versions support
x86-64 binaries and the latest ones don't support anything else, so
there is no need to create i386 binaries any more (and PPC ones don't
work since ages).
Don't explain how to install the library first only to say that it
shouldn't be done afterwards.
Also separate the discussion of installing and distributing the
libraries.
Closes#16316.
Don't do anything when the art provider is being reset during the window
destruction: this is at best useless and is actually harmful as the code
ended up by requesting the DPI of the TLW parent which could already be
half-destroyed.
Remove caching of whether any of the children accept focus in
wxControlContainer as it can change at any moment under Mac, due to full
keyboard access being turned on and off (which can be done using
Ctrl-F7, i.e. easily, and so this might be something users actually do
and not just a theoretical edge case). This also incidentally fixes
caching of the wrong focusability state during window initialization,
when its children are not yet shown, as [NSView canBecomeKeyView:] used
for AcceptsFocusFromKeyboard() implementation under Mac, apparently
always returns false for hidden windows.
The behaviour under the other platforms should remain the same, but
AcceptsFocus() is slower now as it always has to query children instead
of being able to avoid doing it when we know that none of them accepts
focus anyhow. OTOH this only happens to the windows that don't accept
focus themselves and, at least at some moment, don't have any children
accepting focus neither, which should be quite rare and optimizing this
case doesn't seem to be worth the extra code complexity due to extra
preprocessor platform checks.
Closes#18089.
The radio box is just a static box and so can't have focus, only its
child radio buttons should have it.
This resolves the problem with getting stuck on wxRadioBox when full
keyboard access is off, as wxControlContainer code tried to give focus
to wxRadioBox because its AcceptsFocusFromKeyboard() returned true, but
none of its radio buttons could be focused without full keyboard access.
However this introduces a new problem with wxRadioBox being skipped when
full keyboard access is on, which will be fixed in the following commit.
See #18089.
Handle these events in the menu itself first, then the window and only
then at the application level instead of falling back on the application
before searching the window for the handler.
This requires using the logic already present in the base class
DoProcessEvent() method, so make it protected to allow reuse.
Closes#4769.
This is still completely undiscoverable, but slightly better than only
mentioning this in a Stack Overflow answer referencing a comment in the
bug tracker.
Closes#9659.
Size grip in generic wxStatusBar is only supported in wxGTK as it's
drawn using GTK functions, but this is not really a problem as other
platforms either use native implementations (MSW, Qt) or shouldn't show
size grip anyhow as it looks non-native (Mac).
So just ensure we don't leave space for the grip if it's not shown,
correcting the change of 6c1b2b23cf.
Closes#18469.
This renders unnecessary the previous workarounds for using NSOpenGLView
as the base class for wxGLCanvas view, so revert them.
See:
- 2ab430965c which introduced the use of
NSOpenGLView (see https://github.com/wxWidgets/wxWidgets/pull/846).
- ea68934b8e for the first workaround due
to the use of NSOpenGLView and its default context creation.
- 6974a6ceaa for the refinement of the
workaround above.
- e6ae83c386 and
b822e9efe8 which tweaked it futher.
This commit renders unnecessary all the changes since the initial switch
to NSOpenGLView by just preventing NSOpenGLView from creating its own
context and thus enforcing the use of wxGLContext associated with
wxGLCanvas.
Closes https://github.com/wxWidgets/wxWidgets/pull/1617
This can happen when using wxGrid and calling UseNativeColHeader()
before adding any columns and shouldn't be fatal, so simply don't do
anything in this case.
Because wxPGRootProperty has no parent, just like an unattached (waiting
for deletion) child wxPGProperty, so we have to first check whether
the property is the root and next whether it has a parent.
The root wxPGProperty is not designed to be deleted so we should look
for a property to delete in the collection of its child properties.
Closes#18539.
Retrying immediately wasn't very useful, as the times must have been the
same during all loop iterations anyhow, so add a sleep to try to finally
fix the sporadic test failure on Travis.
All OLE-related classes and enums were described
in interface header msw/ole/automatn.h which led
to incorrectly listed include files in the generated
documentation for those classes and enum that
were actually declared in different include header files.
The documentation in the interface files has now been
split into files with names matching the actual include files.
Closes#18536
Shaped windows have the size defined by the shape and it's not really
clear what calling SetSize() on them should do -- so just document that
it's not supposed to work.
Closes#9794.
Instead of doing basically nothing, this call completely mislaid out the
control as -1 were used used literally instead of meaning "use the
current geometry", as they're supposed to. Fix this by handling
arguments with the value of -1 specially.
Such call was done by wxCompositeWindow::SetLayoutDirection() used by
the widgets sample and explained why the slider couldn't be seen when
switching to its page in this sample.
Closes#18442.
No real changes, just add a simple helper function instead of
duplicating it in 2 different places.
This also provides a unique place to write the comment explaining why
PMPrinterGetID() is being used instead of PMPrinterGetName().
See #16774.
Apparently, the user-readable name retrieved by PMPrinterGetName() is
not necessarily unique when multiple printers are available, so use
PMPrinterGetID() which is guaranteed to return a unique string.
Closes#16774.
This implementation suffers at least from 2 problems:
1. It doesn't support icons at all.
2. It toggles the checkbox when clicking on the text and not just on the
checkbox itself, as would be expected.
but it's still better than the current version which simply doesn't work
at all, i.e. can't be toggled in any way (and also doesn't draw itself
correctly when using dark mode under macOS 10.14+), so use it for now.
A better solution would be to fix the problem with ActivateCell() not
working at all (see #17746) and update the code to respect drawing in
dark mode.
Closes#17473.
Closes https://github.com/wxWidgets/wxWidgets/pull/904
Retain the graphics context for the helper overlay window as otherwise
it gets released leaving us with a dangling pointer.
Unfortunately this still doesn't make the existing code actually work.
See #18399.
Fixes to wxUIActionSimulator allowing the tests using it to work for
wxGrid in wxGTK.
And some improvements and bug fixes to wxGrid itself.
Closes https://github.com/wxWidgets/wxWidgets/pull/1609
Recent MSVS 2017 versions (15.9.x) as well as MSVS 2019 give warning
C4548 about "expression before comma having no effect" when including
standard CRT headers.
This happens because when building projects targeting 8.1 SDK, as the
IDE uses the hard coded 10.0.240.0 version of UCRT headers in this case
(see \Common7\IDE\VC\VCTargets\Microsoft.Cpp.Common.props), and the
headers in this version haven't been, and will never be, updated to
avoid this warning, as was done in later 10.0.x UCRT versions.
Fix this by explicitly disabling the warning in wx/beforestd.h, as even
setting the warning level to 1 for the standard headers somehow isn't
enough to suppress it if it's enabled.
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.
Still define it as 0 for compatibility, just in case it's used outside
of the library.
We don't support MSVC 6 (__VISUALC__ == 1200) or eVC (1201) since more
than 5 years (see f4b80e5337), so it's
useless to keep code compiled only when this compiler is used.
Improve the class description.
Mention that one needs to call wxAutomationObject::SetConvertVariantFlags()
with wxOleConvertVariant_ReturnSafeArrays to actually receive a
wxVariant with SAFEARRAY (if possible).
Make better use of now-documented wxSafeArray in the code examples.
Closes https://github.com/wxWidgets/wxWidgets/pull/1611