Commit Graph

71396 Commits

Author SHA1 Message Date
Vadim Zeitlin
37c5f079f1 Disable Direct2D checks failing under Wine
Now that these Direct2D tests are compiled, disable those of them that
fail under Wine due to missing support for Direct2D functionality we use
in Wine implementation.

Don't even give a warning message because there would be too many of
them in these tests, just skip them silently.
2021-08-24 17:12:05 +02:00
Vadim Zeitlin
6a99b2d9a8 Fix wrong exclusion in MSW cross-build CI workflow
Ignore GTK files, not MSW ones.
2021-08-24 17:12:05 +02:00
Vadim Zeitlin
ce92055f3a Fix the effective parent of wxGenericFindReplaceDialog
This dialog is non-modal and so using GetParentForModalDialog() for it
is not quite right, because this function checks that the candidate
parent window is visible, which may not be the case for a modeless
dialog parent, as the dialog isn't necessarily going to be shown
immediately, but may well be shown later, after showing its parent.

And not allowing to use the not yet shown parent was also inconsistent
with the native MSW version which didn't have any problem with this.

So fix this by adding new GetParentForModelessDialog() function and
using it for this modeless dialog instead. This required slightly
refactoring wxDialog code to allow reusing most of it between the old
GetParentForModalDialog() and the new function.
2021-08-24 17:12:05 +02:00
Vadim Zeitlin
b6e29ea4d1 Detect Direct2D when building wxMSW with configure
Check for Direct2D headers (only, as DLLs are loaded during run-time
anyhow) and enable Direct2D-based wxGraphicsContext implementation if
they are available when building wxMSW with configure.
2021-08-24 17:12:05 +02:00
Vadim Zeitlin
8bbcf0af09 Check that wxFindReplaceDialog parent is non-null before using it
Although this dialog is normally supposed to have a valid parent, don't
crash if it doesn't have one when any of its buttons are pressed.
2021-08-24 17:12:05 +02:00
Vadim Zeitlin
0798906e7b Simplify wxFindReplaceDialogBase::Send() code slightly
Use ProcessWindowEvent() instead of GetEventHandler()->ProcessEvent().

No real changes.
2021-08-24 17:12:04 +02:00
Jouk
cc3afe0dc6 Include wx/toplevel.h to for wxTopLevelWindow 2021-08-24 14:05:00 +02:00
Vadim Zeitlin
45dcb1a8a5 Replace IsProofCheckEnabled() with GetProofCheckOptions()
This is more consistent with EnableProofCheck() and allows to retrieve
the current state of grammar checking under macOS, which can be checked
by user and so can be useful to know.
2021-08-23 14:19:11 +02:00
Vadim Zeitlin
94173e3fae Remove stub spell checking functions from wxiOS wxTextCtrl
There doesn't seem to be any need to have these functions here as the
base class implementation already does exactly the same thing (i.e.
nothing at all).
2021-08-23 14:18:42 +02:00
Vadim Zeitlin
db30397921 Implement support for grammar checking in wxOSX
Use native support for grammar checking in NSTextView.

As we're not passing wxTextProofOptions to the lower level function,
this functionality now depends on wxUSE_SPELLCHECK, meaning that even
the previously existing MacCheckSpelling() function is not defined any
more when wxUSE_SPELLCHECK is set to 0. This is not completely
backwards-compatible, but hopefully shouldn't be a problem in practice
and shouldn't break any existing applications which can't disable the
just added wxUSE_SPELLCHECK.
2021-08-23 14:18:42 +02:00
Vadim Zeitlin
79fe43c22d Don't show message box in text sample unnecessarily
This is going to be just annoying on the platforms where spell checking
is not supported, so show the message inside the text control itself
rather than popping up a message box.

Also put a misspelled word in the control from the very beginning to
show that it is highlighted.
2021-08-23 14:18:38 +02:00
Vadim Zeitlin
2bb3083a93 Use wxTextProofOptions itself to enable or disable the checks
Remove a separate "bool enable" argument of EnableProofCheck() and use
wxTextProofOptions::IsSpellCheckingEnabled() to decide whether the
checks should be enabled or disabled.

Also remove wxTextProofOptions ctor and provide named static factory
functions for creating the objects of this class with clearly defined
meaning.
2021-08-23 14:18:19 +02:00
Vadim Zeitlin
72ef834c70 Don't use DLL export declaration with wxTextProofOptions
This class doesn't have any non-inline methods, so applying DLL export
declaration to it is at best useless and might even be harmful, so don't
do it.
2021-08-23 14:17:25 +02:00
Vadim Zeitlin
90e79d8ed4 Implement minimal support for spell checking in wxOSX too
Reuse the existing CheckSpelling() function.

