Commit Graph

69218 Commits

Author SHA1 Message Date
Stefan Brüns
204d8a4536 Add missing wxRibbonMSWArtProvider::GetButtonBarButtonTextWidth interface
The missing override in the interface makes the inherited classes abstract
from the Phoenix SIP generators view.
2020-10-01 05:01:53 +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
Vadim Zeitlin
88f808e303 Add a unit test for wxCaret::Create()
Verify that constructing wxCaret using its default ctor and Create()
works too, now that it does -- previously it uses to result in a GTK
warning and a crash in wxGTK.
2020-10-01 02:28:42 +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
Eric Raijmakers
1f0ade29f0 Fix using mask colour even if there is no mask in wxImage::Paste
In case an image without alpha is pasted on top of an image with alpha,
the alpha blending gives wrong results. This is caused by the fact that
the final (if nothing has been pasted yet) pixel copying algorithm in
Paste() does not take into account whether the pasted image actually
uses a mask.

To fix this:

- Add the check for image.HasMask().
- In case there is no mask, simply copy the image via memcpy.
- Finally, update the alpha channel of the changed image (if present):
  whenever a pixel is copied, the alpha is set to fully opaque.

Closes https://github.com/wxWidgets/wxWidgets/pull/2065
2020-10-01 02:13:28 +02:00
Vadim Zeitlin
a94fda4503 Merge branch 'high-dpi-doc'
Add a new "High DPI" overview, mostly to have a place to document more
new DPI-related APIs later.

See https://github.com/wxWidgets/wxWidgets/pull/2054
2020-09-29 03:46:39 +02:00
Stefan Csomor
9aa5eb9c53 Add beginning of the artwork paragraph
This will be fleshed out later.
2020-09-29 03:46:23 +02:00
Maarten Bent
56521ad8af CMake: add missing test files
Add the source files present in the bkl but not CMakeLists.txt to the
latter one too.

Also link with AUI library now that a test file using it is included.

Closes https://github.com/wxWidgets/wxWidgets/pull/2064
2020-09-29 03:30:15 +02:00
Thomas Khyn
d9deaa8b76 Allow CMake dependencies to be interfaces
In some cases (see https://github.com/bincrafters/community/issues/1181),
the dependencies can be library interfaces.

As CMake's get_target_property is not tolerant about what properties can
be extracted on different library types, it is necessary to make a
distinction between interface libraries and plain libraries.

Closes https://github.com/wxWidgets/wxWidgets/pull/2058
2020-09-29 03:27:38 +02:00
Ian McInerney
bf7965a2d7 Add null check in wxAuiToolBar event handler
This also prevents the AUI_TOOLBAR_BEGIN_DRAG event from
being sent if there is no active toolbar item being dragged.

Closes https://github.com/wxWidgets/wxWidgets/pull/2062
2020-09-29 03:26:26 +02:00
Vadim Zeitlin
5358dd7007 Add a check for trailing whitespace and TABs
Just use Git itself to check for it in the new files.
2020-09-28 03:24:44 +02:00
Vadim Zeitlin
daa6eca2e7 Skip AppVeyor builds when GitHub workflows are modified
Don't waste AppVeyor CI resources unnecessarily.
2020-09-28 02:56:55 +02:00
Vadim Zeitlin
ba547496f9 Minor edit to the high DPI overview
Provide some link between the end of the introduction and the main part
of the text.
2020-09-28 01:57:41 +02:00
Stefan Csomor
6a1e3fa232 Improve the introduction to the high DPI overview
Add images to show the difference between scaled text and text rendered
at the full resolution.
2020-09-28 01:57:37 +02:00
Artur Wieczorek
2f679396fd Fix typo in documentation 2020-09-27 13:58:01 +02:00
Artur Wieczorek
d00ca6a172 Add more unit tests of coordinates conversion functions 2020-09-27 13:38:41 +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
Artur Wieczorek
6fac6c0b35 Add unit tests of coordinates conversion functions 2020-09-26 01:43:20 +02:00
PB
08599d894f Fix displaying Flush() in wxClipboard docs note
Just remove the '@' which was probably there by accident but
made the function name disappear.
2020-09-25 21:29:20 +02:00
Vadim Zeitlin
1f3150b5f0 Merge branch 'image-paste-alpha'
Add support for alpha blending to wxImage::Paste() and add unit tests
for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/2056
2020-09-25 01:12:54 +02:00
Vadim Zeitlin
451ed78dcd Mark wxImageAlphaBlendMode as being new since 3.1.5
It doesn't matter much, but it, and the corresponding parameter, will be
available in this version and not (only) in 3.2.0.
2020-09-25 01:12:24 +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
PB
8ae9987a29 Improve code examples in wxDataViewModel documentation
Fix variable name for the model.

Make the code using wxObjectDataPtr have the same flow as the
code using a raw pointer.

Format the code to be in accordance with the official guidelines.

Closes #18924.
2020-09-24 00:12:37 +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
808ff104dc Don't compile wxGetSelectedButtonInGroup() if it's unused
Now that this function is static, not using it results in warnings when
building the ports not using it (e.g. wxX11).
2020-09-21 20:37:37 +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
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
Vadim Zeitlin
42ec95ff92 Add all Markdown headers to the table of contents
This actually shows a ToC for the just added high DPI overview, which
wasn't created before because the headers didn't have any anchors.
2020-09-21 14:49:48 +02:00
Pavel Tyunin
2d8d1ad9d0 Fix cropping detection for cells with custom font 2020-09-21 11:27:42 +02:00
Pavel Tyunin
ca1e086225 Show units in tooltips 2020-09-21 11:27:42 +02:00
Pavel Tyunin
4c11ab63c1 Fix cropping detection for properties with choice item-specific images 2020-09-21 11:27:42 +02:00
Pavel Tyunin
3d41fa1ac4 Fix cropping detection when wxPG_BOLD_MODIFIED is enabled 2020-09-21 11:27:42 +02:00
Pavel Tyunin
949cda937d Improve cropping detection for properties with images
Take into account images in >2 columns and custom sized images
2020-09-21 11:27:42 +02:00
Pavel Tyunin
47d8299c70 Make wxPG_TOOLTIPS work for >2 columns too 2020-09-21 11:27:42 +02:00
Pavel Tyunin
7d83c6cfe0 Take wxPG_XBEFORETEXT and splitter into account for cropping detection 2020-09-21 11:27:42 +02:00
Pavel Tyunin
e4607a243e Take subgroup margin into account when checking for property label cropping 2020-09-21 11:27:42 +02:00
Pavel Tyunin
075d964eae Fix wxPropertyGrid string cropping detection (wxPG_TOOLTIPS)
splitterHitOffset is only initialized when the mouse is near the splitter.
2020-09-21 11:27:42 +02:00