Commit Graph

69161 Commits

Author SHA1 Message Date
Vadim Zeitlin
bcb016613e Make wxRadioButtonBase a plain class, not template
Use a dirty hack to accommodate wxUniv by deriving wxRadioButtonBase
from wxCheckBox, rather than wxControl, there. This is not pretty, but
should be addressed by refactoring wxUniv code and in the meanwhile all
the other ports don't have to bother with using a template class
unnecessarily.
2020-09-21 18:01:37 +02:00
Vadim Zeitlin
3d72c009be Add wxRadioButtonBase::{Set,Get}Value()
Now that we do have wxRadioButtonBase class, declare wxRadioButton API
methods as pure virtual in it, to force the derived classes to implement
them.

Also remove the outdated comment saying that there is no base class for
wxRadioButtons in different ports, this is not true any longer.
2020-09-21 16:13:55 +02:00
Vadim Zeitlin
9e51389676 Improve radio button navigation functions documentation
Correct the previously wrong described behaviour for wxRB_SINGLE buttons
and also mention that Get{First,Last}InGroup() never return NULL.
2020-09-21 16:02:40 +02:00
Vadim Zeitlin
b84bc8e26a Add unit tests for radio button group navigation functions
Extend the existing "group" and "single" tests to check these functions
too.

This at least verifies that these functions can be used.
2020-09-21 15:54:42 +02:00
Vadim Zeitlin
ee55427c28 Make it simpler to write useful tests comparing windows
Allow creating wxWindowPtr from wxScopedPtr<> too, to avoid having to
use .get() in the test code, and add CHECK_SAME_WINDOW() macro which
gives more useful information about the windows in case of failure.
2020-09-21 15:54:42 +02:00
Vadim Zeitlin
1a4f628e40 Make radio button navigation functions const
This requires adding a couple of const_cast<>s in their implementation
in order to still allow them returning non-const wxRadioButton pointers,
but this seems preferable to not being able to call them on a const
wxRadioButton in the first place.
2020-09-21 15:36:41 +02:00
Vadim Zeitlin
b5fb9bd8d6 Compile radio button group navigation functions on all platforms
Previously they were only used, and compiled, on the platforms without
wxHAS_NATIVE_TAB_TRAVERSAL, i.e. were not compiled at all in wxGTK, but
we now need them everywhere as they're used to implement public API.
2020-09-21 15:34:55 +02:00
Vadim Zeitlin
24cc6c541e Don't DLL-export wxRadioButtonBase template class
This is unnecessary, this class only has inline functions.
2020-09-21 15:28:06 +02:00
Vadim Zeitlin
46a21e5aba Use wxScopedPtr<> instead of manual delete in wxRadioButton test
Make the test code safer and ensure that no controls created here remain
alive after the test end.
2020-09-21 15:18:22 +02:00
Vadim Zeitlin
fceaa907a8 Remove CppUnit boilerplate from wxRadioButton unit test
Replace CppUnit test case class with a simple fixture and use CHECK()
instead of CPPUNIT_ASSERT_XXX().

