Commit Graph

67276 Commits

Author SHA1 Message Date
Vadim Zeitlin
6530323f31 Add unit test for wxWindow::IsThisEnabled()
Check that the child IsEnabled() returns false if its parent is
disabled, but its IsThisEnabled() still returns true in this case.
2019-10-27 01:31:21 +02:00
Vadim Zeitlin
37ca3bcae9 Remove unnecessary wxIsWindowOrParentDisabled()
wxWindow::IsEnabled() already returns false if any of the window
ancestors are disabled, there is no need to check them explicitly.
2019-10-27 01:30:43 +02:00
Vadim Zeitlin
a5d719dc19 Fix setting initial focus in wxOSX
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.
2019-10-27 01:20:39 +02:00
Vadim Zeitlin
c9faa30987 Remove AcceptsFocus() check from SetFocus()
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.
2019-10-27 01:18:27 +02:00
Vadim Zeitlin
55da22563b Add even more focus tracing to wxOSX
Log CanFocus() results too.
2019-10-27 00:19:56 +02:00
Vadim Zeitlin
3406147690 Improve tracing of focus event in wxOSX
Give more details about the window gaining/losing focus rather than only
printing out its address.
2019-10-27 00:14:41 +02:00
Vadim Zeitlin
87bba02fef Stop handling performKeyEquivalent: in wxOSX
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.
2019-10-27 00:02:29 +02:00
Vadim Zeitlin
df689e739a Add tracing to key event handling functions
No real changes, just make it simpler to understand what's going in
wxOSX code when handling key events by sprinkling it with wxLogTrace
calls.
2019-10-26 23:50:01 +02:00
Vadim Zeitlin
456743666c Remove the section about universal binaries from macOS docs
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).
2019-10-26 18:16:52 +02:00
Vadim Zeitlin
7ec0d640ca Clarify library installation instructions for macOS
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.
2019-10-26 18:15:32 +02:00
Vadim Zeitlin
bf99c7ae9f Fix asserts in wxRibbonButtonBar during destruction
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.
2019-10-26 17:24:46 +02:00
Vadim Zeitlin
e303231d00 Simplify drawing plain background in AUI toolbars
Don't bother adjusting the rectangle, just set the pen correctly to
avoid drawing its borders.

Closes #17616.
2019-10-26 16:54:16 +02:00
Robin Dunn
4684607a0d wxGrid now derives from wxScrolledCanvas 2019-10-25 21:22:58 -07:00
Vadim Zeitlin
198a4e97a0 Fix wrongly cached state of children focusability under Mac
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.
2019-10-26 02:58:29 +02:00
Vadim Zeitlin
8648f839e7 Don't accept focus for wxRadioBox itself in wxOSX
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.
2019-10-26 02:46:39 +02:00
Vadim Zeitlin
146befeb88 Fix appearance of ampersands in wxAuiNotebook dropdown menu
They need to be escaped to prevent them from being interpreted as
special characters in wxMenuItem ctor.

Closes #18055.
2019-10-26 00:41:15 +02:00
PB
46792d4933 Fix typos in wxStaticBox docs
Add missing commas in code examples.

Closes #18542
2019-10-25 19:39:47 +02:00
Vadim Zeitlin
2b3e3d6c10 Show wxRendererNative::DrawChoice() in the render sample too
See #18255.
2019-10-25 17:47:02 +02:00
Danny Scott
dc3e685e3a Fix package path when adding wx_setup.props
Closes https://github.com/wxWidgets/wxWidgets/pull/1618
2019-10-25 16:33:48 +02:00
Dummy
5eef7382bc Correct Italian translation of "Shift"
This notably prevented accelerators using Shift from working when using
Italian translations.

Closes #18541.
2019-10-25 14:45:43 +02:00
Vadim Zeitlin
6d1b6c71c4 Fix wxUpdateUIEvent prcoessing for standard menu items under Mac
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.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
7a475e4695 Mention CFBundleLocalizations in the i18n overview
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.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
288b570e11 Don't account for size grip under platforms not showing it
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.
2019-10-25 04:10:23 +02:00
Vadim Zeitlin
616ad0d92b Show status bar fields coordinates in a message box in the sample
Showing them directly on the screen using wxClientDC doesn't work in all
ports, notable under Mac.

See #18469.
2019-10-25 04:10:23 +02:00
Steve Browne
3272509ae5 Prevent default OpenGL context creation in wxGLCanvas under macOS
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
2019-10-25 04:10:18 +02:00
Vadim Zeitlin
fc28ab659a Merge branch 'aui-tabart-high-dpi-fix'
Improve AUI tabs appearance in high DPI: scale the bitmaps to have
correct physical size for the current resolution.

