67248 Commits

Author SHA1 Message Date
Ilya Sinitsyn
751177dc2b Test wxGrid cells selection using End key 2020-06-15 14:24:19 -05:00
Ilya Sinitsyn
9076d9186c Implement wxGrid cells selection for Home and End keys
Select cells if Shift is pressed when handling Home and End keys
2020-06-15 14:24:19 -05:00
Ilya Sinitsyn
a2d7c7210b Test moving the grid cursor using End key for wxGrid 2020-06-15 14:24:19 -05:00
Ilya Sinitsyn
076675eccf Fix wxGrid Home and End keys handling
Take into account that rows and columns may be hidden and columns also can be
reordered.
2020-06-15 14:24:19 -05:00
Ilya Sinitsyn
f13a101458 Test wxGrid scrolling when selecting cells. 2020-06-15 14:24:19 -05:00
Ilya Sinitsyn
cf08e4da3f Fix making the wrong wxGrid cell visible when selecting
We should make visible the cell of the corner of the current selected block.

Also fix names of the wxGrid::UpdateBlockBeingSelected parameters because
actually passed сщщквы are of any opposite selection block corners.
2020-06-15 14:24:19 -05:00
Vadim Zeitlin
85dbf5f732 Don't set focus to unfocusable windows in wxGTK
Restore IsFocusable() check that was commented out, without any real
explanation, by c7bfb76a2c (A number of focus handling improvements:
Left clicking on a window only focuses the window if not processed.
wxControlContainer::SetFocus moved to wxControlContainerBase so that a
container now focuses the first child even on wxGTK. wxAuiBook is now a
container, need for correct navigation on wxGTK., 2007-08-18).

This is needed to avoid giving focus on click to the windows that
explicitly override AcceptsFocus() to return false, as e.g.
wxGridColLabelWindow and other wxGrid subwindow classes do. From the
user point of view, previously clicking on a grid row/column label just
disabled the user of arrow keys, which was very inconvenient (and didn't
happen under MSW).
2020-05-19 09:33:45 -05:00
Vadim Zeitlin
3c2a61d036 Send kill focus events to modal dialogs earlier in wxGTK
Ensure that the dialog is still alive when it gets the kill focus event
for its child which had focus just before the dialog was closed (or any
other events generated by this child when it detects that it's losing
focus, such as wxEVT_SPINCTRL) by resetting focus when the dialog is
being hidden and not when it's being destroyed.

This makes the events order more consistent with wxMSW but also, most
importantly, safer, as wxEVT_KILL_FOCUS handlers could previously easily
reference the fields of an already half-destroyed wxDialog-derived
object by the time they were run during wxTopLevelWindowGTK destructor
execution.

Closes #18145.
2020-05-19 09:33:39 -05:00
Vadim Zeitlin
a548d70cc7 Initialize wxWindowDCImpl::m_window for hidden windows too
Ensure that we set m_window in case of early return from wxWindowDCImpl
ctor, so that using e.g. wxDC::GetSize() works for wxClientDC created
for windows that hadn't been realized yet.

It might be possible to avoid this early return completely as the
comment explaining why we're doing it seems to be out of date: our
SetBackground() doesn't call wxWindow::SetBackground() (and it would be
exceedingly strange if it did), but for now just the bug without
changing anything else.

Closes #18569.
2020-05-19 09:33:30 -05:00
Paul Cornett
94491b07e3 Avoid inadvertently destroying a shared PangoContext on GTK2
wxMemoryDC and wxScreenDC dtors were freeing a context they didn't own, potentially
causing a crash. Fixed by having the base wxWindowDC dtor free the context.
See #18566
2020-05-17 01:24:08 -05:00
Leland Lucius
c0b1c1b00e Updates to Mac accessibility for wx3.1.3 2020-05-03 01:15:31 -05:00
Paul Licameli
96c700c7e9 Implement parts of NSObject(NSAccessibility) informal protocol
Make wxNS* classes interact better with Xcode debugger

wxUSE_ACCESSIBILITY compiles on Mac

Methods in wxOSXCocoa classes intercept OSX 10.6 accessibility protocol