Also deprecate wxTextCtrl::MacCheckSpelling() in favour of the new
portable EnableProofCheck().
2021-08-23 14:17:16 +02:00
Vadim Zeitlin
af43b7c965 Correct description of EnableProofCheck() requirements
This functionality is available since Windows 8 only, not 7.
2021-08-23 14:16:54 +02:00
Vadim Zeitlin
25f9127499 Mark wxTextProofOptions as being new in 3.1.6 in the docs too 2021-08-23 14:16:54 +02:00
Vadim Zeitlin
05df6e0390 Slightly reformat EnableProofCheck() declarations
Keep the entire wxTextProofOptions argument on the same line.

Remove unnecessary WXUNUSED() in the declarations of the function in
wxMSW/wxGTK headers.

No real changes.
2021-08-23 14:16:54 +02:00
Vadim Zeitlin
01d3a96043 Reduce configure warnings about missing spell checking support
It's not really useful to warn that spell checking is not available for
the ports for which it's not implemented anyhow, as there is nothing
that the person running configure can do about it anyhow.

Still warn about missing gtkspell library when using GTK 3, however, as
it may be useful to know that it's not available and could be installed
in order to activate spell checking support.
2021-08-23 14:16:54 +02:00
Vadim Zeitlin
d9ea30cf84 Always set wxUSE_SPELLCHECK to 1 by default for simplicity
It does no real harm to set it to 1 and this avoids the need for the
platform checks in setup.h files, simplifying things (although it does
require checking for GTK 3 in the code compiled for both GTK 2 and 3, as
gtkspell library can only be used with GTK 3).
2021-08-23 14:16:16 +02:00
Vadim Zeitlin
fd9e420b42 Verify that wxUSE_SPELLCHECK is always defined
Add sanity check for this symbol, as it's done for all the other
wxUSE_XXXs.
2021-08-23 14:15:38 +02:00
iwbnwif
472aec2d7e Add support for using native spell checking in wxTextCtrl
Add wxTextCtrl::EnableSpellCheck() and implement it for wxMSW and
wxGTK3.

Closes #17544.
2021-08-23 14:15:38 +02:00
Vadim Zeitlin
d6ba8eafc5 Merge branch 'generic-listctrl-fixes'
Fix selection when right clicking in generic wxListCtrl and other minor
improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2483
2021-08-23 02:01:17 +02:00
Vadim Zeitlin
efb5ae2a1d Merge branch 'modernize-dir-test'
Get rid of CppUnit boilerplate in wxDir unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/2482
2021-08-23 02:00:46 +02:00
AliKet
cb6d67bab4 Reset selection on right click in a more efficient way
Instead of using HighlightAll(), use the second argument of
HighlightOnly() to remove selection from the previous current item.
2021-08-23 01:59:07 +02:00
Dimitri Schoolwerth
b4aaaeae1e Remove some stray settings from minimal sample's Xcode projects
Delete a few settings that are either undesired or already set through
Xcode configuration files.
2021-08-23 00:51:19 +02:00
Dimitri Schoolwerth
32bc67fb8c Regenerate Xcode projects
Ran build/osx/makeprojects.applescript several times, comparing usable
output results and verifying final versions. No symbols are removed,
and mostly wxWeb* related ones added.
2021-08-23 00:51:19 +02:00
Dimitri Schoolwerth
0b9176874e Fix wxOSX build with Xcode 10 and later
Update target architectures to support building with the whole range of
supported Xcode versions by not targeting i386 by default, as well as
adding an arm64 target. Targeting i386 results in a deprecation
error starting with Xcode 10:

error: The i386 architecture is deprecated. You should update your ARCHS
build setting to remove the i386 architecture.
2021-08-23 00:51:19 +02:00
Dimitri Schoolwerth
e29e48a77b Fix Xcode builds with wxUSE_REGEX==1
Update the system header include paths as opposed to user header include
paths to be able to also find wx' pcre2.h #include using angle brackets.
2021-08-23 00:51:19 +02:00
Kvaz1r
247b7dab49 Set m_isShowingModal as true before showing dialog in wxUniv
This allows ModalDialogsTestCase InitDialog unit test to pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/2481
2021-08-23 00:28:02 +02:00
Vadim Zeitlin
0e9e6aaf3a Set "subitem" argument of HitTest() to -1 in generic wxListCtrl
Sub-item hit testing is still not implemented, but at least initialize
the output parameter to the documented value instead of leaving some
junk in it.
2021-08-23 00:24:24 +02:00
Vadim Zeitlin
a90dd434f7 Remove misleading word from the listctrl sample log message
It was surprising to see "right double click" for a right click.
2021-08-23 00:21:21 +02:00
Vadim Zeitlin
14511a8bec Fix selection on right click in generic wxListCtrl
Right clicking item always selected it, which made it possible to have
multiple selected items even in a single-selection control.

