Commit Graph

68850 Commits

Author SHA1 Message Date
Vadim Zeitlin
0079e9a278 Don't assert for unsupported logical functions in wxGCDC
wxGCDC is often used from wxEVT_PAINT handler and showing an assert
dialog from any of its methods results in wxEVT_PAINT being generated
again, resulting in another assert and abort, which is not useful, so
remove this assert to at least avoid crashes whenever unsupported
logical function is used, as it happens e.g. in the "Mask Screen" of our
own drawing sample.
2020-07-19 19:23:12 +02:00
Vadim Zeitlin
005b6dc88b Fix window focus after the last commit
Initialize m_disableFocusFromKbd, added by the parent commit, correctly
to "false" and not "true".

See https://github.com/wxWidgets/wxWidgets/pull/1516
2020-07-19 17:24:43 +02:00
Tomay
bbdd5b4984 Add wxWindow::DisableFocusFromKeyboard()
This allows to easily exclude a window from the TAB chain.

Closes https://github.com/wxWidgets/wxWidgets/pull/1516
2020-07-19 14:55:51 +02:00
Vadim Zeitlin
e5fb5a290c Drop gcc 3.4 from the requirements in the README
It probably doesn't work any longer after the changes of 617db49fda
(Remove support for gcc < 4, 2020-07-10) and nobody uses it anyhow any
more.
2020-07-19 13:14:18 +02:00
Vadim Zeitlin
564676e773 Don't crash if wxWebView::EnableContextMenu() is called too early
Although caller of wxWebViewEdgeImpl::GetSettings() check if it returns
NULL and handle it gracefully, this function itself can crash if it's
called too early, i.e. if ICoreWebView2 hasn't been created yet.

Add a check to avoid this and just return NULL settings in this case.

Closes #18840.
2020-07-19 13:10:08 +02:00
Vadim Zeitlin
2e51076159 Merge branch 'osx-overlay'
Fix wxOverlay under recent macOS versions.

Closes https://github.com/wxWidgets/wxWidgets/pull/1977
2020-07-19 00:20:36 +02:00
Vadim Zeitlin
b1e168b946 Remove _() macros from assert messages
We don't translate those, as they're meant for (presumably
English-speaking) developers only.
2020-07-19 00:20:22 +02:00
Stefan Csomor
130e11688b New macOS overlay window implementation
Make wxOverlay work on recent macOS versions.

Closes #18399.
2020-07-19 00:18:15 +02:00
Stefan Csomor
c8ede8d430 Fix #include form for a wx header in the sample
Use quotes, not angle brackets, for #includes in wx source tree itself.

No real changes.
2020-07-19 00:15:33 +02:00
Vadim Zeitlin
0645ff25a7 Merge branch 'configure-cache'
Fix running configure with "-C" option.

See https://github.com/wxWidgets/wxWidgets/pull/1981
2020-07-18 19:56:07 +02:00
Vadim Zeitlin
90ac5eeb6a Let shell expands $HOME in GitHub workflow
Apparently $HOME doesn't get expanded otherwise, resulting in "codespell
not found" error.
2020-07-18 19:49:21 +02:00
Stefan Csomor
9f89467ff1 Support arbitrary scale factors, not just 2, when loading bitmaps
This notably enables support for @3x icons used under iOS.

Closes https://github.com/wxWidgets/wxWidgets/pull/1983
2020-07-18 19:44:43 +02:00
Vadim Zeitlin
ee09efdb63 Merge branch 'codespell-workflow'
Set up a GitHub workflow checking for spelling errors in the
documentation and headers.

See https://github.com/wxWidgets/wxWidgets/pull/1958
2020-07-18 19:43:06 +02:00
Vadim Zeitlin
e875b11f74 Run codespell from a separate script in GitHub workflow
This allows to give a more detailed error message in case of a problem
and also makes it simpler to run the spell check locally.
2020-07-18 19:42:48 +02:00
mimi89999
2ea7090de2 Change AUI panel button color to wxSYS_COLOUR_BTNTEXT
This colour is more appropriate when using wxGTK and is the same as the
previously used wxSYS_COLOUR_CAPTIONTEXT in wxOSX and should be also a
good choice for wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/1966
2020-07-18 17:15:41 +02:00
Vadim Zeitlin
0df485c928 Fix caching of inotify() availability check in configure
Commit 0fe1146b19 (Cache the result of inotify check in configure,
2020-04-15) was wrong as it defined wxHAS_INOTIFY inside the
AC_CACHE_CHECK(), meaning that this wasn't done at all if the value was
already cached.

