Commit Graph

68888 Commits

Author SHA1 Message Date
Vadim Zeitlin
b762d2fb0f Restore -DWXUSINGDLL in wx-config output
This has been broken by the wrong test added in 13b0981eb9 (Get rid of
WXCONFIG_ONLY_CPPFLAGS variable in configure, 2020-02-02), which was
always false because it tested literal "SHARED" instead of the value of
the variable with this name.

This went unnoticed because WXUSINGDLL is not really necessary anyhow
under Unix, but it broke the build of any project building MSW binaries
using wx-config.
2020-07-21 15:17:45 +02:00
Paul Cornett
83f1df7b6b Avoid -Wsign-compare warning 2020-07-20 12:17:21 -07:00
Vadim Zeitlin
8a81391cf4 Make wx/htmllbox.h self-contained again
Fix problem with wxUSE_HTML added in 05cce8d89d (Add wxUSE_HTML check to
wxHtmlListBox header, 2020-05-28) not being defined when this header is
the first one to be included.
2020-07-20 21:09:43 +02:00
Paul Cornett
f0cf9401b0 Avoid Gtk-CRITICAL "gtk_widget_get_toplevel: assertion 'GTK_IS_WIDGET (widget)' failed"
Happens when running the tests
2020-07-20 10:23:52 -07:00
Paul Cornett
6a2005945a Avoid -Wcast-qual warning 2020-07-20 08:14:06 -07:00
Paul Cornett
de7ab5527b Avoid -Wdouble-promotion warnings in headers 2020-07-20 08:12:02 -07:00
Jouk
516aed372b Suppress warnings on OpenVMS 2020-07-20 16:24:27 +02:00
Jouk
b1270ef87d Suppress warnings on OpenVMS 2020-07-20 16:23:52 +02:00
Vadim Zeitlin
2f450733d4 Merge branch 'dpi-scaling-factor'
Add DPI scaling factor and revert content scaling factor behaviour in
wxMSW and other ports not using logical pixels to be 3.0 compatible.

See https://github.com/wxWidgets/wxWidgets/pull/1985
2020-07-20 15:55:23 +02:00
Vadim Zeitlin
086ab12eee Fix trivial spelling mistake in wxLog::PassMessages() comment
s/reenable/re-enable/
2020-07-20 15:54:10 +02:00
Vadim Zeitlin
4dd009136c Merge branch 'aui-auto-uninit'
Call wxAuiManager::UnInit() automatically.

Closes #14145.
2020-07-20 15:49:05 +02:00
Vadim Zeitlin
4552009805 Merge branch 'pr1312-no-unsafe-wxstring-conv'
Add a way to optionally disallow all implicit conversions between
wxString and "const char*".

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

See #18113.
2020-07-20 15:47:17 +02:00
Vadim Zeitlin
4beccf8883 Revert "Make sure toplevel is active in SetFocus()"
This reverts commit d06e97e8d9 as it
resulted in regression in wxSplitterWindow behaviour.

See #18783.

Closes #18845.
2020-07-20 15:43:43 +02:00
Maarten Bent
00f4242442 CMake: use library namespace in documentation example
Closes https://github.com/wxWidgets/wxWidgets/pull/1988
2020-07-20 14:51:39 +02:00
Stefan Csomor
818f8fe1d6 macOS: fixing wxImage generation from wxBitmap
after 992b594c15 the byte value for ‚masked‘ changed, adapt this accordingly, see https://trac.wxwidgets.org/ticket/18775
2020-07-20 11:05:17 +02:00
mimi89999
70659b6b7c Set tab label colour in AUI native MSW tab art
We must always change the text colour when using non-default background
colour, as otherwise the text may become unreadable in some themes,
which was exactly what happened in the standard "High contrast" theme
when using wxAUI under MSW before.

Closes https://github.com/wxWidgets/wxWidgets/pull/1989

Closes #18832.
2020-07-20 00:47:54 +02:00
Vadim Zeitlin
1a4eff90ae Make opening wxComboCtrl popup under MSW work again
This was recently broken in 3bcbc8fe8e (Implement dismissal for
unfocused wxPopupTransientWindow, 2020-07-09) as the changes in it
resulted in the popup being dismissed as soon as it was opened with a
mouse click.

Fix this by changing several things:

- Check for wxCurrentPopupWindow before processing the message, not
  after, as the message handler itself could create a new popup and we
  definitely don't want to dismiss it immediately after its creation.

- Check for mouse DOWN events only, not UP and DBLCLK ones, as otherwise
  it might be possible that UP matching the same DOWN whose handler
  showed the popup would dismiss it. As for DBLCLK, it's just
  unnecessary, as it should be always preceded by a DOWN message anyhow.

- Don't dismiss the popup if the message is sent to it or one of its
  children, as in this case the popup itself is supposed to deal with it
  (as wxComboCtrl popup does) and we don't want to prevent it from doing
  it.

With these changes both wxComboCtrl and wxTipWindow seem to work as
expected.

