Commit Graph

70755 Commits

Author SHA1 Message Date
Vadim Zeitlin
894861becb Fix wxRTTI for wxAuiNotebook by deriving it from wxBookCtrlBase
Otherwise wxDynamicCast-ing wxAuiNotebook to wxBookCtrlBase didn't work
(even if the more usual and useful upcast did still work).

Add a unit test for this.
2021-06-08 22:40:29 +02:00
Vadim Zeitlin
fbe12789f6 Refactor wxAuiNotebook unit test to use a test fixture
No real changes, this will just make adding more tests using
wxAuiNotebook simpler.
2021-06-08 22:40:03 +02:00
Václav Slavík
c817a434d8 Fix wxIcon wxDVC columns under wxGTK
b376d1402b accidentally broke columns
with wxIcon type. Contrary to that commit's assumption, operator<<
cannot convert wxIcon to wxBitmap and asserts:

src/common/bmpbase.cpp(33): assert "variant.GetType() == "wxBitmap"" failed in operator<<().

Fixed by restoring explicit conversion.
2021-06-07 07:59:56 -07:00
Tijs Vermeulen
7ca4705bd7
removed build-time condition SDK >= 10.14 (#2377)
"trigger redraw upon shown for layer-backed views" is also needed when building with sdk 10.13

the build-time check that the used SDK must be 10.14 or higher is not needed
I checked building with SDK 10.12 and 10.13

the used NsView functions are available in far older SDK's
* https://developer.apple.com/documentation/appkit/nsview/1483475-setneedsdisplay
 Availability macOS 10.0+ 
* https://developer.apple.com/documentation/appkit/nsview/1483473-ishiddenorhashiddenancestor
 Availability macOS 10.3+

I did not add an ifdef checking for sdk 10.3 or higher - I assume the minimum requirement for building wxWidgets is higher than 10.3

see also e484a2db19
2021-06-03 18:18:20 +02:00
Václav Slavík
3417c8e48b Fix passing of default language to wxTranslations
wxTranslations needs the information that user's default language is
used; in particular, it may choose to use a cascade of user-preferred
languages to choose the best UI language.

This was accidentally broken by
18bf718f60 which changed the logic to
fill shortName from the builtin database. This consequently changed
wxTranslations to use only the single detected language and ignore
user's preference cascade.

Closes https://github.com/wxWidgets/wxWidgets/pull/2385
2021-05-31 16:35:38 +02:00
PB
e050c2a1b7 Fix link in High DPI Overview
Make MSW-specific link to point to Win32 documentation
instead of MacOS one.

Closes https://github.com/wxWidgets/wxWidgets/pull/2384
2021-05-31 16:35:07 +02:00
Vadim Zeitlin
01fd98c783 Merge branch 'generic-dvc-composite'
Use wxCompositeWindow for generic wxDVC implementation.

See https://github.com/wxWidgets/wxWidgets/pull/2382
2021-05-31 16:33:50 +02:00
Vadim Zeitlin
82ebbe880a Merge branch 'grid-colours'
Fix colours of wxGrid cursor after a recent regression.

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

Closes #18941.
2021-05-31 16:28:28 +02:00
Vadim Zeitlin
f1d84277b4 Merge branch 'nicer-boxsizer-asserts'
Improve the error messages by indicating what should be done to avoid
the asserts and provide a way to disable them if really needed.

See https://github.com/wxWidgets/wxWidgets/pull/2375
2021-05-31 15:18:37 +02:00
Vadim Zeitlin
58cbad1bc9 Merge branch 'im/doxyfix2' of https://github.com/imciner2/wxWidgets
Fix various documentation problems.

See https://github.com/wxWidgets/wxWidgets/pull/2367
2021-05-31 15:16:43 +02:00
Ian McInerney
3a6c62a965 docs: Swap columns for stock image and label
In newer doxygen versions, the label was being used as the caption
for the image and not appearing in the 3rd column. The only way to
really fix this seems to be to make the image the last column so that
it doesn't eat the remaining text (there is no way to escape it
apparently).
2021-05-30 17:11:21 +01:00
Ian McInerney
d730512d34 Add more aliases for row3col, since there are now places with more commas 2021-05-30 16:41:45 +01:00
Ian McInerney
747acb729f Fix docs for definitions
* Missing parenthesis in the text
* Use brackets when calling doxygen macro instead of parenthesis
2021-05-30 16:40:32 +01:00
jwiesemann
5dbdada6aa Fix wxMask copy ctor from an uninitialized mask in wxMSW
Don't assert when copying an invalid, i.e. uninitialized, mask in wxMSW.