Fix this by crrectly defining wxHAS_INOTIFY if inotify() availability
was either detected or cached.
2020-07-18 17:07:22 +02:00
Vadim Zeitlin
36f3164ea0 Pass options needed by it to libtiff configure only
Use non-standard but convenient AX_SUBDIRS_CONFIGURE() macro instead of
the standard AC_CONFIG_SUBDIRS() for libtiff, in order to allow passing
extra options to this sub-configure script without affecting any other
sub-configure ones and also without wrongly caching these options as
part of the main configure options, as happened before.

This notably fixes the problem with running "config.status", which
complained about unknown "--disable-jbig" and similar options, as they
were cached by the previous configure run.

We could also manually remove these options from ac_configure_args, but
doing it like this seems cleaner and simpler.
2020-07-18 16:59:48 +02:00
Vadim Zeitlin
b79173943a Fix problem with caching in sub-configure scripts
Since the changes of ef2b015e39 (Export CC and similar variables for
sub-configure scripts, 2018-10-20), using "-C" option with configure
didn't work any longer when also using built-in libtiff or expat, as
their configure scripts aborted due to detecting inconsistent build
environment because the values of exported CC etc variables they saw
differed from the values in the cache file.

Fixing this seems to be difficult, as we'd need to update the cache
before running the sub-configure scripts (which is simple enough), but
also remove the cached entries from it after doing it, as otherwise we'd
get the same inconsistent build environment problem simply by running
"configure -C" without any other options twice in a row, because the
first run would cache CC=gcc etc.

So work around this instead by disabling cache when exporting these
variables. And to make this workaround less annoying, restrict it to
only the cases when it's really needed, i.e. when we do modify these
variables in a non-trivial way.

With these changes, "configure -C" works again, but only uses caching if
possible.
2020-07-18 16:59:03 +02:00
Ali Asady
15a4375f93 Add beginning of Persian translations from Ali Asady 2020-07-17 16:02:38 +02:00
Stefan Csomor
051152ff95 Support GetFilterIndex() when filter choice is not shown in wxOSX
Platform native behaviour is not to show a filter, but to allow all
supported types to be selectable. Make sure GetFilterIndex still is a
valid choice (and not -1 as before).

Closes https://github.com/wxWidgets/wxWidgets/pull/1976
2020-07-17 15:06:58 +02:00
Hertatijanto Hartono
113f4bb17d Point to wxWebView Class Reference as an alternative to wxHTML
Currently "wxHTML Overview" refers to http://www.mozilla.org/ as a
high-end HTML browser engine, while already available wxWebView doesn't
get the attention it deserves.

Closes https://github.com/wxWidgets/wxWidgets/pull/1975
2020-07-17 15:02:59 +02:00
Daniel Kulp
6d12e746e1 Fix regression with making sockets non-blocking under Unix
The refactoring in the commit 51ea713826 (Extend and rename
wxSocketImpl::UnblockAndRegisterWithEventLoop(), 2019-11-20)
accidentally inverted the test for wxSOCKET_BLOCK, restore the correct
logic to make non-blocking sockets work again.

Closes #18834.
2020-07-16 11:51:51 +02:00
Vadim Zeitlin
7687d10c51 Merge branch 'empty-text-extent'
Make Get[MultiLine]TextExtent() behave consistently for empty strings on
all platforms, in particular return (0, 0) size for them from
GetTextExtent() in wxGTK, which is an incompatible change but is needed
to make it behave in the same way as the others.

See https://github.com/wxWidgets/wxWidgets/pull/1970
2020-07-16 11:43:05 +02:00
Lauri Nurmi
e6945aeedc Eliminate public header file's dependency on CoreServices.h
wx public headers are not supposed to include platform-specific headers
defining many macros that can conflict with the identifiers defined in
the application code. In this particular case, including CoreServices.h
ultimately #included AssertMacros.h, which by default on older SDKs
(<10.12) introduces various macros whose names very easily conflict with
user code.