Closes #18844.
2020-07-20 00:41:55 +02:00
Vadim Zeitlin
ae7a033cbd Fix units produced by wxSVGFileDC after the previous commit
Reimplement the logic of 16a02e6338 (Use DPI independent text size in
wxSVGFileDC, 2019-08-06) without using GetContentScaleFactor(), but
using wxDC::GetPPI() directly and do it under the platforms not using
logical pixels only.

This makes the units correct again in SVGs produced when using high DPI
under MSW even although wxDC::GetContentScaleFactor() now returns 1 in
this case.
2020-07-19 19:33:53 +02:00
Zane U. Ji
42bf26730f Implement keyboard navigation in rich text editor symbols dialog
Enable and fix keys processing in wxSymbolListCtrl::OnKeyDown().

Also set focus to this control initially as it's more useful and it's
expected that cursor arrows can be used to move the selection in it
rather than changing selection in the font comboboxes.

Note that "Enter" key still doesn't work correctly, i.e. doesn't close
the dialog when it's pressed in the symbols list control.

Closes #16033.

Co-authored-by: Igor Korot <ikorot01@gmail.com>
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2020-07-19 19:24:22 +02:00
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
73bd293416 Revert "Implement GetContentScaleFactor for wxMSWDCImpl"
This reverts commit b0152155c0.

After changing wxWindow::GetContentScaleFactor() to return 1 on
platforms without logical pixels, such as MSW, in the grandparent
commit, make wxDC::GetContentScaleFactor() consistent with it too.
2020-07-19 13:39:27 +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
379e718a33 Remove recently added GetOpenGLScaleFactor()
It has become unnecessary after the previous commit, as now the generic
GetContentScaleFactor() can be used instead of it on all platforms, so
revert the changes of f6cc8ff52c (Add GetOpenGLScaleFactor() to abstract
OpenGL coordinates scaling, 2020-07-10).

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

See #17391.
2020-07-18 23:51:05 +02:00
Vadim Zeitlin
cd8b2d3096 Make wxWindow::GetContentScaleFactor() return 1 under MSW again
This reverts bc492a9e6e (Make wxWindow::GetContentScaleFactor() useful
for non-OSX platforms., 2015-03-18) and restores the old behaviour from
wxWidgets 3.0, which consisted in only returning factor different from 1
from this function for the platforms distinguishing logical and physical
pixels.

After this change, the return value of this function can be portably
used on all platforms to convert between logical and physical pixels,
independently of the current DPI.
2020-07-18 23:44:58 +02:00
Vadim Zeitlin
1422991602 Add wxWindow::GetDPIScaleFactor()
This function replaces some uses of GetContentScaleFactor(), where a
factor greater than 1 must be used even under the platforms not doing
any logical/physical pixel mapping, such as MSW.

For now GetContentScaleFactor() is still unchanged, but it will return 1
for such platforms in the future and adding GetDPIScaleFactor() allows
to avoid changing the behaviour of the code which relied on its current
behaviour.
2020-07-18 23:42:44 +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
Vadim Zeitlin
ceb21d5e86 Also call wxAuiManager::UnInit() when manager itself is destroyed
This completes the changes of the previous commit and should ensure that
UnInit() is always called, whoever is destroyed first -- the managed
window or the manager itself.

Also update the documentation to mention that calling UnInit()
explicitly is not necessary any longer.
2020-07-18 17:51:41 +02:00
Hans Mackowiak
f646532889 Call wxAuiManager::UnInit() if associated frame is destroyed
Don't require the application code to explicitly do it if the frame is
destroyed before the manager itself.
2020-07-18 17:47:34 +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
Arrigo Marchiori
05cce8d89d Add wxUSE_HTML check to wxHtmlListBox header
Avoid compilation errors if wx/htmllbox.h gets included when wxUSE_HTML
is off.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
3aaa31e703 use wxConvWhateverWorks for translation strings
Revert the introduction of wxGet-SetInlineEncoding()
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
5facb56580 note that encodings could fail 2020-07-17 17:52:16 +02:00
Arrigo Marchiori
464aeb8f84 avoid using wxNO_IMPLICIT_WXSTRING_ENCODING in utf-8-only builds 2020-07-17 17:52:16 +02:00
Arrigo Marchiori
40d1a3da35 Test building all headers with wxNO_IMPLICIT_WXSTRING_ENCODING
Check that all our public headers compile with this macro defined and
that using a char string without specifying its expected encoding
results in the expected compilation failure in this case.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
d16787e1af Fix tests build with wxNO_IMPLICIT_WXSTRING_ENCODING
Add wxASCII_STR to the tests sources too.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
57e136d9e1 Enforce consistency of encoding-related macros
Force wxNO_UNSAFE_WXSTRING_CONV on if wxNO_IMPLICIT_WXSTRING_ENCODING is
on, as the latter is even stronger than the former.
2020-07-17 17:52:16 +02:00