No real changes.
2020-09-21 15:15:37 +02:00
Vadim Zeitlin
0edc9d7eda Just use wxPrivate namespace
Writing "wxPrivate::wxFoo()" is a bit ugly, so just add a using
directive for the namespace, it's not a problem to do it in this file.
2020-09-21 15:09:38 +02:00
Vadim Zeitlin
3ccbee2e1c Mark radio button group navigation functions as new in 3.1.5
Just add the missing "@since" lines.
2020-09-21 15:05:35 +02:00
Vadim Zeitlin
dfd1638f39 Improve radio button groups documentation
Explain the role of wxRB_SINGLE better, it's useful not only for
avoiding wxMSW bugs (which, besides, shouldn't exist any more).
2020-09-21 15:02:47 +02:00
Stefan Csomor
7bf00e1161 Added info about wxRB_SINGLE 2020-09-21 09:02:06 +02:00
Stefan Csomor
02b3b9d745 Adding docs 2020-09-20 19:44:16 +02:00
Stefan Csomor
593e6a9ca6 Update include/wx/msw/radiobut.h
Co-authored-by: VZ <vz-github@zeitlins.org>
2020-09-20 18:35:51 +02:00
Stefan Csomor
200c1af697 Going private with the implementations
Although they’re still exported of course …
2020-09-17 23:13:44 +02:00
Stefan Csomor
552dbbe26e Removing const for first version 2020-09-17 22:46:18 +02:00
Stefan Csomor
92ea83f00b First implementation 2020-09-17 22:35:22 +02:00
Paul Cornett
dcdcbbe078 Fix wxDataViewCheckIconTextRenderer icon size with GTK3 2020-09-17 09:29:30 -07:00
Artur Wieczorek
32cc9317f2 Use dedicated CRT function to round the value with MSVC 2020-09-17 13:46:53 +02:00
Artur Wieczorek
4b491c19a2 Implement wxRound() with dedicated C++11 standard library function 2020-09-17 13:45:57 +02:00
Artur Wieczorek
864034bddc Get rid of redundant return statement 2020-09-17 13:44:30 +02:00
Artur Wieczorek
4b10b4f5e2 Use dedicated function to round values 2020-09-17 13:44:15 +02:00
Jouk
5274d2d647 Add src/gtk/image_gtk.cpp for compilation in OpenVMS makefile 2020-09-17 09:37:12 +02:00
Paul Cornett
b376d1402b Add support for HiDPI bitmaps to wxDataViewBitmapRenderer with GTK3 2020-09-16 11:33:13 -07:00
Paul Cornett
85d63c3150 Add a class derived from GtkImage to support HiDPI bitmaps
And use it to get HiDPI support wherever we use GtkImage. This extends and
consolidates support for custom drawing of images which has already been added
somewhat redundantly in several places.
2020-09-15 11:52:03 -07:00
Ian McInerney
cb04c35365 OSX: Fixes for readonly text fields (#2049) 2020-09-15 08:21:47 +02:00
Artur Wieczorek
e88f248e3a Fix calculating bounding box
We should use platform-specific functions to convert coordinates to take
into account all transformations applied to wxDC (also with transform
matrix).

Closes #18916.
2020-09-13 23:54:16 +02:00
Artur Wieczorek
014bd2ae54 Implement platform-specific coordinate conversion functions
Generic wxDC::DeviceToLogical{X|Y}() and wxDC::LogicalToDevice{X|Y}()
functions don't take into account transformations applied with
wxDC::SetTransformMatrix() so conversion results are invalid if wxDC is
transformed with both e.g. wxDC::SetUserScale() and
wxDC::SetTransformMatrix().
We need to implement functions in wxDCImpl and its platform-specific
derivates to do this conversion with taking into account all applied
transformations.

See #18916.
2020-09-13 23:47:26 +02:00
Paul Cornett
4ebfe0059a Pre-include another header for Cygwin
Avoid -Wpedantic warning for extra ';'
2020-09-13 08:27:45 -07:00
Scott Talbert
35f2fd4be7 Fix linking issues with wxGLCanvasEGL for cmake
1) Link with EGL and wayland-egl libraries (with check for GDK Wayland).
2) Provide a way to force disable the EGL backend.
2020-09-12 15:54:15 -07:00
Scott Talbert
c315359c72 Fix linking issues with wxGLCanvasEGL for autoconf
1) Link with the wayland-egl library, but do so only if we determine that we
have Wayland support in the GDK backend with a compile test.
2) Provide a way to force disable the EGL backend.
2020-09-12 15:54:15 -07:00
Stefan Csomor
bc9e7b71e7 macOS wxNativeFontInfo changes (#2045)
* adding native font descriptor serialization = v2

* remove common xml prefix from serialized string

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* static string via accessor

* striping off xml preamble unconditionally

if we use a different format in the future, we will have to increase our version number

* applying italic directly to the font descriptor

thus preserving attributes in the native font descriptor which we don’t store explicitly yet

* Adding support for preserving font width

Although we don’t express this in the public API yet, we try to preserve eg condensed, when changing the font width

* Adding reference, bug fix

double checked the font weight constants,

Co-authored-by: VZ <vz-github@zeitlins.org>
2020-09-12 19:29:26 +02:00
Robin Dunn
16ab09208f Add missing dock art Clone methods 2020-09-10 12:39:05 -07:00
Vadim Zeitlin
c2b1dbda83 Call GDK functions from main thread in wxGStreamerMediaBackend
This fixes another problem similar to the one fixed in be1854c617 (Avoid
UI functions in non-main thread in wxGStreamerMediaBackend, 2020-09-02)
and does it in a similar way: SetupXOverlay(), which calls gdk_flush(),
was called from gst_bus_sync_callback() which is executed in the worker
thread, so use CallAfter() to call it from the main thread later.
2020-09-02 23:24:05 +02:00
Vadim Zeitlin
e4333fdeac Fix recurrent typo in "usable"
This word has a single "e".
2020-09-02 20:49:39 +02:00
Vadim Zeitlin
bf71a70a12 Merge branch 'updateui-ischeckable'
Add a flag to wxUpdateUIEvent to tell if the item supports the check
action.

See https://github.com/wxWidgets/wxWidgets/pull/2027
2020-09-02 19:34:05 +02:00
Vadim Zeitlin
7be693212c Improve documentation of wxUpdateUIEvent::IsCheckable()
Explain when this method can be useful.
2020-09-02 19:33:39 +02:00
Vadim Zeitlin
1db3751235 Merge branch 'macos11-preferences' of https://github.com/vslavik/wxWidgets
Update wxPreferencesEditor to add support for macOS 11.

See https://github.com/wxWidgets/wxWidgets/pull/2040
2020-09-02 19:26:41 +02:00
Vadim Zeitlin
eb8c48a481 Merge branch 'macos11-fix-ui-fonts-handling' of https://github.com/vslavik/wxWidgets
Fix system UI font handling on macOS 11.

See https://github.com/wxWidgets/wxWidgets/pull/2034
2020-09-02 19:24:26 +02:00
Scott Talbert
be1854c617 Avoid UI functions in non-main thread in wxGStreamerMediaBackend
In aa2cd42206 (Report video size changes to the media backend,
2016-02-22), a couple of calls to NotifyMovieSizeChanged() were added,
presumably for a good reason.  Unfortunately, NotifySizeChanged() makes
UI calls on wxGTK, so this resulted in UI calls happening on a non-main
thread because many of GStreamer's callbacks occur on arbitrary threads.
This is bad because it caused random X11 crashes.

Fix this by calling NotifyMovieSizeChanged() with CallAfter().

Closes https://github.com/wxWidgets/wxWidgets/pull/2042
2020-09-02 19:22:46 +02:00
Jouk
1ce2ab5d49 Add definition of wxUSE_GLCANVAS_EGL 2020-09-02 07:46:25 +02:00
Paul Cornett
05a134d985 Build fix for GDK_WINDOWING_WAYLAND not defined
Add some missing GDK_WINDOWING_WAYLAND wrappers.
Also some minor changes to includes.
2020-09-01 08:14:58 -07:00
Vadim Zeitlin
5dd3b733bd Test building without 3.0 compatibility on Travis CI too
This will test errors like the one fixed by the previous commit by
testing that samples and tests still build without 3.0 API.
2020-09-01 15:07:31 +02:00
Vadim Zeitlin
0a053580c0 Use wxEVT_GRID_RANGE_SELECTED instead of deprecated SELECT
Fix building the tests with WXWIN_COMPATIBILITY_3_0 disabled.
2020-09-01 15:04:39 +02:00
Scott Talbert
7cd12a2bd6 Add EGL-based backend for wxGLCanvas
Among other things, this enables wxGLCanvas to be used natively on
Wayland.

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

Closes #17702.
2020-09-01 15:03:30 +02:00
Vadim Zeitlin
ed4b9e5f97 Merge branch 'mac-native-focus-ring' of https://github.com/vslavik/wxWidgets
Draw wxTextCtrl focus ring natively on Mac.

Add wxWindow::EnableVisibleFocus() to explicitly control the focus ring
visibility if necessary.

See https://github.com/wxWidgets/wxWidgets/pull/2037
2020-09-01 14:59:42 +02:00
Rob McKay
94e8129f3f Explicitly specify application class in wxiOS
Although @"UIApplication" is supposed to be used by default anyhow,
passing "nil" is reported to result in an assertion failure in
'_UIApplicationGetPrincipalClass' when running under the iOS 13.1
simulator, so pass this string explicitly.

Closes https://github.com/wxWidgets/wxWidgets/pull/2035
2020-09-01 14:57:29 +02:00
Vadim Zeitlin
b9f946fcd3 Merge branch 'check-headers-max-warn'
Check compilation of all wx headers with all gcc warnings enabled.

This should make it impossible to introduce problems that only appear
when -Wpedantic or -Wany-other-not-completely-unreasonable-warning is
enabled when building user code including wx headers again.

See https://github.com/wxWidgets/wxWidgets/pull/2033
2020-08-31 15:10:16 +02:00