Define proxy class wxAccessibilityChild

Implement notifications, as best we can for the mismatch of codes

Implement accessibilityIsIgnored -- always false when any wxAccessible

Scaffolding to query, get, set standard NSAccessibility attributes

Implement role, subrole, and role description attributes

Implement string-valued standard attributes

Implement the three children attributes

Implement the parent attribute

Implement window and top-level element attributes

Implement the size and position attributes

Implement the focused, selected, enabled, etc. status attributes

Implement wxAccessible default actions
2020-05-01 08:19:51 -05:00
Paul Licameli
09dde48dbb stub virtual functions needed to compile for Mac with accessibility 2020-05-01 08:19:51 -05:00
James Crook
ecfb5952ca Retry file renaming on Windows only.
It won't work on Mac anyway because of use of _get_doserrno()
2020-05-01 08:19:51 -05:00
James Crook
19230f711f Windows: Retry failed rename patch applied.
On Windows, rename can fail for example due to a virus checker.  This patch retries renaming the file.
(see bug #1266 and http://reviews.llvm.org/D13647#eeab044e)

Audacity/win/wxWidgets_Additions/fix_rename.diff
2020-05-01 08:19:51 -05:00
Paul Licameli
5d526180f3 Focus rings are back for buttons, choice, listbox, dateTimePicker controls 2020-05-01 08:19:51 -05:00
James Crook
83e466d9af Windows: Accessibility/Setup patch applied.
Note that the patch in Audacity/win/wxWidgets_additions/accessibility.diff patches setup.h
This patch applied here patches setup0.h, which will become setup.h.
(There is no setup.h in the git repo).
2020-05-01 08:19:51 -05:00
Vadim Zeitlin
8a40d23b27 Update release notes etc for 3.1.3 release
Also simplify MSVC binaries use instructions by instructing people to
just use the provided properties file.
v3.1.3
2019-10-27 18:41:42 +01:00
Vadim Zeitlin
57f3a20d39 Update change log for 3.1.3 release
Add all the changes from "git notes --ref=changelog" and a few more.
2019-10-27 17:53:26 +01:00
Vadim Zeitlin
67739303fd Don't force wxAuiToolBar size to be less than its parent
This results in the toolbar being too small to show any items in it
in wxGTK and wxOSX, because the parent window size is still the default
small one and not the actual size it will be when shown, when the size
of the toolbar is first set.

And it seems completely unnecessary to do this anyhow, as toolbar is
resized by wxAuiManager in any case.

Closes #18218.
2019-10-27 17:41:05 +01:00
Vadim Zeitlin
1d844882ed Avoid closing invalid socket after unsuccessful Accept()
Calling wxSocket::Accept() may return an invalid socket, especially when
non-blocking, so don't close it unconditionally.

This avoids an assertion failure in MSVC CRT due to calling
closesocket() with an invalid argument.
2019-10-27 15:50:33 +01:00
Vadim Zeitlin
56d36d11ba Merge remote-tracking branch 'github/osx-fixes'
Several fixes for wxOSX, including several focus-related changes.

See https://github.com/wxWidgets/wxWidgets/pull/1620
2019-10-27 14:52:37 +01:00
Vadim Zeitlin
d38d8f4f9c Remove Carbon-specific code from wxScreenDC implementation
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.
2019-10-27 01:44:29 +02:00
Vadim Zeitlin
85b5337160 Try to improve CanFocus() behaviour for hidden windows
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.
2019-10-27 01:42:26 +02:00
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 6c1b2b23cf5e707b9971e37eb14715836d9e63e3.

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:

- 2ab430965c457de680d3a3ea37445b7dfa0090e0 which introduced the use of
  NSOpenGLView (see https://github.com/wxWidgets/wxWidgets/pull/846).
- ea68934b8e3374d03e876f56a1637663de351cb7 for the first workaround due
  to the use of NSOpenGLView and its default context creation.
- 6974a6ceaa8f81168459119f98d7ed9a03b1c88d for the refinement of the
  workaround above.
- e6ae83c386427b1cd2840e5f8059310e8b4fb3ea and
  b822e9efe8f35e1683665332cf21f941be89404e 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