Restore HighlightAll(false) erroneously removed by fedc80eee3 (Improve
selection and focus events generation in wxGenericLisCtrl, 2020-09-06)
to fix this and restore the correct old behaviour.

Note that even in multiple selection mode right clicking a previously
unselected item should still clear the selection, as it does it in the
other GTK programs (and also under MSW).
2021-08-23 00:16:32 +02:00
Vadim Zeitlin
683dfcdfae Use native CATCH macros in wxDir unit test
They provide more information than CppUnit-compatibility ones.
2021-08-22 21:35:14 +02:00
Vadim Zeitlin
3e9d66f925 Remove CppUnit test case class from wxDir unit tests
No real changes, just simplify the code by getting rid of unnecessary
CppUnit boilerplate.
2021-08-22 21:27:20 +02:00
Kvaz1r
12ddfb45c5 Fix infinite recursion in wxUniv wxStdScrollBarInputHandler
This could sometimes result in crashes due to stack overflow.

Closes #19230.
2021-08-22 14:25:00 +02:00
Kvaz1r
b28a71085e Call Update before giving away focus on dismiss menu in wxUniv
Without immediate refreshing menu is appearing as inactive.

Closes https://github.com/wxWidgets/wxWidgets/pull/2479
2021-08-22 14:23:54 +02:00
Vadim Zeitlin
593864a816 Merge branch 'm1-ci-builds'
Make self-hosted Mac CI builds faster and more useful.

See https://github.com/wxWidgets/wxWidgets/pull/2476
2021-08-21 18:33:26 +02:00
Blake-Madden
03abc1e685 Fix typo in wxMSW installation instructions
Closes https://github.com/wxWidgets/wxWidgets/pull/2477
2021-08-21 17:49:35 +02:00
Vadim Zeitlin
4c2707d3dc Enable ASAN for the ARM M1 CI build
Run the tests under ASAN to detect potential problems.

Also enable optimizations for the universal build (overriding
--disable-optimise used by default) to check that there are no problems
with building wxWidgets for real production use.
2021-08-21 16:17:26 +02:00
Vadim Zeitlin
1c0258e5d6 Make wxMSW CI builds name more consistent with the other ones
No real changes, this is purely cosmetic.
2021-08-21 15:49:40 +02:00
Vadim Zeitlin
95a337349d Report errors in wxTestingModalHook in non-debug builds too
wxFAIL_MSG_AT() does nothing in these builds, so do at least something
else -- even if it's not ideal, it's still better than doing nothing.
2021-08-21 15:49:40 +02:00
Scott Talbert
8d2de3dd91 Add missing wxEventType declarations to notifmsg interface header
Closes https://github.com/wxWidgets/wxWidgets/pull/2475
2021-08-21 15:06:12 +02:00
Vadim Zeitlin
6f3be7ab26 Reduce the number of Mac CI builds and add a universal one
Don't run 8 builds for all combinations of arch/debug/C++ dialect but
just a few of them covering all of the possibilities.

Also add a static universal build which is what is commonly used for
distributing software using wxWidgets under Mac.
2021-08-21 15:05:13 +02:00
Vadim Zeitlin
cc3c836711 Fix tests build with wxDEBUG_LEVEL==0
Define various macros used in the test code (or in the headers included
from it) as nothing when wxDEBUG_LEVEL==0.

Also don't define a helper function used when asserts are enabled in
this build to avoid clang warnings about unused function.
2021-08-21 15:05:13 +02:00
Vadim Zeitlin
1a8e22d813 Rename self-hosted Mac CI workflow file for consistency
Call this file consistently with the other CI files and also ignore all
of the other files in each workflow to avoid unnecessary rebuilds.

Finally, remove a leftover mention of Travis file which doesn't exist
any longer.
2021-08-21 14:39:43 +02:00
Vadim Zeitlin
9205209099 Demonstrate the thousands separator in internat sample too
Use a number > 1000 to show the difference between the locales.
2021-08-20 23:37:28 +02:00
Vadim Zeitlin
c746953f9b Use wxUILocale for date formatting in wxDataViewDateRenderer
Use the appropriate format for the dates by using the UI, rather than C,
locale, similarly to wxGrid.
2021-08-20 23:37:28 +02:00
Vadim Zeitlin
8373b14280 Add a wxGrid with numbers and dates to the internat sample
Show that the numbers and dates in wxGrid use the expected formats.
2021-08-20 23:37:28 +02:00
Vadim Zeitlin
d08fc7575e Use wxUILocale for formatting dates in wxGrid
This is similar to the previous commit and ensures that the correct date
format is used even if setlocale() is not called.
2021-08-20 23:37:28 +02:00
Vadim Zeitlin
8fa853a3e2 Add wxGetUIDateFormat() helper function
Retrieve thr date format to use, even when wxUSE_INTL==0.
2021-08-20 23:37:28 +02:00