Commit Graph

19114 Commits

Author SHA1 Message Date
Václav Slavík
23992c2e77 Fix implicit conversion loss warning in wx/math.h 2020-10-05 18:56:40 +02:00
Vadim Zeitlin
4f90d31274 Harmonize wxXmlDoctype ctor parameter names
Make the names more clear and similar to the names of member variables
to which they correspond and also use them consistently in the
documentation.

This reverts the changes to this interface header done in 5925893eed
(Fix various doxygen issues in the documentation, 2019-10-20).
2020-10-04 16:00:34 +02:00
Stefan Brüns
d47b857b09 Change data and shortHelpString to adhere to naming convention
Rename data to clientData in the inlined overloads. This change is
transparent for any users.

Rename shortHelpString to shortHelp (dito for longHelp). Although this
change is in general visible for any users, Phoenix already mangles the
the parameter names to strip the 'String' suffix.
2020-10-03 16:12:04 +02:00
Paul Cornett
aef3976e13 Fix WriteText() not scrolling to bottom with GTK >= 3.14
The introduction of scrollbar animations broke scroll-to-end functionality when
large amounts of text are written, due to interactions with GtkTextView's
background layout. Work around this by scrolling after the layout has finished.
See #18864
2020-10-02 11:10:14 -07:00
Stefan Brüns
d18e7718fd Fix wxWindowId parameter type and name in wxHtmlHelpWindow
The type obviously should be wxWindowID, not int.

Rename the parameter, as it is the only instance where the id is not
named 'id', the implementation already uses 'id', and for Phoenix naming
it id is also preferred, as the name is used for mangling.

The naming change causes no further breakage for Phoenix, as the generator
is currently broken anyway for this case.

Closes https://github.com/wxWidgets/wxWidgets/pull/2069
2020-10-02 15:02:03 +02:00
Vadim Zeitlin
123044c68c Merge branch 'fix-caret-default'
Fix using default-constructed wxCaret.

See https://github.com/wxWidgets/wxWidgets/pull/2007
2020-10-01 02:29:43 +02:00
oneeyeman1
61ef150044 Implement GetStringSelection() in generic wxBitmapComboBox
Also update the test to avoid assuming that wxBitmapComboBox inherits
from wxComboBox, which now allows it to build (and pass) on all
platforms.

Closes https://github.com/wxWidgets/wxWidgets/pull/2057
2020-10-01 02:19:12 +02:00
Artur Wieczorek
7153eaf6ec Implement new coordinates conversion functions in wxDC
Current DeviceToLogical{X|Y}(), LogicalToDevice{X|Y}(),
DeviceToLogicalRel{X|Y}(), LogicalToDeviceRel{X|Y}() functions
don't take into account transformations applied with
SetTransformMatrix() so conversion results are invalid if coordinate
system is e.g. rotated.
We need to implement new conversion functions that take into account all
applied transformations and also convert x,y coordinates in one call
because in general case x,y coordinates are coupled and cannot be
converted independently on each other.

Closes #18923.
2020-09-27 11:45:19 +02:00
Artur Wieczorek
2c3c841719 Implement platform-specific coordinate conversion functions
Generic wxDC::DeviceToLogicalRel{X|Y}() and wxDC::LogicalToDeviceRel{X|Y}()
functions don't take into account scaling applied with
wxDC::SetTransformMatrix().
We need to implement in wxDCImpl and its platform-specific derivates
new conversion functions that take all applied transformations into account.

See #18923.
2020-09-27 10:38:08 +02:00
Eric Raijmakers
6e8da8641c Add alpha blending for wxImage::Paste
Add test cases for wxImage::Paste.

Closes #12458.

Co-Authored-By: Rachel Mark <kramdar@gmail.com>
2020-09-25 01:04:49 +02:00
Vadim Zeitlin
1f1a9d52d6 Merge branch 'expose-radiogroup'
Add public functions for navigating in radio button groups.

Also introduce wxRadioButtonBase defining wxRadioButton API for all
ports.

See https://github.com/wxWidgets/wxWidgets/pull/2052
2020-09-24 00:11:15 +02:00
Vadim Zeitlin
09060ed262 Move radio group navigation functions to wxRadioButtonBase
Now that this class is not a template any longer, we can have the code
for radio button group navigation directly in it, without making it
inline, so move the existing functions bodies into the new methods and
remove the old functions entirely.