Do initialize m_maskBitmap in any case in the copy ctor.

Closes #19171.
2021-05-27 23:54:07 +02:00
Vadim Zeitlin
37af51c513 Document that wxDC::DrawSpline() requires at least 3 points
This is the case for wxMSW implementation and while the other ones seem
to accept 1 or 2 points too, document the most stringent requirement,
especially because not satisfying it results not "just" in assertion
failure, but also in a crash in wxMSW.

This should obviously be improved further by, at the very least, using
wxCHECK and not wxASSERT in wxMSW code or, maybe, actually handling the
degenerate cases there if all the other ports really support them.

See #19172.
2021-05-27 23:45:02 +02:00
Vadim Zeitlin
f16b502f66 Forward key down/up events from wxCompositeWindow children too
There doesn't seem to be any reason to only forward CHAR events, but not
KEY_{DOWN,UP} ones, so do the same thing for the latter ones too.

This allows to get rid of GetMainWindow() call in wxDataViewCtrl unit
tests, as wxEVT_KEY_DOWN are now correctly received in the control
itself and not just its main window.
2021-05-24 14:24:24 +01:00
Vadim Zeitlin
3ed930c736 Use wxCompositeWindow for generic wxDataViewCtrl implementation
This makes several methods that didn't have any effect before work
correctly, including SetToolTip(), whose effect is now shown in the
sample, but also SetCursor() and SetLayoutDirection().

Some methods would now actually work too well: SetForegroundColour() and
SetBackgroundColour() implementations in wxCompositeWindow apply to all
sub-windows, but in wxDataViewCtrl they are only supposed to affect the
items, but not the header, so we need to override them to prevent the
base class version from being used. It is still preferable to explicitly
disable these two methods and inherit all the other ones (including any
possibly added in the future) from wxCompositeWindow to implementing all
the methods manually in wxDataViewCtrl itself.
2021-05-24 14:24:24 +01:00
Vadim Zeitlin
fa00fd24f0 Fix event origin for wxEVT_CHAR from wxCompositeWindow children
Use the just added wxEventObjectOriginSetter to set the event object and
ID to that of wxCompositeWindow itself, rather than that of the child
window where the event had actually occurred.
2021-05-24 14:24:24 +01:00
Vadim Zeitlin
9a150ba486 Add wxEventObjectOriginSetter helper class
This RAII helper can be used to temporarily change the event object and
ID of a wxEvent and will be used when redirecting events to make events
from one object to appear as coming from another one.
2021-05-24 14:24:24 +01:00
Vadim Zeitlin
0f0f9eb790 Merge branch 'gtk-key-events'
Fix key events for wxDataViewCtrl in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2379
2021-05-24 15:20:19 +02:00
Vadim Zeitlin
17bc510995 Document when values used with wxDataViewCtrl must be non-null
Explicitly document that wxDataViewRenderer::SetValue() is never called
with null values (if we ever really need this, we should add a separate
ClearValue() method) and also document that MakeHighlighted() both
receives and must return a non-null value (the latter is required
because the returned value is passed to SetValue()).

See #18934.
2021-05-24 15:18:18 +02:00
Vadim Zeitlin
e067e4233c Revert "Fix showing cells without values in wxDataViewCtrl"
This reverts commit f68c88b8d2 which
doesn't seem necessary any longer: the originally observed problem can't
be reproduced in contemporary macOS versions (10.14+), while calling
SetValue() even for null values results in asserts from several
renderers which don't expect this to happen.

This commit is best viewed ignoring whitespace-only changes.

Closes #18934.
2021-05-24 15:15:17 +02:00
Vadim Zeitlin
25c0e27b6c Remove apparently unnecessary call from wxGTK wxToolBar
ConnectWidget() will be called from PostCreation() just below, so it
doesn't seem necessary to call it explicitly from wxToolBar::Create().
2021-05-24 14:43:05 +02:00
Vadim Zeitlin
3e70842775 Test that we get key events from wxDataViewCtrl
This test passes in wxGTK after the previous commit changes.
2021-05-24 14:43:05 +02:00
Vadim Zeitlin
c9d7ba3171 Fix key events for native GTK controls such as wxDataViewCtrl
Connect to key-{press,release}-event on the "focus widget" rather than
the main widget, to ensure that we get them before the native control
does and so can generate the key events even for the keys handled by the
control internally.