See https://github.com/wxWidgets/wxWidgets/pull/1602
2019-10-25 00:31:16 +02:00
Vadim Zeitlin
55d033c68c Scale the bitmap in place in wxAuiScaleBitmap()
This makes the function simpler and is slightly more efficient.

No real changes.
2019-10-25 00:30:42 +02:00
Vadim Zeitlin
82f5c84a06 Remove trivial differences with master
No real changes.
2019-10-25 00:27:29 +02:00
Artur Wieczorek
b97bf311e0 Log widget class name for focus events in widgets sample
This shows better what is going on with focus and makes troubleshooting easier.
2019-10-24 21:00:35 +02:00
Paul Kulchenko
571fda28cf Add scaling of dock art as required by scaling. 2019-10-23 20:10:45 -07:00
Vadim Zeitlin
669e97c016 Ignore attempts to set order of empty wxMSWHeaderCtrl
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.
2019-10-23 19:57:40 +02:00
Vadim Zeitlin
b8c9e6754d Merge branch 'msvc-warns'
Fix an annoying MSVC warning in SDK headers.

Remove wxUSE_IOSTREAMH.

See https://github.com/wxWidgets/wxWidgets/pull/1614
2019-10-23 19:50:14 +02:00
Artur Wieczorek
ec42121235 First check whether it is attempted to delete the root property
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.
2019-10-23 18:05:40 +02:00
Artur Wieczorek
a60c5b36fe Don't attempt to delete root wxPGProperty in propgrid sample
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.
2019-10-23 18:02:35 +02:00
Vadim Zeitlin
1b063e1dea Add a delay before calling wxDateTime::UNow() again in the test
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.
2019-10-23 11:43:53 +02:00
Paul Cornett
ffac936882 Fix crash in propgrid sample, see #18537 2019-10-22 19:51:50 -07:00
Vadim Zeitlin
ab33227578 Merge branch 'fix-doc-oleauto-helpers' of https://github.com/PBfordev/wxWidgets
Improve OLE Automation classes documentation.

See https://github.com/wxWidgets/wxWidgets/pull/1615
2019-10-23 01:54:59 +02:00
PB
aa3e812d42 Add wxVariantDataSafeArray reference to wxOleConvertVariantFlags docs 2019-10-22 20:52:18 +02:00
PB
4f7a3fbbbd Restructure OLE-related doxygen documentation
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
2019-10-22 20:46:13 +02:00
Vadim Zeitlin
dddbc1bafc Document that size of shaped windows can't be changed
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.
2019-10-22 19:37:32 +02:00
Vadim Zeitlin
ed57a9ab7b Fix wxSlider::SetSize(-1, -1, -1, -1) under Mac
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.
2019-10-22 19:28:02 +02:00
Vadim Zeitlin
8587a96d70 Remove unused member variable from listctrl sample
No real changes, just remove a stray declaration.
2019-10-22 18:49:32 +02:00
Vadim Zeitlin
3d488ef8a3 Replace INFO() with WARN() in wxDateTime::UNow() unit test
Another desperate attempt to understand how are failures such as the one
at https://travis-ci.org/wxWidgets/wxWidgets/jobs/601043830 possible.
2019-10-22 15:12:39 +02:00
Vadim Zeitlin
5d8fdcb874 Refactor common code into reusable MacGetPrinterName() function
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.
2019-10-22 02:55:49 +02:00
cosminp
7fa0074e1d Use unique printer ID as its name under macOS
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.
2019-10-22 02:51:34 +02:00
Vadim Zeitlin
e34823a0c4 Stop using wx/ioswrap.h in the samples
This is not necessary any longer after wxUSE_IOSTREAMH removal and it
makes the sample code more clear.
2019-10-22 02:42:33 +02:00
Stefan Csomor
235e61c311 Implement macOS-specific wxDataViewCheckIconTextRenderer
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
2019-10-21 21:14:54 +02:00
tm
fa3c0b1808 Document wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES system option
Make this option slightly more discoverable.

See #12429.
2019-10-21 21:14:54 +02:00
Vadim Zeitlin
8b95467256 Avoid crashing when using wxOverlay under macOS 10.14
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.
2019-10-21 21:14:54 +02:00
Vadim Zeitlin
ad6799f249 Merge branch 'grid-uitests-gtk'
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
2019-10-21 21:12:01 +02:00