For example, if you #included <wx/fswatcher.h> in your own code, and
your code happened to contain a symbol called 'check', or 'verify',
compilation failed.

Fix this by using pImpl idiom to move the variable requiring a type
defined in the SDK header into the source file.

Closes https://github.com/wxWidgets/wxWidgets/pull/1666
2020-07-16 01:54:24 +02:00
Vadim Zeitlin
99f210a0e7 Avoid uninitialized variable warnings in debug MSVC build
The compiler is smart enough to determine that the variables are always
initialized when they're actually used when using optimizations, but
gives a bunch of C4701 warnings for them if we don't initialize them in
the non-optimized debug builds.
2020-07-16 01:49:23 +02:00
Kasper
69da383e96 Make a dialog with a notebook in the dialog sample resizeable
It helps demonstrating how the layout works and is consistent with the
other windows in the sample (which are frames and so are resizeable by
default).

Closes #18830.
2020-07-15 16:25:52 +02:00
Vadim Zeitlin
c325087bce Use a more clear name for a dialog in the layout sample
No real changes, just rename the over generic MySizerDialog to a more
specific MyNotebookWithSizerDialog, as the goal of this dialog seems to
be to demonstrate using wxNotebook and sizers together.
2020-07-15 16:22:30 +02:00
Vadim Zeitlin
857bb9e806 Merge branch 'im/gridcombo' of https://github.com/imciner2/wxWidgets
Close the cell editor when the editor's combobox is closed.

See https://github.com/wxWidgets/wxWidgets/pull/1941
2020-07-15 16:15:42 +02:00
Vadim Zeitlin
155d8546cb Remove the mention of non-existent translators mailing list
This list was unused and removed some time ago, so don't send people on
a wild chase for it.
2020-07-15 14:38:34 +02:00
Vadim Zeitlin
1bf5e536e9 Merge branch 'generic-treectrl-cleanup'
Improve wxGenericTreeCtrl code handling system colours/theme changes.

See #18823.
2020-07-15 14:26:55 +02:00
Vadim Zeitlin
c14053c211 Merge branch 'osx-11'
Adaptations for macOS 11.0.

See https://github.com/wxWidgets/wxWidgets/pull/1940
2020-07-15 14:26:05 +02:00
Vadim Zeitlin
33e8684356 Merge branch 'ios-menu'
Add support for wxMenu under iOS.

See https://github.com/wxWidgets/wxWidgets/pull/1965
2020-07-15 14:25:30 +02:00
Jouk
dd444cc943 OpenVMS : add wxUSE_MENUBAR definition + fix for building wxMOTIF 2020-07-15 08:34:59 +02:00
Jouk
0615f02d6a OpenVMS : add wxUSE_MENUBAR definition + fix for building wxMOTIF 2020-07-15 08:34:13 +02:00
Vadim Zeitlin
d57c688d89 Return non-zero height from GetMultiLineTextExtent("") in wxMSW
This restores the previous behaviour inadvertently changed by bfeae1922d
(Minor optimizations in GetMultiLineTextExtent(), 2020-06-10) and makes
it official by documenting it and adding tests checking for it.

It wasn't completely obviously if this was intentional or accidental
before, but at least wxStaticText itself relied on the old behaviour,
and chances are that so did some code outside the library, so make this
part of the API now.

See #18825.
2020-07-15 02:10:49 +02:00
Vadim Zeitlin
46d6866c9f Make wxGCDC::GetTextExtent("") return (0, 0)
This seems more logical and is compatible with wxDC in wxMSW and wxGTK2,
as well as other kinds of DC, e.g. wxPostScriptDC.

It also looks like the current behaviour was unintentional as it
happened only because wxGCDCImpl::DoGetTextExtent() always passed all
non-null parameters to wxGraphicsContext::GetTextExtent(), even if it
didn't need the values for all of them, and thus bypassed the special
case for the empty string which was already present in the latter
function.

Fix this, making DoGetTextExtent() more efficient as a side effect (we
now avoid unnecessary calls to pango_layout_iter_get_baseline() in the
most common case), and also add another test for empty string to
wxGraphicsContext itself, for non-GTK case.