This allows to get events for the arrow keys in wxDataViewCtrl, for
example, while previously these keys were consumed by the control
itself, as could be seen with the following patch to the sample

---------------------------------- >8 --------------------------------------
diff --git a/samples/treelist/treelist.cpp
b/samples/treelist/treelist.cpp
index af6905cecb..74894cc9a9 100644
--- a/samples/treelist/treelist.cpp
+++ b/samples/treelist/treelist.cpp
@@ -349,6 +349,10 @@ bool MyApp::OnInit()
     sizer->Add(textLog, wxSizerFlags(1).Expand());
     SetSizer(sizer);

+    m_treelist->GetView()->Bind(wxEVT_KEY_DOWN, [](wxKeyEvent& e) {
+        wxLogMessage("Key in tree: %d", e.GetKeyCode());
+        e.Skip();
+    });

     // Finally show everything.
     Show();
---------------------------------- >8 --------------------------------------

Pressing arrow keys didn't generate the expected message before (unless
the focus was on the control header and not on the main area itself).

This may fix similar issues with other controls setting m_focusWidget as
well.
2021-05-24 14:43:05 +02:00
PB
43ace6193a Correct dependencies for wxAUI library in documentation
Library wxAUI does not depend on libraries wxHTML or wxXRC,
remove these incorrect dependencies from documentation.

Closes https://github.com/wxWidgets/wxWidgets/pull/2376
2021-05-22 21:32:29 +01:00
Pedro Vicente
26795b7432 Use C++11 by default in CMake build under macOS
Force the use of C++11 standard on macOS to avoid C++11 specific
warnings with clang.

Closes https://github.com/wxWidgets/wxWidgets/pull/2374
2021-05-22 21:30:10 +01:00
PB
9e34269191 Correct documentation for XRC sizeritem property "ratio"
In the description of XRC sizeritem property "ratio" refer to
wxSizerItem::SetRatio() instead of non-existent wxSizer::SetRatio().

Closes https://github.com/wxWidgets/wxWidgets/pull/2373
2021-05-22 21:29:12 +01:00
Vadim Zeitlin
01aebc08ee Merge branch 'gtk-fix-bogus-dvc-context-menu'
Fix bogus wxDVC context menu event in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2362
2021-05-22 21:28:09 +01:00
Vadim Zeitlin
0b20b97704 Merge branch 'spinctrl-digits'
Improve setting the number of digits in wxSpinCtrlDouble and make it
consistent on all platforms.

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

Closes #17085.
2021-05-22 21:25:32 +01:00
Vadim Zeitlin
7a6bec389b Merge branch 'msw-fix-BCM_GETIDEALSIZE'
Fix size of the buttons when not using manifest in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/2346
2021-05-22 21:18:23 +01:00
Vadim Zeitlin
880c50bade Avoid bogus assert failures when releasing mouse capture
Calling ReleaseMouse() from wxEVT_MOUSE_CAPTURE_LOST handler could
result in bogus asserts about ReleaseMouse() reentrancy because the
function generating "capture lost" events in wx itself wrongly set the
wxMouseCapture::changing flag, instead of just examining it, as it was
supposed to do.

This corrects a problem introduced back in b0ad1918b9 (No changes, just
use wxRecursionGuard instead of manual boolean flag., 2013-08-18) which,
contrary to the commit message, did change the behaviour by replacing a
simple test with the use of wxRecursionGuard here.
2021-05-22 16:23:53 +01:00
Vadim Zeitlin
c31b32d756 Group the same colours together in Mac wxSystemSettings code
No real changes, just make it more obvious that wxSYS_COLOUR_BTNSHADOW
and wxSYS_COLOUR_3DDKSHADOW are mapped to the same colour under Mac.
2021-05-22 16:15:24 +01:00
Vadim Zeitlin
092bd70519 Restore lighter shadow colours for wxGrid row/column separators
This was also changed in 3c28244806 (Improve wxGrid appearance in dark
mode under macOS, 2020-08-07) but there doesn't appear to be any good
reason to do it as wxSYS_COLOUR_3DDKSHADOW is the same as the previously
used wxSYS_COLOUR_3DSHADOW (a.k.a. wxSYS_COLOUR_BTNSHADOW) under Mac, so
this didn't change anything there -- but did make the shadows darker and
hence more pronounced and more noticeable under MSW.

