Commit Graph

71035 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
2cd1ec668c Merge branch 'wxWidgets_cmake_macos' of https://github.com/eligovision/wxWidgets
CMake fixes for macOS.

See https://github.com/wxWidgets/wxWidgets/pull/2363
2021-05-16 22:42:18 +02:00
Vadim Zeitlin
2dc57eef4b Merge branch 'gtk-print-page-setup'
Fix saving print page setup with wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2369
2021-05-16 16:57:46 +02:00
Vadim Zeitlin
fc2e01d9a2 Make GtkPageSetup-related functions private
These functions don't need to be members of wxGtkPrintNativeData as they
don't use this object at all, so one shouldn't be required to call them.

And rather than making them static, just make them private functions
instead.

No real changes, this is just a refactoring.
2021-05-16 00:55:04 +02:00
Vadim Zeitlin
2514945ab3 Fix retrieving paper size and orientation from GTK print dialog
The paper size and orientation in wxPrintData were never updated because
we didn't retrieve them from GTK correctly: they need to be extracted
from "default-page-setup" property and not the main GtkPrintSettings
themselves, at least with GTK 3.
2021-05-16 00:55:04 +02:00
Vadim Zeitlin
131d07b430 Update print dialog data after printing successfully
This is necessary in order to get the information entered by the user in
the dialog and was already done in PrintDialog(), but not Print()
itself -- now do it there as well.
2021-05-16 00:55:04 +02:00
Vadim Zeitlin
16ca2df0c4 Refactor return code in wxGtkPrinter::Print()
No real changes, just make it simpler to do other things before
returning successfully by handling error returns separately.

This is also more consistent with PrintDialog() method of the same
class.

No real changes.
2021-05-16 00:55:04 +02:00
Vadim Zeitlin
1a515725b3 Suppress ASAN leak reports when using print dialog in wxGTK
There is nothing we can do about them, as memory is allocated from a
CUPS functions used by GTK itself, so suppress them.
2021-05-16 00:55:04 +02:00
Ian McInerney
c2d176e4a3 interface: Remove redundant definition of wxPenInfo::LowQuality 2021-05-13 21:33:06 +01:00
Ian McInerney
8482b50129 Fix interface return type for MSWSetTabStops 2021-05-13 21:32:22 +01:00
Ian McInerney
1688429249 Ensure the return documentation is on the correct function
UnreserveId doesn't return anything, and the documentation for the
boolean return in wxFileDialog should be on Create not the constructor.
2021-05-13 21:32:22 +01:00
Vadim Zeitlin
4a7dc31153 Improve wxUSE_DPI_AWARE_MANIFEST description in high DPI overview
Make it more clear that wx/msw/wx.rc must be included for this option to
be taken into account.
2021-05-13 18:53:42 +02:00
PB
99bcb29fce Remove wxGTK1 mentions from the documentation
GTK1 is no longer supported, so do not document control limitations when using it.
2021-05-13 06:52:09 -07:00
Ian McInerney
363216ab29 Readd accidentally deleted argument in wxConfig interface
This missing argument was removed in 0c837e5310
and causes the doxygen docs for wxConfigBase to be incorrect and miss
a lot of functions.
2021-05-13 06:49:31 -07:00
konstantin.matveyev
26671c944c config.cmake tweak for macOS: .tbd extension added 2021-05-11 11:48:08 +03:00
Konstantin S. Matveyev
edc82ffce4 config.cmake fix for macOS 2021-05-09 17:01:00 +03:00
Maarten Bent
9814d58415 CMake: Improve adding external libraries to wx-config
Don't add -l to libraries already containing it (for example -lpthread).
Change libraries with format libName.so or libName.a to -lName,
configure also uses -l for these libraries. Account for possible invalid
libraries (Name-NOTFOUND) which could happen with imported libraries,
for example OpenGL::OpenGL.

Closes https://github.com/wxWidgets/wxWidgets/pull/2359
2021-05-09 00:29:29 +02:00
Vadim Zeitlin
4b71e50094 Merge branch 'opengl-update-info' of https://github.com/PBfordev/wxWidgets
Minor updates to OpenGK-related documentation and comments.

See https://github.com/wxWidgets/wxWidgets/pull/2360
2021-05-09 00:28:16 +02:00
Vadim Zeitlin
07459e8f2f Avoid bogus context menu events in wxGTK wxDataViewCtrl
Right clicking on the column header shouldn't generate context menu
events, but it did because our gtk_dataview_button_press_callback() got
these events for both the "bin" window, containing the items, and the
"header" window.

Fix this by filtering out the events not sent to the right window.

It would be even better to not get these events in the first place, i.e.
somehow not connect to them in the first place, but it's not clear how
to do this, so settle for this solution for now.

For testing this fix, just right click any column in the dataview
sample: previously this generated both messages about the column header
right click and the context menu in wxGTK, while now it only generates
the former, as in the generic version.
2021-05-09 00:15:48 +02:00
Vadim Zeitlin
1ede92afa1 Use temporary variable in gtk_dataview_button_press_callback()
No real changes, just simplify the code a bit by using a local variable
instead of repeating the same expression a couple of times.
2021-05-09 00:15:12 +02:00
Tim Stahlhut
d85665319f Update MSys2 URLs in build documentation 2021-05-08 12:58:54 -04:00