No real changes, this is just a refactoring.
2020-09-21 18:01:47 +02:00
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
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
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
Pavel Tyunin
47d8299c70 Make wxPG_TOOLTIPS work for >2 columns too 2020-09-21 11:27:42 +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
Artur Wieczorek
52631b3368 Use dedicated CRT function to round the value for MSVS 2015+
round() is available since at least VS 2015. It is not available in
VS 2010. VS 2012 and 13 need to be checked.
2020-09-18 11:24:13 +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
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
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
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
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
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
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
Stefan Brüns
b8a4b96243 Create underlying bitmap for caret when it is explicitly created
wxCaret::Create implies a size change, so call DoSize to initialize
the underlying wxBitmap.
2020-08-31 16:49:21 +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
Vadim Zeitlin
be2a61519b Merge branch 'grid-selected'
Split the wxGrid RANGE_SELECT event into separate SELECTING and SELECTED
events.

See https://github.com/wxWidgets/wxWidgets/pull/2028
2020-08-31 14:55:56 +02:00
Vadim Zeitlin
d41539ef05 Merge branch 'fix-grid-resizing'
Fix bugs in wxGrid mouse handling and simplify the code.

See https://github.com/wxWidgets/wxWidgets/pull/2018
2020-08-31 14:53:37 +02:00
Vadim Zeitlin
82f7cb6e9b Merge branch 'art-ids-literals'
Revert art ids changes and make them `char*` literals again.

See https://github.com/wxWidgets/wxWidgets/pull/2031
2020-08-31 14:51:52 +02:00
Václav Slavík
8efc6fb003 Add wxWindow::WXAdjustFontToOwnPPI()
Avoid calling GeTDPI() in font.WXAdjustToPPI(GetDPI()); invocations in
common code on platforms that don't need any adjustment (i.e. anything
other than MSW).

This fixes wxOSX crashes when GetFont() is called too early during
window creation, but is the right thing to do regardless.

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

Closes #18903.
2020-08-31 14:45:02 +02:00
Vadim Zeitlin
8b7ddbd0ac Use wxOVERRIDE for wxStackWalker and wxStackFrame in wxMSW
Thanks gcc for -Wsuggest-override.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
3fc5d134a3 Suppress strange -Wunsafe-loop-optimizations in wxString code
The error message

wx/string.h:558:47: error: missed loop optimization, the loop counter may overflow
                    [-Werror=unsafe-loop-optimizations]
       for ( Cache::Element *c = cacheBegin; c != cacheEnd; c++ )
                                             ~~^~~~~~~~~~~

doesn't seem to really make much sense, as it shouldn't overflow here.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
a535d2c64d Suppress -Wnull-dereference in wxString::GetCacheElement()
It doesn't seem to be really possible here.
2020-08-31 12:40:50 +02:00
Václav Slavík
9f66b03c5c Allow configuring visible focus on Mac
Add wxWindow::EnableVisibleFocus() for changing focus ring behavior on
macOS (currently not implemented elsewhere, although GTK+ has a
discouraged option to do it).
2020-08-31 10:38:59 +02:00
Vadim Zeitlin
24914ec7df Suppress unavoidable -Wformat-literal in wx[F]printf()
Disable gcc format string checks inside these functions.
2020-08-31 01:26:04 +02:00
Vadim Zeitlin
36c5884acb Generalize WX_ATTRIBUTE_PRINTF to WX_ATTRIBUTE_FORMAT
Allow applying gcc "format" attribute to other functions and do apply it
to wxStrftime().

Also suppress -Wformat-nonliteral inside wxStrftime() itself, as it's
now supposed to be checked when calling it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
7352a2879c Rename Qt-specific GetEventType() to start with "Qt" prefix
This avoids conflicts with another method with the same name defined in
generic wxGenericFileDirButton, which must neither override nor hide
this method of wxButton.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9f63592eba Remove unnecessary wxBitmap copy ctor from wxQt
This ctor is not needed as the inherited wxObject ctor is sufficient and
defining it but not operator=() explicitly results in -Wdeprecated-copy
from gcc 10.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
19bc293086 Remove extraneous semicolon in wx/qt/menuitem.h
Avoid -Wpedantic from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9c2cf91223 Don't remove const-ness using C-style cast
Avoid another -Wcast-qual from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9c48b0e8e7 Remove redundant wxSetCursor() declarations
Avoid -Wredundant-decls from gcc by not duplicating the declaration from
wx/gdicmn.h in wx/*/cursor.h.
2020-08-31 01:25:45 +02:00