Undo this change to restore the old and nicer looking appearance.
2021-05-22 16:13:18 +01:00
Vadim Zeitlin
829d3fd094 Restore wxGrid cursor visibility under non-Mac platforms
The changes of 3c28244806 (Improve wxGrid appearance in dark mode under
macOS, 2020-08-07) resulted in using white highlight colour over white
background under at least MSW and probably elsewhere, making the grid
cursor invisible by default.

Fix this by using wxSYS_COLOUR_WINDOWTEXT which must contrast with
wxSYS_COLOUR_WINDOW used for the background colour.
2021-05-22 16:06:10 +01:00
Ian McInerney
b9d9ba46ce Fix doxygen page linking bugs 2021-05-21 02:58:57 +01:00
Ian McInerney
07a129a9cc Fixup the QT architecture markdown page 2021-05-21 02:48:05 +01:00
Ian McInerney
33c1088aad Escape the HTML tags in the doxygen comments 2021-05-21 02:26:31 +01:00
Ian McInerney
4bb1fe8e0a Fix doxygen section bugs 2021-05-21 02:26:24 +01:00
Ian McInerney
36ae759b7c Fix doxygen misplaced div warnings 2021-05-21 02:09:56 +01:00
Ian McInerney
c628ffdfff Don't specify the @def for defines
This isn't needed when the comment comes right before the define,
and also in newer doxygen versions it causes the __WXDEBUG__ macro
to be not documented because it interprets @def __WXDEBUG__ as being
the WXDEBUG macro instead.
2021-05-21 01:57:54 +01:00
Ian McInerney
b084271a1a Fix grouping warning on newer doxygen
Newer doxygen wants the bracket in its own line and not in the
comment for the enum.
2021-05-21 01:56:39 +01:00
Vadim Zeitlin
1d6c740f3b Disable sizer flag checks if WXSUPPRESS_SIZER_FLAGS_CHECK is set
This provides a less intrusive, and also usable by the end users rather
than only by the developers, way of doing the same thing as the just
added wxSizerFlags::DisableConsistencyChecks() does.
2021-05-20 13:27:08 +01:00
Vadim Zeitlin
2e289d7231 Add wxSizerFlags::DisableConsistencyChecks()
This allows to (hopefully temporarily) disable size flag check asserts.
2021-05-20 13:27:06 +01:00
Vadim Zeitlin
5502d2d86b Make sizer flag asserts even more verbose and hopefully helpful
Try to indicate that these asserts are informative and don't indicate a
fatal problem.
2021-05-20 13:26:44 +01:00
Vadim Zeitlin
405cfe7f32 Add ASSERT_NO_IGNORED_FLAGS() macro and use it in wxBoxSizer code
No real changes, just refactor the asserts a bit before the upcoming
changes and also try to make the messages more clear and useful.
2021-05-20 13:25:10 +01:00
Vadim Zeitlin
a352dee1f1 Disable warnings inside winsock2.h when using MSVC too
We already disabled the warnings inside windows.h, but since bf5090bcf3
(Enable Winsock 2 and IPv6 build options by default, 2021-04-24) we
could get warnings from winsock2.h, so move its inclusion inside the
region where the warnings were disabled too.

For the record, the warnings were, rather surprisingly, C4668, which is
disabled by default, but apparently was enabled somewhere inside (at
least some versions of) SDK headers.

This commit is best viewed with --color-moved git option.
2021-05-19 18:51:30 +01:00
cnbatch
94b399418c Fix an issue that MSVC 2019 cannot compile with CMake
Fix using PCH with MSVC too, which notably fixes using it with vcpkg.

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

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2021-05-19 19:48:04 +02:00
Vadim Zeitlin
1b76ff4887 Disable wxWebRequest tests on CI platforms without Python 3
This currently means macOS 10.11 only, which is only used on Travis CI
and Python 2 installation there is broken anyhow, so this doesn't make
anything worse than it already is.
2021-05-17 01:26:32 +02:00
Maarten Bent
750bf01fe6 CMake: don't include libc.so in wx-config
Closes https://github.com/wxWidgets/wxWidgets/pull/2364
2021-05-16 22:43:50 +02:00