Also document this behaviour and add a test checking for it.
2020-07-15 02:10:34 +02:00
Vadim Zeitlin
a52a27ad90 Display wxSize less confusingly if any tests fail
Using "x" as separator between the components created confusion with
hexadecimal notation, resulting in confusing messages like "0x17==0x0"
that seemed to describe comparison of 2 numbers and not 2 wxSize
objects.

Using "*" is also more consistent with wxRect output format.
2020-07-15 02:09:42 +02:00
Vadim Zeitlin
844ec191f0 Use CallGetTextExtent() directly in GetMultiLineTextExtent()
There is no need to pass by GetTextExtent() now that we already make
sure width/height are non-null in this function, so just construct the
MeasuringGuard slightly earlier and call CallGetTextExtent() directly.

No real changes.
2020-07-15 01:23:23 +02:00
Vadim Zeitlin
55c71fdac9 Ensure that pointers in GetMultiLineTextExtent() are always valid
Do the same thing as in GetTextExtent() to simplify the code a little
and also avoid temporary variables.

No real changes.
2020-07-15 01:21:14 +02:00
Vadim Zeitlin
2280e43fe9 Factor out wxTextMeasureBase::GetEmptyLineHeight()
No real changes, just refactor to extract a trivial helper function.
2020-07-15 01:16:23 +02:00
Vadim Zeitlin
db556fc388 Remove CppUnit boilerplate from wxDC::GetTextExtent() unit tests
Drop the test case class and use CATCH macros.
2020-07-14 23:36:23 +02:00
Vadim Zeitlin
093c3067e8 Don't use windres --use-temp-file option
According to the manual, it should only be needed for Win9x systems not
supported since a long time anyhow and this option is apparently buggy
in recent MinGW binutils as it results in build errors when used, see
https://github.com/msys2/MINGW-packages/issues/6558

Closes https://github.com/wxWidgets/wxWidgets/pull/1961
2020-07-14 22:10:58 +02:00
PB
88a6c8c905 Fix building wxMSW using GCC 10.1 with C++20 standard
Add comparison operator overloads using NativeFormat to wxDataFormat
to prevent ambiguous operator overload errors.

Closes https://github.com/wxWidgets/wxWidgets/pull/1962
2020-07-14 22:09:47 +02:00
Hertatijanto Hartono
7f617d97a5 Add word 'be' for consistency of error message
No real change, just a typo fix after f1f27bc37c (Checks for 3rdparty
libraries availability in configure, 2020-07-13).

Closes https://github.com/wxWidgets/wxWidgets/pull/1969
2020-07-14 22:08:27 +02:00
Vadim Zeitlin
c073995352 Merge branch 'aui-dark-mode'
Fixes for AUI in dark mode, especially, but not only, under macOS.

See https://github.com/wxWidgets/wxWidgets/pull/1955

Closes #18812.
2020-07-14 20:26:52 +02:00
Vadim Zeitlin
5bf7db419a Show whether generated setup.h files changed or not
Don't output "ok" for all files when running update-setup-h, this was
not very informative and possibly misleading. Only show "ok" for the
actually updated files and "unchanged" otherwise.
2020-07-14 20:24:52 +02:00
Vadim Zeitlin
e95ff829ef Remove extra quotes from --with-cxx error message
No real changes, just a cosmetic improvement to the error message given
if the value of --with-cxx=NN option is not recognized.
2020-07-14 20:21:00 +02:00
Vadim Zeitlin
33038a2ce7 Remove the now unnecessary empty wxMessageDialog dtor
No real changes, just some minor cleanup after 220dfe17ea (Replace
deprecated API usage for window modal dialogs, 2020-07-09).
2020-07-14 20:16:03 +02:00
Stefan Csomor
ab858b5805 Produce NFD in wxConvFileName::FromWChar() on macOS
This ensures that fn_str() returns the string in the expected,
decomposed, format.

Also simplify the code by removing workarounds for old systems which are
not supported any more and make explicit the fact that under macOS
ToWChar() always produced NFC.
2020-07-14 20:15:04 +02:00
Stefan Csomor
47cc0b8946 Replace deprecated NSDate dateWithString 2020-07-14 20:10:51 +02:00